function PublicVarText($dbConnect, $group, $name) { $this->BORDER = 0; $a = getPublicVarArray($dbConnect, $group, $name); $t = new Table(array("")); $t->setBorder($this->BORDER); foreach ($a as $title => $text) { $r1 = $t->createRow(); $r1->setAttribute(0, new Title($title)); $r1->setHeader(true); $t->addRow($r1); $r2 = $t->createRow(); $r2->setAttribute(0, $text); $t->addRow($r2); $t->addSpacer(); } $this->TBL = $t; }
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; }
$form->add($spc); $form->add($table); $form->add($spc); $form->show(); // ------------------------------------------- // Schaltgruppen // ------------------------------------------- $regelItemsDbTable = new DbTable($_SESSION['config']->DBCONNECT, 'homecontrol_regeln_items', array("config_id", "art_id", "zimmer_id", "etagen_id", "on_off", "regel_id", "id"), "Objekt, Objekt-Art, Zimmer, Etage, An/Aus", "regel_id=" . $_SESSION['SelectedRegelToEdit'], "config_id DESC, zimmer_id DESC, etagen_id DESC", "regel_id=" . $_SESSION['SelectedRegelToEdit']); $regelItemsDbTable->setReadOnlyCols(array("id")); $regelItemsDbTable->setNoInsertCols(array("id")); $regelItemsDbTable->setNoUpdateCols(array("regel_id", "id")); $regelItemsDbTable->setDeleteInUpdate(true); $regelItemsDbTable->setHeaderEnabled(true); $itemsTable = new Table(array("", "")); //$itemsTable->setColSizes(array(150)); $itemsTable->setBorder(0); $ttlItems = new Title("Zu schaltende Objekte"); $ttlItems->setAlign("left"); $itemsTable->addSpacer(0, 15); $r1Title = $itemsTable->createRow(); $r1Title->setSpawnAll(true); $r1Title->setAttribute(0, $ttlItems); $itemsTable->addRow($r1Title); // Neuer Eintrag if (isset($_REQUEST['InsertIntoDB' . $regelItemsDbTable->TABLENAME]) && $_REQUEST['InsertIntoDB' . $regelItemsDbTable->TABLENAME] == "Speichern") { $regelItemsDbTable->doInsert(); $regelItemsDbTable->refresh(); } else { if (isset($_REQUEST[$regelItemsDbTable->getNewEntryButtonName()])) { $regelItemsDbTable->setBorder(0); $insMsk = $regelItemsDbTable->getInsertMask();
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 eine Tabellarische ÃÂÃÂÃÂÃÂbersicht der Bilder an * Hier werden die Zeilenanzahl und die Bilder-Pro Zeile * wie sie im Objekt definiert wurden als Konfiguration verwendet * ($this->PICS_PER_LINE und $this->MAXIMUM_LINES) */ function getPicturelist() { if (count($this->PICS) <= 0) { return; } $picCounter = 0; $lineCounter = 1; $reachedFirstPicture = false; $picWidth = round(($this->WIDTH - 50) / $this->PICS_PER_LINE - $this->PICS_PER_LINE * 4); if ($picWidth < 0 || $picWidth > $this->WIDTH) { $picWidth = 150; } $picnr = ($this->CURRENT_PAGE - 1) * $this->MAXIMUM_LINES * $this->PICS_PER_LINE; $pCnt = $this->MAXIMUM_LINES * $this->PICS_PER_LINE; $hiddenPath = new HiddenField("Current_BB_Path", substr($this->PATH, strlen($_SERVER['DOCUMENT_ROOT']))); $form = new Form($this->PARENT_PAGE, "haupt"); $form->add($hiddenPath); $table = new Table($this->getPictureTableColnamesArray()); $table->setAlign($this->getAlign()); $table->setBorder(0); $row = $table->createRow(); for ($i = $picnr; $i < $picnr + $pCnt && $i < count($this->PICS); $i++) { $pic = $this->PICS[$i]; if (is_file($pic) && $lineCounter <= $this->MAXIMUM_LINES) { $img = new Image(substr($pic, strlen($_SERVER['DOCUMENT_ROOT']) . dirname($_SERVER['SCRIPT_NAME'])), -1, -1, $picWidth, 0, 0); $img->setToolTip(getCommentDialogForImage($img->getSource())); $img->setCommentsActive(true); checkForInsertBBComment(); $img->setBorder(0); $linkStartPos = strlen($_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['SCRIPT_NAME'])); if (strlen(dirname($_SERVER['SCRIPT_NAME'])) <= 1) { $linkStartPos = $linkStartPos - 1; } if ($this->LINKPREFIX != "" && substr($this->LINKPREFIX, strlen($this->LINKPREFIX) - 1, 1) != "&") { $this->LINKPREFIX = $this->LINKPREFIX . "&"; } $lnk = new Link($this->PARENT_PAGE . "?" . $this->LINKPREFIX . "showPic=" . $i . "&Current_BB_Path=" . substr($this->PATH, strlen($_SERVER['DOCUMENT_ROOT'])), $img, false); $lnkDirect = new Link(substr($this->PICS[$i], $linkStartPos), $img, false, $this->CURRENT_PICTURE, "newPic"); if ($this->IMAGEDIRECTLINK) { $row->setAttribute($picCounter, $lnkDirect); } else { $row->setAttribute($picCounter, $lnk); } // Neue Zeile starten if ($picCounter + 1 >= $this->PICS_PER_LINE) { $picCounter = -1; $table->addRow($row); $lineCounter++; if ($lineCounter <= $this->MAXIMUM_LINES) { $row = $table->createRow(); } } $picCounter++; } } if ($picCounter != 0) { $table->addRow($row); } $form->add($table); return $form; }
$spcr = new Div(); $spcr->setWidth(0); $spcr->setHeight($mainHeight); $tbl = new Table(array("", "", "")); $tbl->setBorder(0); $tbl->setColSizes(array($mainWidth, "1")); $tbl->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_1']); $rMain = $tbl->createRow(); $rMain->setAttribute(0, $cont); $rMain->setAttribute(1, $spcr); $rMain->setAttribute(2, $cont2); $tbl->addRow($rMain); $MainPanel->add($tbl); } else { $tbl = new Table(array("")); $tbl->setBorder(0); $tbl->setColSizes(array($mainWidth)); $tbl->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_1']); $rMain = $tbl->createRow(); $rMain->setAttribute(0, $cont); $tbl->addRow($rMain); $MainPanel->add($tbl); } $contentLayoutRow = $layoutTable->createRow(); $contentLayoutRow->setAttribute(0, $MainPanel); $layoutTable->addRow($contentLayoutRow); /* --------------------------------- */ /* ------------------------------------ FUSS-MENU ------------------------------------ */ $footMenuDiv = new Div();
function show() { //Wenn notwendig Eingabemaske, ansonsten Standard-Anzeige if (!$this->showInsertMaskIfNeeded()) { $rowsToShow = $this->getRowsToShow(); //Tabelle fÃÂÃÂÃÂür gesamte NEWS $tbl = new Table(array("News")); $tbl->setHeadEnabled(false); $tbl->setBorder(0); foreach ($rowsToShow as $row) { $tt = new Text($row['Text']); $tt->setFilter(false); $ta = new Text($row['Autor']); $tblxTitle = new Table(array("", "")); $tblxTitle->setColSizes(array("50")); $tblxTitle->setAlign("left"); $rxtitle = $tblxTitle->createRow(); $t0 = new Title(getFormatedDate($row['Datum'], "standard") . ":"); $t0->setWidth(20); $rxtitle->setAttribute(0, $t0); $t1 = new Title($row['Title']); $rxtitle->setAttribute(1, $t1); $rxtitle->setAlign("left"); $tblxTitle->addRow($rxtitle); //Tabelle fÃÂÃÂÃÂür den jeweiligen Eintrag $tblx = new Table(array("")); if (strlen($row['pic']) > 0) { $tblx = new Table(array("", "")); $tblx->setColSizes(array("180")); } $tblx->setBorder($this->CONFIG->GB_CONFIG['border']); $tblx->setWidth("100%"); //TEXT $rx = $tblx->createRow(); if (strlen($row['pic']) > 0 && !(isset($_REQUEST['removeNewsPicId']) && $_REQUEST['removeNewsPicId'] == $row['id'])) { $img = new Image($row['pic']); $img->setWidth(175); $rx->setAttribute(0, $img); $rx->setAttribute(1, $tt); } else { $rx->setAttribute(0, $tt); } $rx->setAlign("left"); $tblx->addRow($rx); $f = new FontType(); $rx->setFonttypes(array(0 => $f)); $f = new FontType(); $f->setFontsize(1); $f->setItalic(false); $rx->setFonttypes(array(0 => $f)); $r = $tbl->createRow(); $r->setAttribute(0, $tblxTitle); $tbl->addRow($r); $r1 = $tbl->createRow(); $r1->setAttribute(0, $tblx); $tbl->addRow($r1); $ytElem = new YouTubeElement($row['yt_video'], "news", "yt_video", $row['id']); $r1 = $tbl->createRow(); $r1->setAttribute(0, $ytElem); $tbl->addRow($r1); $tbl->addSpacer(0, 7); if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") { $r2 = $tbl->createRow(); $xDv = new Div(); $xDv->setWidth(450); $xDv->setHeight(40); $txChngePic = new Text("Bild Hochladen/ÃÂÃÂÃÂÃÂndern<br>"); $txChngePic->setFilter(false); $newPicLink = new Link("?popupRunLink=imageUploaderPopup&targetPath=pics/news&DbInsertTable=news&DbInsertCol=pic&DbInsertId=" . $row['id'] . "&stayAlive=ok", $txChngePic); $txRemPic = new Text("Bild Entfernen<br>"); $txRemPic->setFilter(false); $removePicLink = new Link("?removeNewsPicId=" . $row['id'] . "", $txRemPic); $spTx = new Text(" "); $spTx->setFilter(false); $xDv->add($newPicLink); if (strlen($row['pic']) > 0) { if (isset($_REQUEST['removeNewsPicId']) && $_REQUEST['removeNewsPicId'] == $row['id']) { $sql = "UPDATE news SET pic = null WHERE id = " . $_REQUEST['removeNewsPicId']; $_SESSION['config']->DBCONNECT->executeQuery($sql); } else { $xDv->add($removePicLink); } } $newPicLink->setPopup(true); $r2->setAttribute(0, $xDv); $tbl->addRow($r2); } $tbl->addSpacer(0, 35); } if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user") { // Neuer Eintrag- BUTTON //-------------------------------- $insertButton = new Button('dbTableNew', 'News eintragen'); $form = new Form($_SERVER['SCRIPT_NAME']); $form->add($insertButton); $form->show(); } // Tabelle anzeigen //-------------------------------- $tbl->show(); if ($_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user" && $tbl->getRowcount() > 2) { // Neuer Eintrag- BUTTON //-------------------------------- $insertButton = new Button('dbTableNew', 'News eintragen'); $form = new Form($_SERVER['SCRIPT_NAME']); $form->add($insertButton); $form->show(); } } }
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; }
/** * show-Methode fÃÂÃÂÃÂür TYPE = button * * @param $PIC gibt die Hintergrundgrafik der Buttons an */ function showWithButtons($PIC, $HOVER = "") { $tbl = new Table(array("")); $tbl->setWidth($this->getWidth() + 5); $tbl->setXPos($this->getXPos()); $tbl->setYPos($this->getYPos()); $tbl->setBorder($this->getBorder()); $tbl->setFonttypes(array($this->getFonttype())); $userStatus = $this->CONFIG->CURRENTUSER->STATUS; $menuresult = $this->MENUTABLE->getMenuByStatus($userStatus); $txt = array(); $r = array(); while ($row = mysql_fetch_array($menuresult)) { if ($row['id'] > 0) { $rcnt = count($txt); $txt[$rcnt] = new Text($row['text']); $txt[$rcnt]->setFonttype($this->getFonttype()); $ftx = $txt[$rcnt]->getFonttype(); if ($row['text'] == $_SESSION['MENU_PARENT'] || $row['text'] == $this->getLabelByRunlink($_SESSION['runLink'], $_SESSION['MENU_PARENT'])) { $ftx->setColor($_SESSION['config']->COLORS['hover']); $ftx->setBold(true); } else { $ftx->setBold(false); } $txt[$rcnt]->setFonttype($ftx); $btn = new MenuButton($row['link'], $txt[$rcnt], $PIC, $row['target'], $this->COLOR); $btn->setHoverPic($HOVER); $btn->setToolTip($row['tooltip']); $r[$rcnt] = $tbl->createRow(); $r[$rcnt]->setAttribute(0, $btn); $tbl->addRow($r[$rcnt]); } } $tbl->show(); }