Example #1
0
 function message()
 {
     $BS = new Button("Nachricht", "comment_alt2_stroke", "iconicL");
     $BS->style("float:left;");
     $read = false;
     $message = $this->messageParser();
     #$this->A("NuntiusMessage");
     if ($this->A("NuntiusRead") > "0") {
         $read = true;
         $BS = new Button("Nachricht", "check", "iconicL");
         $BS->style("float:left;color:darkgreen;");
         $ex = explode("\n", $message);
         $message = "<span style=\"color:grey;\">" . $ex[0];
         if (isset($ex[1])) {
             $message .= " …";
         }
         $message .= "</span>";
     }
     $from = "";
     $ex = explode(":", $this->A("NuntiusSender"));
     if ($ex[0] == "Device") {
         $D = new Device($ex[1]);
         $from = $D->A("DeviceName");
     }
     if ($ex[0] == "FritzBox") {
         $from = $this->A("NuntiusSender");
     }
     if ($ex[0] == "Mobile") {
         $from = $this->A("NuntiusSender");
     }
     return "\n\t\t\t<div id=\"Nuntius" . $this->getID() . "\" style=\"cursor:pointer;" . ($read ? "" : "background-color:#efefef;") . "min-height:40px;margin-bottom:10px;margin-top:10px;\" onclick=\"" . OnEvent::rme($this, "read", "", "function(t){ \$j('#Nuntius" . $this->getID() . "').replaceWith(t.responseText); fheOverview.loadContent('mNuntiusGUI::getOverviewContent'); }") . "\">\n\t\t\t\t{$BS}\n\t\t\t\t<div style=\"margin-left:40px;\" class=\"\">\n\t\t\t\t\t<p><small style=\"float:right;color:grey;\">Von {$from}, " . Util::CLDateTimeParser($this->A("NuntiusTime")) . "</small>" . nl2br($message) . "</p>\n\t\t\t\t</div>\n\t\t\t</div>";
 }
Example #2
0
 public function getOverviewContent($DeviceID)
 {
     $html = "<div class=\"touchHeader\"><span class=\"lastUpdate\" id=\"lastUpdatemNuntiusGUI\"></span><p>Nuntius</p></div>\n\t\t\t<div style=\"padding:10px;overflow:auto;\">";
     $Device = new Device($DeviceID);
     $BS = new Button("Nachricht senden", "comment_alt2_stroke", "touch");
     $BS->popup("", "Nachricht senden", "mNuntius", "-1", "sendMessagePopup", "", "", "{remember: true" . ($Device->A("DeviceType") != "4" ? ", top: 10" : "") . "}");
     $AC = anyC::get("Nuntius");
     $AC->addAssocV3("NuntiusDeviceID", "=", $DeviceID, "AND", "1");
     $AC->addAssocV3("NuntiusDeviceID", "=", "0", "OR", "1");
     $AC->addAssocV3("NuntiusRead", "=", "0", "AND", "2");
     $AC->setFieldsV3(array("COUNT(*) AS anzahl"));
     $N = $AC->getNextEntry();
     if ($N->A("anzahl") == 0) {
         $BM = new Button("Keine Nachrichten", "check", "touch");
         $BM->style("background-color:transparent;");
     } else {
         $BM = new Button($N->A("anzahl") . " Nachricht" . ($N->A("anzahl") == 1 ? "" : "en"), "info", "touch");
         $BM->className("highlight");
     }
     $BM->popup("", "Nachrichten", "mNuntius", "-1", "showMessages", array($DeviceID), "", "{remember: true" . ($Device->A("DeviceType") != "4" ? ", top: 10" : "") . "}");
     $html .= "{$BM}{$BS}</div>";
     echo $html;
 }
Example #3
0
 public function pluginShow(Device $Device, $plugin, $isLast = false, $options = null)
 {
     try {
         $C = new $plugin();
     } catch (ClassNotFoundException $e) {
         return "Laden des Plugins fehlgeschlagen!";
     }
     $E = $C->getOverviewPlugin();
     $styles = "";
     if ($options != null) {
         $styles = "position:absolute;top:{$options->top}px;left:{$options->left}px;";
     }
     $html = "<div id=\"fheOverviewContent" . $plugin . "_getOverviewContent\" data-plugin=\"{$plugin}\" class=\"desktopDraggable\" style=\"" . (($isLast or $E->minHeight() === 0) ? "" : ($Device->A("DeviceType") == 4 ? "min-" : "") . "height:" . $E->minHeight() . "px;overflow:hidden;") . ($Device->A("DeviceType") == 4 ? "width:300px;" : "") . "{$styles}\">";
     $BM = new Button("Plugin verschieben", "move", "iconicL");
     $BM->style("cursor:move;");
     $BM->addClass("handleMove");
     $BC = new Button("Plugin schließen", "x", "iconicL");
     $BC->addClass("handleClose");
     $BC->doBefore("var currentPlugin = this; %AFTER");
     $BC->rmePCR("mfheOverview", "-1", "pluginDelete", array($Device->getID(), "'{$plugin}'"), "function(){ \$j(currentPlugin).closest('.desktopDraggable').remove(); \$j('#addPlugin{$plugin}').show(); }");
     $html .= "<div class=\"desktopAlterIcons\">{$BM}{$BC}</div>";
     ob_start();
     $C->getOverviewContent($Device->getID());
     $html .= ob_get_contents();
     ob_end_clean();
     $html .= "</div>";
     if ($E->updateInterval()) {
         $this->addPlugin($E->className(), $E->updateInterval(), $E->updateFunction());
     }
     return $html;
 }