Пример #1
0
 public function getHTML($id)
 {
     if ($_SESSION["S"]->isUserAdmin()) {
         $D = new ADesktopGUI();
         return $D->getHTML($id);
     }
     $c = Applications::activeApplication() . "DesktopGUI";
     try {
         $c = new $c();
         if ($id == "1") {
             return "\n\t\t\t\t\t<div style=\"float:right;width:33.3333%;\"><div id=\"desktopRight\" style=\"padding:10px;\">" . $c->getHTML($id) . "</div></div>\n\t\t\t\t\t<div style=\"float:right;width:33.3333%;\"><div id=\"desktopMiddle\" style=\"padding:10px;width:90%;margin:auto;\"></div></div>\n\t\t\t\t\t<div style=\"float:right;width:33.3333%;\"><div id=\"desktopLeft\" style=\"padding:10px;\"></div></div>\n\t\t\t\t\t" . OnEvent::script(OnEvent::frame("desktopLeft", "Desktop", "2") . OnEvent::frame("desktopMiddle", "Desktop", "3")) . "<div style=\"clear:both;\"></div>";
         }
         return $c->getHTML($id);
     } catch (ClassNotFoundException $e) {
     }
 }
Пример #2
0
 public function bricklets()
 {
     $BA = new Button("Bricklet\nhinzufügen", "new");
     $BA->doBefore("\$j('#editAP').fadeOut(400, function(){ \$j('#editDetailsTinkerforge').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
     $BA->rmePCR("Tinkerforge", $this->getID(), "createNew", "", OnEvent::reloadPopup("Tinkerforge"));
     $BA->style("margin:10px;");
     $TE = new HTMLTable(4, "Bricklets");
     $TE->setColWidth(1, 20);
     $TE->setColWidth(2, 35);
     $TE->setColWidth(4, 20);
     $TE->useForSelection(false);
     $TE->maxHeight(400);
     $TE->weight("light");
     $BE = new Button("Eintrag bearbeiten", "arrow_right", "iconic");
     $autoLoad = false;
     $AC = anyC::get("TinkerforgeBricklet", "TinkerforgeBrickletTinkerforgeID", $this->getID());
     while ($A = $AC->getNextEntry()) {
         $B = new Button("Master", "bars", "iconicL");
         $B->popup("", "Plot", "TinkerforgeBricklet", $A->getID(), "getControls", "", "", "{width:820}");
         $B->style("float:right;");
         $BD = new Button("Eintrag löschen", "trash_stroke", "iconic");
         $BD->doBefore("\$j('#editAP').fadeOut(400, function(){ \$j('#editDetailsTinkerforge').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
         $BD->onclick("deleteClass('TinkerforgeBricklet','" . $A->getID() . "', function() { Popup.refresh('Tinkerforge'); },'Eintrag wirklich löschen?');");
         if ($A->A("TinkerforgeBrickletUID") == "") {
             $autoLoad = $A->getID();
         }
         $div = "<span id=\"TinkerforgeBrickletUID" . $A->getID() . "\">" . ($A->A("TinkerforgeBrickletUID") != "" ? $A->A("TinkerforgeBrickletUID") : "Neues Bricklet") . "</span>&nbsp;<br />\n\t\t\t\t\t<small style=\"color:grey;\" id=\"TinkerforgeBrickletType" . $A->getID() . "\">" . ($A->A("TinkerforgeBrickletType") != "" ? TinkerforgeBricklet::$types[$A->A("TinkerforgeBrickletType")] : "") . "</small>";
         $TE->addRow(array($BD, $B, $div, $BE));
         $TE->addCellEvent(3, "click", "contentManager.selectRow(this); \$j('#editDetailsTinkerforge').animate({'width':'800px'}, 200, 'swing', function(){ " . OnEvent::frame("editAP", "TinkerforgeBricklet", $A->getID(), "0", "function(){ \$j('#editAP').fadeIn(); }") . " });");
     }
     if ($AC->numLoaded() == 0) {
         $TE->addRow("Keine Bricklets eingetragen");
         $TE->addRowColspan(1, 3);
     }
     echo "{$BA}\n\t\t\t<div style=\"float:right;width:400px;height:500px;display:none;\" id=\"editAP\"></div>\n\t\t\t<div id=\"listAP\" style=\"width:400px;height:440px;overflow:auto;\">{$TE}</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t" . ($autoLoad ? OnEvent::script("\$j('#TinkerforgeBrickletUID" . $autoLoad . "').parent().trigger(Touch.trigger);") : "");
 }
Пример #3
0
 public function browser()
 {
     $BA = new Button("Eintrag\nhinzufügen", "new");
     $BA->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
     $BA->rmePCR($this->object->getClearClass(), "-1", "create", $this->parametersCreate, OnEvent::reloadPopup($this->object->getClearClass()));
     $BA->style("margin:10px;");
     $cols = 3 + count($this->colsLeft) + count($this->colsRight);
     $TE = new HTMLTable($cols, "Einträge");
     $TE->setColWidth(1, 20);
     $TE->setColWidth($cols, 20);
     $TE->useForSelection(false);
     $TE->maxHeight(400);
     $TE->weight("light");
     $BE = new Button("Eintrag bearbeiten", "arrow_right", "iconic");
     $autoLoad = false;
     while ($A = $this->object->getNextEntry()) {
         $BD = new Button("Eintrag löschen", "trash_stroke", "iconic");
         $BD->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
         $BD->onclick("deleteClass('" . get_class($A) . "','" . $A->getID() . "', function() { " . OnEvent::reloadPopup($this->object->getClearClass()) . " },'Eintrag wirklich löschen?');");
         $isEmpty = false;
         if ($this->emptyCheckField != null and $A->A($this->emptyCheckField) == "") {
             $autoLoad = $A->getID();
             $isEmpty = true;
         }
         if (!$isEmpty) {
             $div = Util::invokeStaticMethod(get_class($this->object), $this->parsers["main"], array($A));
         } else {
             $div = "Neuer Eintrag";
         }
         $row = array();
         $row[] = $BD;
         $row[] = $div;
         foreach ($this->colsRight as $col) {
             $c = Util::invokeStaticMethod(get_class($this->object), $col[0], array($A));
             $row[] = $c;
         }
         $row[] = $BE;
         $TE->addRow($row);
         $action = "contentManager.selectRow(this); \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'800px'}, 200, 'swing', function(){ " . OnEvent::frame("popupEditEntry", get_class($A), $A->getID(), "0", "function(){ \$j('#popupEditEntry').fadeIn(); }") . " });";
         $TE->addCellEvent(2, "click", $action);
         $TE->addCellID(2, "popupEntryID" . $A->getID());
         $TE->addCellEvent(count($row), "click", $action);
     }
     if ($this->object->numLoaded() == 0) {
         $TE->addRow("Keine Einträge");
         $TE->addRowColspan(1, 3);
     }
     return "{$BA}\n\t\t\t<div style=\"float:right;width:400px;height:500px;display:none;\" id=\"popupEditEntry\"></div>\n\t\t\t<div id=\"popupListEntries\" style=\"width:400px;height:440px;overflow:auto;\">{$TE}</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t" . ($autoLoad ? OnEvent::script("\$j('#popupEntryID" . $autoLoad . "').trigger(Touch.trigger);") : "");
 }
Пример #4
0
 public function browser()
 {
     $BA = new Button("Eintrag\nhinzufügen", "new");
     $BA->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
     $BA->rmePCR($this->object->getClearClass(), "-1", "create", $this->parametersCreate, OnEvent::reloadPopup($this->object->getClearClass()));
     $BA->style("margin:10px;");
     if (!$this->showNew) {
         $BA = "";
     }
     $cols = ($this->showTrash ? 1 : 0) + ($this->showEdit ? 1 : 0) + 1 + count($this->colsLeft) + count($this->colsRight);
     $TE = new HTMLTable($cols, "Einträge");
     if ($this->showTrash) {
         $TE->setColWidth(1, 20);
     }
     if ($this->showEdit) {
         $TE->setColWidth($cols, 20);
         $TE->useForSelection(false);
     }
     $TE->maxHeight(400);
     $TE->weight("light");
     $BE = new Button("Eintrag bearbeiten", "arrow_right", "iconic");
     $autoLoad = false;
     while ($A = $this->object->getNextEntry()) {
         $action = "contentManager.selectRow(this); \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'800px'}, 200, 'swing', function(){ " . OnEvent::frame("popupEditEntry", get_class($A), $A->getID(), "0", "function(){ \$j('#popupEditEntry').fadeIn(); }") . " });";
         $BD = new Button("Eintrag löschen", "trash_stroke", "iconic");
         $BD->doBefore("\$j('#popupEditEntry').fadeOut(400, function(){ \$j('#editDetails" . $this->object->getClearClass() . "').animate({'width':'400px'}, 200, 'swing', function(){ %AFTER }); });");
         $BD->onclick("deleteClass('" . get_class($A) . "','" . $A->getID() . "', function() { " . OnEvent::reloadPopup($this->object->getClearClass()) . " },'Eintrag wirklich löschen?');");
         $isEmpty = false;
         if ($this->emptyCheckField != null and !is_array($this->emptyCheckField) and $A->A($this->emptyCheckField) == $this->emptyCheckValue) {
             $autoLoad = $action;
             $isEmpty = true;
         }
         if ($this->emptyCheckField != null and is_array($this->emptyCheckField)) {
             $ec = 0;
             foreach ($this->emptyCheckField as $field) {
                 if ($A->A($field) != "") {
                     continue;
                 }
                 $autoLoad = $action;
                 $isEmpty = true;
                 $ec++;
             }
             $isEmpty = $ec == count($this->emptyCheckField);
         }
         if (!$isEmpty) {
             $obj = get_class($this->object);
             $meth = $this->parsers["main"];
             if (strpos($this->parsers["main"], "::")) {
                 $ex = explode("::", $this->parsers["main"]);
                 $obj = $ex[0];
                 $meth = $ex[1];
             }
             $div = Util::invokeStaticMethod($obj, $meth, array($A));
             #($A->A("TinkerforgeBrickletUID") != "" ? $A->A("TinkerforgeBrickletUID") : "Neuer Eintrag");
         } else {
             $div = "Neuer Eintrag";
         }
         $row = array();
         if ($this->showTrash) {
             $row[] = $BD;
         }
         $row[] = $div;
         foreach ($this->colsRight as $col) {
             $obj = get_class($this->object);
             $meth = $col[0];
             if (strpos($col[0], "::")) {
                 $ex = explode("::", $col[0]);
                 $obj = $ex[0];
                 $meth = $ex[1];
             }
             $row[] = Util::invokeStaticMethod($obj, $meth, array($A));
         }
         if ($this->showEdit) {
             $row[] = $BE;
         }
         $TE->addRow($row);
         if ($this->showTrash) {
             $TE->addCellStyle(1, "vertical-align:top;");
         }
         #$TE->addCellEvent(2, "click", $action);
         if ($this->showEdit) {
             $TE->addCellID(count($row), "popupEntryID" . $A->getID());
             $TE->addCellStyle(count($row), "vertical-align:top;");
             $TE->addCellEvent(count($row), "click", $action);
         }
     }
     if ($this->object->numLoaded() == 0) {
         $TE->addRow("Keine Einträge");
         $TE->addRowColspan(1, $cols);
     }
     return "{$BA}\n\t\t\t<div style=\"float:right;width:calc(100% - 400px);height:500px;display:none;background-color:#f4f4f4;overflow:auto;\" id=\"popupEditEntry\"></div>\n\t\t\t<div id=\"popupListEntries\" style=\"width:400px;height:440px;overflow:auto;\">{$TE}</div>\n\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t" . ($autoLoad ? OnEvent::script($autoLoad) : "");
 }
Пример #5
0
 public function getHTML($id, $page)
 {
     $TID = BPS::getProperty("mphimGUI", "with", 0);
     if ($TID[0] != "g") {
         $this->addAssocV3("phimFromUserID", "=", Session::currentUser()->getID(), "AND", "1");
         $this->addAssocV3("phimToUserID", "=", $TID, "AND", "1");
         $this->addAssocV3("phimphimGruppeID", "=", "0", "AND", "1");
         $this->addAssocV3("phimFromUserID", "=", $TID, "OR", "2");
         $this->addAssocV3("phimToUserID", "=", Session::currentUser()->getID(), "AND", "2");
         $this->addAssocV3("phimphimGruppeID", "=", "0", "AND", "2");
     } else {
         $this->addAssocV3("phimphimGruppeID", "=", str_replace("g", "", $TID));
     }
     #$this->addJoinV3("User", $field1)
     #$this->addOrderV3("phimToUserID", "DESC");
     #$this->addOrderV3($order)
     $this->addOrderV3("phimTime", "DESC");
     $this->addOrderV3("phimID", "DESC");
     $this->setFieldsV3(array("phimRead", "phimFromUserID", "phimMessage", "DATE_FORMAT(FROM_UNIXTIME(phimTime), '%Y-%m-%d') AS grouper"));
     $this->loadMultiPageMode($id, $page, 0);
     $gui = new HTMLGUIX($this);
     $gui->version("mphim");
     $gui->colWidth("phimRead", 20);
     $gui->name("phim");
     $gui->displayGroup("grouper", "mphimGUI::parserDG");
     $gui->options(true, true, false);
     $gui->parser("phimRead", "parserRead");
     $gui->parser("phimFromUserID", "parserFrom");
     $gui->attributes(array("phimRead", "phimFromUserID", "phimMessage"));
     $B = $gui->addSideButton("Gruppen", "./ubiquitous/phim/group.png");
     $B->loadPlugin("contentRight", "mphimGruppe");
     $B = $gui->addSideButton("System-\nBenutzer", "./ubiquitous/phim/phimUser.png");
     $B->loadPlugin("contentRight", "mphimUser");
     $B = $gui->addSideButton("Benutzer\nausblenden", "./ubiquitous/phim/hidden.png");
     $B->loadPlugin("contentRight", "mphimUserHidden");
     $B = $gui->addSideButton("phim\nanzeigen", "new");
     $B->onclick("windowWithRme('mphim', -1, 'chatPopup', [], '', 'window', {height: 300, width:550, left: \$j.jStorage.get('phimX', 20), top: \$j.jStorage.get('phimY', 20), name: 'phim', scroll: false});");
     $B = $gui->addSideButton("Config-Datei", "new");
     $B->windowRme("mphim", "-1", "getConfigFile");
     $users = self::$users = Users::getUsersArray("Alle", true);
     $T = new HTMLTable(1, "Konversation mit");
     $T->setTableStyle("width:100%");
     $T->weight("light");
     $T->useForSelection(false);
     foreach ($users as $ID => $U) {
         $T->addRow(array($U));
         $T->addRowEvent("click", OnEvent::frame("contentRight", "mphim", "-1", 0, "", "mphimGUI;with:{$ID}"));
         if ($ID . "" === $TID . "") {
             $T->addRowClass("highlight");
         }
     }
     $AC = anyC::get("phimGruppe");
     $AC->addAssocV3("INSTR(phimGruppeMembers, ';" . Session::currentUser()->getID() . ";')", ">", "0");
     $TG = new HTMLTable(1, "Gruppen");
     $TG->setTableStyle("width:100%");
     $TG->weight("light");
     $TG->useForSelection(false);
     while ($G = $AC->n()) {
         $TG->addRow(array($G->A("phimGruppeName")));
         $TG->addRowEvent("click", OnEvent::frame("contentRight", "mphim", "-1", 0, "", "mphimGUI;with:g" . $G->getID()));
         if ("g" . $G->getID() === $TID . "") {
             $TG->addRowClass("highlight");
         }
     }
     $gui->addSideRow($T);
     $gui->addSideRow($TG);
     return $gui->getBrowserHTML($id);
 }
Пример #6
0
 function ldapUsersPopup()
 {
     $T = "";
     try {
         $AD = new LoginAD();
         $AD->getUsers();
         $T = new HTMLTable(2);
         $T->setColWidth(1, 20);
         $T->maxHeight(400);
         $T->useForSelection(false);
         $B = new Button("Eintrag bearbeiten", "./images/i2/edit.png", "icon");
         while ($U = $AD->n()) {
             $T->addRow(array($B, $U->A("name")));
             $T->addRowEvent("click", OnEvent::frame("contentLeft", "User", $U->getID()));
         }
     } catch (Exception $e) {
     }
     echo $T;
 }
Пример #7
0
 public function getWindow($redo = false)
 {
     register_shutdown_function('BackupManagerGUIFatalErrorShutdownHandler');
     $F = new File(Util::getRootPath() . "system/Backup");
     if (!$F->A("FileIsWritable")) {
         $B = new Button("Achtung", "restrictions");
         $B->type("icon");
         $B->style("float:left;margin-right:10px;");
         $T = new HTMLTable(1);
         $T->addRow($B . "Es können keine Backups von Ihrer Datenbank angelegt werden, da das Verzeichnis /system/Backup nicht durch den Webserver beschreibbar ist.");
         $T->addRow("Machen Sie das Verzeichnis mit einem FTP-Programm beschreibbar. Klicken Sie dazu mit der rechten Maustaste auf das Verzeichnis auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 777 an, damit es durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.");
         $BRefresh = new Button("Aktualisieren", "refresh");
         $BRefresh->rmePCR("BackupManager", "", "getWindow", "", "Popup.displayNamed('BackupManagerGUI','Backup-Manager',transport);");
         $BRefresh->style("float:right;");
         $T->addRow($BRefresh);
         $T->addRow("");
         $T->addRowClass("backgroundColor0");
         $T->addRow($this->noBackupButton());
         die($T);
     }
     $html = "";
     if (!BackupManagerGUI::checkForTodaysBackup() or $redo) {
         $T = new HTMLTable(1);
         if ($redo) {
             unlink(BackupManagerGUI::getNewBackupName());
         }
         $BOK = $this->makeBackupOfToday();
         $F = new File(BackupManagerGUI::getNewBackupName());
         $F->loadMe();
         if ($BOK === basename(BackupManagerGUI::getNewBackupName()) and $F->A("FileSize") > 100) {
             $B = new Button("Backup abgeschlossen", "okCatch");
             $B->type("icon");
             $B->style("float:left;margin-right:10px;");
             $T->addRow($B . "Das Backup wurde erfolgreich abgeschlossen!<br />Die Größe der Sicherungsdatei beträgt <strong>" . Util::formatByte($F->A("FileSize"), 2) . "</strong>");
             $T->addRowClass("backgroundColor0");
             try {
                 $ftpUpload = $this->FTPUpload(Util::getRootPath() . "system/Backup/{$BOK}");
                 if ($ftpUpload === true) {
                     $B = new Button("FTP-Upload erfolgreich", "okCatch");
                     $B->type("icon");
                     $B->style("float:left;margin-right:10px;");
                     $T->addRow(array($B . "Das Backup wurde erfolgreich auf den FTP-Server hochgeladen"));
                 }
             } catch (Exception $e) {
                 $T->addRow(array($B . $e->getMessage()));
             }
             $html .= $T;
         } else {
             $B = new Button("Es ist ein Fehler aufgetreten", "stop");
             $B->type("icon");
             $B->style("float:left;margin-right:10px;");
             $T->addRow($B . "Beim Erstellen des Backups ist ein Fehler aufgetreten: {$BOK}");
             $html .= $T;
         }
         $html .= OnEvent::script(OnEvent::frame("desktopLeft", "Desktop", "2"));
         #"<script type=\"text/javascript\">contentManager.reloadFrame('contentLeft');</script>";
     }
     $gesamt = 0;
     $data = $this->getBackupsList();
     $i = 0;
     $maxD = 5;
     if (count($data) < $maxD) {
         $maxD = count($data);
     }
     $TF = new HTMLTable(2, "Backups ({$maxD}/" . count($data) . ")");
     $TF->addColStyle(2, "text-align:right;");
     $TF->setColWidth(2, "80px");
     foreach ($data as $name => $size) {
         if ($i < 5) {
             if ($name == basename(BackupManagerGUI::getNewBackupName())) {
                 $name = "<span style=\"color:green;\">{$name}</span>";
             }
             $TF->addRow(array($name, Util::formatByte($size, 2)));
         }
         $i++;
         $gesamt += $size;
     }
     $TF->addRow("");
     $TF->addRowClass("backgroundColor0");
     $TF->addRow(array("<b>Gesamt:</b>", "<b>" . Util::formatByte($gesamt, 2) . "</b>"));
     $TF->addCellStyle(1, "text-align:right");
     $TF->addRow(array("Diese Backups können als Admin-Benutzer im Installation-Plugin heruntergeladen und wiederhergestellt werden."));
     $TF->addRowColspan(1, 2);
     $TF->addRow("");
     $TF->addRowClass("backgroundColor0");
     $TF->addRow(array($this->noBackupButton()));
     $TF->addRowColspan(1, 2);
     $BC = new Button("Fenster\nschließen", "bestaetigung");
     $BC->onclick(OnEvent::closePopup("", "BackupManagerGUI"));
     $BC->style("float:right;margin:10px;");
     $BD = new Button("Details\nanzeigen", "down");
     $BD->onclick("\$j('#BMMoreDetails').slideToggle();");
     $BD->style("margin:10px;");
     $BD->className("backgroundColor0");
     echo $html . $BC . $BD . "<div style=\"clear:both;\"></div><div id=\"BMMoreDetails\" style=\"display:none;\">" . $TF . "</div>";
 }