Example #1
0
 public function Load()
 {
     require_once dirname(__FILE__) . "/includes/utils-unset-var.inc.php";
     if (!$this->isAjaxPage()) {
         unsetWspAdminVariables();
     }
     parent::$PAGE_TITLE = __(CONNECT_PAGE_TITLE);
     $this->setUserRights("");
     // Welcome message
     $this->render = new Table();
     $this->render->setWidth("100%");
     $connect_box = new RoundBox(RoundBox::STYLE_SECOND, "connect_box", 420, 150);
     $connect_box->setShadow(true);
     $connect_box->setValign(RoundBox::VALIGN_CENTER);
     $connect_table = new Table();
     $connect_table->setWidth("100%")->setDefaultAlign(RowTable::ALIGN_LEFT);
     $admin_pic = new Picture("img/wsp-admin/admin_128.png", 128, 128);
     $this->auth_obj = new Authentication($this, "connect");
     $this->auth_obj->setTableWidth(265);
     $connect_table->addRowColumns($admin_pic, $this->auth_obj);
     $connect_box->setContent($connect_table);
     $this->render->addRow("<br/><br/><br/><br/><br/>");
     $this->obj_br_before = new Object();
     $this->obj_br_before->setId("divBrBefore");
     $this->render->addRow($this->obj_br_before);
     $this->mod_obj = new Object();
     $this->mod_obj->setId("divConfigRecommandation")->setWidth(400);
     $this->render->addRow($this->mod_obj);
     $this->render->addRow("");
     $this->render->addRow($connect_box, RowTable::ALIGN_CENTER, RowTable::VALIGN_CENTER);
     $this->render->addRow("<br/>");
 }
 /**
  * Set/get width
  */
 public function testWidth()
 {
     $oTable = new Table();
     $iVal = rand(1, 1000);
     $oTable->setWidth($iVal);
     $this->assertEquals($iVal, $oTable->getWidth());
 }
Example #3
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CHANGE_PASSWD);
     $form = new Form($this, "Form_change_passwd");
     if (extension_loaded('openssl')) {
         //$form->setEncryptObject(new EncryptDataWspObject("change wsp password", 2048));
     }
     $table = new Table();
     $table->addRow();
     $this->edt_old_passwd = new Password($form, "wsp_old_password");
     $this->edt_old_passwd->setFocus();
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(OLD_PASSWD));
     $table->addRowColumns(__(OLD_PASSWD) . " :&nbsp;", $this->edt_old_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $this->edt_new_passwd = new Password($form, "wsp_new_password");
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(NEW_PASSWD));
     $table->addRowColumns(__(NEW_PASSWD) . " :&nbsp;", $this->edt_new_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $this->edt_confirm_passwd = new Password($form, "wsp_confirm_password");
     $live_validation = new LiveValidation();
     $live_validation->addValidatePresence()->setFieldName(__(CONFIRM_PASSWD));
     $live_validation->addValidateConfirmation("wsp_new_password");
     $table->addRowColumns(__(CONFIRM_PASSWD) . " :&nbsp;", $this->edt_confirm_passwd->setLiveValidation($live_validation))->setStyle("color:black;");
     $table->addRow();
     $this->validate_btn = new Button($form);
     $this->validate_btn->setValue(__(CHANGE_PASSWD))->onClick("onChangePasswd")->setAjaxEvent();
     $table->addRow($this->validate_btn)->setColspan(2)->setAlign(RowTable::ALIGN_CENTER);
     $table->addRow();
     $form->setContent($table);
     $table = new Table();
     $table->setWidth("100%");
     $table->addRow($form, RowTable::ALIGN_CENTER);
     $this->render = $table;
 }
Example #4
0
 public function Load()
 {
     parent::$PAGE_TITLE = __(CONFIGURE_MODULES);
     $config_modules_obj = new Object();
     $construction_page = new Object(__(PAGE_IN_CONSTRUCTION));
     $construction_page->setClass("warning");
     $config_modules_obj->add($construction_page);
     $config_modules_obj->add("<br/>", __(PRESENTATION), "<br/><br/>");
     $sort_event_install = new SortableEvent($this);
     $sort_event_install->onSort("onChangeModule")->setAjaxEvent()->disableAjaxWaitMessage();
     $this->list_install_modules_obj = new Object();
     $this->list_install_modules_obj->setId("list_install_modules");
     $this->list_install_modules_obj->setSortable(true, $sort_event_install);
     $list_all_install_modules_obj = new Object();
     $module_style = "cursor:pointer;width:100px;border:1px solid gray;padding:2px;margin:2px;";
     $array_active_modules = array();
     $module_file = new File(dirname(__FILE__) . "/../../../wsp/config/modules.cnf");
     while (($line = $module_file->read_line()) != false) {
         if (trim($line) != "") {
             $array_active_modules[] = trim($line);
             $module_obj = new Object(trim($line));
             $module_obj->setId("module_" . str_replace("-", "_", trim($line)))->forceDivTag();
             if (trim($line) != "Authentication") {
                 $module_obj->setStyle($module_style);
                 $module_obj->setDraggable(true, false, null, true);
                 $this->list_install_modules_obj->add($module_obj);
             } else {
                 $module_obj->setStyle($module_style . "cursor:none;");
                 $list_all_install_modules_obj->add($module_obj);
             }
         }
     }
     $module_file->close();
     $list_all_install_modules_obj->add($this->list_install_modules_obj);
     $sort_event = new SortableEvent($this);
     $sort_event->onSort("onChangeModule")->setAjaxEvent()->disableAjaxWaitMessage();
     $this->list_modules_obj = new Object();
     $this->list_modules_obj->setId("list_modules");
     $this->list_modules_obj->setSortable(true, $sort_event);
     $folder = dirname(__FILE__) . "/../../../wsp/class/modules";
     $array_module_dir = scandir($folder);
     for ($i = 0; $i < sizeof($array_module_dir); $i++) {
         if (is_dir($folder . "/" . $array_module_dir[$i]) && !in_array($array_module_dir[$i], $array_active_modules) && $array_module_dir[$i] != "." && $array_module_dir[$i] != ".." && $array_module_dir[$i] != ".svn") {
             $module_obj = new Object($array_module_dir[$i]);
             $module_obj->setId("module_" . str_replace("-", "_", $array_module_dir[$i]))->forceDivTag();
             $module_obj->setDraggable(true, false, null, true)->setStyle($module_style);
             $this->list_modules_obj->add($module_obj);
         }
     }
     $config_table = new Table();
     $config_table->setWidth(400)->setDefaultAlign(RowTable::ALIGN_CENTER);
     $config_table->setDefaultValign(RowTable::VALIGN_TOP);
     $config_table->addRowColumns(new Object(new Label(__(ALL_MODULES), true), "<br/>", $this->list_modules_obj), "&nbsp;", new Object(new Label(__(INSTALLED_MODULES), true), "<br/>", $list_all_install_modules_obj));
     $config_modules_obj->add($config_table, "<br/><br/>");
     $this->render = new AdminTemplateForm($this, $config_modules_obj);
 }
Example #5
0
 function Error($title, $text, $backLink = '')
 {
     $t = "<font color='red' size='3' ><b>" . $text . "</b></font>";
     if (strlen($backLink) > 0) {
         $t .= " <br><br><a target ='_top' href='" . $backLink . "'>Zurück</a>";
     }
     $text = new Text($t);
     $text->setFilter(false);
     $title = array("FEHLER: " . $title);
     $tbl = new Table($title);
     $r = $tbl->createRow();
     $r->setAttribute(0, $text);
     $tbl->addRow($r);
     $tbl->setWidth(500);
     $tbl->show();
     exit;
 }
 /**
  * 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();
 }
<?php

/**
 * @filename layout_apple.php
 * @author  Daniel Scheidler
 * @copyright November 2012
 */
echo "NO APPLE!!!";
exit;
$layoutTable = new Table(array(""));
$layoutTable->setWidth(600);
$layoutTable->setAlign("left");
$layoutTable->setBORDER(0);
$layoutTable->setBackgroundColor("#ffdddd");
//  $_SESSION['config']->COLORS['panel_background']);
$layoutTable->setSpacing(0);
$layoutTable->setPadding(0);
/* ------------------------------------
     HAUPT-MENU
   ------------------------------------ */
$menuDiv = new Div();
$menuDiv->setWidth(600);
$menuDiv->setBorder(0);
$menuDiv->setOverflow("hidden");
$menuDiv->setAlign("center");
$menuDiv->setStyle("padding-left", "2px");
$menuDiv->setBackgroundColor($_SESSION['config']->COLORS['panel_background']);
$spc = new Text(" | ");
$menu = new DbMenu("Hauptmenue");
$menu->setAlign("center");
$menu->setFontsize(2);
 function __construct($page_object, $content, $right_side_content = null)
 {
     parent::__construct();
     $page_object->includeJsAndCssFromObjectToPage("LiveValidation");
     $this->render = new Table();
     $this->render->setWidth("100%");
     $this->render->setDefaultAlign(RowTable::ALIGN_CENTER);
     $table = new Table();
     $table->setWidth("800");
     $table->setDefaultAlign(RowTable::ALIGN_LEFT);
     // search parent link and current page icon, name
     $pathway = "";
     $page_icon_16 = "";
     $wsp_admin_url = WSP_ADMIN_URL;
     $array_menu = xml2array(file_get_contents(dirname(__FILE__) . "/../menu.xml"));
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
             eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
         } else {
             eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
         }
         eval("\$page_link = \"" . $menuitems['Menu_attr']['url'] . "\";");
         if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
             $sub_menuitems = $menuitems['MenuItems'];
         } else {
             $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
         }
         foreach ($sub_menuitems as $menuitem) {
             eval("\$sub_page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
             if ($sub_page_link == $_GET['p'] . ".html") {
                 eval("\$page_icon_16 = \"" . $menuitem['Menu_attr']['icon_16'] . "\";");
                 if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                     eval("\$sub_page_title = " . $menuitem['Menu_attr']['name'] . ";");
                 } else {
                     eval("\$sub_page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
                 }
                 $pathway = new Object(new Link($page_link, Link::TARGET_NONE, $page_title), " > ", $sub_page_title);
                 break;
             }
         }
         if ($pathway != "") {
             break;
         }
     }
     // Header
     $logo_pic = new Picture("img/wsp-admin/logo_60x160_" . $_SESSION['lang'] . ".png", 60, 160, 0);
     $table->addRowColumns(new AdminMenu($page_object, $array_menu), new Link("http://www.website-php.com", Link::TARGET_BLANK, $logo_pic))->setColumnAlign(2, RowTable::ALIGN_RIGHT);
     // check WSP version
     $alert_version_obj = getAlertVersiobObject($page_object);
     if ($alert_version_obj != null) {
         $table->addRowColumns($alert_version_obj)->setColspan(2);
     }
     // Main
     $small_img = new Picture($page_icon_16, 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img);
     $title_header->add(new Object(new Link("wsp-admin/admin.html", Link::TARGET_NONE, __(ADMIN)), " > ", $pathway));
     $box_width = 800;
     if ($right_side_content != null) {
         $box_width = 700;
     }
     $configure_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "configure_database_box", $box_width);
     $configure_box->setContent($content);
     if ($right_side_content != null) {
         $table->addRowColumns($configure_box, "&nbsp;", $right_side_content)->setColumnColspan(1, 2)->setColumnWidth(1, $box_width)->setColumnWidth(2, 10);
     } else {
         $table->addRow($configure_box)->setColspan(2);
     }
     $this->render->addRow($table);
     $this->render->addRow(__(CURRENT_WSP_VERSION, getCurrentWspVersion()));
 }
 /**
  * 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;
 }
Example #10
0
 function getDefaultRegisterMask()
 {
     $tbl = new Table(array("", ""));
     $tbl->setSpacing(4);
     $tbl->setWidth(250);
     $r = $tbl->createRow();
     $r->setAttribute(0, "Vorname:");
     $txfUsername = new Textfield("vorname");
     $r->setAttribute(1, $txfUsername);
     $tbl->addRow($r);
     $r = $tbl->createRow();
     $r->setAttribute(0, "Nachname:");
     $txfUsername = new Textfield("nachname");
     $r->setAttribute(1, $txfUsername);
     $tbl->addRow($r);
     $r = $tbl->createRow();
     $r->setAttribute(0, "E-Mail:");
     $txfUsername = new Textfield("email");
     $r->setAttribute(1, $txfUsername);
     $tbl->addRow($r);
     $r = $tbl->createRow();
     $r->setAttribute(0, "Benutzer:");
     $txfUsername = new Textfield("user");
     $r->setAttribute(1, $txfUsername);
     $tbl->addRow($r);
     $r = $tbl->createRow();
     $r->setAttribute(0, "Passwort:");
     $txfUsername = new Textfield("passwort");
     $r->setAttribute(1, $txfUsername);
     $tbl->addRow($r);
     $r = $tbl->createRow();
     $r->setAttribute(0, new Button("saveRegister", "Speichern"));
     $r->setAttribute(1, "");
     $tbl->addRow($r);
     $frm = new Form($_SERVER['SCRIPT_NAME']);
     $frm->add($tbl);
     return $frm;
 }
 function getMap($dbTable)
 {
     $dv = new Div();
     $bgTbl = new Table(array(""));
     $bgTbl->setOnClick("Coords()");
     $bgTbl->setWidth("600");
     $bgTbl->setHeight("340");
     $bgTbl->setStyle("background-image", "url(" . $this->getEtagenImagePath() . ")");
     $rowImg = $bgTbl->createRow();
     //    $img = $this->getEtagenImage();
     $rowImg->setAttribute(0, " ");
     $rowImg->setPadding("4px");
     $bgTbl->addRow($rowImg);
     $dv->add($bgTbl);
     for ($i = 1; $i <= $dbTable->getRowCount(); $i++) {
         $currConfigRow = $dbTable->getRow($i);
         $ctrlItem = new HomeControlItem($currConfigRow, $this->EDITMODE);
         $dv->add($ctrlItem);
     }
     return $dv;
 }
Example #12
0
 public function createExamples($ind)
 {
     $table_box = new Table();
     $table_box->setWidth(250)->setDefaultAlign(RowTable::ALIGN_LEFT);
     $table_box->addRow();
     $body_obj = new Object();
     $body_obj->setAlign(Object::ALIGN_CENTER);
     //->setId("id_body_obj")->setStyle("padding:5px;background:".$this->background_body->getValue().";");
     $text_obj = new Object(__(TEXT_ON_BODY));
     $body_obj->add($text_obj->setId("id_body_text"), "<br/>");
     $link_obj = new Object(new Link("javascript:void(0);", Link::TARGET_BLANK, __(LINK_ON_BODY)));
     $body_obj->add($link_obj->setId("id_body_link"), "<br/>");
     $body_obj->add($this->text_link_note_obj, "<br/>");
     $table_box->addRow($body_obj);
     $table_box->addRow();
     $table_box->addRow();
     $button_1 = new Button($this);
     $button_1->setWidth(245);
     $table_box->addRow($button_1->setValue("Button [style jquery]"));
     $table_box->addRow();
     $tabs = new Tabs("tab-sample");
     $tabs->addTab("Tab1", "");
     $tabs->addTab("Tab2", "");
     $tabs->addTab("Tab3", "");
     $table_box->addRow($tabs);
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $dialogbox = new DialogBox(__(DIALOGBOX_TITLE), __(DIALOGBOX_CONTENT));
     $dialogbox->setWidth(245)->activateOneInstance()->setPosition("");
     $dialogbox_link = new Object(new Link($dialogbox, Link::TARGET_NONE, __(VIEW_DIALOGBOX)));
     $table_box->addRow($dialogbox_link->setId("id_dialogbox_link"));
     $dialogbox->setPositionX("\$('#" . $dialogbox_link->getId() . "').position().left-f_scrollLeft()");
     $dialogbox->setPositionY("\$('#" . $dialogbox_link->getId() . "').position().top-f_scrollTop()-70");
     $this->addObject(clone $dialogbox);
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $table_box->addRow();
     $style1_box_text = new Box("text", false, $this->current_style_val, $this->current_style_val, "", "box_text_" . $this->current_style_val, 245);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box_text->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box_text->forceBoxWithPicture(false);
     }
     $table_box->addRow($style1_box_text->setContent("Box Object [<a href=\"javascript:void(0);\">style " . $this->current_style_val . "</a>]"));
     $style1_box = new Box("link", false, $this->current_style_val, $this->current_style_val, "javascript:void(0);", "box_" . $this->current_style_val, 245);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box->forceBoxWithPicture(false);
     }
     $style1_box->setShadow(true);
     $table_box->addRow($style1_box->setContent("Box Object [<a href=\"javascript:void(0);\">style " . $this->current_style_val . "</a>]"));
     $style1_box = new RoundBox($this->current_style_val, "round_box_" . $this->current_style_val, 245);
     $style1_box->setShadow(true);
     if ($this->background_picture_1->getValue() != "") {
         $style1_box->forceBoxWithPicture(true, $this->border_table_1->getValue());
     } else {
         $style1_box->forceBoxWithPicture(false);
     }
     $table_box->addRow($style1_box->setContent("RoundBox Object<br/>[style " . $this->current_style_val . "]"));
     $table_box->addRow();
     if (!defined('DEFINE_STYLE_BORDER_TABLE_' . $this->current_style_val)) {
         define('DEFINE_STYLE_BORDER_TABLE_' . $this->current_style_val, $this->border_table_1->getValue());
     }
     $table = new Table();
     $table->setId("table_sample")->setWidth(245);
     $table->addRowColumns("header1", "header2", "header3")->setHeaderClass($this->current_style_val);
     $table->addRowColumns("cel 1-1", "cel 1-2", "cel 1-3")->setId("table_tr_sample")->setBorderPredefinedStyle($this->current_style_val)->setAlign(RowTable::ALIGN_CENTER);
     $table_box->addRow($table);
     return $table_box;
 }
 $spc->setHeight(10);
 $spc->show();
 $newBtn = $scDbTable->getNewEntryButton();
 $newBtn->show();
 $spc->show();
 $ln->show();
 $spc->setHeight(20);
 $spc->show();
 // --------------------------------------------------
 //  Zuordnungen
 // --------------------------------------------------
 if (isset($_REQUEST['SelectedShortcutToEdit'])) {
     $_SESSION['SelectedShortcutToEdit'] = $_REQUEST['SelectedShortcutToEdit'];
 }
 $table = new Table(array("", ""));
 $table->setWidth(640);
 $rTitle = $table->createRow();
 $rTitle->setAttribute(0, new Title("Zuordnungen bearbeiten"));
 $rTitle->setSpawnAll(true);
 $table->addRow($rTitle);
 $table->addSpacer(0, 10);
 $cobSelect = new ComboBoxBySql($_SESSION['config']->DBCONNECT, "SELECT id, name FROM homecontrol_shortcut ORDER BY name", "SelectedShortcutToEdit", isset($_SESSION['SelectedShortcutToEdit']) ? $_SESSION['SelectedShortcutToEdit'] : "", "id", "name", " ");
 $cobSelect->setDirectSelect(true);
 $rAuswahl = $table->createRow();
 $rAuswahl->setColSizes(array(120));
 $rAuswahl->setAttribute(0, new Text("Shortcut auswählen: "));
 $rAuswahl->setAttribute(1, $cobSelect);
 $table->addRow($rAuswahl);
 $table->addSpacer(0, 20);
 // Zuordnung ausgewählt
 if (isset($_SESSION['SelectedShortcutToEdit']) && strlen($_SESSION['SelectedShortcutToEdit']) > 0) {
Example #14
0
<?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  ";
<?php

$t = new Title("Alarmanlagen Einstellungen");
$t->show();
doUpdateAlarm();
if ($_SESSION['config']->CURRENTUSER->STATUS != "admin" && $_SESSION['config']->CURRENTUSER->STATUS != "user") {
    /* ------------------------------------
       BENUTZERSTATUS ANZEIGEN
       ------------------------------------ */
    $USR = $_SESSION['config']->CURRENTUSER;
    $USERSTATUS = new UserStatus($USR, -1, -1);
    $tbl = new Table(array(""));
    $tbl->setWidth(600);
    $tbl->setAlign("center");
    $r = $tbl->createRow();
    $r->setAttribute(0, $USERSTATUS);
    $tbl->addRow($r);
    $tbl->show();
    /* --------------------------------- */
} else {
    $spc = new Spacer(20);
    $ln = new Line();
    $scDbTable = new HcAlarmDbTable($_SESSION['config']->DBCONNECT, 'homecontrol_alarm', array("id", "name", "email", "cam_trigger_jn", "foto_senden_jn"), "Id, Name, Email, Kamera als \nAusloeser, Bei Alarm \nFoto per Email", "", "name", "");
    $scDbTable->setReadOnlyCols(array("id"));
    $scDbTable->setNoInsertCols(array("id"));
    $scDbTable->setDeleteInUpdate(true);
    $scDbTable->setHeaderEnabled(true);
    $scDbTable->setWidth("100%");
    $scDbTable->setPadding("5px");
    $scDbTable->setSpacing("5px");
    $scDbTable->setVAlign("middle");
 function __construct($page_object, $menu_url)
 {
     parent::__construct();
     $wsp_admin_url = WSP_ADMIN_URL;
     $array_menu = xml2array(file_get_contents(dirname(__FILE__) . "/../menu.xml"));
     foreach ($array_menu['MenuItems']['MenuItem'] as $menuitems) {
         if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/" . $menu_url) {
             eval("\$icon_16 = \"" . $menuitems['Menu_attr']['icon_16'] . "\";");
             if (find($menuitems['Menu_attr']['name'], "__(", 0, 0) > 0) {
                 eval("\$page_title = " . $menuitems['Menu_attr']['name'] . ";");
             } else {
                 eval("\$page_title = \"" . $menuitems['Menu_attr']['name'] . "\";");
             }
             if ($menuitems['Menu_attr']['url'] == "\$wsp_admin_url/admin.html") {
                 $menuitems = $array_menu;
             }
             if (!isset($menuitems['MenuItems']['MenuItem'][0])) {
                 $sub_menuitems = $menuitems['MenuItems'];
             } else {
                 $sub_menuitems = $menuitems['MenuItems']['MenuItem'];
             }
             foreach ($sub_menuitems as $menuitem) {
                 if ($menuitem['Menu_attr']['url'] != "\$wsp_admin_url/admin.html") {
                     eval("\$sub_page_icon_64 = \"" . $menuitem['Menu_attr']['icon_64'] . "\";");
                     if (find($menuitem['Menu_attr']['name'], "__(", 0, 0) > 0) {
                         eval("\$sub_page_title = " . $menuitem['Menu_attr']['name'] . ";");
                     } else {
                         eval("\$sub_page_title = \"" . $menuitem['Menu_attr']['name'] . "\";");
                     }
                     eval("\$sub_page_link = \"" . $menuitem['Menu_attr']['url'] . "\";");
                     $this->addLink($sub_page_icon_64, $sub_page_title, $sub_page_link);
                 }
             }
             break;
         }
     }
     if ($page_title == "" && $icon_16 == "") {
         throw new NewException("Administration page doesn't exists", 0, getDebugBacktrace(1));
     }
     $this->render = new Table();
     $this->render->setWidth("100%");
     $this->render->setDefaultAlign(RowTable::ALIGN_CENTER);
     $table = new Table();
     $table->setWidth("800");
     $table->setDefaultAlign(RowTable::ALIGN_LEFT);
     // Header
     $logo_pic = new Picture("img/wsp-admin/logo_60x160_" . $_SESSION['lang'] . ".png", 60, 160, 0);
     $table->addRowColumns(new AdminMenu($page_object, $array_menu), new Link("http://www.website-php.com", Link::TARGET_BLANK, $logo_pic))->setColumnAlign(2, RowTable::ALIGN_RIGHT);
     // check WSP version
     $alert_version_obj = getAlertVersiobObject($page_object);
     if ($alert_version_obj != null) {
         $table->addRowColumns($alert_version_obj)->setColspan(2);
     }
     // Main
     $small_img = new Picture($icon_16, 16, 16, 0, Picture::ALIGN_ABSMIDDLE);
     $title_header = new Object($small_img);
     if ($page_title == __(ADMIN)) {
         $title_header->add($page_title);
     } else {
         $title_header->add(new Object(new Link(WSP_ADMIN_URL . "/admin.html", Link::TARGET_NONE, __(ADMIN)), " > ", $page_title));
     }
     $admin_box = new Box($title_header, true, Box::STYLE_SECOND, Box::STYLE_SECOND, "", "admin_box", 800);
     $admin_obj = new Object("<br/>");
     $admin_obj->add(createTableFirstPagePic64($this->array_link_obj), "<br/><br/>");
     $admin_box->setContent($admin_obj);
     $table->addRow($admin_box)->setColspan(2);
     $this->render->addRow($table);
     $this->render->addRow(__(CURRENT_WSP_VERSION, getCurrentWspVersion()));
 }
Example #17
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();
         }
     }
 }
Example #18
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;
 }
 * erwartet die BenutzerId des anzuzeigenden Benutzers in der Variable $_REQUEST['showUserId']
 */
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);
<?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);
<?php

/**
 * @filename layout_mobile.php
 * @author  Daniel Scheidler
 * @copyright November 2012
 */
$_SESSION['additionalLayoutHeight'] = 215;
$layoutTable = new Table(array(""));
$layoutTable->setWidth("100%");
$layoutTable->setBORDER(0);
$layoutTable->setBackgroundColor($_SESSION['config']->COLORS['panel_background']);
$layoutTable->setSpacing(0);
$layoutTable->setPadding(0);
$layoutTable->setStyle("padding", "0px 12px");
/* ------------------------------------
BANNER
------------------------------------ */
$banner = new Image("pics/Banner.png", -1, -1, 800);
$banner->setGenerated(false);
$contentLayoutRow1 = $layoutTable->createRow();
$contentLayoutRow1->setAlign("left");
$contentLayoutRow1->setAttribute(0, $banner);
$layoutTable->addRow($contentLayoutRow1);
/* ------------------------------------
HAUPT-MENU
------------------------------------ */
$menuDiv = new Div();
$menuDiv->setWidth("99%");
$menuDiv->setBorder(0);
$menuDiv->setOverflow("hidden");
Example #22
0
<?php

/***
 * Register.
 */
$win = new SDPanel();
$win->setCaption("Create an account");
$table = new Table();
$table->setWidth("100%");
$table->setHeight("100%");
$table->setClass("table.white");
$table_form = new Table();
$table_form->setRowsStyle("76dip;76dip;76dip");
$table_form->setClass("table.forms");
$email = new InputEmail();
$email->setInviteMessage("E-Mail");
$email->setClass("input.form");
$password = new InputText();
$password->setClass("input.form");
$password->setInviteMessage("Password");
$password->setIsPassword(true);
$password_2 = new InputText();
$password_2->setClass("input.form");
$password_2->setInviteMessage("Confirm your Password");
$password_2->setIsPassword(true);
$table_form->addControl($email, 1, 1);
$table_form->addControl($password, 2, 1);
$table_form->addControl($password_2, 3, 1);
$btn_save = new Button();
$btn_save->setCaption("SIGN UP");
$btn_save->setClass("button.blue");
Example #23
0
        $rslt = $_SESSION['config']->DBCONNECT->executeQuery($sqlDelNoFrame);
    }
}
$sqlNoFrame = "SELECT * FROM homecontrol_noframe WHERE ip = '" . $_SERVER['REMOTE_ADDR'] . "'";
//$_SERVER['HTTP_X_FORWARDED_FOR']
$rslt = $_SESSION['config']->DBCONNECT->executeQuery($sqlNoFrame);
$noFrameLayout = mysql_num_rows($rslt) > 0;
if (isset($_REQUEST['changeMode']) && strlen($_REQUEST['changeMode']) > 0 && $_SESSION['config']->PUBLICVARS['changeMode'] != $_REQUEST['changeMode']) {
    $updSql = "UPDATE pageconfig SET value=" . $_REQUEST['changeMode'] . " WHERE name='currentMode' ";
    $_SESSION['config']->DBCONNECT->executeQuery($updSql);
    $_SESSION['config']->PUBLICVARS['currentMode'] = $_REQUEST['changeMode'];
}
$topSpaceTable = new Table(array(""));
$topSpaceTable->show();
$layoutTable = new Table(array(""));
$layoutTable->setWidth($bannerWidth);
$layoutTable->setAlign("left");
$layoutTable->setBORDER(0);
$layoutTable->setBackgroundColor($_SESSION['config']->COLORS['panel_background']);
$layoutTable->setSpacing(0);
$layoutTable->setPadding(0);
/* ------------------------------------
BANNER
------------------------------------ */
$banner = new Image("pics/Banner.png");
$banner->setWidth($bannerWidth);
if (!$noFrameLayout) {
    $banner->setGenerated(false);
    $contentLayoutRow1 = $layoutTable->createRow();
    $contentLayoutRow1->setAlign("left");
    $contentLayoutRow1->setAttribute(0, $banner);
Example #24
0
<?php

$win = new SDPanel();
$win->setCaption("Movements");
$maintable = new Table();
$maintable->setRowsStyle("100%");
$maintable->setWidth("100%");
$maintable->setHeight("100%");
$maintable->setClass("table.white");
$label_budget = new Label();
$label_budget->setCaption("Add Budget");
$label_budget->setClass("label.blue");
$label_budget->onTap(budget());
$label_income = new Label();
$label_income->setCaption("Income");
$label_income->setClass("label.green");
$label_income->onTap(income());
$label_outcome = new Label();
$label_outcome->setCaption("Outcome");
$label_outcome->setClass("label.red");
$label_outcome->onTap(outcome());
$maintable->addControl($label_budget, 1, 1, 1, 1, "Center", "Middle");
$maintable->addControl($label_income, 2, 1, 1, 1, "Center", "Middle");
$maintable->addControl($label_outcome, 3, 1, 1, 1, "Center", "Middle");
$win->addControl($maintable);
function budget()
{
    $win->Open("Budget");
}
function income()
{
Example #25
0
 /**
  * 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();
 }