function getShortcutImageString($configId, $width = 50) { $ret = ""; $configDb = new DbTable($_SESSION['config']->DBCONNECT, 'homecontrol_config', array("*"), "", "", "", "id=" . $configId); if ($configDb->getRow(1) != null) { $itm = new HomeControlItem($configDb->getRow(1), false); $ret = "<img src='" . $itm->getPic() . "' width='" . $width . "'>"; } return $ret; }
function getTabletView() { $colCount = 4; $layoutTable = new Table(array("", "", "", "")); $layoutTable->setSpacing(20); $this->handleEtage(); $dbTable = new DbTable($_SESSION['config']->DBCONNECT, 'homecontrol_config', array("id", "name", "funk_id", "funk_id2", "beschreibung", "control_art", "etage", "zimmer", "x", "y", "sender_id"), "", "", "etage, name", ""); $currCol = $colCount; $layoutRow = null; $letzteEtage = ""; foreach ($dbTable->ROWS as $row) { if ($letzteEtage != $row->getNamedAttribute("etage")) { $letzteEtage = $row->getNamedAttribute("etage"); $currCol = 0; $layoutTable->addSpacer(0, 25); $ttl = new Title($letzteEtage); $layoutRow = $layoutTable->createRow(); $layoutRow->setSpawnAll(true); $layoutTable->addRow($layoutRow); $layoutRow->setAttribute(0, $ttl); $layoutRow = $layoutTable->createRow(); $layoutTable->addRow($layoutRow); } elseif ($currCol == $colCount) { $currCol = 0; $layoutRow = $layoutTable->createRow(); $layoutTable->addRow($layoutRow); } $hcItem = new HomeControlItem($row, false); $switchComp = $hcItem->getMobileSwitch(); $layoutRow->setAttribute($currCol, $switchComp); $currCol++; } return $layoutTable; }