Ejemplo n.º 1
0
 public function getHTML($id)
 {
     $bps = $this->getMyBPSData();
     $t = new HTMLTable(1);
     $t->setTableStyle("width:160px;float:right;margin-right:10px;");
     if (!isset($bps["ID"])) {
         $F = new mFhemGUI();
         $F->addAssocV3("FhemType", "!=", "FHZ");
         while ($f = $F->getNextEntry()) {
             $B = new Button($f->getA()->FhemName, "./fheME/Fhem/fhem.png");
             $B->onclick("contentManager.loadFrame('contentRight','mFhemTimer',-1,0,'mFhemTimerGUI;ID:" . $f->getID() . ";type:D;name:" . $f->getA()->FhemName . "');");
             $t->addRow($B);
             $t->addRowClass("backgroundColor0");
         }
         $t->addRow("");
         $t->addRowClass("backgroundColor1");
         $F = new anyC();
         $F->setCollectionOf("FhemPreset");
         $F->addAssocV3("FhemPresetHide", "=", "0");
         while ($f = $F->getNextEntry()) {
             $B = new Button($f->getA()->FhemPresetName, "./fheME/Fhem/events.png");
             $B->onclick("contentManager.loadFrame('contentRight','mFhemTimer',-1,0,'mFhemTimerGUI;ID:" . $f->getID() . ";type:P;name:" . $f->getA()->FhemPresetName . "');");
             $t->addRow($B);
             $t->addRowClass("backgroundColor0");
         }
         return $t;
     }
     if (isset($bps["ID"])) {
         if ($bps["type"] == "D") {
             $F = new Fhem($bps["ID"]);
             $F->loadMe();
             $FF = new Fhem("timer");
             $FF->setA($F->getA());
             $C = new FhemControlGUI();
             $control = $C->getControl($FF);
         } else {
             $control = "";
         }
         $rand = rand(10, 10000000);
         $B = new Button("set timer", "okCatch");
         $B->rme("FhemControl", '', 'setTimer', array($bps["ID"], "'setBPSValue'", "'{$bps['type']}'", "parent.clock4Timer{$rand}.stunden", "parent.clock4Timer{$rand}.minuten", "'{$bps['name']}'"), "contentManager.loadFrame(\\'contentRight\\',\\'mFhem\\',-1,0,\\'\\');");
         $B->style("float:right;");
         $t->addRow("<iframe name=\"clock4Timer{$rand}\" style=\"width:240px;height:330px;border:0px;\" src=\"./libraries/ClockGUI.class.php\"></iframe>");
         $t->addRowClass("backgroundColor0");
         $t->addRow($B);
         $t->addRowClass("backgroundColor0");
         return $control . $t;
     }
 }
Ejemplo n.º 2
0
 function getHTML($id)
 {
     #$p = mUserdata::getPluginSpecificData("mStatistik");
     #if(!isset($p["pluginSpecificCanUseControlling"]))
     #	return;
     $html = "";
     #parent::getHTML($id);
     $tab = new HTMLTable(1);
     $tab->addRow("<div id=\"my_chartTodo\" style=\"height:200px;width:470px;\"></div>");
     $tab->addRowClass("backgroundColor0");
     $AC = $this->data();
     $U = Users::getUsersArray(null, true);
     $U[-1] = "Allgemein";
     $T = new HTMLTable(6);
     $T->addColStyle(2, "text-align:right;");
     $T->addColStyle(3, "text-align:right;");
     $T->addColStyle(4, "text-align:right;");
     $T->addColStyle(5, "text-align:right;");
     $T->addColStyle(6, "text-align:right;");
     $T->addHeaderRow(array("Benutzer", "Gesamt", "Abgesch.", "Kalt", "Erst", "Folge"));
     while ($A = $AC->n()) {
         $T->addRow(array(isset($U[$A->A("TodoUserID")]) ? $U[$A->A("TodoUserID")] : "Benutzer ID " . $A->A("TodoUserID"), $A->A("gesamt"), $A->A("gesamtDM") . " (" . Util::CLNumberParserZ($A->A("gesamt") != 0 ? round($A->A("gesamtDM") / $A->A("gesamt") * 100, 2) : 0) . "%)", $A->A("gesamtKalt"), $A->A("gesamtErst"), $A->A("gesamtFolge")));
         $T->addRowStyle("cursor:pointer;");
         $T->addRowEvent("click", OnEvent::rme($this, "details", array($A->A("TodoUserID")), "function(t){ \$j('#contentScreenLeft').html(t.responseText); }"));
     }
     if ($AC->numLoaded() == 0) {
         $T->addRow(array("Es liegen keine Daten vor"));
         $T->addRowColspan(1, 4);
     }
     return "<p class=\"prettySubtitle\">Termine</p>" . $tab . $html . $T . OnEvent::script("\n\t\t\tvar plot = \$j.plot(\$j('#my_chartTodo'), " . $this->chart() . ", {\n\t\t\tseries: {\n\t\t\t\tpie: { show: true, innerRadius: 0.4 }\n\t\t\t}\n\t\t\t});" . OnEvent::rme($this, "getHeaderCenter", "", "function(transport){ \$j('#contentScreenCenterHeader').html(transport.responseText); }"));
 }
Ejemplo n.º 3
0
 public function getHTML($id, $page)
 {
     $bps = $this->getMyBPSData();
     $LangTab = new HTMLTable(1, "Language selection:");
     $LangTab->addRow("German");
     $LangTab->addRowEvent("click", "contentManager.loadFrame('contentRight', 'mNewSeries', -1, 0, 'mNewSeriesGUI;lang:de');");
     $LangTab->addRowStyle("cursor:pointer;");
     if ($bps != -1 and $bps["lang"] == "de") {
         $LangTab->addRowClass("backgroundColor1");
     }
     $LangTab->addRow("English");
     $LangTab->addRowEvent("click", "contentManager.loadFrame('contentRight', 'mNewSeries', -1, 0, 'mNewSeriesGUI;lang:en');");
     $LangTab->addRowStyle("cursor:pointer;");
     if ($bps != -1 and $bps["lang"] == "en") {
         $LangTab->addRowClass("backgroundColor1");
     }
     if ($bps == -1) {
         return $LangTab;
     }
     $T = new HTMLTable(1);
     $T->setTableStyle("width:370px;float:left;");
     $FeedSerien = array();
     $i = 0;
     $Series = array();
     $RSS = new mRSSFilterGUI();
     while ($R = $RSS->getNextEntry()) {
         $new = $R->filterNew();
         foreach ($new as $S => $v) {
             if ($v->language != $bps["lang"]) {
                 continue;
             }
             $Series[$v->name] = "rmeP('NewSeries', '-1', 'showInfo', ['{$v->name}', '{$v->language}'], 'if(checkResponse(transport)) { \$(\\'Row{$i}\\').className = \\'backgroundColor1\\'; \$(\\'contentLeft\\').update(transport.responseText); }');";
         }
     }
     asort($Series);
     foreach ($Series as $name => $action) {
         $T->addRow(array($name));
         $T->addRowStyle("cursor:pointer;");
         $T->addRowEvent("click", $action);
         $T->setRowID("Row{$i}");
         $i++;
     }
     return $LangTab . "<div style=\"margin-left:0px;height:500px;overflow:auto;\">" . $T . "</div>";
 }
Ejemplo n.º 4
0
 /**
  * Popup zur Konfiguration eines Servers.
  */
 public function getConfigPopup($echo = true)
 {
     // Button
     $BCreate = new Button("Server\nhinzufügen", "new");
     $BCreate->rmePCR("mxCal", "-1", "createNewServer", array(), OnEvent::reloadPopup("mxCal"));
     $htmlTableButton = new HTMLTable(1);
     $htmlTableButton->addRow($BCreate);
     // Liste der konfigurierten Server
     $userId = $_SESSION["S"]->getCurrentUser()->getID();
     $T = new HTMLTable(1, "xCal Server");
     $BDeleteRaw = new Button("Eintrag löschen", "./images/i2/delete.gif", "icon");
     $BDeleteRaw->style("float: right;");
     $serverList = anyC::get("xCal", "xCalUserID", $userId);
     $counter = 0;
     while ($S = $serverList->getNextEntry()) {
         $BDelete = clone $BDeleteRaw;
         $BDelete->onclick("deleteClass('xCal','" . $S->getID() . "', function() { Popup.refresh('mxCal'); }, 'Eintrag wirklich löschen?');");
         $F = new HTMLForm("xCal_" . $S->A("xCalID"), array("xCalName", "xCalUrl", "xCalServerActive"));
         $F->getTable()->setColWidth(1, 120);
         $F->setValues($S);
         $F->setLabel("xCalName", "Bezeichnung");
         $F->setLabel("xCalUrl", "URL");
         $F->setLabel("xCalServerActive", "Für den Import verwenden");
         $F->setType("xCalServerActive", "checkbox");
         $F->useRecentlyChanged();
         $F->setSaveClass("xCal", $S->getID(), "''");
         $display = "none";
         if ($S->A("xCalName") == "" && $S->A("xCalUrl") == "") {
             $display = "";
         }
         $div = "<div\n\t\t\t\t\tonmouseover=\"this.className = 'backgroundColor3';\" \n\t\t\t\t\tonmouseout=\"this.className = '';\" \n\t\t\t\t\tstyle=\"padding:3px;cursor:pointer;\" \n\t\t\t\t\tonclick=\"if(\$('APDetails" . $S->getID() . "').style.display == 'none') new Effect.BlindDown('APDetails" . $S->getID() . "'); else new Effect.BlindUp('APDetails" . $S->getID() . "');\">\n\t\t\t\t\t{$BDelete}<span id=\"APPosition" . $S->getID() . "\">" . ($S->A("xCalName") != "" ? $S->A("xCalName") : "Neuer Server") . "</span>&nbsp;<br />\n\t\t\t\t\t<small style=\"color:grey;\" id=\"APName" . $S->getID() . "\">" . ($S->A("xCalServerActive") == "1" ? "Import aktiviert" : "Import deaktiviert") . "&nbsp;</small>\n\t\t\t\t</div>";
         $T->addRow(array($div . "<div id=\"APDetails" . $S->getID() . "\" style=\"display:" . $display . ";\">" . $F . "</div>"));
         $T->addRowClass("backgroundColor0");
         $T->addCellClass(1, "borderColor1");
         $counter++;
     }
     if ($counter == 0) {
         $T->addRow("Keine Server eingetragen!");
     }
     if ($echo == "" || $echo === true) {
         echo $htmlTableButton . $T;
     } else {
         return $htmlTableButton . $T;
     }
 }
Ejemplo n.º 5
0
 public function getHTML($id)
 {
     // <editor-fold defaultstate="collapsed" desc="Aspect:jP">
     try {
         $MArgs = func_get_args();
         return Aspect::joinPoint("around", $this, __METHOD__, $MArgs);
     } catch (AOPNoAdviceException $e) {
     }
     Aspect::joinPoint("before", $this, __METHOD__, $MArgs);
     // </editor-fold>
     if ($_SESSION["S"]->isUserAdmin()) {
         return parent::getHTML($id);
     }
     switch ($id) {
         case "1":
             $AC = anyC::get("JDownload");
             $AC->addOrderV3("JDownloadDate", "DESC");
             $AC->setLimitV3(19);
             $T = new HTMLTable(2);
             $T->weight("light");
             $T->addColStyle(1, "padding:5px;padding-left:10px;");
             $T->addColStyle(2, "color:grey;text-align:right;padding:5px;");
             while ($D = $AC->getNextEntry()) {
                 $T->addRow(array($D->A("JDownloadRenameto"), Util::formatByte($D->A("JDownloadFilesize"), 2)));
                 if ($D->A("JDownloadRenamed") == 0) {
                     $T->addRowClass("error");
                 }
                 #$r .= OnEvent::script ("\$j('#BrowsermJDownload".$E->getID()."').css('background-color', '');");
                 $T->addRowStyle("cursor:pointer;");
                 $T->addRowEvent("click", "contentManager.loadPlugin('contentRight', 'mJDownload', '', " . $D->getID() . ");");
             }
             return "<p class=\"prettyTitle\">Downloads</p>" . $T;
             break;
         case "2":
             break;
         case "3":
             return "";
             break;
     }
 }
Ejemplo n.º 6
0
 public function editInWindow($UDID)
 {
     $T = new HTMLTable(1);
     $B = new Button("Desktop-Link\nlöschen", "trash");
     $B->onclick("");
     $B->style("float:right;");
     $B->rmePCR("DesktopLink", "", "delete", $UDID, "if(checkResponse(transport)){ Popup.close('', 'DesktopLinkPopup'); DesktopLink.loadContent(true); }");
     $T->addRow($B);
     $T->addRowClass("backgroundColor0");
     $UD = new Userdata($UDID);
     $F = new HTMLForm("DesktopLinkEdit", array("order", "symbol", "name", "UDID"), "Bearbeiten:");
     $F->setSaveRMEP("Desktop-Link speichern", "./images/i2/save.gif", "DesktopLink", "{$UDID}", "save", "if(checkResponse(transport)){ Popup.close(\\'\\', \\'DesktopLinkPopup\\'); DesktopLink.loadContent(true); }");
     $v = explode(";", $UD->A("wert"));
     $F->setValue("order", $v[0]);
     $F->setValue("symbol", $v[1]);
     $F->setValue("name", $v[2]);
     $F->setValue("UDID", $UDID);
     $F->setType("UDID", "hidden");
     $F->setType("order", "hidden");
     $F->setType("symbol", "hidden");
     echo $T . $F;
 }
Ejemplo n.º 7
0
 /**
  * Method to display an E-Mail popup for easy E-Mail sending
  * 
  * Requires a method named "getEMailData" in $dataClass which returns an array:
  * array(fromName, fromAddress, recipientName, recipientAddress, subject, body)
  * 
  * Will call $dataClass($dataClassID)::sendEmail afterwards
  * 
  * @param string $dataClass
  * @param string $dataClassID 
  */
 public static function EMailPopup($dataClass, $dataClassID, $callbackParameter = null, $onSuccessFunction = null)
 {
     $c = new $dataClass($dataClassID);
     $data = $c->getEMailData($callbackParameter);
     $tab = new HTMLTable(2);
     $tab->setColWidth(1, "120px;");
     $tab->addLV("Absender:", "{$data['fromName']}<br /><small>&lt;{$data['fromAddress']}&gt;</small>");
     if (count($data["recipients"]) == 1) {
         $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small>&lt;" . $data["recipients"][0][1] . "&gt;</small>");
     } else {
         $recipients = array();
         foreach ($data["recipients"] as $ID => $Rec) {
             $recipients[$ID] = new HTMLInput($Rec[0] . " &lt;" . $Rec[1] . "&gt;", "option", $ID);
         }
         $IS = new HTMLInput("EMailRecipient{$dataClassID}", "select", "0", $recipients);
         $IS->id("EMailRecipient{$dataClassID}");
         $tab->addLV("Empfänger:", $IS);
     }
     $tab->addLV("Betreff:", "<input type=\"text\" id=\"EMailSubject{$dataClassID}\" value=\"{$data['subject']}\" />");
     $tab->addRow(array("<textarea id=\"EMailBody{$dataClassID}\" style=\"width:100%;height:300px;font-size:10px;\">{$data['body']}</textarea>"));
     $tab->addRowColspan(1, 2);
     $tab->addRowClass("backgroundColor0");
     if ($onSuccessFunction == null) {
         $onSuccessFunction = "" . OnEvent::reload("Left") . " Popup.close('Util', 'edit');";
     }
     $BAbort = new Button("Abbrechen", "stop");
     $BAbort->onclick("Popup.close('Util', 'edit');");
     $BAbort->style("margin-bottom:10px;margin-top:10px;");
     $BGo = new Button("E-Mail\nsenden", "okCatch");
     $BGo->style("float:right;margin-top:10px;");
     $BGo->rmePCR($dataClass, $dataClassID, "sendEmail", array("\$('EMailSubject{$dataClassID}').value", "\$('EMailBody{$dataClassID}').value", count($data["recipients"]) == 1 ? "0" : "\$('EMailRecipient{$dataClassID}').value", "'" . $callbackParameter . "'"), $onSuccessFunction);
     #$BGo->onclick("CloudKunde.directMail('$this->ID', '$data[recipientAddress]', $('EMailSubject$this->ID').value, $('EMailBody$this->ID').value); ");
     $tab->addRow(array($BGo . $BAbort));
     $tab->addRowColspan(1, 2);
     #$tab->addRowClass("backgroundColor0");
     echo $tab;
 }
Ejemplo n.º 8
0
 public function getEditHTML()
 {
     if (BPS::getProperty($this->className . "GUI", "edit") == "ok") {
         return $this->getEditTableHTML();
     }
     ################################################################################
     if ($this->name == null) {
         $this->name = $this->className;
     }
     if ($this->attributes == null) {
         $this->attributes = PMReflector::getAttributesArrayAnyObject($this->object->getA());
     }
     $widths = Aspect::joinPoint("changeWidths", $this, __METHOD__);
     if ($widths == null) {
         $widths = array(700, 132, 218);
     }
     $tab = new HTMLTable(2);
     $tab->setTableStyle("width:{$widths['0']}px;margin-left:10px;");
     $tab->setColWidth(1, "50%");
     $tab->setColWidth(2, "50%");
     $A = $this->object->getA();
     $TSub = new HTMLTable(2);
     $TSub->setColWidth(1, 120);
     $TSub->setColClass(1, "");
     $TSub->setColClass(2, "");
     $TC = clone $TSub;
     $row = array();
     foreach ($this->attributes as $k => $v) {
         if (isset($this->types[$v]) and $this->types[$v] == "hidden") {
             continue;
         }
         if (isset($this->parsers[$v])) {
             $A->{$v} = $this->invokeParser($this->parsers[$v], $A->{$v}, $this->object);
         }
         if (isset($this->types[$v]) and $this->types[$v] == "select") {
             if (isset($this->options[$v]) and isset($this->options[$v][$A->{$v}])) {
                 $A->{$v} = $this->options[$v][$A->{$v}];
             }
         }
         if (isset($this->spaces[$v]) and $this->spaces[$v] != "") {
             if ($k > 0) {
                 $row[] = $TC;
             }
             if ($this->forceNewRow[$v]) {
                 $row[] = "";
                 $tab->addRow($row);
                 $tab->addRowClass("backgroundColor0");
                 $tab->addRowStyle("vertical-align:top;");
                 $row = array();
             }
             if (count($row) == 2) {
                 $tab->addRow($row);
                 $tab->addRowClass("backgroundColor0");
                 $tab->addRowStyle("vertical-align:top;");
                 $row = array();
             }
             $TC = clone $TSub;
             if (trim($this->spaces[$v]) != "") {
                 $TC->addRow(array($this->spaces[$v]));
                 $TC->addRowClass("backgroundColor2");
                 $TC->addRowColspan(1, 2);
             }
         }
         if ($A->{$v} != "") {
             $B = "";
             if (isset($this->fieldButtons[$v])) {
                 $B = $this->fieldButtons[$v];
                 $B->style("float:right;");
             }
             $TC->addLV($this->labels($v) . ":", $B . nl2br($A->{$v}));
             $TC->addRowStyle("vertical-align:top;");
         }
         /*
         			$label = isset($this->labels[$v]) ? $this->labels[$v] : $v;
         
         			$row[] = "<label>".($label != "" ? ucfirst($label).":" : "")."</label>";
         
         
         
         			$row[] = nl2br($A->$v);*/
         /*if(count($row) == 4){
         			$tab->addRow($row);
         			$row = array();
         		}*/
     }
     $row[] = $TC;
     if (count($row) == 1) {
         $row[] = "";
     }
     if (count($row) == 2) {
         $tab->addRow($row);
         $tab->addRowClass("backgroundColor0");
         $tab->addRowStyle("vertical-align:top;");
     }
     $BE = new Button("Eintrag\nbearbeiten", "edit");
     $BE->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionEdit));
     $BE->style("float:left;margin-left:10px;");
     $BD = new Button("Eintrag\nlöschen", "trash");
     $BD->onclick(str_replace(array("%CLASSNAME", "%CLASSID"), array($this->className, $this->object->getID()), $this->functionDelete));
     $BD->style("float:left;margin-left:10px;");
     $options = "<div style=\"width:{$widths['0']}px;\">" . $BE . $BD . implode("", $this->topButtons) . "</div><div style=\"clear:left;height:10px;width:{$widths['0']}px;\"></div>";
     $appended = "";
     if (count($this->appended) > 0) {
         foreach ($this->appended as $k => $v) {
             $appended .= $v->getHTML();
         }
     }
     $prepended = "";
     if (count($this->prepended) > 0) {
         foreach ($this->prepended as $k => $v) {
             $prepended .= $v->getHTML();
         }
     }
     /*
     		if(count($this->CRMGUIappendedElements) > 0)
     			foreach($this->CRMGUIappendedElements as $k => $v)
     				$appended .= $v->getHTML();*/
     return $options . $prepended . $tab . $appended;
 }
Ejemplo n.º 9
0
 public function loadDetails()
 {
     echo $this->getHTML($this->ID, "window");
     return;
     $this->setParser("TodoFromDay", "Util::nothingParser");
     $this->setParser("TodoFromTime", "Util::nothingParser");
     $this->setParser("TodoTillDay", "Util::nothingParser");
     $this->setParser("TodoTillTime", "Util::nothingParser");
     $this->loadMe();
     $head = "<div id=\"TodoDetailsHandler{$this->ID}\" class=\"backgroundColor1 cMHeader\">Detailansicht ToDo \"" . $this->A->TodoName . "\"</div>";
     try {
         $T = new mTeilnehmerGUI();
         $T->classID = $this->ID;
         $T->className = "Todo";
         $T->addAssocV3("TeilnehmerTodoID", "=", $this->ID);
         $T->addJoinV3("User", "TeilnehmerUserID", "=", "UserID");
         $T->addOrderV3("TeilnehmerTeamID");
         $table = "\n\t\t\t<table style=\"width:100%;border:0px;\">\n\t\t\t\t<colgroup>\n\t\t\t\t\t<col />\n\t\t\t\t</colgroup>";
         $teilnehmerID = 0;
         $teilnehmerStatus = -1;
         $cu = $_SESSION["S"]->getCurrentUser()->getID();
         while ($s = $T->getNextEntry()) {
             if ($s->getA()->TeilnehmerUserID == $cu) {
                 $teilnehmerID = $s->getID();
                 $teilnehmerStatus = $s->getA()->TeilnehmerStatus;
             }
             $table .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td style=\"padding-left:0px;padding-top:0px;\">" . $s->getA()->name . "</td>\n\t\t\t\t</tr>";
         }
         $table .= "\n\t\t\t</table>";
     } catch (ClassNotFoundException $e) {
         $table = "";
     }
     $t = new HTMLTable(2, "Detailansicht ToDo \"" . $this->A->TodoName . "\"");
     $t->addColStyle(1, "text-align:right;");
     $t->addColStyle(1, "width:110px;");
     #<input class=\"multiEditInput2\" onfocus=\"oldValue = this.value;\" onblur=\"if(oldValue != this.value) saveMultiEditInput('Posten','".$t->getID()."','preis');\" value=\"$ta->preis\" id=\"preisID".$t->getID()."\" type=\"text\" onkeyup=\"updateEKs('".$t->getID()."');\" onkeydown=\"if(event.keyCode == 13) saveMultiEditInput('Posten','".$t->getID()."','preis');\"  />
     if ($teilnehmerID != 0) {
         $st = $this->getStatus();
         $o = "";
         foreach ($st as $k => $v) {
             $o .= "<option " . ($k == $this->A->TodoStatus ? "selected=\"selected\"" : "") . " value=\"{$k}\">{$v}</option>";
         }
         $status = "<select id=\"TodoStatusID{$this->ID}\" onchange=\"saveMultiEditInput('Todo','" . $this->getID() . "','TodoStatus');\">{$o}</select>";
     } else {
         $status = $this->getStatus($this->A->TodoStatus);
     }
     $t->addRow(array("Priorität:", $this->getPriorities($this->A->TodoPriority)));
     $t->addRow(array("Status:", $status));
     if ($teilnehmerID != 0) {
         $percent = "\n\t\t\t<select id=\"TodoPercentID{$this->ID}\" onchange=\"ToDo.onChange();\">";
         for ($i = 0; $i <= 100; $i += 5) {
             $percent .= "\n\t\t\t\t<option " . ($this->A->TodoPercent == $i ? "selected=\"selected\"" : "") . " value=\"{$i}\">{$i} %</option>";
         }
         $percent .= "\n\t\t\t</select>\n\t\t\t<input type=\"hidden\" id=\"TodoID\" value=\"{$this->ID}\" />";
         /*<input type=\"text\" readonly=\"readonly\" id=\"TodoPercentID$this->ID\" value=\"{$this->A->TodoPercent}\" style=\"width:30px;float:right;text-align:right;margin-right:13px;\" />
         			
         			<div id=\"prozentSlider$this->ID\" style=\"height:19px;width:4px;background-color:black;cursor:move;margin-bottom:-17px;\"></div>
         			<div id=\"prozentTrack$this->ID\" style=\"width:80%;height:15px;\" class=\"backgroundColor1\" />";
         		*/
     } else {
         $percent = $this->A->TodoPercent;
     }
     $t->addRow(array("Prozent:", $percent));
     if ($this->A->TodoDescription != "") {
         $t->addRow("");
         $t->addRowClass("backgroundColor0");
         $t->addRow(array("Beschreibung:", nl2br($this->A->TodoDescription)));
     }
     $t->addRow("");
     $t->addRowClass("backgroundColor0");
     $t->addRow(array("Beginn am:", Util::CLDateParserL($this->A->TodoFromDay)));
     $t->addRow(array("Fällig bis:", Util::CLDateParserL($this->A->TodoTillDay)));
     $t->addRow("");
     $t->addRowClass("backgroundColor0");
     echo $t->getHTML();
 }
Ejemplo n.º 10
0
 private function topButtons($bps = null)
 {
     T::D($this->className);
     $TT = "";
     if (count($this->topButtons) > 0 and ($bps == null or !isset($bps["selectionMode"]))) {
         $TT = new HTMLTable(1);
         $TT->addTableClass("browserContainerSubHeight");
         if ($this->displayMode == "CRMSubframeContainer") {
             $buttons = "";
             foreach ($this->topButtons as $B) {
                 $buttons .= $B;
             }
             $TT->addRow($buttons);
             $TT->addRowClass("backgroundColor0");
         } else {
             foreach ($this->topButtons as $B) {
                 $TT->addRow($B . "");
             }
         }
     }
     T::D("");
     return $TT;
 }
Ejemplo n.º 11
0
 /**
  * Method to display an E-Mail popup for easy E-Mail sending
  * 
  * Requires a method named "getEMailData" in $dataClass which returns an array:
  * array(fromName, fromAddress, recipientName, recipientAddress, subject, body)
  * 
  * Will call $dataClass($dataClassID)::sendEmail afterwards
  * 
  * @param string $dataClass
  * @param string $dataClassID 
  */
 public static function EMailPopup($dataClass, $dataClassID, $callbackParameter = null, $onSuccessFunction = null, $onAbortFunction = null, $return = false)
 {
     $c = new $dataClass($dataClassID);
     $data = $c->getEMailData($callbackParameter);
     $html = "";
     if (isset($data["attachmentsAlways"])) {
         /*$B = new Button("Anhänge", "export", "LPBig");
         		$B->style("margin:10px;float:right;");
         		$B->sidePanel("Util", "-1", "EMailPopupAttachmentsSP", array("'$dataClass'", "'$dataClassID'", "'$callbackParameter'"));
         		
         		$html .= $B;*/
         $html .= OnEvent::script(OnEvent::popupSidePanel("Util", "-1", "EMailPopupAttachmentsSP", array("'{$dataClass}'", "'{$dataClassID}'", "'{$callbackParameter}'")));
     }
     #$html .= "<p class=\"prettyTitle\">Neue E-Mail</p>";
     #$html .= "<div style=\"clear:both;\"></div>";
     $tab = new HTMLTable(2);
     $tab->setColWidth(1, "120px;");
     $tab->addLV("Absender:", "{$data['fromName']}<br /><small style=\"color:grey;\">&lt;{$data['fromAddress']}&gt;</small>");
     if (is_array($data["recipients"])) {
         if (count($data["recipients"]) == 1) {
             $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small style=\"color:grey;\">&lt;" . $data["recipients"][0][1] . "&gt;</small>");
         } else {
             $recipients = array();
             foreach ($data["recipients"] as $ID => $Rec) {
                 $recipients[$ID] = new HTMLInput($Rec[0] . " &lt;" . $Rec[1] . "&gt;", "option", $ID);
             }
             $IS = new HTMLInput("EMailRecipient{$dataClassID}", "select", isset($data["default"]) ? $data["default"] : "0", $recipients);
             $IS->id("EMailRecipient{$dataClassID}");
             $tab->addLV("Empfänger:", $IS);
         }
     } else {
         $IS = new HTMLInput("EMailRecipient{$dataClassID}", "text", $data["recipients"]);
         $IS->id("EMailRecipient{$dataClassID}");
         $tab->addLV("Empfänger:", $IS);
     }
     if (isset($data["bcc"]) and count($data["bcc"]) > 0) {
         foreach ($data["bcc"] as $bcc) {
             $tab->addLV("BCC:", $bcc);
         }
     }
     $tab->addLV("Betreff:", "<input type=\"text\" id=\"EMailSubject{$dataClassID}\" value=\"{$data['subject']}\" />");
     $html .= $tab;
     $html .= "<div style=\"width:94%;margin:auto;\"><textarea class=\"tinyMCEEditor\" id=\"EMailBody{$dataClassID}\" style=\"width:100%;height:300px;font-size:10px;\">{$data['body']}</textarea></div>";
     #$tab->addRow(array(""));
     #$tab->addRowColspan(1, 2);
     #$tab->addRowClass("backgroundColor0");
     $tab = new HTMLTable(2);
     $tab->setColWidth(1, "120px;");
     if ($onSuccessFunction == null) {
         $onSuccessFunction = "" . OnEvent::reload("Left") . " Popup.close('Util', 'edit');";
     }
     $BAbort = new Button("Abbrechen", "stop");
     if ($onAbortFunction == null) {
         $BAbort->onclick("Popup.close('Util', 'edit');");
     } else {
         $BAbort->onclick($onAbortFunction);
     }
     $BAbort->style("margin-bottom:10px;margin-top:10px;");
     $optional = "var files = '';";
     if (isset($data["attachmentsOptional"])) {
         $optional .= "\$j('#UtilEmailFormAttachments input[type=checkbox]:checked').each(function(k, v){ files += \$j(v).data('value')+'##'; });";
     }
     $BGo = new Button("E-Mail\nsenden", "okCatch");
     $BGo->style("float:right;margin-top:10px;");
     $BGo->loading();
     $BGo->doBefore("{$optional} %AFTER");
     if (strpos($data["body"], "<p") !== false or trim($data["body"]) == "") {
         $BGo->doBefore("{$optional} \$j('#EMailBody{$dataClassID}').val(tinyMCE.get('EMailBody{$dataClassID}').getContent()); %AFTER");
     }
     $BGo->rmePCR(str_replace("GUI", "", $dataClass), $dataClassID, "sendEmail", array("\$('EMailSubject{$dataClassID}').value", "\$j('#EMailBody{$dataClassID}').val()", (is_array($data["recipients"]) and count($data["recipients"]) == 1) ? "0" : "\$('EMailRecipient{$dataClassID}').value", "'" . $callbackParameter . "'", "files"), $onSuccessFunction);
     #$BGo->onclick("CloudKunde.directMail('$this->ID', '$data[recipientAddress]', $('EMailSubject$this->ID').value, $('EMailBody$this->ID').value); ");
     $tab->addRow(array($BGo . $BAbort));
     $tab->addRowColspan(1, 2);
     $tab->addRowClass("backgroundColor0");
     $html .= $tab;
     if (strpos($data["body"], "<p") !== false or trim($data["body"]) == "") {
         echo OnEvent::script("\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t" . tinyMCEGUI::editorMail("EMailBody{$dataClassID}", null, "undo redo | pastetext | bold italic underline | fullscreen code") . "\n\t\t\t}, 100);");
     }
     if ($return) {
         return $html;
     } else {
         echo $html;
     }
 }
 public function getWindow()
 {
     $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()) {
         $T = new HTMLTable(1);
         $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 des Backups beträgt " . Util::formatByte($F->A("FileSize"), 2));
             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 .= "<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);
     echo $html . $TF;
 }
Ejemplo n.º 13
0
 public function checkAddressKlickTel($data)
 {
     $KT = new klickTel(-1);
     $Adresse = new Adresse($data["AdresseID"]);
     Aspect::joinPoint("before", $this, __METHOD__, $data);
     //call AFTER new Adresse!
     try {
         $result = $KT->checkAddress($data["AdresseID"]);
     } catch (Exception $e) {
         Aspect::joinPoint("onError", $this, __METHOD__, array($data, $e));
         //call AFTER new Adresse!
         die("<p>" . $e->getMessage() . "</p>");
     }
     $T = new HTMLTable(2, "Gefundene Adressen");
     $T->useForSelection(false);
     $T->setTableStyle("width:100%;");
     $i = 0;
     $found = null;
     foreach ($result as $k => $A) {
         $T->addRow(array($A->street . " " . $A->streetnumber, $A->zipcode . " " . $A->city));
         $T->addRowEvent("click", "CustomerPage.rme('changeAddressKlickTel', {AdresseID: {$data['AdresseID']}, useNr: {$k}, GRLBMID:{$data['GRLBMID']}}, function(){ CustomerPage.closePopup(); CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); \$('#BCheckKT').css('color', 'green'); }); });");
         $T->addRowClass("selectable");
         $found = $A;
         $i++;
     }
     echo "<p>" . $Adresse->getHTMLFormattedAddress() . "</p>";
     if ($i == 1 and $Adresse->A("strasse") == $found->street and $Adresse->A("nr") == $found->streetnumber and $Adresse->A("plz") == $found->zipcode and $Adresse->A("ort") == $found->city) {
         Aspect::joinPoint("onSuccess", $this, __METHOD__, array($data, $found));
         //call AFTER new Adresse!
         die("<p style=\"color:green;\">Diese Adresse wurde genau so in der klickTel Datenbank gefunden.</p>" . OnEvent::script("\$('#BCheckKT').css('color', 'green');"));
     }
     echo $T;
 }
Ejemplo n.º 14
0
 function getBrowserHTML($lineWithId = -1)
 {
     $this->texts = $this->languageClass->getBrowserTexts();
     $singularLanguageClass = $this->loadLanguageClass($this->singularClass);
     $userCanDelete = mUserdata::isDisallowedTo("cantDelete" . $this->singularClass);
     $userCanCreate = mUserdata::isDisallowedTo("cantCreate" . $this->singularClass);
     $userHiddenFields = mUserdata::getHides($this->singularClass);
     $defaultTarget = "contentRight";
     if ($this->displaySide != "default") {
         $defaultTarget = "content" . ucfirst($this->displaySide);
     }
     if ($this->singularClass == "none") {
         echo "collectionOf is not set. See message log for further details.";
         throw new CollectionOfNotSetException();
     }
     if ($this->name == "Noname") {
         $_SESSION["messages"]->addMessage("There is no name set. You might use setName of HTMLGUI to do that.");
     }
     /**
      * ERROR-TABLE
      */
     $errorTab = new HTMLTable(1);
     if (isset($_SESSION["phynx_errors"]) and $lineWithId == -1 and ($_SERVER["HTTP_HOST"] == "dev.furtmeier.lan" or strpos(__FILE__, "nemiah") !== false)) {
         $errorTab->addRow("\n\t\t\t\t\t<img style=\"float:left;margin-right:10px;\" src=\"./images/navi/warning.png\" />\n\t\t\t\t\t<b>Es " . (count($_SESSION["phynx_errors"]) != 1 ? "liegen" : "liegt") . " " . count($_SESSION["phynx_errors"]) . " PHP-Fehler vor:</b><br />\n\t\t\t\t\t<a href=\"javascript:windowWithRme('Util','','showPHPErrors','');\">Fehler anzeigen</a>,<br />\n\t\t\t\t\t<a href=\"javascript:rme('Util','','deletePHPErrors','','contentManager.reloadFrameRight();');\">Fehler löschen</a>");
     }
     /**
      * RETURN-BUTTON
      */
     $returnTab = new HTMLTable(1);
     if ($this->isSelection) {
         $BReturn = new Button("Auswahl\nbeenden", "back");
         $BReturn->onclick("contentManager.restoreFrame('content" . ucfirst($this->displaySide) . "','selectionOverlay');");
         #return "<input type=\"button\" value=\"zurück zu\n".$p2[$s[0]]."\" style=\"background-image:url(./images/navi/back.png);\" class=\"bigButton backgroundColor3\" onclick=\"loadFrameV2('contentRight','$s[0]');\" />";
         $returnTab->addRow($BReturn);
     }
     /**
      * DELETE-BUTTON
      */
     if ((!$this->onlyDisplayMode or $this->deleteInDisplayMode) and $userCanDelete and !$this->isSelection and $this->showDeleteButton) {
         $this->newColsRight["delete"] = "\n\t\t\t<span class=\"iconic trash_stroke\" onclick=\"deleteClass('" . $this->singularClass . "','%%VALUE%%', " . ($this->JSOnDelete == null ? "function() { " . ($this->displaySide == "left" ? "contentManager.reloadFrameLeft();" : "contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '%%VALUE%%') \$('contentLeft').update('');") . " }" : $this->JSOnDelete) . ",'" . str_replace("%1", $this->singularName, $this->texts["%1 wirklich löschen?"]) . "');\"></span>";
     } elseif (!$userCanDelete) {
         $this->newColsRight["delete"] = "<img src=\"./images/i2/empty.png\" />";
     }
     /**
      * EDIT-BUTTON
      */
     if (!isset($this->newColsLeft["select"]) and (!$this->onlyDisplayMode or $this->editInDisplayMode) and $this->showEditButton) {
         $EB = new Button("", "./images/i2/edit.png");
         $EB->type("icon");
         $EB->className("editButton");
         if ($this->JSOnEdit == null) {
             $EB->onclick("contentManager.selectRow(this); contentManager.loadFrame('contentLeft','" . $this->singularClass . "','%%VALUE%%','0');");
         } else {
             $EB->onclick($this->JSOnEdit);
         }
         $this->newColsLeft["select"] = $EB;
     }
     $cols = count($this->showAttributes) + count($this->newColsLeft) + count($this->newColsRight);
     $valuesTab = new HTMLTable($cols, $lineWithId == -1 ? $this->displaySide == "left" ? $this->name : "" : null);
     $valuesTab->addTableClass("contentBrowser");
     /*if(isset($this->newColsRight["delete"]) AND ($this->displaySide == "default" OR $this->displaySide == "right"))
     			$valuesTab->setColClass($cols, "backgroundColor0");
     		if(isset($this->newColsRight["delete"]) AND $this->displaySide == "left")
     			$valuesTab->setColClass(1, "backgroundColor0");*/
     /**
      * QUICKSEARCH
      */
     #$quickSearchRow = "";
     if ($this->quickSearchPlugin != "" and $lineWithId == -1) {
         list($quickSearchRow, $BSearchInfo) = $this->getQuicksearchField();
         if ($this->displaySide == "left") {
             $insertRow = array($quickSearchRow);
             for ($i = 1; $i < $cols - 1; $i++) {
                 $insertRow[] = "";
             }
             $insertRow[] = $BSearchInfo;
             $valuesTab->addRow($insertRow);
             $valuesTab->addRowColspan(1, $cols - 1);
         } else {
             $valuesTab->addRow(array($BSearchInfo, $quickSearchRow));
             $valuesTab->addRowColspan(2, $cols - 1);
         }
         $valuesTab->addRowClass("backgroundColorHeader");
     }
     if ($this->headerRow != null) {
         $valuesTab->addHeaderRow($this->headerRow);
     }
     /**
      * PAGE-BROWSER
      */
     #$multiPageRow = "";
     $separator = "";
     $userDefinedEntriesPerPage = false;
     $isMultiPageMode = false;
     if (count($this->multiPageMode) > 0) {
         $isMultiPageMode = true;
         $this->multiPageMode[3] = $defaultTarget;
         if ($this->multiPageMode[2] == 0) {
             $userDefinedEntriesPerPage = true;
             #$mU = new mUserdata();
             #$this->multiPageMode[2] = $mU->getUDValue("entriesPerPage{$this->multiPageMode[4]}");
             #if($this->multiPageMode[2] == null) $this->multiPageMode[2] = 20;
         }
         /*
         
         if($this->multiPageMode[1] == "undefined") $this->multiPageMode[1] = 0;
         
         $pages = ceil($this->multiPageMode[0] / $this->multiPageMode[2]);
         
         if($this->multiPageMode[1] != 0) $pageLinks = "<a href=\"javascript:contentManager.loadPage('$defaultTarget', '0');\">&nbsp;&lt;&lt;&nbsp;</a> ";
         else $pageLinks = "&nbsp;&lt;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != 0) $pageLinks .= "<a href=\"javascript:contentManager.backwardOnePage('$defaultTarget');\">&nbsp;&lt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&lt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.forwardOnePage('$defaultTarget');\">&nbsp;&gt;&nbsp;</a> ";
         else $pageLinks .= "&nbsp;&gt;&nbsp; ";
         
         if($this->multiPageMode[1] != $pages - 1) $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget',".($pages-1).");\">&nbsp;&gt;&gt;&nbsp;</a> | ";
         else $pageLinks .= "&nbsp;&gt;&gt;&nbsp; | ";
         
         $start = $this->multiPageMode[1] - 3;
         if($start < 0) $start = 0;
         
         $end = $this->multiPageMode[1] + 3;
         if($end > $pages - 1) $end = $pages - 1;
         
         for($i=$start; $i<=$end; $i++)
         	if($this->multiPageMode[1] != "$i") $pageLinks .= "<a href=\"javascript:contentManager.loadPage('$defaultTarget','".$i."');\">".($i+1)."</a> ";
         	else $pageLinks .= ($i+1)." ";
         
         	$pageLinks = "".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": ".$pageLinks;
         */
         if ($this->displaySide == "left") {
             $pageLinks = "<span style=\"float:right;\">" . $this->getMultiPageButtons() . "</span>";
         } else {
             $pageLinks = $this->getMultiPageButtons();
         }
         /*if($lineWithId == -1) $multiPageRow = "
         					<tr>
         						".($userDefinedEntriesPerPage ? "<td><img class=\"mouseoverFade\" src=\"./images/i2/settings.png\" onclick=\"phynxContextMenu.start(this, 'HTML','multiPageSettings:{$this->multiPageMode[4]}','".$this->texts["Einstellungen"].":');\" /></td>" : "")."
         						<td colspan=\"".($colspan+1+($userDefinedEntriesPerPage ? 0 : 1))."\"><input type=\"text\"onkeydown=\"if(event.keyCode == 13) loadFrameV2('".$this->multiPageMode[3]."','".$this->multiPageMode[4]."','',this.value - 1);\" style=\"width:30px;float:right;text-align:right;\" value=\"".($this->multiPageMode[1]+1)."\" onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\" />".$this->multiPageMode[0]." ".($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"])."<!--, ".$pages." ".($pages != 1 ? $this->texts["Seiten"] : $this->texts["Seite"])."--></td>
         					</tr>
         					<tr>
         						<td colspan=\"$determinedNumberofCols\">".($pages == 0 ? 1 : $pages)." ".(($pages == 0 ? 1 : $pages) != 1 ? $this->texts["Seiten"] : $this->texts["Seite"]).": $pageLinks</td>
         					</tr>";
         
         
         */
         if ($lineWithId == -1) {
             $BSettings = $this->getPageOptionsButton();
             #$IPage = $this->getPageSelectionField();
             #$IPage->style("width:30px;float:right;text-align:right;");
             $pageOptions = $this->multiPageMode[0] . " " . ($this->multiPageMode[0] == 1 ? $this->texts["Eintrag"] : $this->texts["Einträge"]) . ", {$pageLinks}";
             if (!$userDefinedEntriesPerPage) {
                 $valuesTab->addRow(array($pageOptions));
                 $valuesTab->addRowColspan(1, $cols);
             } else {
                 if ($this->displaySide == "left") {
                     $insertRow = array($pageOptions);
                     for ($i = 1; $i < $cols - 1; $i++) {
                         $insertRow[] = "";
                     }
                     $insertRow[] = $BSettings;
                     $valuesTab->addRow($insertRow);
                     #$valuesTab->addRow(array($pageOptions,$BSettings));
                     $valuesTab->addRowColspan(1, $cols - 1);
                 } else {
                     /*$insertRow = array($BSettings);
                     		for($i=1; $i<$cols-1; $i++)
                     			$insertRow[] = "";
                     		$insertRow[] = $pageOptions;
                     		$valuesTab->addRow($insertRow);*/
                     $valuesTab->addRow(array($BSettings, $pageOptions));
                     $valuesTab->addRowColspan(2, $cols - 1);
                 }
             }
             $valuesTab->addRowClass("backgroundColorHeader");
             #$valuesTab->addRow(array($pageLinks));
             #$valuesTab->addRowColspan(1, $cols);
             #$valuesTab->addRowClass("backgroundColorHeader");
             $valuesTab->addRow("");
             $valuesTab->addRowColspan(1, $cols);
             $valuesTab->addRowClass("backgroundColor0 browserSeparatorTop");
         }
     }
     $filteredCol = null;
     if ($lineWithId == -1 and $this->showFilteredCategoriesWarning != null and $this->showFilteredCategoriesWarning[0]) {
         $dB = new Button($this->texts["Filter löschen"], "./images/i2/delete.gif");
         $dB->style("float:right;");
         $dB->type("icon");
         $dB->rme("HTML", "", "saveContextMenu", array("'deleteFilters'", "'{$this->showFilteredCategoriesWarning[1]}'"), "if(checkResponse(transport)) contentManager.reloadFrameRight();");
         /*$separator = "
         		<tr>
         			<td class=\"backgroundColor0\"".((isset($this->showFilteredCategoriesWarning[0]) AND $this->showFilteredCategoriesWarning[0] == true) ? "<img src=\"./images/i2/note.png\" /></td><td class=\"backgroundColor0\" colspan=\"".($determinedNumberofCols - 2)."\" style=\"color:grey;\" >".$this->texts["Anzeige wurde gefiltert"]."</td><td class=\"backgroundColor0\">$dB</td>" : " >")."</td>
         		</tr>";*/
         $filteredCol = array("<img src=\"./images/i2/note.png\" />", $dB . $this->texts["Anzeige wurde gefiltert"]);
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     /**
      * NEW-BUTTON
      */
     if (!$this->onlyDisplayMode and $userCanCreate and $this->showNewButton and $lineWithId == -1) {
         $BNew = new Button("", "./images/i2/new.gif");
         $BNew->type("icon");
         $BNew->id("buttonNewEntry{$this->singularClass}");
         #$BNew->onclick($this->JSOnNew == null ? "contentManager.newClassButton('$this->singularClass','');" : $this->JSOnNew);
         if ($this->displaySide == "left") {
             #$valuesTab->addRow(array("<b>$this->singularName neu anlegen</b>",$BNew));
             #$valuesTab->addRowColspan(1, $cols-1);
         } else {
             $valuesTab->addRow(array($BNew, "<b>{$this->singularName} neu anlegen</b>"));
             $valuesTab->addRowColspan(2, $cols - 1);
             $valuesTab->addRowEvent("click", $this->JSOnNew == null ? "contentManager.newClassButton('{$this->singularClass}','');" : $this->JSOnNew);
             $valuesTab->addRowStyle("cursor:pointer;");
         }
         #$valuesTab->addRowColspan(2, $cols-1);
     }
     /**
      * TABLE-CONTENT
      */
     $displayGroup = null;
     for ($i = 0; $i < count($this->attributes); $i++) {
         $aid = $this->attributes[$i]->getID();
         // get the id of an object separately
         $sc = $this->attributes[$i]->getA();
         // get the attributes-object from the object
         if ($this->displayGroupBy != null) {
             $displayGroupField = $this->displayGroupBy;
             if ($sc->{$displayGroupField} != $displayGroup and $i > 0) {
                 $valuesTab->addRow("");
                 $valuesTab->addRowClass("backgroundColor0");
             }
         }
         $row = array();
         $styles = array();
         if ($this->displaySide == "left") {
             $colsLeft = $this->newColsRight;
             $colsRight = $this->newColsLeft;
         } else {
             $colsLeft = $this->newColsLeft;
             $colsRight = $this->newColsRight;
         }
         if (count($colsLeft) > 0) {
             foreach ($colsLeft as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         foreach ($this->showAttributes as $key => $value) {
             if (isset($userHiddenFields[$value])) {
                 continue;
             }
             if (isset($this->parsers[$value])) {
                 $t = $this->invokeParser($this->parsers[$value], $sc->{$value}, $this->makeParameterStringFromArray($this->parserParameters[$value], $sc, $aid));
             } else {
                 $t = htmlspecialchars($sc->{$value});
             }
             if ($this->multiEditMode != null and in_array($value, $this->multiEditMode)) {
                 $posInArray = array_search($value, $this->multiEditMode);
                 if ($this->multiEditModeInputs[$posInArray] == null) {
                     $MI = new HTMLInput($value . "ID{$aid}", "multiInput", $sc->{$value}, array($this->singularClass, $aid, $value));
                     if ($this->multiEditModeStyle != null) {
                         $MI->style($this->multiEditModeStyle[$posInArray]);
                     }
                 } else {
                     $MI = clone $this->multiEditModeInputs[$posInArray];
                     $MI->setValue($sc->{$value});
                     $MI->activateMultiEdit($this->singularClass, $aid);
                 }
                 $t = $MI;
             }
             #<td id=\"Browser".$value."$aid\" ".(isset($this->colStyles[$value]) ? "style=\"".$this->colStyles[$value]."\"" : "").">".$t."</td>";
             $row[] = $t;
             if (isset($this->colStyles[$value])) {
                 $styles[count($row)] = $this->colStyles[$value];
             }
         }
         if (count($colsRight) > 0) {
             foreach ($colsRight as $key => $value) {
                 $row[] = str_replace("%%VALUE%%", $aid, $value);
                 $valuesTab->setColWidth(count($row), "20px");
             }
         }
         $valuesTab->addRow($row);
         if (count($styles) > 0) {
             foreach ($styles as $col => $s) {
                 $valuesTab->addColStyle($col, $s);
             }
         }
         $valuesTab->setRowID("BrowserMain{$aid}");
         #foreach($this->showAttributes as $key => $value) {
         #	$valuesTab->addCellID($cellNo, "Browser".$value."$aid");
         #}
         if ($this->displayGroupBy != null) {
             $displayGroup = $sc->{$displayGroupField};
         }
     }
     if ($filteredCol !== null) {
         $valuesTab->addRow($filteredCol);
         $valuesTab->addRowColspan(2, $cols - 1);
         $valuesTab->addRowClass("backgroundColor0");
         $valuesTab->addRowStyle("color:grey;");
     }
     if ($lineWithId == -1 and $isMultiPageMode) {
         $valuesTab->addRow("");
         $valuesTab->addRowColspan(1, $cols);
         $valuesTab->addRowClass("backgroundColor0 browserSeparatorBottom");
         if (!$userDefinedEntriesPerPage) {
             $valuesTab->addRow(array($pageOptions));
             $valuesTab->addRowColspan(1, $cols);
         } else {
             if ($this->displaySide == "left") {
                 $valuesTab->addRow(array($pageOptions, $BSettings));
                 $valuesTab->addRowColspan(1, $cols - 1);
             } else {
                 $valuesTab->addRow(array($BSettings, $pageOptions));
                 $valuesTab->addRowColspan(2, $cols - 1);
             }
         }
         $valuesTab->addRowClass("backgroundColorHeader");
         #$valuesTab->addRow(array($pageLinks));
         #$valuesTab->addRowColspan(1, $cols);
         #$valuesTab->addRowClass("backgroundColorHeader");
     }
     if (count($this->attributes) == 0) {
         $valuesTab->addRow(array("keine Einträge"));
         $valuesTab->addRowColspan(1, $cols);
     }
     if ($lineWithId != -1) {
         $valuesTab = $valuesTab->getHTMLForUpdate();
     }
     return $errorTab . $returnTab . $valuesTab . ($lineWithId == -1 ? $this->tip : "");
 }
Ejemplo n.º 15
0
 public function getHTML($id)
 {
     $bps = $this->getMyBPSData();
     $B1 = new Button("Servers", "./fheME/Fhem/fhemServers.png");
     $B1->style("float:right;");
     $B1->onclick("contentManager.loadFrame('contentRight','mFhemServer'); contentManager.emptyFrame('contentLeft');");
     $B2 = new Button("Devices", "./fheME/Fhem/fhem.png");
     $B2->style("float:right;");
     $B2->onclick("contentManager.loadFrame('contentRight','mFhem', -1, 0,'mFhemGUI;showDevices:true'); contentManager.emptyFrame('contentLeft');");
     //		$B3 = new Button("Rooms","gutschrift");
     //		$B3->style("float:right;");
     //		$B3->onclick("contentManager.loadFrame('contentRight','mGruppe');");
     $B6 = new Button("Presets", "./fheME/Fhem/events.png");
     $B6->style("float:right;");
     $B6->onclick("contentManager.loadFrame('contentRight','mFhemPreset'); contentManager.emptyFrame('contentLeft');");
     $BLoc = new Button("Locations", "./fheME/FhemLocation/FhemLocation.png");
     $BLoc->style("float:right;");
     $BLoc->onclick("contentManager.loadFrame('contentRight','mFhemLocation'); contentManager.emptyFrame('contentLeft');");
     if (!Session::isPluginLoaded("mFhemLocation")) {
         $BLoc = "";
     }
     //		$B4 = new Button("Refresh","refresh");
     //		$B4->style("float:right;");
     //		$B4->onclick("Fhem.refreshControls();");
     #$B5 = new Button("Timers","backup");
     #$B5->style("float:right;");
     #$B5->onclick("contentManager.loadFrame('contentRight','mFhemTimer',-1,0,'mFhemTimerGUI;-'); contentManager.emptyFrame('contentLeft');");
     $html = "\n\t\t<script type=\"text/javascript\">\n\t\t\tcontentManager.loadFrame('contentLeft','FhemControl');\n\t\t</script>";
     if (isset($bps["noLeft"])) {
         $html = "";
     }
     $t = new HTMLTable(1);
     $t->setTableStyle("width:160px;float:right;margin-right:10px;");
     #$t->addRow($B5);
     #$t->addRowClass("backgroundColor0");
     #$t->addRow("");
     #$t->addRowClass("backgroundColor1");
     //		$t->addRow($B3);
     //		$t->addRowClass("backgroundColor0");
     $t->addRow($B2);
     $t->addRowClass("backgroundColor0");
     $t->addRow($B6);
     $t->addRowClass("backgroundColor0");
     //		$t->addRow($B4);
     //		$t->addRowClass("backgroundColor0");
     $t->addRow($B1);
     $t->addRowClass("backgroundColor0");
     $t->addRow($BLoc);
     $t->addRowClass("backgroundColor0");
     if (!isset($bps["showDevices"]) and !isset($bps["selectionMode"])) {
         return $html . $t;
     }
     if (isset($bps["selectionMode"])) {
         $this->addAssocV3("FhemServerID", "=", $_SESSION["BPS"]->getProperty("mFhemSelection", "selectionServerID"));
         $this->addAssocV3("FhemType", "!=", "FHZ");
     }
     #----------------------------------------------
     $this->addOrderV3("FhemServerID");
     $this->addOrderV3("FhemType");
     $this->addOrderV3("FhemName");
     $gui = new HTMLGUIX($this);
     $gui->displayGroup("FhemServerID", "mFhemGUI::DGParser");
     $B = $gui->addSideButton("Load devices\nfrom server", "refresh");
     $B->popup("", "Load devices", "mFhem", "-1", "loadDevices");
     $B = $gui->addSideButton("Register\nsettings", "./fheME/Fhem/fhem.png");
     $B->rme("FhemControl", "", "registerSettings", "", "if(checkResponse(transport)) \$(\\'contentLeft\\').update(transport.responseText);");
     $B = $gui->addSideButton("Reset\nServers", "empty");
     $B->rme("FhemControl", "", "resetServers", "", "if(checkResponse(transport)) \$(\\'contentLeft\\').update(transport.responseText);");
     #$this->lCV3($id);
     $gui->attributes(array("FhemName", "FhemType"));
     $gui->name("Device");
     if ($bps != -1 and isset($bps["selectionMode"])) {
         $t2 = "";
     }
     return $gui->getBrowserHTML($id);
 }
Ejemplo n.º 16
0
 /**
  * Creates HTML for several global context menus
  */
 public function getContextMenuHTML($identifier)
 {
     $s = explode(":", $identifier);
     switch ($s[0]) {
         case "operations":
             $onDeleteEvent = "";
             $onDeleteQuestion = "";
             if (PMReflector::implementsInterface($s[1], "iDeletable2")) {
                 $c = $s[1];
                 $c = new $c(-1);
                 $onDeleteEvent = $c->getOnDeleteEvent();
                 $onDeleteQuestion = $c->getOnDeleteQuestion();
             }
             $texts = $this->languageClass->getEditTexts();
             #$BRepeatable = "";
             $T = new HTMLTable(1);
             $Buttons = "";
             if ($s[3][0] == "1") {
                 $B = new Button($texts["Neu mit Werten"], "new", "icon");
                 $B->onclick(OnEvent::reload("Left", "HTMLGUI;insertAsNew:true"));
                 $B->style("margin-right:10px;");
                 $Buttons .= $B;
             }
             if ($s[3][1] == "1") {
                 $B = new Button($texts["Kopieren"], "seiten", "icon");
                 $B->rmePCR(str_replace("GUI", "", $s[1]), $s[2], 'cloneMe', "", "function(transport){ lastLoadedLeft = (transport.responseText == '' ? -1 : transport.responseText); contentManager.reloadFrameLeft(); contentManager.reloadFrameRight(); }");
                 #$B->onclick("rme('$s[1]','$s[2]','cloneMe','', 'lastLoadedLeft = (transport.responseText == \'\' ? -1 : transport.responseText); contentManager.reloadFrameLeft(); contentManager.reloadFrameRight();');");
                 $B->style("margin-right:10px;");
                 $Buttons .= $B;
             }
             if ($s[3][2] == "1") {
                 $B = new Button($texts["Löschen"], "trash", "icon");
                 $B->onclick("deleteClass('" . str_replace("GUI", "", $s[1]) . "','{$s['2']}'," . ($onDeleteEvent == "" ? "function() {  contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '{$s['2']}') \$('contentLeft').update(''); }" : $onDeleteEvent) . ",'" . ($onDeleteQuestion == "" ? $texts["Wirklich löschen?"] : $onDeleteQuestion) . "');");
                 $B->style("margin-right:10px;");
                 $Buttons .= $B;
             }
             if ($s[3][3] == "1") {
                 $BRepeatable = new Button($texts["Repeatable erstellen"], "redo");
                 $BRepeatable->type("icon");
                 $BRepeatable->onclick("contentManager.newClassButton('Repeatable','','contentLeft','RepeatableGUI;RepeatablePlugin:{$s['1']};RepeatablePluginElementID:{$s['2']}');");
                 $Buttons .= $BRepeatable;
             }
             if ($s[3][4] == "1") {
                 $B = new Button($texts["XML Export"], "export", "icon");
                 $B->onclick("windowWithRme('{$s['1']}', '{$s['2']}', 'getXML', '');phynxContextMenu.stop();");
                 $B->style("margin-right:10px;");
                 $Buttons .= $B;
             }
             $T->addRow(array($Buttons));
             $T->addRowClass("backgroundColor0");
             echo $T;
             /*echo "
             		<table style=\"text-align:center;border:0px;\">
             			<tr>
             				".($s[3]{0} == "1" ? "<td><img class=\"mouseoverFade\" src=\"./images/navi/new.png\" title=\"".$texts["Neu mit Werten"]."\" onclick=\"contentManager.reloadFrameLeft('HTMLGUI;insertAsNew:true');\" /></td>" : "")."
             				".($s[3]{1} == "1" ? "<td><img class=\"mouseoverFade\" src=\"./images/navi/seiten.png\" title=\"".$texts["Kopieren"]."\" onclick=\"rme('$s[1]','$s[2]','cloneMe','', 'lastLoadedLeft = (transport.responseText == \'\' ? -1 : transport.responseText); contentManager.reloadFrameLeft(); contentManager.reloadFrameRight();');\" /></td>" : "")."
             				".($s[3]{2} == "1" ? "<td><img class=\"mouseoverFade\" src=\"./images/navi/trash.png\" title=\"".$texts["Löschen"]."\" onclick=\"deleteClass('$s[1]','$s[2]',".($onDeleteEvent == "" ? "function() {  contentManager.reloadFrameRight(); if(typeof lastLoadedLeft != 'undefined' && lastLoadedLeft == '$s[2]') $('contentLeft').update(''); }" : $onDeleteEvent).",'".($onDeleteQuestion == "" ? $texts["Wirklich löschen?"] : $onDeleteQuestion)."');\" /></td>" : "")."
             				".($s[3]{4} == "1" ? "<td><img class=\"mouseoverFade\" src=\"./images/navi/export.png\" title=\"".$texts["XML Export"]."\" onclick=\"windowWithRme('$s[1]', '$s[2]', 'getXML', '');phynxContextMenu.stop();\" /></td>" : "")."
             				$BRepeatable
             			</tr>
             		</table>";*/
             break;
         case "multiPageSettings":
             $texts = $this->languageClass->getBrowserTexts();
             $mU = new mUserdata();
             $entriesPerPage = $mU->getUDValue("entriesPerPage{$s['1']}");
             if ($entriesPerPage == null) {
                 $entriesPerPage = 20;
             }
             echo "\n\t\t\t\t<table style=\"border:0px;\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"backgroundColor3\">" . $texts["Anzahl Einträge pro Seite"] . ":</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"image\" \n\t\t\t\t\t\t\t\tsrc=\"./images/i2/save.gif\"\n\t\t\t\t\t\t\t\tstyle=\"border: 0px none ; width: 18px;float:right;\" \n\t\t\t\t\t\t\t\tonclick=\"contentManager.rmePCR('HTML','', 'saveContextMenu', Array('multiPageSettings', '{$s['1']}:'+\$('entriesPerPageCM').value), 'phynxContextMenu.stop(); contentManager.reloadFrame(\\'" . (!isset($s[2]) ? "contentRight" : $s[2]) . "\\');');\" />\n\t\t\t\t\t\t<input style=\"width:130px;text-align:right;\" id=\"entriesPerPageCM\" type=\"text\" value=\"{$entriesPerPage}\" /></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class=\"backgroundColor3\">\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>";
             $selectForOrderByField = "";
             $n = $s[1] . "GUI";
             if (PMReflector::implementsInterface($n, "iOrderByField")) {
                 $mU = new mUserdata();
                 $HKs = $mU->getUDValue("OrderByFieldInHTMLGUI{$s['1']}");
                 $selectForOrderByField = "<select onchange=\"rme('HTML','','saveContextMenu',Array('setOrderByField','{$s['1']};:;'+this.value),'if(checkResponse(transport)) { phynxContextMenu.stop(); contentManager.reloadFrameRight(); }');\"><option " . (($HKs == null or $HKs == "default") ? "selected=\"selected\"" : "") . " value=\"default\">Standard-Sortierung</option><optgroup label=\"aufsteigend\">";
                 $cFOBy = new $n();
                 $cFOBy = $cFOBy->getOrderByFields();
                 foreach ($cFOBy as $k => $v) {
                     $selectForOrderByField .= "<option " . ($HKs == "{$k};ASC" ? "selected=\"selected\"" : "") . " value=\"{$k};ASC\">" . $v . "</option>";
                 }
                 $selectForOrderByField .= "</optgroup><optgroup label=\"absteigend\">";
                 foreach ($cFOBy as $k => $v) {
                     $selectForOrderByField .= "<option " . ($HKs == "{$k};DESC" ? "selected=\"selected\"" : "") . " value=\"{$k};DESC\">" . $v . "</option>";
                 }
                 $selectForOrderByField .= "</optgroup></select>";
                 echo "<div style=\"height:10px;\" class=\"backgroundColor1\"></div>\n\t\t\t\t\t\t\t<table style=\"border:0px;\">\n\t\t\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t\t\t<col />\n\t\t\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td class=\"backgroundColor3\">" . $texts["nach Spalte sortieren"] . ":</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td>{$selectForOrderByField}</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>";
             }
             try {
                 $n = $s[1] . "GUI";
                 $c = new $n();
                 if (PMReflector::implementsInterface($n, "iCategoryFilter")) {
                     $Ks = $c->getAvailableCategories();
                     if ($Ks == null) {
                         return;
                     }
                     $mU = new mUserdata();
                     $HKs = $mU->getUDValue("filteredCategoriesInHTMLGUI{$s['1']}");
                     $HKs = explode(";", $HKs);
                     $checks = "";
                     foreach ($Ks as $key => $value) {
                         $checks .= "\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><input type=\"checkbox\" id=\"hide{$key}\" value=\"{$key}\" name=\"{$key}\" " . (in_array("{$key}", $HKs) ? "checked=\"checked\"" : "") . " /></td>\n\t\t\t\t\t\t\t\t<td onclick=\"\$('hide{$key}').checked = !\$('hide{$key}').checked;\" style=\"cursor:pointer;\">{$value}</td>\n\t\t\t\t\t\t\t</tr>";
                     }
                     echo "<div style=\"height:10px;\" class=\"backgroundColor1\"></div>\n\t\t\t\t\t\t<form id=\"filterCatsOf{$s['1']}\">\n\t\t\t\t\t\t\t<table style=\"border:0px;\">\n\t\t\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t\t\t<col class=\"backgroundColor2\" style=\"width:20px;\" />\n\t\t\t\t\t\t\t\t\t<col />\n\t\t\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan=\"2\" class=\"backgroundColor3\">" . $texts["nach Kategorien filtern"] . ":</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t{$checks}\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<td colspan=\"2\" class=\"backgroundColor3\">\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\" \n\t\t\t\t\t\t\t\t\t\t\tvalue=\"" . $texts["speichern"] . "\" \n\t\t\t\t\t\t\t\t\t\t\tstyle=\"background-image:url(./images/i2/save.gif);\" \n\t\t\t\t\t\t\t\t\t\t\tonclick=\"contentManager.rmePCR('HTML','', 'saveContextMenu', Array('filterCategories', '{$s['1']}--'+joinFormFields('filterCatsOf{$s['1']}').replace(/\\&/g,';').replace(/=/g,':')), 'phynxContextMenu.stop(); contentManager.reloadFrame(\\'contentRight\\');');\" />\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t</form>";
                 }
             } catch (ClassNotFoundException $e) {
             }
             if (PMReflector::implementsInterface($n, "iCustomSettings")) {
                 $cFOBy = new $n();
                 echo "<div style=\"height:10px;\" class=\"backgroundColor1\"></div>";
                 echo $cFOBy->getCustomSettings();
             }
             break;
             /*case "upload":
             			$texts = $this->languageClass->getBrowserTexts();
             			echo "
             				<form 
             					action=\"./interface/set.php\" 
             					method=\"post\" 
             					enctype=\"multipart/form-data\" 
             					id=\"formImage\" 
             					onsubmit=\"return AIM.submit($('formImage'), {'onComplete' : function(){
             						$('uploadImage').src = $('uploadImage').src+'&r2=".rand()."'
             						$('uploadImage').style.display = '';
             						phynxContextMenu.stop();
             					}});\"
             				><p>
             					<input type=\"file\" name=\"datei\" size=\"4\" /><br /><br />
             					<input type=\"submit\" value=\"".$texts["hochladen"]."\" />
             					<input type=\"hidden\" name=\"id\" value=\"$s[1]\" />
             					<input type=\"hidden\" name=\"class\" value=\"$s[2]\" />
             					<input type=\"hidden\" name=\"saveToAttribute\" value=\"$s[3]\" /></p>
             					<p>".$texts["<=100KB"]."</p>
             				</form>";
             		break;*/
     }
 }
Ejemplo n.º 17
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);
 }
Ejemplo n.º 18
0
 function getHTML($id)
 {
     #$showHelp = true;
     if ($this->collector == null) {
         $this->lCV3($id);
     }
     $singularLanguageClass = $this->loadLanguageClass("Installation");
     $text = $singularLanguageClass != null ? $singularLanguageClass->getText() : "";
     if ($id == -1) {
         echo OnEvent::script(OnEvent::rme($this, "getActions", "", "function(transport){ contentManager.contentBelow(transport.responseText); }"));
     }
     $hasDBConnection = false;
     try {
         mUserdata::getGlobalSettingValue("DBVersion", false);
         $hasDBConnection = true;
     } catch (Exception $e) {
     }
     $g = "";
     $DBFilePath = Util::getRootPath() . "system/DBData/Installation.pfdb.php";
     $writable = new HTMLTable(1);
     $File = new File($DBFilePath);
     $File->loadMe();
     if (!$File->A("FileIsWritable") and !$hasDBConnection) {
         return;
     }
     if (!$File->A("FileIsWritable")) {
         $writable->addRow("<img src=\"./images/navi/restrictions.png\" style=\"float:left;margin-right:10px;\"/>Die Datei " . $DBFilePath . " ist nicht beschreibbar, Änderungen können nicht gespeichert werden.<br /><br />Machen Sie die Datei mit einem FTP-Programm beschreibbar. Klicken Sie dazu mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.");
         $g .= $writable->getHTML();
     }
     $gui = new HTMLGUI();
     $gui->setName("Datenbank-Zugangsdaten");
     if ($this->collector != null) {
         $gui->setAttributes($this->collector);
     }
     $gui->setCollectionOf($this->collectionOf, "Datenbank-Zugangsdaten");
     $gui->hideAttribute("password");
     $gui->hideAttribute("httpHost");
     $gui->hideAttribute("InstallationID");
     if (strstr($_SERVER["SCRIPT_FILENAME"], "demo")) {
         $UA = $_SESSION["S"]->getCurrentUser()->getA();
         if ($UA->name != "Installations-Benutzer") {
             $g = "In der Demo können keine Datenbank-Zugangsdaten geändert werden!";
             $gui->setIsDisplayMode(true);
         }
     }
     if (!Session::isPluginLoaded("multiInstall")) {
         $gui->setIsDisplayMode(true);
         $gui->setEditInDisplayMode(true, "contentLeft");
     }
     #try {
     $g .= $gui->getBrowserHTML($id);
     #} catch (Exception $e){
     #	$t->addRow(array("Etwas stimmt nicht, eine ".get_class($e)." wurde abgefangen!"));
     #	$t->addRow(array("<span style=\"font-size:8px;\">".nl2br(str_replace("#","\n#", $e->getTraceAsString()))."</span>"));
     #}
     /*	$help = "
     	<script type=\"text/javascript\">
     		contentManager.rmePCR('mInstallation','','getHelp','true','if(checkResponse(transport)) { Popup.create(\'123\', \'Installation\', \'Hilfe\'); Popup.update(transport, \'123\', \'Installation\'); }');
     	</script>";*/
     $ST = new HTMLSideTable("left");
     try {
         #$MailServer = LoginData::get("MailServerUserPass");
         #$MailServerID = $MailServer == null ? -1 : $MailServer->getID();
         $BMail = $ST->addButton("Mail-Server", "./plugins/Installation/serverMail.png");
         #$BMail->popup("edit", "Mail-Server", "LoginData", $MailServerID, "getPopup", "", "LoginDataGUI;preset:mailServer");
         $BMail->popup("edit", "Mail-Server", "mInstallation", -1, "manageMailservers");
         $BTestMail = $ST->addButton("Mailversand\ntesten", "mail");
         $BTestMail->popup("mailTest", "Mailversand testen", "mInstallation", "-1", "testMailGUI");
         if (Session::isPluginLoaded("mJabber")) {
             $JabberServer = LoginData::get("JabberServerUserPass");
             $JabberServerID = $JabberServer == null ? -1 : $JabberServer->getID();
             $BJabber = $ST->addButton("Jabber-Server", "./plugins/Installation/serverMail.png");
             $BJabber->popup("edit", "Jabber-Server", "LoginData", $JabberServerID, "getPopup", "", "LoginDataGUI;preset:jabberServer");
         }
         $BackupButton = $ST->addButton("Daten-\nsicherungen", "disk");
         $BackupButton->onclick("contentManager.loadFrame('contentLeft','BackupManager');");
     } catch (Exception $e) {
     }
     return $ST . $g;
     #.$t->getHTML();
     $t = new HTMLTable(1);
     try {
         $user = new User(1);
         $user->loadMe();
     } catch (DatabaseNotSelectedException $e) {
         if (BPS::getProperty("mInstallationGUI", "showErrorText", false)) {
             $t->addRow(isset($text["noDatabase"]) ? $text["noDatabase"] : "Es wurde kein korrekter Datenbankname angegeben.<br /><br />Bitte geben Sie eine existierende Datenbank an, sie wird nicht automatisch erzeugt.");
             $t->addRowClass("backgroundColor0");
             $t->addRowStyle("color:red;");
         }
         return $g . $t->getHTML();
         #.$help;
     } catch (NoDBUserDataException $e) {
         if (BPS::getProperty("mInstallationGUI", "showErrorText", false)) {
             $t->addRow(isset($text["wrongData"]) ? $text["wrongData"] : "Mit den angegebenen Datenbank-Zugangsdaten kann keine Verbindung aufgebaut werden.<br /><br />Wenn sie korrekt sind, werden hier weitere Möglichkeiten angezeigt angezeigt.");
             $t->addRowClass("backgroundColor0");
             $t->addRowStyle("color:red;");
         }
         if (PHYNX_MAIN_STORAGE == "MySQL") {
             try {
                 $DB1 = new DBStorageU();
                 $B = new Button("Hinweis", "notice", "icon");
                 $B->style("float:left;margin-right:10px;");
                 $File = new File(Util::getRootPath() . "system/connect.php");
                 $BR = new Button("DB-Verbindung\numstellen", "lieferschein");
                 $BR->style("float:right;margin-left:10px;");
                 $BR->rmePCR("mInstallation", "-1", "switchDBToMySQLo", "", "Installation.reloadApp();");
                 $BR = "Verwenden Sie den nebenstehenden Knopf, um die Verbindungsart auf die ältere Version umzustellen.<br />{$BR} Sie müssen sich anschließend erneut anmelden.";
                 $BReload = new Button("Ansicht\naktualisieren", "refresh");
                 $BReload->onclick("contentManager.emptyFrame('contentLeft'); contentManager.loadFrame('contentRight', 'mInstallation', -1, 0, 'mInstallationGUI;-');Popup.closeNonPersistent();");
                 $BReload->style("float:right;margin:10px;");
                 if (!$File->A("FileIsWritable")) {
                     $BR = "Bitte machen Sie die Datei /system/connect.php für den Webserver beschreibbar, damit phynx auf die ältere Verbindungsart umstellen kann.<br /><br />Verwenden Sie dazu Ihr FTP-Programm. Klicken Sie mit der rechten Maustaste auf die Datei auf dem Server, wählen Sie \"Eigenschaften\", und geben Sie den Modus 666 an, damit sie durch den Besitzer, die Gruppe und alle Anderen les- und schreibbar ist.{$BReload}";
                 }
                 $t->addRow(array("{$B} <b>Möglicherweise ist die MySQLi-Erweiterung auf Ihrem Server nicht korrekt konfiguriert.</b><br /><br />{$BR}"));
                 $t->addRowClass("backgroundColor0");
             } catch (Exception $e) {
                 #echo "MySQL geht auch nicht!";
             }
         }
         return $g . $t->getHTML();
         #.$help;
     } catch (TableDoesNotExistException $e) {
     } catch (StorageException $e) {
     }
     /*$help = "
     	<script type=\"text/javascript\">
     		rme('mInstallation','','getHelp','false','if(checkResponse(transport)) { Popup.create(\'123\', \'Installation\', \'Hilfe\'); Popup.update(transport, \'123\', \'Installation\'); }');
     	</script>";*/
     /*if(false AND $id == -1) {
     			$BackupTab = new HTMLTable(1);
     
     			$BackupButton = new Button("Backup-\nManager","disk");
     			$BackupButton->style("float:right;");
     			$BackupButton->onclick("contentManager.loadFrame('contentLeft','BackupManager');");
     
     			$BackupTab->addRow($BackupButton);
     
     			$BUT = new Button((isset($text["alle Tabellen aktualisieren"]) ? $text["alle Tabellen aktualisieren"] : "alle Tabellen\naktualisieren"), "update");
     			$BUT->rmePCR("mInstallation", "", "updateAllTables", "", "$('contentLeft').update(transport.responseText);");
     
     			$g .= "
     	<div style=\"height:30px;\"></div>
     	$BackupTab
     	<div class=\"Tab backgroundColor1\"><p>Plugins</p></div>
     	<table>
     		<colgroup>
     			<col style=\"width:100px;\" class=\"backgroundColor2\" />
     			<col class=\"backgroundColor3\" />
     		</colgroup>
     		<tr>
     			<td colspan=\"3\">
     				<span style=\"float:right;\">".Installation::getReloadButton()."</span>
     				$BUT
     			</td>
     		</tr>
     		<tr>
     			<td style=\"background-color:white;\"></td>
     		</tr>";
     
     			$p = array_flip($_SESSION["CurrentAppPlugins"]->getAllPlugins());
     			
     			
     			foreach($p as $key => $value){
     				try {
     					if(method_exists($_SESSION["CurrentAppPlugins"], "isPluginGeneric") AND $_SESSION["CurrentAppPlugins"]->isPluginGeneric($key)){
     						$c = new mGenericGUI('', $key);
     					} else {
     						$c = new $key();
     					}
     				} catch (ClassNotFoundException $e){
     					$key2 = $key."GUI";
     					
     					try {
     						$c = new $key2();
     					} catch (ClassNotFoundException $e2){
     						continue;
     					}
     				}
     				if($key == "CIs") continue;
     				
     
     				if($c->checkIfMyTableExists() AND $c->checkIfMyDBFileExists()) $showHelp = false;
     
     				if(!$c->checkIfMyDBFileExists())
     					continue;
     
     				$g .= "
     		<tr>
     			<td style=\"font-weight:bold;text-align:right;\">".($value != -1 ? $value : $key )."</td>
     			<td>".(!$c->checkIfMyTableExists() ? ($c->checkIfMyDBFileExists() ? "<input type=\"button\" value=\"".(isset($text["Tabelle anlegen"]) ? $text["Tabelle anlegen"] : "Tabelle anlegen")."\" onclick=\"installTable('$key');\" />" : "keine DB-Info-Datei" ) : ($c->checkIfMyDBFileExists() ? "<input type=\"button\" onclick=\"checkFields('$key');\" value=\"Tabellenupdate\" style=\"float:right;width:140px;\" />".(isset($text["Tabelle existiert"]) ? $text["Tabelle existiert"] : "Tabelle existiert") : (isset($text["keine DB-Info-Datei"]) ? $text["keine DB-Info-Datei"] : "keine DB-Info-Datei"))."")."</td>
     		</tr>";
     			}
     
     			$g .= "
     	</table>";
     		}*/
     #$showHelp = false;
     #if(!$showHelp)
     #	$help = OnEvent::script(OnEvent::closePopup("123", "Installation"));
     return $ST . $g;
     #.$help;
 }
Ejemplo n.º 19
0
 function getSetTable($DeviceID, $values)
 {
     $controls = new HTMLTable(1);
     $controls->setTableStyle("width:100%;border:0px;");
     $i = 0;
     foreach ($values as $v => $l) {
         $controls->addRow(array($l));
         $controls->addRowClass("backgroundColor0");
         $controls->addCellStyle(1, "padding-top:10px;padding-bottom:10px;cursor:pointer;");
         if ($i != count($values) - 1) {
             $controls->addCellStyle(1, "border-bottom-style:solid;border-bottom-width:1px;");
             $controls->addCellClass(1, "borderColor1");
         }
         $controls->addCellEvent(1, "click", OnEvent::rme($this, "setDevice", array(str_replace(array("D", "H"), "", $DeviceID), "'{$v}'"), "function(){ \$j('#controls_{$DeviceID}').hide(); if(Fhem.doAutoUpdate) Fhem.requestUpdate(); }"));
         $i++;
     }
     $controls = "<div id=\"controls_{$DeviceID}\" style=\"display:none;width:50px;position:absolute;margin-left:150px;border-style:solid;border-width:1px;padding:3px;\" class=\"borderColor1 backgroundColor0 fhemeControl\">{$controls}</div>";
     return $controls;
 }