Example #1
0
 function show()
 {
     $t = new Table(array(""));
     $t->setAlign($this->getAlign());
     $r = $t->createRow();
     $r->setHeader(true);
     $txt = new Text($this->TEXT);
     $txt->setFonttype($this->FONTTYPE);
     $txt->setFilter($this->getFilter());
     $r->setAttribute(0, $txt);
     $t->addRow($r);
     $t->show();
 }
<?php

//Filename: Startseite.php
$loginNeed = getPageConfigParam($_SESSION['config']->DBCONNECT, "loginForSwitchNeed") == "J";
$loginExternOnly = getPageConfigParam($_SESSION['config']->DBCONNECT, "loginExternOnly") == "J";
$loginOK = $_SESSION['config']->CURRENTUSER->STATUS == "admin" || $_SESSION['config']->CURRENTUSER->STATUS == "user";
$clientIP = explode(".", $_SERVER['REMOTE_ADDR']);
$serverIP = explode(".", $_SERVER['SERVER_ADDR']);
if (!$loginNeed || $loginOK || $loginExternOnly && ($serverIP[0] == $clientIP[0] && $serverIP[1] == $clientIP[1] && $serverIP[2] == $clientIP[2])) {
    $hcMap = new HomeControlMap(false, "MOBILE");
    $hcMap->show();
} else {
    /* ------------------------------------
         BENUTZERSTATUS ANZEIGEN
       ------------------------------------ */
    $USR = $_SESSION['config']->CURRENTUSER;
    $USERSTATUS = new UserStatus($USR, -1, -1);
    $tbl = new Table(array(""));
    $tbl->setAlign("center");
    $r = $tbl->createRow();
    $r->setAttribute(0, $USERSTATUS);
    $tbl->addRow($r);
    $tbl->show();
    /* --------------------------------- */
}
<?php

/**
 * @filename layout_tablet.php
 * @author  Daniel Scheidler
 * @copyright November 2012
 */
echo "Tablet-Version:<br>";
$topSpaceTable = new Table(array(""));
$topSpaceTable->show();
$layoutTable = new Table(array(""));
$layoutTable->setWidth(820);
$layoutTable->setHeight(400);
$layoutTable->setAlign("left");
$layoutTable->setBORDER(0);
$layoutTable->setBackgroundColor($_SESSION['config']->COLORS['panel_background']);
$layoutTable->setSpacing(0);
$layoutTable->setPadding(0);
/* ------------------------------------
     HAUPT-MENU
   ------------------------------------ */
$menuDiv = new Div();
$menuDiv->setWidth(810);
$menuDiv->setBorder(0);
$menuDiv->setOverflow("hidden");
$menuDiv->setAlign("center");
$menuDiv->setStyle("padding-left", "2px");
$spc = new Text(" | ");
$menu = new DbMenu("Hauptmenue");
$menu->setAlign("center");
$menu->setFontsize(3);
 /**
  * Maske um Urhzeit incl. Bedingung (<>=) zu erzeugen
  */
 private function getWochentagTermEditorMask()
 {
     $div = new Div("editWochentag");
     $cboMo = new Checkbox("montag", "", "J", $this->TERM_ROW->getNamedAttribute("montag"));
     $cboDi = new Checkbox("dienstag", "", "J", $this->TERM_ROW->getNamedAttribute("dienstag"));
     $cboMi = new Checkbox("mittwoch", "", "J", $this->TERM_ROW->getNamedAttribute("mittwoch"));
     $cboDo = new Checkbox("donnerstag", "", "J", $this->TERM_ROW->getNamedAttribute("donnerstag"));
     $cboFr = new Checkbox("freitag", "", "J", $this->TERM_ROW->getNamedAttribute("freitag"));
     $cboSa = new Checkbox("samstag", "", "J", $this->TERM_ROW->getNamedAttribute("samstag"));
     $cboSo = new Checkbox("sonntag", "", "J", $this->TERM_ROW->getNamedAttribute("sonntag"));
     $triggerChb = new Checkbox("trigger_jn", "", "J", $this->TERM_ROW->getNamedAttribute("trigger_jn"));
     $triggerChb->setToolTip("Gibt an, ob Bedingung für Reverse-Schaltungen geprüft werden soll.");
     $t = new Table(array("Mo", "Di", "Mi", "Do", "Fr", "Sa", "So", "", ""));
     $t->setAlign("center");
     $r = $t->createRow();
     $r->setAttribute(0, "Montag");
     $r->setAttribute(1, "Dienstag");
     $r->setAttribute(2, "Mittwoch");
     $r->setAttribute(3, "Donnerstag");
     $r->setAttribute(4, "Freitag");
     $r->setAttribute(5, "Samstag");
     $r->setAttribute(6, "Sonntag");
     $r->setAttribute(7, "Trigger?");
     $r->setAttribute(8, "");
     $t->addRow($r);
     $r = $t->createRow();
     $r->setAttribute(0, $cboMo);
     $r->setAttribute(1, $cboDi);
     $r->setAttribute(2, $cboMi);
     $r->setAttribute(3, $cboDo);
     $r->setAttribute(4, $cboFr);
     $r->setAttribute(5, $cboSa);
     $r->setAttribute(6, $cboSo);
     $r->setAttribute(7, $triggerChb);
     $r->setAttribute(8, new Button("saveEditWochentagTerm", " Speichern "));
     $t->addRow($r);
     $rH3 = $t->createRow();
     $rH3->setSpawnAll(true);
     $rH3->setAttribute(0, new Hiddenfield("editTerm", $_REQUEST['editTerm']));
     $t->addRow($rH3);
     $rH4 = $t->createRow();
     $rH4->setSpawnAll(true);
     $rH4->setAttribute(0, new Hiddenfield("editWochentag", "ok"));
     $t->addRow($rH4);
     $div->add($t);
     return $div;
 }
Example #5
0
 function getSingleUpdateMask($rowId)
 {
     $tblAll = new Table(array(""));
     if ($rowId == null || $rowId == "") {
         return $tblAll;
     }
     $f1 = new FontType();
     $f1->setFontSize(2);
     $f1->setBold(true);
     $f2 = new FontType();
     $fts = array($f1, $f2);
     $table = new Table(array("", ""));
     $table->setHeadEnabled(false);
     $table->setBorder(0);
     $table->setFontTypes($fts);
     $table->setAlign($this->getAlign());
     $table->setVAlign($this->getVAlign());
     $table->setAlignments($this->getAlignments());
     if ($this->WIDTH > 0) {
         $table->setWidth($this->WIDTH);
     }
     if ($this->HEIGHT > 0) {
         $table->setHeight($this->HEIGHT);
     }
     if ($this->BORDER != null && strlen($this->BORDER) > 0) {
         $table->setBorder($this->BORDER);
     }
     if ($this->PADDING >= 0) {
         $table->setPadding($this->PADDING);
     }
     if ($this->HEAD_ENABLED) {
         $table->setHeadEnabled($this->HEAD_ENABLED);
     }
     if ($this->SPACING >= 0) {
         $table->setSpacing($this->SPACING);
     }
     if ($this->XPOS > 0 && $this->YPOS > 0) {
         $table->setXPos($this->XPOS);
         $table->setYPos($this->YPOS);
     }
     $chk = 0;
     $stmnt = "SELECT ";
     foreach ($this->COLNAMES as $cn) {
         if ($stmnt != "SELECT ") {
             $stmnt .= ", ";
         }
         $stmnt .= $cn;
         $chk++;
     }
     $stmnt .= ", id as rowid ";
     $stmnt .= " FROM " . $this->TABLENAME . "  where id = " . $rowId . " " . $this->ORDERBY . " LIMIT 1 ";
     $result = $this->DBCONNECT->executeQuery($stmnt);
     $rowEdit = mysql_fetch_array($result);
     for ($i = 0; $i < mysql_num_fields($result) - 1; $i++) {
         $fieldName = mysql_field_name($result, $i);
         $arrChk = array_search($fieldName, $this->NOUPDATECOLS);
         if (strlen($arrChk) == 0) {
             $r = $table->createRow();
             $o = "";
             $lookups = getLookupWerte($_SESSION['config']->DBCONNECT, $this->TABLENAME, $fieldName);
             // in der Datenbank für dieses Datenbankfeld
             // definierte Combobox laden (wenn vorhanden)
             $dbCombo = getDbComboArray($this->TABLENAME, $fieldName, $rowEdit);
             $val = "";
             if (isset($rowEdit[$fieldName]) && strlen($rowEdit[$fieldName]) > 0) {
                 $val = $rowEdit[$fieldName];
             }
             if (mysql_num_rows($lookups) == 0 && !$this->isDbComboSet($this->TABLENAME, $fieldName)) {
                 /*if (strpos(" " . $this->DEFAULTS, $fieldName) > 0) {
                                     $tmpval = substr($this->DEFAULTS, strpos($this->DEFAULTS, "=") + 1);
                                     $o = new HiddenField($fieldName, $tmpval);
                 
                                     } else*/
                 if (strpos(mysql_field_flags($result, $i), "enum") > 0) {
                     $ev = $this->getEnumValues($fieldName);
                     if (count($ev) == 2 && (in_array('J', $ev) && in_array('N', $ev))) {
                         $o = new Checkbox($fieldName . $rowId, "", "J");
                         if ($rowEdit[$fieldName] == "J") {
                             $o->setSelected(true);
                         }
                     } else {
                         $o = new ComboBox($fieldName . $rowId, $this->getComboboxEnumArray($fieldName));
                     }
                 } else {
                     if (mysql_field_type($result, $i) == "blob") {
                         $o = new TextArea($fieldName . $rowId, $val, 80, 10);
                         $o->setTextEditor($this->TEXTEDITOR_ENABLED);
                     } else {
                         if (mysql_field_type($result, $i) == "date") {
                             $o = new DateTextfield($fieldName . $rowId, $val);
                             $o->setToolTip("Bitte im Format:  <b>YYYY-MM-TT</b>  angeben");
                         } else {
                             if (mysql_field_type($result, $i) == "int") {
                                 $o = new TextField($fieldName . $rowId, $val);
                             } else {
                                 if (mysql_field_type($result, $i) == "timestamp") {
                                     $o = new TextField($fieldName . $rowId, $val);
                                 } else {
                                     $o = new TextField($fieldName . $rowId, $val);
                                 }
                             }
                         }
                     }
                 }
             } else {
                 if (mysql_num_rows($lookups) > 0) {
                     $o = new LookupCombo($_SESSION['config']->DBCONNECT, $fieldName . $rowId, $this->TABLENAME, $fieldName, $rowEdit[$fieldName]);
                 } else {
                     if (count($dbCombo) > 0) {
                         if (!strpos(" " . $this->DEFAULTS, $fieldName) > 0) {
                             $o = new ComboBox($fieldName . $rowId, $dbCombo, $val);
                         } else {
                             $o = new HiddenField($fieldName . $rowId, $val);
                         }
                     }
                 }
             }
             if ($i < count($this->LABELS)) {
                 $r->setAttribute(0, $this->LABELS[$i]);
             } else {
                 $r->setAttribute(0, "");
             }
             $arrChk = array_search($fieldName, $this->READONLYCOLS);
             if (strlen($arrChk) != 0) {
                 $o->setReadOnly(true);
             }
             $r->setAttribute(1, $o);
             $table->addRow($r);
         }
     }
     foreach ($this->ADDITIONAL_UPDATE_FIELDS as $label => $field) {
         $r = $table->createRow();
         $r->setAttribute(0, $label);
         $r->setAttribute(1, $field);
         $table->addRow($r);
     }
     $okButton = new Button("DbTableUpdate" . $this->TABLENAME, "Speichern");
     $r = $table->createRow();
     $r->setSpawnAll(true);
     $r->setAttribute(0, $okButton);
     $table->addRow($r);
     $rowAll1 = $tblAll->createRow();
     $rowAll2 = $tblAll->createRow();
     $rowAll1->setAttribute(0, $table);
     $tblAll->addRow($rowAll1);
     $tblAll->addRow($rowAll2);
     $f = new Form($_SERVER['SCRIPT_NAME']);
     $f->add($tblAll);
     $f->add(new Hiddenfield("SingleUpdateRowId", $rowId));
     $f->add($this->DEFAULT_HIDDEN_FIELDS);
     return $f;
 }
 /**
  * Zeigt das DateTextfield an
  * Es wird eine Tabelle um das Feld gesetzt um eine 
  * freie Positionierung so wie Tooltips oä zu ermöglichen. 
  * (da der eigentliche Kalender ein Script ist)
  */
 function show()
 {
     $tbl = new Table(array(""));
     $tbl->setWidth(50);
     $tbl->setAlign("left");
     $dtText = "<script>DateInput('" . $this->NAME . "', true";
     if (strlen($this->DATEFORMAT) > 7) {
         $dtText .= ", '" . $this->DATEFORMAT . "'";
         if (strlen($this->VALUE) == strlen($this->DATEFORMAT)) {
             $dtText .= ", '" . $this->VALUE . "'";
         }
     }
     $dtText .= ")</script>";
     $dateTextField = new Text($dtText);
     $dateTextField->setFilter(false);
     $r = $tbl->createRow();
     $r->setAttribute(0, $dateTextField);
     $tbl->addRow($r);
     $tbl->setToolTip($this->getTooltip());
     $tbl->show();
 }
 /**
 *  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;
 }
Example #8
0
 function getRessourceInfoBar()
 {
     if ($this->getUserRow() == null) {
         return new Div();
     }
     $dbTbl = new DbTable($_SESSION['config']->DBCONNECT, "game_ressourcen_art", array("*"), "", "", "", "");
     $tbl = new Table(array("Level", "", "EP", "", "Spacer", "Gold", "", "Erz", "", "Felsen", "", "Holz", "", "Wasser", "", "Nahrung", ""));
     $tbl->setWidth("670");
     $tbl->setColSizes(array(16, 30, 16, 40, 10, 13, 80, 13, 80, 13, 80, 13, 80, 13, 80, 13, 80));
     $tbl->setAlign("left");
     $r = $tbl->createRow();
     $r->setAttribute(0, "Level: ");
     $r->setAttribute(1, $this->getLevel());
     $r->setAttribute(2, "EP: ");
     $r->setAttribute(3, $this->getEP());
     $r->setAttribute(4, "");
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Gold"));
     $gTx = new Text($this->getGold());
     $gTx->setToolTip("Gold");
     $gImg = $ress->getRessourceImage();
     $gImg->setWidth(10);
     $gImg->setHeight(10);
     $gImg->setToolTip("Gold");
     $r->setAttribute(5, $gImg);
     $r->setAttribute(6, $gTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Erz"));
     $eTx = new Text($this->getErz());
     $eTx->setToolTip("Felsen");
     $eImg = $ress->getRessourceImage();
     $eImg->setWidth(10);
     $eImg->setHeight(10);
     $eImg->setToolTip("Erz");
     $r->setAttribute(7, $eImg);
     $r->setAttribute(8, $eTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Felsen"));
     $fTx = new Text($this->getFelsen());
     $fTx->setToolTip("Felsen");
     $fImg = $ress->getRessourceImage();
     $fImg->setWidth(10);
     $fImg->setHeight(10);
     $fImg->setToolTip("Felsen");
     $r->setAttribute(9, $fImg);
     $r->setAttribute(10, $fTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Holz"));
     $hTx = new Text($this->getHolz());
     $hTx->setToolTip("Holz");
     $hImg = $ress->getRessourceImage();
     $hImg->setWidth(10);
     $hImg->setHeight(10);
     $hImg->setToolTip("Holz");
     $r->setAttribute(11, $hImg);
     $r->setAttribute(12, $hTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Wasser"));
     $wTx = new Text($this->getWasser());
     $wTx->setToolTip("Wasser");
     $wImg = $ress->getRessourceImage();
     $wImg->setWidth(10);
     $wImg->setHeight(10);
     $wImg->setToolTip("Wasser");
     $r->setAttribute(13, $wImg);
     $r->setAttribute(14, $wTx);
     $ress = new Ressource($this->getRessourceRowByName($dbTbl, "Nahrung"));
     $nTx = new Text($this->getNahrung());
     $nTx->setToolTip("Nahrung");
     $nImg = $ress->getRessourceImage();
     $nImg->setWidth(10);
     $nImg->setHeight(10);
     $nImg->setToolTip("Nahrung");
     $r->setAttribute(15, $nImg);
     $r->setAttribute(16, $nTx);
     $tbl->addRow($r);
     return $tbl;
 }
 /**
  * Maske um Urhzeit incl. Bedingung (<>=) zu erzeugen
  */
 private function getWochentagTermCreatorMask()
 {
     $div = new Div("createWochentag");
     $cboMo = new Checkbox("montag");
     $cboDi = new Checkbox("dienstag");
     $cboMi = new Checkbox("mittwoch");
     $cboDo = new Checkbox("donnerstag");
     $cboFr = new Checkbox("freitag");
     $cboSa = new Checkbox("samstag");
     $cboSo = new Checkbox("sonntag");
     $triggerChb = new Checkbox("trigger_jn", "", "J");
     $triggerChb->setToolTip("Gibt an, ob eine &Auml;nderung des Wertes einen Schaltvorgang aktiviert oder nur als Bedingung dient.");
     $t = new Table(array("Mo", "Di", "Mi", "Do", "Fr", "Sa", "So", "", ""));
     $t->setAlign("center");
     $r = $t->createRow();
     $r->setAttribute(0, "Montag");
     $r->setAttribute(1, "Dienstag");
     $r->setAttribute(2, "Mittwoch");
     $r->setAttribute(3, "Donnerstag");
     $r->setAttribute(4, "Freitag");
     $r->setAttribute(5, "Samstag");
     $r->setAttribute(6, "Sonntag");
     $r->setAttribute(7, "Trigger?");
     $t->addRow($r);
     $r = $t->createRow();
     $r->setAttribute(0, $cboMo);
     $r->setAttribute(1, $cboDi);
     $r->setAttribute(2, $cboMi);
     $r->setAttribute(3, $cboDo);
     $r->setAttribute(4, $cboFr);
     $r->setAttribute(5, $cboSa);
     $r->setAttribute(6, $cboSo);
     $r->setAttribute(7, $triggerChb);
     $r->setAttribute(8, new Button("saveCreateWochentagTerm", "Bedingung hinzufuegen"));
     $t->addRow($r);
     $rH = $t->createRow();
     $rH->setSpawnAll(true);
     $rH->setAttribute(0, new Hiddenfield("dbTableNewhomecontrol_term", "Neuen Eintrag"));
     $t->addRow($rH);
     $rH2 = $t->createRow();
     $rH2->setSpawnAll(true);
     $rH2->setAttribute(0, new Hiddenfield("createWochentag", "ok"));
     $t->addRow($rH2);
     $div->add($t);
     return $div;
 }
Example #10
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();
         }
     }
 }
 */
if (!isset($_REQUEST['showUserId']) || strlen($_REQUEST['showUserId']) <= 0) {
    $e = new Error("Fehlender Übergabewert", "Keine Eingabe in \$_REQUEST['showUserId'] gefunden");
}
$currPath = dirname($_SERVER['SCRIPT_NAME']);
$currPath = substr($currPath, 1);
if (strlen($currPath) > 0) {
    $currPath = $currPath . "/";
}
//Daten holen
$userDBTable = new DbTable($_SESSION['config']->DBCONNECT, 'user', array("*"), "", "", "", "id=" . $_REQUEST['showUserId'] . " ");
$userDBRow = $userDBTable->getRow(1);
//Daten in Table stecken
$userTable = new Table(array("", ""));
$userTable->setWidth(400);
$userTable->setAlign("left");
$ft = new FontType();
$ft->setFontsize(4);
//User-Name
$userRow = $userTable->createRow();
$userRow->setSpawnAll(true);
$userRow->setAlign("center");
$user = new Text($userDBRow->getNamedAttribute("User"));
$userRow->setAttribute(0, $user);
$user->setFonttype($ft);
$userTable->addRow($userRow);
$userTable->addSpacer(0);
//User-Avatar
$userRow1 = $userTable->createRow();
$userRow1->setSpawnAll(true);
$userRow1->setAlign("center");
Example #12
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();
 }