Exemple #1
0
 /**
  * Set the time span from an array.
  *
  * Set the time span from an array. Any value can be a float (but it
  * has no sense in seconds), for example array(23.5, 20, 0) is
  * interpreted as 23 hours, .5*60 + 20 = 50 minutes and 0 seconds.
  *
  * @param array $time
  *        	Items are counted from right to left. First
  *        	item is for seconds, second for minutes, third
  *        	for hours and fourth for days. If there are
  *        	less items than 4, zero (0) is assumed for the
  *        	absent values.
  *        	
  * @return bool True on success.
  *        
  * @access public
  */
 function setFromArray($time)
 {
     if (!is_array($time)) {
         return false;
     }
     $tmp1 = new Span();
     if (!$tmp1->setFromSeconds(@array_pop($time))) {
         return false;
     }
     $tmp2 = new Span();
     if (!$tmp2->setFromMinutes(@array_pop($time))) {
         return false;
     }
     $tmp1->add($tmp2);
     if (!$tmp2->setFromHours(@array_pop($time))) {
         return false;
     }
     $tmp1->add($tmp2);
     if (!$tmp2->setFromDays(@array_pop($time))) {
         return false;
     }
     $tmp1->add($tmp2);
     return $this->copy($tmp1);
 }
 function showMobile()
 {
     $dvSc = new Div();
     $dvSc->setWidth("100%");
     $title = new Title("Shortcuts", 0, "10em");
     $spc = new Line();
     $dvSc->add(new Spacer(20));
     $dvSc->add($title);
     $dvSc->add($spc);
     foreach ($this->SHORTCUTS_DB->ROWS as $shortcutRow) {
         $this->SHORTCUTS_URL_COMMAND = "/?switchShortcut=";
         $this->SHORTCUTS_TOOLTIP = "<table width='120' cellspacing=0 cellpadding=0>";
         $this->prepareShortcutSwitchLink($shortcutRow->getNamedAttribute("id"));
         if ($this->SHORTCUTS_URL_COMMAND != "/?switchShortcut=") {
             // aktiver Link mit konfigurierten Items
             $this->SHORTCUTS_URL_COMMAND = str_replace("_", "", $this->SHORTCUTS_URL_COMMAND);
             $this->SHORTCUTS_TOOLTIP .= "</table> ";
             //$txtShortcut = new Text($shortcutRow->getNamedAttribute("name"), 3, true);
             //$txtShortcut->setTooltip($this->SHORTCUTS_TOOLTIP);
             $spn = new Span($shortcutRow->getNamedAttribute("name"), $shortcutRow->getNamedAttribute("name"));
             $spn->setFontsize("12em");
             $spn->add(new Text($this->SHORTCUTS_TOOLTIP, null, false, false, false, false));
             $dvSc->add($spn);
             $dvSc->add(new Text("<a href='" . $this->SHORTCUTS_URL_COMMAND . "'>" . "<center><div align='center' style='display:table-cell; padding:2px 25px; width:100%;vertical-align:middle;background-color:green'>" . "<font size='12em' color='#deffde'><b>aktivieren</b></font>" . "</div></center>" . "</a>", 2, false, false, false, false));
             $dvSc->add($spc);
         } else {
             // inaktiv (Keine konfigurierten Items)
             $txt = new Text($shortcutRow->getNamedAttribute("name"), 3, false);
             $txt->setTooltip("Noch keine Konfiguration hinterlegt");
             $dvSc->add($txt);
             $dvSc->add($spc);
         }
     }
     $dvSc->show();
 }