function showFullname() { $fp = new Text($this->getPath(), 3, true); $btnDel = new Button("clearLog", "Log leeren"); $hdnDel = new Hiddenfield("clearLogFile", $this->FULLPATH); $frmDel = new Form(); $tblTtl = new Table(array("", "")); $tblTtl->setColSizes(array(null, 100)); $tblTtl->setAlignments(array("left", "right")); $rTtl = $tblTtl->createRow(); $rTtl->setAttribute(0, $fp); $rTtl->setAttribute(1, $btnDel); $tblTtl->addRow($rTtl); $frmDel->add($tblTtl); $frmDel->add($hdnDel); $frmDel->show(); }
function getMobileSwitch() { $tbl = new Table(array("", "", "", "")); $tbl->setAlignments(array("center", "left", "left", "right")); $tbl->setColSizes(array(60, "", 170, 150)); $tbl->setBorder(0); $rowTtl = $tbl->createRow(); $rowTtl->setVAlign("middle"); $txtAn = new Text("AN", 7, true); $txtAus = new Text("AUS", 7, true); $divAn = new Div(); $divAn->add($txtAn); $divAn->setWidth(150); $divAn->setHeight(50); $divAn->setAlign("center"); $divAn->setVAlign("middle"); $divAn->setStyle("line-height", "50px"); $divAn->setBorder(1); $divAn->setBackgroundColor("green"); $divAus = new Div(); $divAus->setWidth(150); $divAus->setHeight(50); $divAus->setAlign("center"); $divAus->setVAlign("middle"); $divAus->setStyle("line-height", "50px"); $divAus->add($txtAus); $divAus->setBorder(1); $divAus->setBackgroundColor("red"); $txtName = new Text($this->OBJNAME, 6, true); $img = $this->getControlArtIcon(false); $lnkAn = new Link("http://" . $this->IP . "?schalte=on", $divAn, false, "arduinoSwitch"); $lnkAus = new Link("http://" . $this->IP . "?schalte=-" . $this->FUNK_ID, $divAus, false, "arduinoSwitch"); $rowTtl->setAttribute(0, $img); $rowTtl->setAttribute(1, $txtName); $rowTtl->setAttribute(2, $lnkAn); $rowTtl->setAttribute(3, $lnkAus); $tbl->addRow($rowTtl); return $tbl; }
<?php /* $fTbl = new Table(array("", "")); $fRow = $fTbl->createRow(); $cntr = new Counter(); $fRow->setAttribute(0, $cntr); $fTbl->addRow($fRow); $fTbl->setWidth(940); $fTbl->show(); */ // $t = new Text("Arduino URL: ".$_SESSION['config']->PUBLICVARS['arduino_url'], 2, false, true, false); $versionInfo = "Status-Info"; $t = new Link("http://status.smarthomeyourself.de", $versionInfo, false, "status"); $l = new Link("/?run=logView", "Logs", false); $versionInfo = "Version: " . file_get_contents('version.txt'); $lVersion = new Link("/versionHistory.txt", $versionInfo, false, "versionHist"); $fTbl = new Table(array("", "", "")); $fTbl->setAlignments(array("left", "left", "right")); $fTbl->setColSizes(array("100", "100")); $fTbl->setWidth($bannerWidth + 15); $fRow = $fTbl->createRow(); $fRow->setAttribute(0, $t); $fRow->setAttribute(1, $l); $fRow->setAttribute(2, $lVersion); $fTbl->addRow($fRow); $fTbl->show(); echo "</body>\r\n \r\n </html>\r\n ";
/** * Maske um Urhzeit incl. Bedingung (<>=) zu erzeugen */ private function getSensorStatusTermEditorMask() { $div = new Div("editSensorStatus"); $statusCbo = new Checkbox("status", "", "J", $this->TERM_ROW->getNamedAttribute("status")); $sensorSql = "SELECT id, concat(name, ' (', IFNULL((SELECT name FROM homecontrol_etagen e WHERE e.id=s.etage),''), ' - '," . " IFNULL((SELECT name FROM homecontrol_zimmer z WHERE z.id=s.zimmer),''), ')') " . " FROM homecontrol_sensor s WHERE (SELECT status_sensor_jn FROM homecontrol_sensor_arten WHERE id = s.sensor_art)='J' ORDER BY etage, zimmer, name"; $sensorCbo = new ComboBoxBySql($_SESSION['config']->DBCONNECT, $sensorSql, "sensor"); $sensorCbo->setStyle("width", 200); $triggerChb = new Checkbox("trigger_jn", "Trigger?", "J", $this->TERM_ROW->getNamedAttribute("trigger_jn")); $triggerChb->setToolTip("Gibt an, ob eine Änderung des Wertes einen Schaltvorgang aktiviert oder nur als Bedingung dient."); $t = new Table(array("", "", "", "", "", "", "")); $t->setAlignments(array("", "", "", "right", "", "right", "right")); $r = $t->createRow(); $r->setAttribute(0, "Status"); $r->setAttribute(1, $sensorCbo); $r->setAttribute(2, "="); $r->setAttribute(3, $statusCbo); $r->setAttribute(4, " "); $r->setAttribute(5, $triggerChb); $r->setAttribute(6, new Button("saveEditSensorStatusTerm", " Speichern ")); $t->addRow($r); $rH = $t->createRow(); $rH->setSpawnAll(true); $rH->setAttribute(0, new Hiddenfield("editTerm", $_REQUEST['editTerm'])); $t->addRow($rH); $rH2 = $t->createRow(); $rH2->setSpawnAll(true); $rH2->setAttribute(0, new Hiddenfield("editSensorStatus", "ok")); $t->addRow($rH2); $div->add($t); return $div; }
function getShowMask() { $tNames = $this->COLNAMES; if (count($this->LABELS) == count($this->COLNAMES)) { $tNames = $this->LABELS; } $table = new Table($tNames); $table->setAlignments($this->getAlignments()); $table->setBorder($this->BORDER); $table->setHeadEnabled($this->HEAD_ENABLED); $table->setBackgroundColorChange(true); if ($this->WIDTH > 0) { $table->setWidth($this->WIDTH); } if ($this->HEIGHT > 0) { $table->setHeight($this->HEIGHT); } if ($this->BORDER >= 0) { $table->setBorder($this->BORDER); } if ($this->PADDING >= 0) { $table->setPadding($this->PADDING); } else { $table->setPadding(0); } if ($this->SPACING >= 0) { $table->setSpacing($this->SPACING); } else { $table->setSpacing(0); } if ($this->XPOS > 0 && $this->YPOS > 0) { $table->setXPos($this->XPOS); $table->setYPos($this->YPOS); } //--------------------------------------------------- // ROWS in Table aufnehmen //--------------------------------------------------- $bgCtr = 1; for ($ir = 1; $ir <= count($this->ROWS); $ir++) { $r = $table->createRow(); for ($ia = 0; $ia < count($this->COLNAMES); $ia++) { $row = $this->ROWS[$ir]; $val = ""; $t = ""; if (!$this->isInvisibleCol($this->COLNAMES[$ia])) { if (strlen($row->getAttribute($ia)) > 0) { $val = getDbComboValue($this->TABLENAME, $this->COLNAMES[$ia], $row->getAttribute($ia)); } // Wenn DbCombo definiert wurde wird der passende Text zum Code der Spalte angezeigt if (strlen($val) > 0) { $t = $val; } else { $t = $row->getAttribute($ia); } if (strtolower($this->COLNAMES[$ia]) == "email") { $txt = $row->getAttribute($ia); $tmp = new Text($txt); $tmp->setFilter(false); $r->setAttribute($ia, new Link("mailto:" . $txt, $tmp)); } else { $r->setAttribute($ia, new Text($t)); } } else { $r->setAttribute($ia, " "); } } $table->addRow($r); } return $table; }
/** * Zeigt Als erstes die Ordner-Navigation ( showFoldersList() ) an und darunter die Bilder-Liste ( showPicList() ) * wenn angefordert, wird das aktuelle Bild einzeln angezeigt. * setzen des aktuellen Bildes erfolgt in changeHandler(). */ function show() { $this->handleChanges(); $tbl = new Table(array("")); $tbl->setAlignments(array("center")); if ($this->isShowTitle()) { $title = new Title($this->FOLDER->NAME); $rTtl = $tbl->createRow(); $rTtl->setAlign("center"); $rTtl->setAttribute(0, $title); $tbl->addRow($rTtl); } $fl = $this->getFolderslist(); $rFl = $tbl->createRow(); $rFl->setAttribute(0, $fl); $tbl->addRow($rFl); if (isset($_REQUEST['showPic']) && !isset($_REQUEST['BB_BackToList']) && strlen($_REQUEST['showPic']) > 0) { $p = $this->getPicture(); $rP = $tbl->createRow(); $rP->setAlign("center"); $rP->setAttribute(0, $p); $tbl->addRow($rP); } else { $pn = $this->getPageNavigation(); $pl = $this->getPicturelist(); $rPn = $tbl->createRow(); $rPn->setAlign("center"); $rPn->setAttribute(0, $pn); $tbl->addRow($rPn); $rPl = $tbl->createRow(); $rPl->setAlign("center"); $rPl->setAttribute(0, $pl); $tbl->addRow($rPl); } $tbl->show(); }
/** * Liefert die Bedingung als Table zurück * incl. Bearbeiten und Löschen Links */ private function getEditableTermItem() { $t = new Table(array("name", "edit", "delete")); $t->setWidth("99%"); $t->setColSizes(array(null, 65, 65)); $t->setAlignments(array("left", "left", "right")); $r = $t->createRow(); $r->setAttribute(0, $this->getDescription()); $r->setAttribute(1, $this->getEditLink()); $r->setAttribute(2, $this->getDeleteLink()); $t->addRow($r); return $t; }
// -------------------------------------------------- // Bearbeiten-Maske // -------------------------------------------------- $tDel = $scDbTable->doDeleteFromUpdatemask(); if (method_exists($tDel, "show")) { $fDel = new Form(); $fDel->add($tDel); $fDel->show(); } if (isset($_REQUEST["DbTableUpdate" . $scDbTable->TABLENAME])) { $scDbTable->doUpdate(); } $tblEtagen = new Table(array("Name", "Raumplan", "hochladen", "entfernen")); $tblEtagen->setHeadEnabled(true); $tblEtagen->setVAlign("middle"); $tblEtagen->setAlignments(array("left", "center", "center", "right")); $tblEtagen->setBackgroundColorChange(true); foreach ($scDbTable->ROWS as $etagenRow) { $rowId = $etagenRow->getNamedAttribute("rowid"); $txfName = new Textfield("name" . $rowId, $etagenRow->getNamedAttribute("name")); $btnRaumplan = new Button("uploadImage" . $rowId, "Raumplan hochladen"); $btnDelete = new Button("delete" . $rowId . "homecontrol_etagen", "entfernen"); $imgRaumplan = ""; if (isset($_REQUEST["uploadImage" . $rowId]) && $_REQUEST["uploadImage" . $rowId] == "Raumplan hochladen") { $hdnImg = new Hiddenfield("uploadImage" . $rowId, $_REQUEST["uploadImage" . $rowId]); $imgUploader = new ImageUploader("/pics/raumplan", "RP_", "homecontrol_etagen", "pic", $rowId, $hdnImg, $rowId . ".jpg"); $imgUploader->show(); $imgRaumplan = new Image(getDbValue("homecontrol_etagen", "pic", "id=" . $rowId)); } else { $imgRaumplan = new Image(getEtagenImagePath($rowId)); }
------------------------------------ */ $menuDiv = new Div(); $menuDiv->setWidth($bannerWidth - 80); $menuDiv->setBorder(0); $menuDiv->setOverflow("hidden"); $menuDiv->setAlign("left"); $menuDiv->setStyle("padding-left", "2px"); $menuDiv->setBackgroundColor($_SESSION['config']->COLORS['panel_background']); $menu = new DbMenu("Kopfmenue"); $menu->setAlign("center"); $menu->setFontsize("4em"); $menu->setMenuType("horizontal"); $menu->setSpacer(new Text("|")); $menuDiv->add($menu); $tblMenu = new Table(array("", "")); $tblMenu->setAlignments(array("left", "right")); $tblMenu->setWidth($bannerWidth + 20); $tblMenu->setColSizes(array($bannerWidth - 70)); $rMenu = $tblMenu->createRow(); $rMenu->setAttribute(0, $menuDiv); $rMenu->setAttribute(1, $fMode); $tblMenu->addRow($rMenu); $layoutTable->addSpacer(0, 15); $contentLayoutRow1 = $layoutTable->createRow(); $contentLayoutRow1->setAttribute(0, $tblMenu); $layoutTable->addRow($contentLayoutRow1); /* --------------------------------- */ /* ------------------------------------ HAUPTPANEL ------------------------------------ */ $MainPanel = new Div();
function getMobileSwitch() { $tbl = new Table(array("", "", "", "", "")); $tbl->setAlignments(array("center", "left", "left", "left", "right")); $tbl->setColSizes(array(60, "", 100, 160, 150)); $tbl->setBorder(0); $rowTtl = $tbl->createRow(); $rowTtl->setVAlign("middle"); $txtAn = new Text("AN", 7, true); $txtAus = new Text("AUS", 7, true); switch ($this->ART) { case 1: // Steckdosen // Steckdosen case 3: // Glühbirne $txtAn = new Text("AN", 7, true); $txtAus = new Text("AUS", 7, true); break; case 2: // Jalousien $txtAn = new Text("AUF", 7, true); $txtAus = new Text("ZU", 7, true); break; case 4: // Heizung $txtAn = new Text("WARM", 7, true); $txtAus = new Text("KALT", 7, true); break; default: $txtAn = new Text("AN", 7, true); $txtAus = new Text("AUS", 7, true); } $divAn = new Div(); $divAn->add($txtAn); $divAn->setWidth(150); $divAn->setHeight(50); $divAn->setAlign("center"); $divAn->setVAlign("middle"); $divAn->setStyle("line-height", "50px"); $divAn->setBorder(1); $divAn->setBackgroundColor("green"); $divAn->setOverflow("hidden"); $divAus = new Div(); $divAus->setWidth(150); $divAus->setHeight(50); $divAus->setAlign("center"); $divAus->setVAlign("middle"); $divAus->setStyle("line-height", "50px"); $divAus->add($txtAus); $divAus->setBorder(1); $divAus->setBackgroundColor("red"); $divAus->setOverflow("hidden"); $txtName = new Text($this->OBJNAME, 6, true); $img = $this->getControlArtIcon(false); $lnkAn = new Link("?switchShortcut=" . $this->FUNK_ID . "-on", $divAn, false, "arduinoSwitch"); $lnkAus = new Link("?switchShortcut=" . $this->FUNK_ID . "-off", $divAus, false, "arduinoSwitch"); $fDimmLvl = ""; if ($this->isDimmable()) { $fDimmLvl = new Form(); $cobDimmLvl = new Combobox("dimmer", getNumberComboArray(1, 16), "", " "); $cobDimmLvl->setDirectSelect(true); $cobDimmLvl->setStyle("font-size", "40px"); $fDimmLvl->add($cobDimmLvl); $fDimmLvl->add(new Hiddenfield("schalte", $this->FUNK_ID)); } $rowTtl->setAttribute(0, $img); $rowTtl->setAttribute(1, $txtName); $rowTtl->setAttribute(2, $fDimmLvl); $rowTtl->setAttribute(3, $lnkAn); $rowTtl->setAttribute(4, $lnkAus); $tbl->addRow($rowTtl); return $tbl; }
function getNavigationBar() { $mask = new Table(array("Etage Label", "Etage Combo", "Spacer", "Zimmer Full-Switch")); $mask->setAlignments(array("left", "left", "left", "right")); $mask->setHeight(40); $mask->setWidth(600); $mask->setVAlign("middle"); $row = $mask->createRow(); $mask->addRow($row); $cobEtage = $this->getEtagenCombo("aktEtage", $_SESSION['aktEtage']); $cobEtage->setDirectSelect(true); $frmEtage = new Form(); $frmEtage->add($cobEtage); $frmFullSwitch = $this->getZimmerFullSwitchNavigation(); $frmSensorOrControlSwitch = $this->EDITMODE ? $this->getSensorOrControlSwitch() : new Text(""); $row->setAttribute(0, "Etage:"); $row->setAttribute(1, $frmEtage); $row->setAttribute(2, $frmSensorOrControlSwitch); $row->setAttribute(3, ""); //$frmFullSwitch); return $mask; }