Example #1
0
 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;
 }
     $scDbTable->refresh();
 }
 // --------------------------------------------------
 //  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 {
Example #3
0
 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("&nbsp;&nbsp;&nbsp;");
                 $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 show()
 {
     if ($this->isIconViewActive()) {
         $this->showAsIcon();
         return;
     }
     $active = true;
     if (time() - 24 * 60 * 60 * 1000 > $this->LASTSIGNAL) {
         $active = false;
     }
     $tbl = new Table(array("Name", "ID", "letztes Signal", "letzter Wert"));
     $tbl->setBackgroundColorChange(false);
     $tbl->setHeadEnabled($this->isWithHeader());
     $tbl->setColSizes(array(null, 100, 150, 120));
     $tbl->setStyle("padding-left", "5px");
     $tbl->setStyle("padding-right", "25px");
     $tbl->setStyle("padding-top", "5px");
     $tbl->setStyle("padding-bottom", "5px");
     $tbl->setBackgroundColor($_SESSION['config']->COLORS['Tabelle_Hintergrund_' . ($this->BGID % 2 == 0 ? "1" : "2")]);
     $r = $tbl->createRow();
     $r->setAlignments(array("left", "left", "left", "right"));
     $r->setAttribute(0, new Text($this->SENSORNAME, 3));
     $r->setAttribute(1, new Text($this->ID, 3));
     $r->setAttribute(2, $active ? new Text(date("D d.m.Y H:i:s", $this->LASTSIGNAL), 3) : "-");
     $r->setAttribute(3, $active ? new Text($this->LASTVALUE, 3) : "-");
     $tbl->addRow($r);
     $tbl->show();
 }
Example #5
0
 /**
  * show-Methode für TYPE = default
  */
 function showNormalMenu()
 {
     $tbl = new Table(array(""));
     if (!(get_class($this->SPACER) == "Text" && $this->SPACER->getText() == "&nbsp|&nbsp;")) {
         $tbl = new Table(array("", ""));
         $tbl->setColSizes(array("27"));
     }
     $tbl->setHeadEnabled(false);
     if (strlen($this->getAlign()) > 0) {
         $tbl->setAlign($this->getAlign());
     }
     $tbl->setXPos($this->XPOS);
     $tbl->setYPos($this->YPOS);
     $tbl->setBorder($this->BORDER);
     $userStatus = $this->CONFIG->CURRENTUSER->STATUS;
     $menuArray = $this->MENUTABLE->getMenuByStatus($userStatus);
     $r = array();
     $txt = array();
     $lSpacer = "";
     while ($row = mysql_fetch_array($menuArray)) {
         if ($row['id'] > 0) {
             $rcnt = count($r);
             if (!(get_class($this->SPACER) == "Text" && $this->SPACER->getText() == "&nbsp|&nbsp;")) {
                 // Spacer ( | oder übergebener Spacer )
                 $lnk = $row['link'];
                 if (strlen($row['parent']) > 0 && !strpos($lnk, "menuParent")) {
                     $lnk .= "&menuParent=" . $row['parent'];
                 }
                 $lSpacer = new Link($lnk, $this->SPACER, false, $row['target']);
                 //$lSpacer->setToolTip($row['tooltip']);
             }
             $txt[$rcnt] = new Text($row['text']);
             $txt[$rcnt]->setFonttype($this->getFonttype());
             $lnk = $row['link'];
             if (strlen($row['parent']) > 0 && !strpos($lnk, "menuParent")) {
                 $lnk .= "&menuParent=" . $row['parent'];
             }
             $l = new Link($lnk, $txt[$rcnt], false, $row['target']);
             $l->setStyleclass("menulink");
             // $l->setToolTip($row['tooltip']);
             $r[$rcnt] = $tbl->createRow();
             $r[$rcnt]->setVAlign("middle");
             if (!(get_class($this->SPACER) == "Text" && $this->SPACER->getText() == "&nbsp|&nbsp;")) {
                 $r[$rcnt]->setAttribute(0, $lSpacer);
                 $r[$rcnt]->setAttribute(1, $l);
             } else {
                 $r[$rcnt]->setAttribute(0, $l);
             }
             $tbl->addRow($r[$rcnt]);
             $ftx = $txt[$rcnt]->getFonttype();
             if ($row['name'] == $_SESSION['MENU_PARENT'] || $row['name'] == $this->getLabelByRunlink($_SESSION['runLink'], $_SESSION['MENU_PARENT'])) {
                 $ftx->setColor($_SESSION['config']->COLORS['hover']);
                 #
                 $ftx->setBold(true);
             } else {
                 $ftx->setBold(false);
             }
             $txt[$rcnt]->setFonttype($ftx);
         }
         $tbl->addSpacer(0, 2);
     }
     $tbl->show();
 }