private function getInput($v) { if (!isset($this->types[$v]) or $this->types[$v] != "parser") { if (isset($this->types[$v]) and ($this->types[$v] == "tinyMCE" or $this->types[$v] == "TextEditor" or $this->types[$v] == "nicEdit")) { $options = array($this->id, $v); if (isset($this->options[$v])) { foreach ($this->options[$v] as $ov) { $options[] = $ov; } } $this->options[$v] = $options; } $Input = new HTMLInput($v, isset($this->types[$v]) ? $this->types[$v] : "text", isset($this->values[$v]) ? $this->values[$v] : null, isset($this->options[$v]) ? $this->options[$v] : null); if (isset($this->onChange[$v])) { $Input->onchange($this->onChange[$v]); } if (isset($this->onBlur[$v])) { $Input->onblur($this->onBlur[$v]); } if (isset($this->onFocus[$v])) { $Input->onfocus($this->onFocus[$v]); } if (isset($this->onKeyup[$v])) { $Input->onkeyup($this->onKeyup[$v]); } if (isset($this->inputStyle[$v])) { $Input->style($this->inputStyle[$v]); } if (isset($this->autocomplete[$v])) { $Input->autocomplete($this->autocomplete[$v][0], $this->autocomplete[$v][1], false, $this->autocomplete[$v][2]); } if (isset($this->placeholders[$v])) { $Input->placeholder($this->placeholders[$v]); } $Input->isDisplayMode(!$this->editable); } else { $method = explode("::", $this->options[$v][0]); $Input = Util::invokeStaticMethod($method[0], $method[1], array(isset($this->values[$v]) ? $this->values[$v] : null, "", isset($this->options[$v][1]) ? $this->options[$v][1] : null)); } return $Input; }
private function row(poolAnzeige $A) { $html = "\n\t\t\t<div style=\"height:auto;padding-top:30px;padding-bottom:25px;border-bottom: 1px solid #ddd;\">"; $I = new HTMLInput("poolAnzeigeName", "text", $A->A("poolAnzeigeName")); $I->activateMultiEdit("poolAnzeige", $A->getID()); $I->style("text-align: right;width:90%;"); $I->placeholder("Beschriftung"); $B = new Button("Zeile löschen", "trash_stroke", "iconicL"); $B->style("margin-top:10px;"); $B->doBefore("if(confirm('Die Zeile löschen?')) %AFTER"); $B->rmePCR("poolAnzeige", $A->getID(), "deleteMe", "", OnEvent::reload("Screen")); $html .= "\n\t\t\t\t<div style=\"text-align: right;color: #777;font-size: 1.5em;display: inline-block;width: 195px;height: auto;vertical-align: top;margin-top: 7px;margin-right: 21px;\">\n\t\t\t\t\t{$I}{$B}\n\t\t\t\t</div>"; $close = 0; $AC = anyC::get("poolAnzeigeControl", "poolAnzeigeControlpoolAnzeigeID", $A->getID()); $AC->addOrderV3("poolAnzeigeControlOrder"); $AC->addOrderV3("poolAnzeigeControlID"); while ($C = $AC->n()) { if ($C->A("poolAnzeigeControlNewLine")) { $html .= "<div style=\"margin-top:15px;\">\n\t\t\t\t\t<div style=\"display: inline-block;width: 195px;height: 120px;vertical-align: top;margin-top: 7px;margin-right: 21px;\"></div>"; $close++; } $html .= $this->control($C); } $B = new Button("Element\nhinzufügen", "new"); $B->style("margin:10px;display:inline-block;vertical-align:top;"); $B->popup("", "Element hinzufügen", "mpoolAnzeige", "-1", "addElementPopup", array($A->getID())); $html .= $B; for ($i = 0; $i < $close; $i++) { $html .= "</div>"; } $html .= "</div>"; return $html; }
public function showCurrentFrozenList() { $I = new HTMLInput("GefrierschrankNewEntry", "textarea", ""); $I->placeholder("Neuer Eintrag"); $I->style("width:390px;padding:5px;margin-left:5px;font-size:20px;float:left;font-family:monospace;max-width:390px;resize:none;height:35px;max-height:35px;"); $I->onEnter(OnEvent::rme($this, "addFrozenItem", array("this.value"), "function(transport){ \$j('#currentList').html(transport.responseText); }") . " \$j(this).val('');"); $B = new Button("Liste schließen", "stop"); $B->onclick(OnEvent::closePopup("mGericht")); $B->style("float:right;margin:10px;"); #<div id=\"EinkaufslisteNewEntryAC\" style=\"width:390px;height:35px;padding:5px;font-size:20px;margin-top:3px;font-family:monospace;color:grey;float:left;\"></div> echo "\n\t\t<div style=\"width:600px;display:inline-block;vertical-align:top;\" id=\"reAddList\">\n\t\t\t" . $this->getFrozenListReAddTable() . "\n\t\t</div><div style=\"width:400px;display:inline-block;vertical-align:top;\">\n\t\t\t<div id=\"headerList\">\n\t\t\t{$B}\n\t\t\t{$I}<div style=\"clear:both;\"></div></div>\n\t\t\t\n\t\t\t<div id=\"currentList\">" . $this->getFrozenListTable() . "</div>\n\t\t</div>\n\t\t\t" . OnEvent::script("\$j('#editDetailsContentmEinkaufszettel').css('overflow', ''); setTimeout(function(){ \$j('input[name=EinkaufslisteNewEntry]').focus(); }, 200);"); }
public function getQuicksearchInput() { $I = new HTMLInput("quickSearch", "text", ""); #$I->hasFocusEvent(true); $I->id("quickSearch{$this->collectionName}"); $I->onkeyup("AC.update(event.keyCode, this, '{$this->collectionName}','quickSearchLoadFrame');"); $I->autocompleteBrowser(false); $I->onfocus("focusMe(this); ACInputHasFocus=true; AC.start(this); if(this.value != '') AC.update('10', this, '{$this->collectionName}', 'quickSearchLoadFrame');"); $I->onblur("blurMe(this); ACInputHasFocus=false; AC.end(this);"); $I->placeholder("Suche"); $B = ""; $showSF = PMReflector::implementsInterface($this->collectionName . "GUI", "iSearchFilter"); if ($showSF) { $B = new Button("Suche als Filter anwenden", "./images/i2/searchFilter.png", "icon"); $B->style("float:right;"); $B->rme("HTML", "", "saveContextMenu", array("'searchFilter'", "'{$this->collectionName};:;'+\$('quickSearch{$this->collectionName}').value"), "if(checkResponse(transport)) contentManager.reloadFrameRight();"); $mU = new mUserdata(); $K = $mU->getUDValue("searchFilterInHTMLGUI" . $this->collectionName); $I->setValue($K); $I->style("width:90%;"); } return $B . $I; }
public function getArtikel($data) { $TKategorien = new HTMLTable(2, "Kategorien"); $TKategorien->setTableStyle("width:100%;"); $TKategorien->setTableID("tableKategorien"); $TKategorien->setColWidth(1, 20); $B = new Button("Nach Kategorie filtern", "arrow_down", "iconic"); $B->className("reverse"); $AC = anyC::get("Kategorie", "type", "2"); $AC->addOrderV3("name"); $TKategorien->addRow(array($B, "Alle Kategorien")); $TKategorien->addRowClass("selectable"); $TKategorien->addRowEvent("click", "CustomerPage.rme('getArtikel', {KategorieID: '', query : '{$data['query']}', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); if ($data["KategorieID"] == "") { $TKategorien->addRowStyle("text-decoration:underline;"); } while ($K = $AC->getNextEntry()) { $B = new Button("Nach Kategorie filtern", "arrow_down", "iconic"); if ($data["KategorieID"] != $K->getID()) { $B->className("reverse"); } $TKategorien->addRow(array($B, $K->A("name"))); $TKategorien->addRowClass("selectable"); $TKategorien->addRowEvent("click", "CustomerPage.rme('getArtikel', {KategorieID: '" . $K->getID() . "', query : '{$data['query']}', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); #if($data["KategorieID"] == $K->getID()) # $TKategorien->addRowStyle ("text-decoration:underline;"); } $TArtikel = new HTMLTable(4, "Artikel"); $TArtikel->setTableStyle("width:100%;"); $TArtikel->setColWidth(1, 26); $TArtikel->setColWidth(2, 100); $TArtikel->setColStyle(4, "text-align:right;"); $BQ = ""; if ($data["query"] != "") { $BQ = new Button("Suche löschen", "x_alt", "iconic"); $BQ->onclick("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : '', GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); $BQ->style("color:darkred;float:left;"); } else { $BQ = new Button("Suche", "question_mark", "iconic"); } $I = new HTMLInput("query", "text", $data["query"]); $I->placeholder("Suche nach Name, Nummer oder Beschreibung"); $I->style("width:90%;"); $I->onEnter("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : this.value, GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); $BS = new Button("Los", "arrow_right", "iconic"); $BS->onclick("CustomerPage.rme('getArtikel', {KategorieID: '{$data['KategorieID']}', query : \$j('[name=query]').val(), GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentRight').html(transport); });"); $TArtikel->addRow(array($BQ, $I . " " . $BS)); $TArtikel->addRowColspan(2, 3); $AC = anyC::get("Artikel"); if ($data["KategorieID"] != "") { $AC->addAssocV3("KategorieID", "=", $data["KategorieID"], "AND", "1"); } if ($data["query"] != "") { $AC->addAssocV3("artikelnummer", "LIKE", "%{$data['query']}%", "AND", "2"); $AC->addAssocV3("name", "LIKE", "%{$data['query']}%", "OR", "2"); $AC->addAssocV3("beschreibung", "LIKE", "%{$data['query']}%", "OR", "2"); } $AC->addOrderV3("artikelnummer"); $AC->addOrderV3("name"); $AC->setLimitV3(100); while ($A = $AC->getNextEntry()) { $B = new Button("Artikel hinzufügen", "arrow_left", "iconic"); $B->className("reverse"); #$B->onclick("CustomerPage.rme('delPosten', {PostenID: '".$P->getID()."'}, function(){ CustomerPage.rme('getAuftrag', {GRLBMID: $data[GRLBMID]}, function(transport){ $('#contentLeft').html(transport); }); });"); $A->resetParsers(); $TArtikel->addRow(array($B, $A->A("artikelnummer"), $A->A("name") . ($A->A("bemerkung") != "" ? "<br /><small style=\"color:grey;\">" . $A->A("bemerkung") . "</small>" : ""), $this->showPrices ? Util::CLFormatCurrency($A->getGesamtBruttoVK() * 1, true) . "<br /><small style=\"color:grey;\">" . Util::CLFormatCurrency($A->getGesamtNettoVK() * 1, true) . "</small>" : "")); $TArtikel->addRowClass("selectable"); $TArtikel->addRowEvent("click", "CCAuftrag.lastTextbausteinUnten = \$('[name=textbausteinUnten]').val(); CustomerPage.rme('addArtikel', {ArtikelID: '" . $A->getID() . "', GRLBMID: {$data['GRLBMID']}}, function(transport){ CustomerPage.rme('getAuftrag', {GRLBMID: {$data['GRLBMID']}}, function(transport){ \$('#contentLeft').html(transport); }); });"); } if ($AC->numLoaded() == 0) { $TArtikel->addRow(array("", "Keine Artikel gefunden")); $TArtikel->setColWidth(2, 200); } $html = "<h1>Artikel</h1>\n\t\t\t\t{$TKategorien}\n\t\t\t\t{$TArtikel}"; return $html; }
public function sendMessagePopup() { $AC = anyC::get("Device"); $AC->addOrderV3("DeviceName"); $B = new Button("Alle", "fullscreen", "touch"); $B->className("nuntiusMessageTo"); $B->id("nuntiusMessageTarget0"); $B->onclick("\$j('.nuntiusMessageTo:not(#nuntiusMessageTarget0)').slideToggle(); \$j('#nuntiusMessageContainer').slideToggle();"); $L = $B; while ($D = $AC->getNextEntry()) { $B = new Button($D->A("DeviceName"), "iphone", "touch"); $B->className("nuntiusMessageTo"); $B->id("nuntiusMessageTarget" . $D->getID()); $B->onclick("\$j('.nuntiusMessageTo:not(#nuntiusMessageTarget" . $D->getID() . ")').slideToggle(); \$j('#nuntiusMessageContainer').slideToggle();"); $L .= $B; } $BS = new Button("Senden", "arrow_right", "touch"); $BS->style("margin-top:0px;height:190px;margin-bottom:0px;"); $BS->rmePCR("mNuntius", "-1", "sendMessage", array("\$j('.nuntiusMessageTo:visible').attr('id').replace('nuntiusMessageTarget', '')", "\$j('[name=NuntiusMessage]').val()", "'Device:'+\$j.jStorage.get('phynxDeviceID', -1)"), "function(){ " . OnEvent::closePopup("mNuntius") . " }"); $I = new HTMLInput("NuntiusMessage", "textarea"); $I->style("width:100%;height:200px;max-width:400px;font-size:15px;"); $I->placeholder("Nachricht..."); echo "\n\t\t\t<div id=\"nuntiusTargets\" style=\"padding-top:15px;padding-bottom:1px;\">\n\t\t\t\t" . $L . "\n\t\t\t</div>\n\t\t\t<div style=\"display:none;padding-bottom:1px;\" id=\"nuntiusMessageContainer\">\n\t\t\t\t<div style=\"width:100px;float:right;\">{$BS}</div><div style=\"width:300px;\">{$I}</div>\n\t\t\t</div>"; }
public function rightCol($return = false) { $useDir = realpath(FileStorage::getFilesDir()); $path = BPS::getProperty("mFileGUI", "path", false); if ($path) { $path = preg_replace("/^([A-Z])%/", "\\1:", $path); if (strpos($path, realpath(FileStorage::getFilesDir())) === 0) { $useDir = $path; } } $writable = is_writable($useDir); $readable = is_readable($useDir); $this->setDir($useDir); $this->loadMultiPageMode(-1, 0, 10000); $showPath = str_replace(realpath(FileStorage::getFilesDir()), "", $useDir); $BH = new Button("Root", "home", "iconicL"); $BH->onclick($this->pather(FileStorage::getFilesDir())); $BH->style("float:left;"); $way = realpath(FileStorage::getFilesDir()); $bread = "<div style=\"vertical-align:top;display:inline-block;border-right:1px solid #aaa;\" class=\"isFolder\" data-path=\"{$way}\">{$BH} </div>"; foreach (explode(DIRECTORY_SEPARATOR, $showPath) as $k => $v) { if ($k == 0) { continue; } $way .= DIRECTORY_SEPARATOR . "{$v}"; $bread .= "<div class=\"selectionRow isFolder\" data-path=\"{$way}\" onclick=\"" . $this->pather($way) . "\" style=\"padding:8px;cursor:pointer;border-right:1px solid #aaa;color:#555;vertical-align:top;display:inline-block;padding-left:20px;padding-right:20px;border-bottom:0px;\">{$v}</div>"; } $I = new HTMLInput("upload", "file", null, array("path" => $way, "class" => "File")); $I->style("width:250px;"); $I->onchange($this->pather($way)); $IN = new HTMLInput("newDir", "text"); $IN->placeholder("Neues Verzeichnis"); $IN->style("width:250px;margin-right:20px;"); $IN->onEnter(OnEvent::rme($this, "makeDir", array("'{$way}'", "\$j(this).val()"), "function(){ " . $this->pather($way) . " }")); $ISA = new HTMLInput("selectAll", "checkbox"); $ISA->onchange("console.log(\$j(this).prop('checked')); \$j('.selectFile').prop('checked', \$j(this).prop('checked'));"); if (!$writable or !$readable) { $I = ""; $IN = ""; } $html = "\n\t\t\t<div style=\"background-color:#F7F7F7;border-bottom:1px solid #ddd;\">\n\t\t\t\t{$bread}\n\t\t\t\t<div style=\"display:inline-block;margin-top:2px;float:right;\">{$IN}</div>\n\t\t\t\t<div style=\"display:inline-block;margin-top:1px;float:right;\">{$I}</div>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div id=\"filesFrame\" style=\"overflow:auto;\">\n\t\t\t<form id=\"dlFiles\">\n\t\t\t<div style=\"border-bottom:1px solid #ddd;color:#777;\">\n\t\t\t\t<div style=\"display:inline-block;float:right;padding:5px;\">\n\t\t\t\t\tGröße\n\t\t\t\t\t<div style=\"display:inline-block;width:64px;\"> </div>\n\t\t\t\t</div>\n\t\t\t\t<!--<div style=\"display:inline-block;width:57px;float:left;padding-left:5px;\">{$ISA}</div>-->\n\t\t\t\t<div style=\"display:inline-block;width:26px;float:left;padding-left:5px;\"> </div>\n\t\t\t\t<div style=\"padding:5px;\">Dateiname</div>\n\t\t\t</div>"; if (!$readable) { $html .= "<div style=\"padding:5px;\" class=\"highlight\">Das Verzeichnis <code>{$useDir}</code> ist nicht lesbar.</div>"; return $html; } if (!$writable) { $html .= "<div style=\"padding:5px;\" class=\"highlight\">Das Verzeichnis {$useDir} ist nicht beschreibbar.<br />\n\t\t\t\tEs können keine Unterverzeichnisse angelegt oder Dateien hochgeladen werden.<br />\n\t\t\t\tBitte machen Sie das Verzeichnis mit <code>chmod 777 " . basename($useDir) . "</code> durch den Webserver beschreibbar.</div>"; } $i = 0; while ($F = $this->getNextEntry()) { if ($F->A("FileName") == "." or $F->A("FileName") == "..") { continue; } $ext = Util::ext($F->A("FileName")); $B = ""; if ($F->A("FileIsDir")) { $B = new Button("Verzeichnis öffnen", "./plugins/Files/icons/folder.png", "icon"); $B->style("margin-right:5px;margin-top:2px;"); } elseif (!$F->A("FileIsDir") and file_exists(dirname(__FILE__) . "/icons/file_extension_{$ext}.png")) { $B = new Button("", "./plugins/Files/icons/file_extension_{$ext}.png", "icon"); $B->style("margin-right:5px;margin-top:2px;"); } elseif (!$F->A("FileIsDir") and !file_exists(dirname(__FILE__) . "/icons/file_extension_{$ext}.png")) { $B = new Button("", "./plugins/Files/icons/file_extension_unknown.png", "icon"); $B->style("margin-right:5px;margin-top:2px;"); } $BDL = new Button("Datei herunterladen", "download", "iconic"); $BDL->style("margin-right:10px;"); $BDL->windowRme("File", $F->getID(), "download"); $size = "<div style=\"display:inline-block;margin-right:20px;color:grey;width:60px;text-align:right;\"></div>"; if ($F->A("FileIsDir")) { $onclick = $this->pather($F->getID()); $BDL = ""; } else { $onclick = OnEvent::popup("Vorschau", "File", $F->getID(), "previewWindow", "", "", "{width:600, hPosition: 'center'}"); $size = "<div style=\"display:inline-block;margin-right:20px;color:grey;width:60px;text-align:right;\">" . Util::formatByte($F->A("FileSize")) . "</div>"; } $onRename = OnEvent::rme($F, "rename", array("\$j('input[name=renameFile{$i}]').val()"), "function(t){ \$j('.fileName{$i}').html(t.responseText); \$j('#default{$i}').show(); \$j('#rename{$i}').hide(); }"); $BD = new Button("Element löschen", "trash_stroke", "iconic"); #$BD->style("float:right;"); $BD->onclick("deleteClass('File','" . $F->getID() . "', function() { " . $this->pather(realpath(dirname($F->getID()))) . " },'Element wirklich löschen?');"); $BR = new Button("Element umbenennen", "pen_alt2", "iconic"); $BR->style("margin-right:10px;"); $BR->onclick("\$j('.fileDefault').show(); \$j('.fileRename, #default{$i}').hide(); \$j('#rename{$i}').show();"); $IR = new HTMLInput("renameFile{$i}", "text", $F->A("FileName")); $IR->style("width:350px;"); $IR->onEnter($onRename); $BC = new Button("Umbenennen abbrechen", "x", "iconic"); $BC->onclick("\$j('#default{$i}').show(); \$j('#rename{$i}').hide();"); $BC->style("margin-left:10px;"); $BO = new Button("Umbenennen abschließen", "check", "iconic"); $BO->onclick($onRename); $BO->style("margin-left:10px;"); $IC = new HTMLInput("select{$i}", "checkbox"); $IC->setClass("selectFile"); $IC->style("margin-top:2px;margin-right:10px;display:none;"); $html .= "\n\t\t\t<div data-path=\"" . $F->getID() . "\" class=\"selectionRow " . ($F->A("FileIsDir") ? "isFolder" : "") . "\" style=\"\">\n\t\t\t\t<div class=\"selectionRowHeightSetter\" style=\"display:inline-block;float:left;\">{$IC}{$B}</div>\n\t\t\t\t<div class=\"selectionRowHeightSetter\" style=\"display:inline-block;float:right;\">{$BDL}{$BR}{$size}{$BD}</div>\n\t\t\t\t\t\n\t\t\t\t<div id=\"rename{$i}\" class=\"fileRename selectionRowHeightSetter\" style=\"display:none;margin-bottom:-3px;\">{$IR}{$BC}{$BO}</div>\n\t\t\t\t<div id=\"default{$i}\" class=\"selectionRowHeightSetter fileDefault\" onclick=\"" . $onclick . "\" style=\"padding:5px;padding-top:9px;cursor:pointer;\">\n\t\t\t\t\t<span class=\"fileName{$i}\">" . str_replace(".{$ext}", "<span style=\"color:grey;\">.{$ext}</span>", $F->A("FileName")) . "</span>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<div style=\"clear:both;\"></div>\n\t\t\t</div>"; $i++; } $html .= "</form></div>" . OnEvent::script("\n\$j('.selectionRow').draggable({\n\trevert: true,\n\thelper: function(v){\n\t\tvar newE = \$j(v.target).closest('.selectionRow').clone();\n\t\tnewE.css('width', '400px').css('opacity', '0.7').addClass('selectionRow');\n\t\tnewE.find('.iconic').remove();\n\t\treturn newE;\n\t}/*,\n\tstart: function (event, ui) {\n\t\t \$j(ui.helper).css('margin-left', event.clientX - \$j(event.target).offset().left + 10);\n\t\t \$j(ui.helper).css('margin-top', event.clientY - \$j(event.target).offset().top + 10);\n\t }*/\n});\n\n\$j('.isFolder').droppable({\n\thoverClass: 'highlight',\n\taccept: '.selectionRow',\n\ttolerance: 'pointer',\n\tdrop: function(event, ui) {\n\t\tvar newE = ui.helper.clone();\n\t\tui.helper.remove();\n\t\t" . OnEvent::rme($this, "moveFile", array("\$j(ui.draggable).data('path')", "\$j(this).data('path')"), "function(){ \n\t\t\t\$j(ui.draggable).fadeOut(400, function(){ \$j(this).remove(); }); \n\t\t\t\$j('body').append(newE);\n\t\t\t\$j(newE).fadeOut(400, function(){ \$j(this).remove(); }); \n\t\t}") . "\n\t}\n});\n"); if (!$return) { echo $html; } else { return $html; } }
public function __toString() { #$style = ""; if ($this->type == "date" and strpos($this->style, "width:") === false) { $this->style .= "width:87%;"; } #if($this->style != null) $style = " style=\"$this->style\""; switch ($this->type) { case "audio": return "<audio controls preload=\"auto\" autobuffer style=\"{$this->style}\"><source src=\"{$this->value}\"></audio>"; break; case "search": $currentId = $this->id != null ? $this->id : $this->name . rand(100, 100000000); $enter = "if(\$j('#{$currentId}').val() != ''){ \$j('#SB{$currentId}').fadeOut(200, function(){ \$j('#SA{$currentId}').fadeIn();}); } else { \$j('#SA{$currentId}').fadeOut(200, function(){ \$j('#SB{$currentId}').fadeIn(); }); }"; $I = new HTMLInput($this->name, "text", $this->value, $this->options); $I->style($this->style); $I->placeholder($this->placeholder); $I->onEnter($this->onenter . $enter); #$I->onEnter(" "); $I->id($currentId); $BSearch = new Button("Suchen", "question_mark", "iconicG"); $BSearch->style("margin-left:5px;"); $BSearch->id("SB{$currentId}"); $BSearch->onclick($this->onenter . $enter); #$BSearch->id("searchMailsInfo"); $BSearchClear = new Button("Suche beenden", "x_alt", "iconicR"); $BSearchClear->style("margin-left:5px;display:none;"); $BSearchClear->id("SA{$currentId}"); $BSearchClear->onclick("\$j('#{$currentId}').val('').trigger('blur'); {$this->onenter}{$enter}"); #$BSearchClear->id("searchMailsClear"); return $I . $BSearch . $BSearchClear . $this->requestFocus; break; case "HTMLEditor": $B = new Button("in HTML-Editor\nbearbeiten", "editor"); $B->windowRme("Wysiwyg", "", "getEditor", "", "WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}"); $B->className("backgroundColor2"); return $B->__toString(); break; case "TextEditor": #return "<input ".(isset($this->events[$as]) ? $eve : "")." style=\"background-image:url(./images/navi/editor.png);".(isset($this->inputStyle[$as]) ? "".$this->inputStyle[$as]."" : "")."\" type=\"button\" class=\"bigButton backgroundColor2\" onclick=\"TextEditor.show('$as','$this->FormID');\" value=\"".$this->texts["in Editor bearbeiten"]."\" /><textarea style=\"display:none;\" name=\"".$as."\" id=\"".$as."\">".$this->attributes->$as."</textarea>"; $B = new Button("in Editor\nbearbeiten", "editor"); $B->className("backgroundColor2"); $B->onclick("TextEditor.show('{$this->name}','{$this->options[0]}');"); $ITA = new HTMLInput($this->name, "textarea", $this->value); $ITA->id($this->name); $ITA->style("display:none;"); return $B->__toString() . $ITA; break; case "nicEdit": $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'"); if (isset($this->options[2])) { $BO[] = "'{$this->options[2]}'"; } $B = new Button("in Editor\nbearbeiten", "editor"); #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}"); $B->doBefore("Overlay.showDark(); %AFTER"); $B->popup("", "Editor", "nicEdit", "-1", "editInPopup", $BO, "", "Popup.presets.large"); $B->className("backgroundColor2"); $ITA = new HTMLInput($this->name, "hidden", $this->value); return $B->__toString() . $ITA; break; case "tinyMCE": $BO = array("'{$this->options[0]}'", "'{$this->options[1]}'"); if (isset($this->options[2])) { $BO[] = "'{$this->options[2]}'"; } $B = new Button("in Editor\nbearbeiten", "editor"); #$B->windowRme("Wysiwyg","","getEditor","","WysiwygGUI;FieldClass:{$this->options[0]};FieldClassID:{$this->options[1]};FieldName:{$this->options[2]}"); $B->popup("", "Editor", "Wysiwyg", "-1", "editInPopup", $BO, "", "Popup.presets.large"); $B->className("backgroundColor2"); $ITA = new HTMLInput($this->name, "textarea", $this->value); return $B->__toString() . $ITA; break; case "multiInput": return "<input\n\t\t\t\t\tclass=\"multiEditInput2\"\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tvalue=\"" . htmlspecialchars($this->value) . "\"\n\t\t\t\t\tonfocus=\"oldValue = this.value;\"\n\t\t\t\t\tid=\"" . $this->options[2] . "ID" . $this->options[1] . "\"\n\t\t\t\t\tonblur=\"if(oldValue != this.value) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"\n\t\t\t\t\tonkeydown=\"if(event.keyCode == 13) saveMultiEditInput('" . $this->options[0] . "','" . $this->options[1] . "','" . $this->options[2] . "');\"/>"; break; /*case "customSelection": $B = new Button("Eintrag auswählen...", "gutschrift"); $B->type("LPBig"); $B->style("float:right;margin-left:10px;"); # "contentRight" "callingPluginID" "selectPlugin" $B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]); return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />"; break;*/ /*case "customSelection": $B = new Button("Eintrag auswählen...", "gutschrift"); $B->type("LPBig"); $B->style("float:right;margin-left:10px;"); # "contentRight" "callingPluginID" "selectPlugin" $B->customSelect($this->options[0], $this->options[1], $this->options[2], $this->options[3]); return $B."<input type=\"text\" name=\"$this->name\" value=\"$this->value\" />"; break;*/ case "textarea": if ($this->isDisplayMode) { return nl2br($this->value); } if ($this->multiEditOptions != null) { $this->id($this->name . "ID" . $this->multiEditOptions[1]); $this->onfocus .= " contentManager.oldValue = this.value;"; $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");"; $this->onblur .= "if(contentManager.oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");"; if ($this->hasFocusEvent) { $this->onfocus .= "focusMe(this);"; $this->onblur .= "blurMe(this);"; } $this->hasFocusEvent = false; } return "<textarea\n\t\t\t\t\t" . ($this->placeholder != null ? " placeholder=\"{$this->placeholder}\"" : "") . "\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . (!$this->autocorrect ? "autocorrect=\"off\"" : "") . "\n\t\t\t\t\t" . (!$this->spellcheck ? "spellcheck=\"false\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->hasFocusEvent ? "onfocus=\"focusMe(this);\" onblur=\"blurMe(this);\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">{$this->value}</textarea>"; break; case "file": $physion = Session::physion(); $currentId = ($this->id != null ? $this->id : $this->name) . rand(100, 100000000); if (isset($this->options["autoUpload"]) and !$this->options["autoUpload"]) { $this->callback = "QQUploader{$currentId}.uploadStoredFiles();"; } return "\n\t\t\t\t\t<div id=\"progress_{$currentId}\" style=\"height:10px;width:95%;display:none;\" class=\"\">\n\t\t\t\t\t\t<div id=\"progressBar_{$currentId}\" style=\"height:10px;width:0%;\" class=\"backgroundColor1\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id=\"{$currentId}\" style=\"width:100%;{$this->style}\"></div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tQQUploader{$currentId} = new qq.FileUploader({\n\t\t\t\t\t\t\tmaxSizePossible: '" . ini_get("upload_max_filesize") . "B',\n\t\t\t\t\t\t\tsizeLimit: " . Util::toBytes(ini_get("upload_max_filesize")) . ",\n\t\t\t\t\t\t\telement: \$j('#{$currentId}')[0],\n\t\t\t\t\t\t\taction: './interface/set.php',\n\t\t\t\t\t\t\tparams: {\n\t\t\t\t\t\t\t\t'class': '" . (($this->options == null or !isset($this->options["class"])) ? "TempFile" : $this->options["class"]) . "'\n\t\t\t\t\t\t\t\t,'id':'-1'\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["path"])) ? ",'path':'" . $this->options["path"] . "'" : "") . "\n\t\t\t\t\t\t\t\t" . (($this->options != null and isset($this->options["targetFilename"])) ? ",'targetFilename':'" . $this->options["targetFilename"] . "'" : "") . "\n\t\t\t\t\t\t\t\t" . ($physion ? ",'physion':'{$physion['0']}'" : "") . "\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t" . (isset($this->options["autoUpload"]) ? "autoUpload: " . ($this->options["autoUpload"] ? "true" : "false") . "," : "") . "\n\t\t\t\t\t\t\t" . (isset($this->options["multiple"]) ? "multiple: " . ($this->options["multiple"] ? "true" : "false") . "," : "") . "\n\t\t\t\t\t\t\tonSubmit: function(id, fileName){ \$j('#progress_{$currentId}').css('display', 'block');},\n\t\t\t\t\t\t\tonComplete: function(id, fileName, transport){ \$j('progress_{$currentId}').css('display', 'none'); {$this->onchange} },\n\t\t\t\t\t\t\tonProgress: function(id, fileName, loaded, total){ \$j('#progressBar_{$currentId}').css('width', Math.ceil((loaded / total) * 100)+'%'); }});\n\t\t\t\t\t</script>"; break; case "time": $this->type = "text"; if (!$this->id) { $this->id = rand(100000, 9999999) . $this->name; } #$this->onkeyup .= "if(\$j(this).val().length == 2 && \$j(this).val().lastIndexOf(':') == -1) \$j(this).val(\$j(this).val()+':'); "; if ($this->connectTo) { $this->onkeyup .= "contentManager.connectedTimeInput(event, '{$this->id}', '{$this->connectTo}'); "; } else { $this->onkeyup .= "contentManager.timeInput(event, '{$this->id}'); "; } case "radio1": case "date": case "email": case "text": case "hidden": case "submit": case "number": case "button": case "password": case "checkbox": case "readonly": case "fileold": $JS = ""; if ($this->type == "radio1") { $this->type = "radio"; } if ($this->type == "fileold") { $this->type = "file"; } if ($this->isDisplayMode) { if ($this->type == "checkbox") { return Util::catchParser($this->value); } if ($this->type == "hidden") { return ""; } if ($this->type == "password") { return str_repeat("*", mb_strlen($this->value)); } return $this->value . ""; } if ($this->hasFocusEvent) { $this->onfocus .= "focusMe(this);"; $this->onblur .= "blurMe(this);"; } $cal = ""; $B2 = ""; if ($this->type == "date") { if ($this->id == null) { $this->id = rand(10000, 90000); } $cal = new Button("Kalender anzeigen", "calendar", "iconic"); $cal->onclick("\$j('#{$this->id}').focus();"); $cal->style("float:right;"); $JS = "<script type=\"text/javascript\">\$j('#{$this->id}').datepicker();</script>"; $this->type = "text"; } $value = "value=\"" . htmlspecialchars($this->value) . "\""; if ($this->type == "checkbox") { $value = $this->value == "1" ? "checked=\"checked\"" : ""; } if ($this->multiEditOptions != null) { $this->id($this->name . "ID" . $this->multiEditOptions[1]); if ($this->type == "checkbox") { $this->onchange = "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");"; } else { $this->onfocus .= " oldValue = this.value;"; $this->onkeyup .= "if(event.keyCode == 13) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");"; $this->onblur .= "if(oldValue != this.value) saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");"; } } if ($this->autocomplete != null) { if ($this->id == null) { $this->id = $this->name; } /*$this->onfocus .= " ACInputHasFocus=true; AC.start(this);"; $this->onblur .= " ACInputHasFocus = false; AC.end(this);"; $this->onkeyup .= " AC.update(event.keyCode, this, '".$this->autocomplete[0]."');";*/ $this->autocompleteBrowser = false; $cal = $this->autocomplete[5]; #new Button("Suche", "./images/i2/details.png"); $cal->onclick("\$('{$this->id}').style.display = ''; \$('{$this->id}').value = ''; \$('{$this->id}').focus();"); if ($cal->getStyle() == "") { $cal->style("float:right;"); } if ($this->autocomplete[4] != null) { $B2 = $this->autocomplete[4]; $B2->style("float:right;margin-left:5px;"); if (strpos($this->style, "width") === false) { $this->style .= "width:80%"; } } else { if (strpos($this->style, "width") === false) { $this->style .= "width:87%"; } } if ($this->autocomplete[1] == null) { $cal->onclick("\$('{$this->id}Display').style.display = ''; \$('{$this->id}Display').value = ''; \$('{$this->id}').value = ''; \$('{$this->id}Display').focus();"); $IN = new HTMLInput($this->name, "hidden", htmlspecialchars($this->value)); $IN->id($this->name); $JS .= $IN; $this->autocomplete[1] = "function(selection){ \$('{$this->id}').value = selection.value; \$('{$this->id}Display').value = selection.label; return false; }"; if ($this->value != "") { $C = substr($this->autocomplete[0], 1) . "GUI"; $C = new $C($this->value); $value = "value=\"" . htmlspecialchars($C->ACLabel()) . "\""; } $this->id .= "Display"; } $JS .= OnEvent::script("var OnSelectCallback{$this->id} = " . $this->autocomplete[1] . "; \$j(\"input#{$this->id}\").autocomplete({\n\t\t\t\t\t\tsource: function(request, response){ \n\t\t\t\t\t\t\t " . OnEvent::rme($this->autocomplete[0], "getACData", array("'{$this->name}'", "request.term", $this->autocomplete[3]), "function(transport){ response(jQuery.parseJSON(transport.responseText)); }") . "\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t},\n\t\t\t\t\t\tselect: function(event, ui) { var r = OnSelectCallback{$this->id}(ui.item); " . ($this->autocomplete[2] ? "\$('{$this->id}').style.display = 'none';" : "") . " return r; }\n\t\t\t\t\t}).data(\"ui-autocomplete\")._renderItem = function( ul, item ) {\n\t\t\t\t\t\treturn \$j( \"<li>\" )\n\t\t\t\t\t\t\t.data( \"item.ui-autocomplete\", item )\n\t\t\t\t\t\t\t.append( \"<a>\" + item.label + (item.description ? \"<br /><small>\"+item.description+\"</small>\" : \"\")+\"</a>\" )\n\t\t\t\t\t\t\t.appendTo( ul );\n\t\t\t\t\t};"); } return "{$B2}{$cal}<input\n\t\t\t\t\t" . ($this->maxlength != null ? " maxlength=\"{$this->maxlength}\"" : "") . "\n\t\t\t\t\t" . ($this->placeholder != null ? " placeholder=\"{$this->placeholder}\"" : "") . "\n\t\t\t\t\t" . ($this->style != null ? " style=\"{$this->style}\"" : "") . "\n\t\t\t\t\t" . (!$this->autocompleteBrowser ? "autocomplete=\"off\"" : "") . "\n\t\t\t\t\t" . ($this->className != null ? "class=\"{$this->className}\"" : "") . "\n\t\t\t\t\t" . ($this->onclick != null ? "onclick=\"{$this->onclick}\"" : "") . "\n\t\t\t\t\t" . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . "\n\t\t\t\t\t" . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeyup != null ? "onkeyup=\"{$this->onkeyup}\"" : "") . "\n\t\t\t\t\t" . ($this->onkeydown != null ? "onkeydown=\"{$this->onkeydown}\"" : "") . "\n\t\t\t\t\t" . ($this->tabindex != null ? "tabindex=\"{$this->tabindex}\"" : "") . "\n\t\t\t\t\t" . ($this->isSelected ? "checked=\"checked\"" : "") . "\n\t\t\t\t\t" . ($this->type == "file" ? "size=\"1\"" : "") . "\n\t\t\t\t\t" . ($this->type == "readonly" ? "readonly=\"readonly\"" : "") . "\n\t\t\t\t\tname=\"{$this->name}\"\n\t\t\t\t\t" . ($this->isDisabled ? "disabled=\"disabled\"" : "") . "\n\t\t\t\t\ttype=\"" . ($this->type != "readonly" ? $this->type : "text") . "\"\n\t\t\t\t\t" . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . "\n\t\t\t\t\t" . ($this->id != null ? "id=\"{$this->id}\"" : "") . "\n\t\t\t\t\t{$value} />{$this->requestFocus}{$JS}"; break; case "option": return "<option" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->isSelected ? "selected=\"selected\"" : "") . " value=\"{$this->value}\">{$this->name}</option>"; break; case "radio": $html = ""; foreach ($this->options as $k => $v) { $html .= "<div style=\"margin-bottom:5px;\"><input name=\"{$this->name}\" value=\"{$k}\" " . ($k == $this->value ? "checked=\"checked\"" : "") . " style=\"float:left;margin-right:5px;\" type=\"radio\">{$v}</div>"; } return $html; break; case "select": case "select-multiple": if ($this->hasFocusEvent) { $this->onfocus .= "focusMe(this);"; $this->onblur .= "blurMe(this);"; } if ($this->type == "select-multiple") { $values = trim($this->value) != "" ? explode(";:;", $this->value) : array(); } if ($this->isDisplayMode) { return is_object($this->options[$this->value]) ? $this->options[$this->value]->__toString() : $this->options[$this->value]; } if ($this->multiEditOptions != null) { $this->onchange("saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");"); $this->id($this->name . "ID" . $this->multiEditOptions[1]); } $html = "<select " . ($this->onblur != null ? "onblur=\"{$this->onblur}\"" : "") . " " . ($this->onfocus != null ? "onfocus=\"{$this->onfocus}\"" : "") . " " . ($this->size ? "size=\"{$this->size}\"" : "") . " " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->type == "select-multiple" ? " multiple=\"multiple\"" : "") . "" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " " . ($this->onchange != null ? "onchange=\"{$this->onchange}\"" : "") . " name=\"{$this->name}\" " . ($this->id != null ? "id=\"{$this->id}\"" : "") . ">"; if ($this->options != null and is_array($this->options)) { foreach ($this->options as $k => $v) { if (!is_object($v)) { if ($this->type == "select") { $isThisIt = $this->value == $k; } else { $isThisIt = in_array($k, $values); } $html .= "<option " . ($isThisIt ? "selected=\"selected\"" : "") . " value=\"{$k}\">{$v}</option>"; } else { if ($this->value == $k or $v->getValue() == $this->value) { $v->isSelected(true); } $html .= $v; } } } $html .= "</select>"; return $html; break; } }
public function showCurrentList() { $BM = new Button("Handy-Version\nanzeigen", "./fheME/Einkaufszettel/mobile.png"); $BM->style("float:right;margin:10px;"); $BM->onclick("window.open('" . str_replace("/interface/rme.php", "/ubiquitous/CustomerPage/?CC=Shopping&key=" . substr(Util::eK(), 0, 5), $_SERVER["SCRIPT_NAME"]) . "');"); #$BH = new Button("Hinzufügen", "bestaetigung", "icon"); #$BH->style("margin-left:10px;margin-top:10px;float:left;margin-top:-28px;"); #$BH->onclick("if(\$j('input[name=EinkaufslisteNewEntry]').val() != 'Neuer Eintrag') ".OnEvent::rme($this, "addItem", array("\$j('input[name=EinkaufslisteNewEntry]').val()"), OnEvent::reloadPopup("mEinkaufszettel"))); $I = new HTMLInput("EinkaufslisteNewEntry", "textarea", ""); $I->placeholder("Neuer Eintrag"); $I->style("width:390px;padding:5px;margin-left:5px;font-size:20px;float:left;font-family:monospace;max-width:390px;resize:none;height:35px;max-height:35px;"); #$I->onfocus("if(this.value == 'Neuer Eintrag') { \$j(this).val('').css('color', 'black'); }"); #$I->onblur("if(this.value == '') { \$j(this).val('Neuer Eintrag').css('color', 'grey'); }"); #$I->onkeyup("var currentContent = \$j(this).val(); ".OnEvent::rme($this, "getACData", array("this.value"), "function(transport){ var json = jQuery.parseJSON(transport.responseText); if(json.length >= 1) \$j('#EinkaufslisteNewEntryAC').html(json[0].EinkaufszettelName.replace(currentContent, '<span style=\'color:white;\'>'+currentContent+'</span>')); else \$j('#EinkaufslisteNewEntryAC').html(''); }")); $I->onEnter(OnEvent::rme($this, "addItem", array("this.value"), "function(transport){ \$j('#currentList').html(transport.responseText); }") . " \$j(this).val('');"); $B = new Button("Liste schließen", "stop"); $B->onclick(OnEvent::closePopup("mEinkaufszettel")); $B->style("float:right;margin:10px;"); #<div id=\"EinkaufslisteNewEntryAC\" style=\"width:390px;height:35px;padding:5px;font-size:20px;margin-top:3px;font-family:monospace;color:grey;float:left;\"></div> echo "\n\t\t<div style=\"width:600px;display:inline-block;vertical-align:top;\" id=\"reAddList\">\n\t\t\t" . $this->getListReAddTable() . "\n\t\t</div><div style=\"width:400px;display:inline-block;vertical-align:top;\">\n\t\t\t<div id=\"headerList\">\n\t\t\t{$B}{$BM}\n\t\t\t{$I}<div style=\"clear:both;\"></div></div>\n\t\t\t\n\t\t\t<div id=\"currentList\">" . $this->getListTable() . "</div>\n\t\t</div>\n\t\t\t" . OnEvent::script("\$j('#editDetailsContentmEinkaufszettel').css('overflow', ''); setTimeout(function(){ \$j('input[name=EinkaufslisteNewEntry]').focus(); }, 200);"); }