Example #1
0
 function getCMSHTML()
 {
     if (!isset($_GET["terminalID"])) {
         return "<p>Keine Terminal-ID per GET übergeben! (terminalID)</p>";
     }
     if (!isset($_GET["done"])) {
         return "<p style=\"font-size:30px;\">\r\n\t\t\t\tTerminal IP: " . $_SERVER['REMOTE_ADDR'] . "<br>\r\n\t\t\t\tServer IP: " . $_SERVER['SERVER_ADDR'] . "</p>\r\n\t\t\t\t<p>\r\n\t\t\t\t<a href=\"#\" onclick=\"\$.jStorage.set('pKTransferStack', []); \$.jStorage.set('pKTimeStack', []); return false;\">Datenspeicher löschen</a>\r\n\t\t\t\t</p>" . OnEvent::script("window.setTimeout(function(){ document.location.href=\"?" . $_SERVER['QUERY_STRING'] . "&done=true\"; }, 3000);");
     }
     self::loadClasses();
     $AC = self::getPersonal();
     $json = $AC->asJSON();
     $html = "\r\n\t\t<style type=\"text/css\">\r\n\t\t\thtml {\r\n\t\t\t\toverflow-y: hidden;\r\n\t\t\t}\r\n\t\t\tbody {\r\n\t\t\t\t/*background-image:url(./images/TimeTerminalBG.svg);\r\n\t\t\t\tbackground-size:100%;*/\r\n\t\t\t\tmargin:0px;\r\n\t\t\t}\r\n\t\t\t.message {\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 0;\r\n\t\t\t\tleft: 0;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tbackground-color: #72c100;\r\n\t\t\t\tz-index: 1100;\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlayCenter {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 6%;\r\n\t\t\t\tleft: 3%;\r\n\t\t\t\twidth: 94%;\r\n\t\t\t\theight: 88%;\r\n\t\t\t\tbackground-color: white;\r\n\t\t\t\tz-index: 1101;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.green {\r\n\t\t\t\tbackground-color:#72c100;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.red {\r\n\t\t\t\tbackground-color:#c90021;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.orange {\r\n\t\t\t\tbackground-color:orange;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.touchField {\r\n\t\t\t\tbackground-color:#CCC;\r\n\t\t\t\tmargin-top:40px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.currentAction {\r\n\t\t\t\tbackground-color:#c5ffab;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay ul {\r\n\t\t\t\tlist-style-type:none;\r\n\t\t\t}\r\n\r\n\t\t\t.overlay li {\r\n\t\t\t\tfont-size:30px;\r\n\t\t\t\tfont-weight:normal;\r\n\t\t\t\tpadding-top:14px;\r\n\t\t\t\tpadding-bottom:14px;\r\n\t\t\t}\r\n\t\t</style>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\tvar months = new Array('" . implode("', '", Datum::getGerMonthArray()) . "');\r\n\t\t\tvar days = new Array('" . implode("', '", Datum::getGerWeekArray()) . "');\r\n\t\t\tvar action = '" . ($this->switch ? "G" : "K") . "';\r\n\t\t\tvar inOverlay = false;\r\n\t\t\tvar inTransfer = false;\r\n\t\t\tvar Personal = {$json};\r\n\t\t\tvar PersonalLastUpdate = " . time() . ";\r\n\t\t\tvar timeoutTransfer = null;\r\n\t\t\t\r\n\t\t\t\$(function(){\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tclokk();\r\n\t\t\t\t}, 1000 * 30);\r\n\t\t\t\t\r\n\t\t\t\tclokk();\r\n\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tif(inOverlay || document.activeElement.id == 'chipCode')\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t}, 1000);\r\n\t\t\t\t\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\talive();\r\n\t\t\t\t}, 60000);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfunction alive(){\r\n\t\t\t\tCustomerPage.rme('alive', [" . $_GET["terminalID"] . ", PersonalLastUpdate], function(t){\r\n\t\t\t\t\t\$('#aliveStatus').css('background-color', 'green');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(t != ''){\r\n\t\t\t\t\t\tPersonal = JSON.parse(t);\r\n\t\t\t\t\t\tPersonalLastUpdate = Math.round(Date.now() / 1000);\r\n\t\t\t\t\t\t//console.log(Personal);\r\n\t\t\t\t\t}\r\n\t\t\t\t}, function(){\r\n\t\t\t\t\t\$('#aliveStatus').css('background-color', 'red');\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfunction clokk(){\r\n\t\t\t\tvar jetzt = new Date();\r\n\t\t\t\t\$('#clock').html(jetzt.getHours()+':'+(jetzt.getMinutes() < 10 ? '0' : '')+jetzt.getMinutes());\r\n\t\t\t\t\$('#day').html(days[jetzt.getDay()]+', '+jetzt.getDate()+'. '+months[jetzt.getMonth()]+' '+jetzt.getFullYear());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction heightContent(){\r\n\t\t\t\tvar max = \$j(window).height() / 100 * 88;\r\n\t\t\t\t\r\n\t\t\t\t\$j.each(\$j('.overlayContentSub'), function(k, v){\r\n\t\t\t\t\tmax -= \$j(v).outerHeight();\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn max;\r\n\t\t\t}\r\n\r\n\t\t\tfunction transfer(){\r\n\t\t\t\tif(inOverlay){\r\n\t\t\t\t\ttimeoutTransfer = window.setTimeout(function(){\r\n\t\t\t\t\t\ttransfer();\r\n\t\t\t\t\t}, 60000);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tinTransfer = true;\r\n\t\t\t\tvar timeStack = \$.jStorage.get('pKTimeStack', []);\r\n\t\t\t\t\$.jStorage.set('pKTimeStack', []);\r\n\t\t\t\tinTransfer = false;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tvar transferStack = \$.jStorage.get('pKTransferStack', []);\r\n\t\t\t\tvar newTransferStack = transferStack.concat(timeStack);\r\n\t\t\t\t\$.jStorage.set('pKTransferStack', newTransferStack);\r\n\t\t\t\t\r\n\t\t\t\tif(newTransferStack.length > 0)\r\n\t\t\t\t\tCustomerPage.rme('stampStack', [JSON.stringify(newTransferStack)/*, PersonalLastUpdate*/], function(t){\r\n\t\t\t\t\t\t\$.jStorage.set('pKTransferStack', []);\r\n\t\t\t\t\t\t//console.log('Transfer succeeded!');\r\n\t\t\t\t\t\tcounter();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t/*if(t != ''){\r\n\t\t\t\t\t\t\tPersonal = JSON.parse(t);\r\n\t\t\t\t\t\t\tPersonalLastUpdate = Math.round(Date.now() / 1000);\r\n\t\t\t\t\t\t}*/\r\n\t\t\t\t\t}, function(){\r\n\t\t\t\t\t\t//console.log('Transfer failed!');\r\n\t\t\t\t\t\tcounter();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\ttimeoutTransfer = window.setTimeout(function(){\r\n\t\t\t\t\t\t\ttransfer();\r\n\t\t\t\t\t\t}, 60000);\r\n\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfunction counter(){\r\n\t\t\t\t\$('#transferCounter').html(\$.jStorage.get('pKTimeStack', []).length+'/'+\$.jStorage.get('pKTransferStack', []).length);\r\n\t\t\t}\r\n\r\n\t\t\tfunction stampp(){\r\n\t\t\t\tif(inTransfer){\r\n\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\tstampp();\r\n\t\t\t\t\t}, 20);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tinOverlay = true;\r\n\t\t\t\tvar stack = \$.jStorage.get('pKTimeStack', []);\r\n\t\t\t\tvar chip = \$('#chipCode').val();\r\n\t\t\t\t\r\n\t\t\t\tstack.push({'chip': chip, 'terminal': " . $_GET["terminalID"] . ", 'action': action, 'time': Math.round(Date.now() / 1000)});\r\n\t\t\t\t\$.jStorage.set('pKTimeStack', stack);\r\n\r\n\t\t\t\tvar usePersonal = null;\r\n\t\t\t\tfor (k in Personal) {\r\n\t\t\t\t//console.log(Personal[k].PersonalName+':'+Personal[k].PersonalChipNummer+';'+Personal[k].PersonalChipNummer2+';'+Personal[k].PersonalChipNummer3+';'+Personal[k].PersonalChipNummer4);\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer2){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer3){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(chip == Personal[k].PersonalChipNummer4){\r\n\t\t\t\t\t\tusePersonal = Personal[k];\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\t\tvar color = 'green';\r\n\t\t\t\t\$('#chipCode').val('');\r\n\t\t\t\tif(usePersonal)\r\n\t\t\t\t\t\$j('.overlayText').html(usePersonal.PersonalName);\r\n\t\t\t\telse\r\n\t\t\t\t\t\$j('.overlayText').html('Zeit erfasst');\r\n\t\t\t\t\$j('.overlayDetails').html('');\r\n\r\n\t\t\t\t\$('.overlay').addClass(color).show();\r\n\r\n\t\t\t\tmoep();\r\n\r\n\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\$('.overlay').hide().removeClass(color);\r\n\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t}, " . (isset($_GET["wait"]) ? $_GET["wait"] : "1500") . ");\r\n\t\t\t\t\r\n\r\n\t\t\t\tif(timeoutTransfer){\r\n\t\t\t\t\twindow.clearTimeout(timeoutTransfer);\r\n\t\t\t\t\ttimeoutTransfer = null;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\ttimeoutTransfer = window.setTimeout(function(){\r\n\t\t\t\t\ttransfer();\r\n\t\t\t\t}, 60000 * 2);\r\n\t\t\t\t\r\n\t\t\t\tcounter();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction moep(){\r\n\t\t\t\tif(typeof alex == 'undefined')\r\n\t\t\t\t\treturn;\r\n\t\t\t\tconsole.log(alex);\r\n\t\t\t\talex.beep();\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\$('html').focus(function() {\r\n\t\t\t\tif(inOverlay)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t}); \r\n\r\n\t\t\t\$(function(){\r\n\t\t\t\tmoep();\r\n\t\t\t\tcounter();\r\n\t\t\t\talive();\r\n\t\t\t\ttransfer();\r\n\t\t\t\t\r\n\t\t\t\t\$('.touchField').css('height', \$(window).height() - \$('#displayTime').outerHeight() - 60 - 130);\r\n\t\t\t\t\$('.touchField').hammer().on('touch release', function(ev){\r\n\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', '');\r\n\t\t\t\t\t\t\taction = \$(ev.target).closest('.touchField').data('action');\r\n\t\t\t\t\t\t\t\$('.currentAction').removeClass('currentAction');\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').addClass('currentAction');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t</script>";
     $I = new HTMLInput("chipCode");
     $I->id("chipCode");
     $I->onEnter("stampp();");
     $I->style("background-color:white;border:1px solid white;font-size:30px;width:96%;position:fixed;bottom:50px;");
     $BK = new Button("Kommen", "arrow_right", "iconic");
     $BK->style("font-size:200px;width:auto;");
     $BG = new Button("Gehen", "arrow_left", "iconic");
     $BG->style("font-size:200px;width:auto;");
     $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"G\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:4%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Gehen<br />{$BG}</p>\r\n\t\t\t\t</div><div data-action=\"K\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Kommen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     if ($this->switch) {
         $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"K\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:4%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Kommen<br />{$BG}</p>\r\n\t\t\t\t</div><div data-action=\"G\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Gehen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     }
     $html .= "\r\n\t\t\t<div id=\"transferCounter\" style=\"position:absolute;top:0px;left:0px;padding:3px;color:grey;\"></div>\r\n\t\t\t<div id=\"aliveStatus\" style=\"position:absolute;top:0px;right:0px;height:10px;width:10px;\"></div>\r\n\t\t\t\r\n\t\t\t<div id=\"displayTime\">\r\n\t\t\t\t<div id=\"clock\" style=\"font-size:190px;text-align:center;margin-top:40px;color:#333;\"></div>\r\n\t\t\t\t<div id=\"day\" style=\"font-size:35px;text-align:right;padding-right:45px;margin-top:0px;color:#CCC;\"></div>\r\n\t\t\t</div>\r\n\t\t\t{$actschion}\r\n\t\t\t{$I}\r\n\t\t\t<div class=\"overlay\">\r\n\t\t\t\t<div class=\"overlayCenter\">\r\n\t\t\t\t\t<div class=\"overlayList\"></div>\r\n\t\t\t\t\t<p style=\"font-size:70px;margin-top:60px;font-weight:bold;\" class=\"overlayText\"></p>\r\n\t\t\t\t\t<p style=\"font-size:50px;margin-top:60px;\" class=\"overlayDetails\"></p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     return $html;
 }
Example #2
0
 public function openInPopup($className, $classID, $fieldName)
 {
     $C = new $className($classID);
     $ITA = new HTMLInput("nicEditor", "textarea");
     $ITA->id("nicEditor");
     $ITA->style("width:998px;height:300px;");
     echo $ITA;
     echo OnEvent::script("\n\$j('#nicEditor').val('" . addslashes($C->A($fieldName)) . "'.makeHTML());\n\nsetTimeout(function(){\n\tnew nicEditor({\n\t\ticonsPath : './libraries/nicEdit/nicEditorIconsTiny.gif',\n\t\tbuttonList : ['save','bold','italic','underline','hr'],\n\t\tmaxHeight : 400,\n\n\t\tonSave : function(content, id, instance) {\n\t\t\tif(content.substr(0, 3) != '<p ' && content.substr(0, 3) != '<p>')\n\t\t\t\tcontent = '<p>'+content+'</p>';\n\t\t\t\n\t\t\t" . OnEvent::rme($C, "saveMultiEditField", array("'{$fieldName}'", "content.replace(/<br>/g, '<br />')")) . "\n\n\t\t\t" . OnEvent::closePopup("nicEdit") . "\n\t\t}\n\t}).panelInstance('nicEditor');}, 100);");
 }
 private function noBackupButton()
 {
     $GoAway = new HTMLInput("BackupGoAway", "checkbox");
     $GoAway->id("BackupGoAway");
     $GoAway->style("float:left;margin-right:5px;");
     $BSave = new Button("Einstellung\nspeichern", "save");
     $BSave->style("float:right;");
     $BSave->onclick("if(\$('BackupGoAway').checked) ");
     $BSave->rmePCR("BackupManager", "", "GoAway", "", "Popup.close('','BackupManagerGUI'); contentManager.reloadFrame('contentLeft');");
     return $BSave . $GoAway . " <label for=\"BackupGoAway\" style=\"float:none;text-align:left;width:auto;\">Diese Meldung nicht mehr anzeigen, ich erstelle meine Backups selbst.</label>";
 }
Example #4
0
 public function getPosten(GRLBM $Beleg)
 {
     $T = new HTMLTable(1, "Arbeitsbeschreibung");
     $T->setTableStyle("width:100%;");
     $tinyMCEID = "tinyMCE" . rand(100, 90000000);
     $I = new HTMLInput("textbausteinUnten", "textarea", $Beleg->A("textbausteinUnten"));
     $I->style("width:100%;height:300px;margin-left:10px;");
     $I->id($tinyMCEID);
     $T->addRow(array($I));
     $buttons = "undo redo | pastetext | styleselect fontsizeselect fontselect | bold italic underline forecolor | hr";
     return $T . parent::getPosten($Beleg) . OnEvent::script("if(CCAuftrag.lastTextbausteinUnten != null) \$('[name=textbausteinUnten]').val(CCAuftrag.lastTextbausteinUnten); CCAuftrag.lastTextbausteinUnten = null;" . tinyMCEGUI::editorDokument($tinyMCEID, "function(content){}", $buttons, "../../styles/tinymce/email.css"));
 }
Example #5
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;
 }
Example #6
0
 function getCMSHTML()
 {
     if (!isset($_GET["terminalID"])) {
         return "<p>Keine Terminal-ID per GET übergeben! (terminalID)</p>";
     }
     if (!isset($_GET["done"])) {
         return "<p style=\"font-size:30px;\">Terminal IP: " . $_SERVER['REMOTE_ADDR'] . "<br />Server IP: " . $_SERVER['SERVER_ADDR'] . "</p>" . OnEvent::script("window.setTimeout(function(){ document.location.href=\"?" . $_SERVER['QUERY_STRING'] . "&done=true\"; }, 3000);");
     }
     $html = "\r\n\t\t<style type=\"text/css\">\r\n\t\t\thtml {\r\n\t\t\t\toverflow-y: hidden;\r\n\t\t\t}\r\n\t\t\tbody {\r\n\t\t\t\t/*background-image:url(./images/TimeTerminalBG.svg);\r\n\t\t\t\tbackground-size:100%;*/\r\n\t\t\t\tmargin:0px;\r\n\t\t\t}\r\n\t\t\t.message {\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 0;\r\n\t\t\t\tleft: 0;\r\n\t\t\t\twidth: 100%;\r\n\t\t\t\theight: 100%;\r\n\t\t\t\tbackground-color: #72c100;\r\n\t\t\t\tz-index: 1100;\r\n\t\t\t\tdisplay:none;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlayCenter {\r\n\t\t\t\tposition: fixed;\r\n\t\t\t\ttop: 6%;\r\n\t\t\t\tleft: 3%;\r\n\t\t\t\twidth: 94%;\r\n\t\t\t\theight: 88%;\r\n\t\t\t\tbackground-color: white;\r\n\t\t\t\tz-index: 1101;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.green {\r\n\t\t\t\tbackground-color:#72c100;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.red {\r\n\t\t\t\tbackground-color:#c90021;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.orange {\r\n\t\t\t\tbackground-color:orange;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.touchField {\r\n\t\t\t\tbackground-color:#CCC;\r\n\t\t\t\tmargin-top:40px;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.currentAction {\r\n\t\t\t\tbackground-color:#c5ffab;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t.overlay ul {\r\n\t\t\t\tlist-style-type:none;\r\n\t\t\t}\r\n\r\n\t\t\t.overlay li {\r\n\t\t\t\tfont-size:30px;\r\n\t\t\t\tfont-weight:normal;\r\n\t\t\t\tpadding-top:14px;\r\n\t\t\t\tpadding-bottom:14px;\r\n\t\t\t}\r\n\t\t</style>\r\n\t\t<script type=\"text/javascript\">\r\n\t\t\tvar months = new Array('" . implode("', '", Datum::getGerMonthArray()) . "');\r\n\t\t\tvar days = new Array('" . implode("', '", Datum::getGerWeekArray()) . "');\r\n\t\t\tvar action = '" . ($this->switch ? "G" : "K") . "';\r\n\t\t\tvar inOverlay = false;\r\n\t\t\tvar learnPersonalID = 0;\r\n\t\t\tvar learnChipID = 0;\r\n\t\t\t\r\n\t\t\t\$(function(){\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tclokk();\r\n\t\t\t\t}, 1000 * 30);\r\n\t\t\t\t\r\n\t\t\t\tclokk();\r\n\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t\r\n\t\t\t\twindow.setInterval(function(){\r\n\t\t\t\t\tif(inOverlay || document.activeElement.id == 'chipCode')\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t}, 1000);\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tfunction clokk(){\r\n\t\t\t\tvar jetzt = new Date();\r\n\t\t\t\t\$('#clock').html(jetzt.getHours()+':'+(jetzt.getMinutes() < 10 ? '0' : '')+jetzt.getMinutes());\r\n\t\t\t\t\$('#day').html(days[jetzt.getDay()]+', '+jetzt.getDate()+'. '+months[jetzt.getMonth()]+' '+jetzt.getFullYear());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction heightContent(){\r\n\t\t\t\tvar max = \$j(window).height() / 100 * 88;\r\n\t\t\t\t\r\n\t\t\t\t\$j.each(\$j('.overlayContentSub'), function(k, v){\r\n\t\t\t\t\tmax -= \$j(v).outerHeight();\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn max;\r\n\t\t\t}\r\n\r\n\t\t\tfunction stampp(){\r\n\t\t\t\tinOverlay = true;\r\n\t\t\t\tif(typeof alex != 'undefined' && typeof alex.takePhoto == 'function')\r\n\t\t\t\t\talex.takePhoto();\r\n\t\t\t\t\r\n\t\t\t\tlearnChipID = \$('#chipCode').val();\r\n\r\n\t\t\t\tCustomerPage.rme('stamp', [\$('#chipCode').val(), " . $_GET["terminalID"] . ", action, " . (isset($_GET["learn"]) ? "1" : "0") . ", learnPersonalID], function(t){\r\n\t\t\t\t\tif(t == '')\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tvar r = jQuery.parseJSON(t);\r\n\t\t\t\t\t\$('#chipCode').val('');\r\n\t\t\t\t\tlearnPersonalID = 0;\r\n\t\t\t\t\tif(r.status == 'command' && r.action =='reload'){\r\n\t\t\t\t\t\tdocument.location.reload();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\tvar message = r.message;\r\n\t\t\t\t\tvar color = 'green';\r\n\t\t\t\t\tvar list = '';\r\n\t\t\t\t\tif(r.status == 'error')\r\n\t\t\t\t\t\tcolor = 'red';\r\n\t\t\t\t\tif(r.status == 'learn')\r\n\t\t\t\t\t\tcolor = 'orange';\r\n\r\n\t\t\t\t\tif(r.status == 'learn'){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlist = '<p class=\"overlayContentSub\" style=\"font-size:70px;font-weight:bold;background-color:white;margin-top:-20;\">Bitte wählen Sie:</p>';\r\n\t\t\t\t\t\tlist += '<ul class=\"overlayContentHeight\" style=\"padding-left:0px;padding-top:0px;padding-bottom:0px;margin-top:0;margin-bottom:0;overflow:auto;\">';\r\n\t\t\t\t\t\tfor(var i = 0;i < r.message.length; i++){\r\n\t\t\t\t\t\t\tlist += '<li data-personalid=\"'+r.message[i].PersonalID+'\" class=\"selectionName\" style=\"padding-left:40px;\">'+r.message[i].name+'</li>';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tlist += '</ul>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tlist += '<div class=\"overlayContentSub\" id=\"buttonCancel\" style=\"background-color: rgb(204, 204, 204);padding-top:20px;padding-bottom:20px;font-size:30px;width:50%;display:inline-block;\"><div style=\"padding-left:10px;\"><span style=\"font-size:40px;margin-right:20px;\" class=\"iconic x\"></span> Abbrechen</div></div>';\r\n\t\t\t\t\t\tlist += '<div id=\"buttonSave\" style=\"background-color: rgb(204, 204, 204);padding-top:20px;padding-bottom:20px;width:50%;display:inline-block;font-size:30px;color:grey;\"><div style=\"padding-left:10px;\"><span style=\"font-size:40px;margin-right:20px;\" class=\"iconic check\"></span> Speichern</div></div>';\r\n\t\t\t\t\t\t//return;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t\$j('.overlayText').html(message);\r\n\t\t\t\t\t\$j('.overlayDetails').html('');\r\n\t\t\t\t\t\$j('.overlayList').html(list);\r\n\t\t\t\t\t\$j('.overlayCenter').scrollTop(0);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(r.details)\r\n\t\t\t\t\t\t\$j('.overlayDetails').html(r.details);\r\n\r\n\t\t\t\t\t\$('.overlay').removeClass().addClass('overlay '+color).show();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(\$j('.overlayContentHeight').length)\r\n\t\t\t\t\t\t\$j('.overlayContentHeight').css('height', heightContent());\r\n\r\n\t\t\t\t\tif(r.status == 'learn'){\r\n\t\t\t\t\t\t\$('.selectionName').hammer().on('tap', function(ev){\r\n\t\t\t\t\t\t\t\$j('.selectionName').css('background-color', '');\r\n\t\t\t\t\t\t\t\$j(ev.target).css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\t\t\$j('#buttonSave').css('background-color', '#c5ffab').css('color', '');\r\n\t\t\t\t\t\t\tlearnPersonalID = \$j(ev.target).data('personalid');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\$('#buttonSave').hammer().on('touch release', function(ev){\r\n\t\t\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonSave').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonSave').css('background-color', 'rgb(204, 204, 204)');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif(learnPersonalID == 0)\r\n\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\$('.overlay').hide();\r\n\t\t\t\t\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t\t\t\t\t\t\$('#chipCode').val(learnChipID);\r\n\t\t\t\t\t\t\t\t\tstampp();\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\$('#buttonCancel').hammer().on('touch release', function(ev){\r\n\t\t\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonCancel').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\t\t\$(ev.target).closest('#buttonCancel').css('background-color', 'rgb(204, 204, 204)');\r\n\t\t\t\t\t\t\t\t\t\$('.overlay').hide();\r\n\t\t\t\t\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t\t\t\t\t\tlearnPersonalID = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(r.status != 'learn')\r\n\t\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\t\t\$('.overlay').hide();\r\n\t\t\t\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t\t\t\t\tinOverlay = false;\r\n\t\t\t\t\t\t}, 1500);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(r.status == 'OK')\r\n\t\t\t\t\t\tmoep();\r\n\r\n\r\n\t\t\t\t\tvar stack = \$.jStorage.get('pKTimeStack', [])\r\n\t\t\t\t\tif(stack.length > 0)\r\n\t\t\t\t\t\tCustomerPage.rme('stampStack', [JSON.stringify(stack)], function(t){\r\n\t\t\t\t\t\t\t\$.jStorage.set('pKTimeStack', []);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}, function(){\r\n\t\t\t\t\tvar stack = \$.jStorage.get('pKTimeStack', []);\r\n\t\t\t\t\t//console.log(stack);\r\n\t\t\t\t\tstack.push({'chip': \$('#chipCode').val(), 'terminal': " . $_GET["terminalID"] . ", 'action': action, 'time': Math.round(Date.now() / 1000)});\r\n\t\t\t\t\t\$.jStorage.set('pKTimeStack', stack);\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar color = 'orange';\r\n\t\t\t\t\t\$('#chipCode').val('');\r\n\t\t\t\t\t\$j('.overlayText').html('Zeit erfasst');\r\n\t\t\t\t\t\$j('.overlayDetails').html('Der Server ist nicht erreichbar.');\r\n\r\n\t\t\t\t\t\$('.overlay').addClass(color).show();\r\n\t\t\t\t\t\r\n\t\t\t\t\twindow.setTimeout(function(){\r\n\t\t\t\t\t\t\$('.overlay').hide().removeClass(color);\r\n\t\t\t\t\t}, 1000);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfunction moep(){\r\n\t\t\t\tif(typeof alex == 'undefined')\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\r\n\t\t\t\talex.beep();\r\n\r\n\t\t\t}\r\n\r\n\t\t\t//if(typeof alex != 'undefined')\r\n\t\t\t//\talex.louder(100);\r\n\t\t\t\r\n\t\t\tmoep();\r\n\r\n\t\t\t\$('html').focus(function() {\r\n\t\t\t\tif(inOverlay)\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t\r\n\t\t\t\t\$('#chipCode').focus();\r\n\t\t\t}); \r\n\r\n\t\t\t\$(function(){\r\n\t\t\t\t\$('.touchField').css('height', \$(window).height() - \$('#displayTime').outerHeight() - 40 - 130);\r\n\t\t\t\t\$('.touchField').hammer().on('touch release', function(ev){\r\n\t\t\t\t\tswitch(ev.type){\r\n\t\t\t\t\t\tcase 'touch':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', 'rgba(255,204,0,0.3)');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 'release':\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', '');\r\n\t\t\t\t\t\t\taction = \$(ev.target).closest('.touchField').data('action');\r\n\t\t\t\t\t\t\t\$('.currentAction').removeClass('currentAction');\r\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').addClass('currentAction');\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t</script>";
     $I = new HTMLInput("chipCode");
     $I->id("chipCode");
     $I->onEnter("stampp();");
     $I->style("background-color:white;border:1px solid white;font-size:30px;width:96%;position:fixed;bottom:20px;");
     $BK = new Button("Kommen", "arrow_right", "iconic");
     $BK->style("font-size:200px;width:auto;");
     $BG = new Button("Gehen", "arrow_left", "iconic");
     $BG->style("font-size:200px;width:auto;");
     $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"G\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Gehen<br />{$BG}</p>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div data-action=\"K\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Kommen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     if ($this->switch) {
         $actschion = "\r\n\t\t\t<div>\r\n\t\t\t\t<div data-action=\"K\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Kommen<br />{$BG}</p>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div data-action=\"G\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\r\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Gehen<br />{$BK}</p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     }
     $html .= "\r\n\t\t\t<div id=\"displayTime\">\r\n\t\t\t\t<div id=\"clock\" style=\"font-size:190px;text-align:center;margin-top:40px;color:#333;\"></div>\r\n\t\t\t\t<div id=\"day\" style=\"font-size:35px;text-align:right;padding-right:45px;margin-top:0px;color:#CCC;\"></div>\r\n\t\t\t</div>\r\n\t\t\t{$actschion}\r\n\t\t\t{$I}\r\n\t\t\t<div class=\"overlay\">\r\n\t\t\t\t<div class=\"overlayCenter\">\r\n\t\t\t\t\t<div class=\"overlayList\"></div>\r\n\t\t\t\t\t<p style=\"font-size:70px;margin-top:60px;font-weight:bold;\" class=\"overlayText\"></p>\r\n\t\t\t\t\t<p style=\"font-size:50px;margin-top:60px;\" class=\"overlayDetails\"></p>\r\n\t\t\t\t</div>\r\n\t\t\t</div>";
     return $html;
 }
Example #7
0
 public static function parserDays($w, $l, $E)
 {
     $tag = array();
     $tag[1] = "Montag";
     $tag[2] = "Dienstag";
     $tag[3] = "Mittwoch";
     $tag[4] = "Donnerstag";
     $tag[5] = "Freitag";
     $tag[6] = "Samstag";
     $tag[0] = "Sonntag";
     $R = "";
     $i = 1;
     foreach ($tag as $d) {
         $t = substr($d, 0, 2);
         $I = new HTMLInput("Wecker" . $t, "checkbox", $E->A("Wecker{$t}"));
         $I->id("Wecker{$t}");
         $R .= $I . "<label for=\"Wecker{$t}\" style=\"display:inline-block;float:none;width:100px;text-align:left;\">{$d}</label>";
         if ($i % 2 == 0) {
             $R .= "<br />";
         }
         $i++;
     }
     return $R;
 }
 function getCMSHTML()
 {
     if (!isset($_GET["terminalID"])) {
         return "<p>Keine Terminal-ID per GET übergeben! (terminalID)</p>";
     }
     if (!isset($_GET["done"])) {
         return "<p style=\"font-size:30px;\">Terminal IP: " . $_SERVER['REMOTE_ADDR'] . "<br />Server IP: " . $_SERVER['SERVER_ADDR'] . "</p>" . OnEvent::script("window.setTimeout(function(){ document.location.href=\"?" . $_SERVER['QUERY_STRING'] . "&done=true\"; }, 3000);");
     }
     $html = "\n\t\t<style type=\"text/css\">\n\t\t\thtml {\n\t\t\t\toverflow-y: hidden;\n\t\t\t}\n\t\t\tbody {\n\t\t\t\t/*background-image:url(./images/TimeTerminalBG.svg);\n\t\t\t\tbackground-size:100%;*/\n\t\t\t\tmargin:0px;\n\t\t\t}\n\t\t\t.message {\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t.overlay {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t\tbackground-color: #72c100;\n\t\t\t\tz-index: 1100;\n\t\t\t\tdisplay:none;\n\t\t\t}\n\t\t\t\n\t\t\t.overlayCenter {\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 6%;\n\t\t\t\tleft: 3%;\n\t\t\t\twidth: 94%;\n\t\t\t\theight: 88%;\n\t\t\t\tbackground-color: white;\n\t\t\t\tz-index: 1101;\n\t\t\t}\n\t\t\t\n\t\t\t.green {\n\t\t\t\tbackground-color:#72c100;\n\t\t\t}\n\t\t\t\n\t\t\t.red {\n\t\t\t\tbackground-color:#c90021;\n\t\t\t}\n\t\t\t\n\t\t\t.touchField {\n\t\t\t\tbackground-color:#CCC;\n\t\t\t\tmargin-top:40px;\n\t\t\t}\n\t\t\t\n\t\t\t.currentAction {\n\t\t\t\tbackground-color:#c5ffab;\n\t\t\t}\n\t\t</style>\n\t\t<script type=\"text/javascript\">\n\t\t\tvar months = new Array('" . implode("', '", Datum::getGerMonthArray()) . "');\n\t\t\tvar days = new Array('" . implode("', '", Datum::getGerWeekArray()) . "');\n\t\t\tvar action = 'K';\n\n\t\t\t\$(function(){\n\t\t\t\twindow.setInterval(function(){\n\t\t\t\t\tclokk();\n\t\t\t\t}, 1000 * 30);\n\t\t\t\t\n\t\t\t\tclokk();\n\t\t\t\t\n\t\t\t\t\$('#chipCode').focus();\n\t\t\t});\n\t\t\t\n\t\t\tfunction clokk(){\n\t\t\t\tvar jetzt = new Date();\n\t\t\t\t\$('#clock').html(jetzt.getHours()+':'+(jetzt.getMinutes() < 10 ? '0' : '')+jetzt.getMinutes());\n\t\t\t\t\$('#day').html(days[jetzt.getDay()]+', '+jetzt.getDate()+'. '+months[jetzt.getMonth()]+' '+jetzt.getFullYear());\n\t\t\t}\n\t\t\t\n\t\t\tfunction stampp(){\n\t\t\t\tif(typeof alex != 'undefined')\n\t\t\t\t\talex.takePhoto();\n\t\t\t\t\t\n\t\t\t\tCustomerPage.rme('stamp', [\$('#chipCode').val(), " . $_GET["terminalID"] . ", action], function(t){\n\t\t\t\t\tif(t == '')\n\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\n\t\t\t\t\tvar r = jQuery.parseJSON(t);\n\t\t\t\t\t\$('#chipCode').val('');\n\t\t\t\t\tif(r.status == 'command' && r.action =='reload'){\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar color = 'green';\n\t\t\t\t\tif(r.status == 'error')\n\t\t\t\t\t\tcolor = 'red';\n\n\t\t\t\t\t\$j('.overlayText').html(r.message);\n\t\t\t\t\t\$j('.overlayDetails').html('');\n\t\t\t\t\tif(r.details)\n\t\t\t\t\t\t\$j('.overlayDetails').html(r.details);\n\n\t\t\t\t\t\$('.overlay').addClass(color).show();\n\t\t\t\t\t\n\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\$('.overlay').hide().removeClass(color);\n\t\t\t\t\t}, 2000);\n\t\t\t\t\t\n\t\t\t\t\tif(r.status == 'OK')\n\t\t\t\t\t\tmoep();\n\n\t\t\t\t}, function(){\n\t\t\t\t\tvar color = 'red';\n\t\t\t\t\t\$('#chipCode').val('');\n\t\t\t\t\t\$j('.overlayText').html('Server nicht erreichbar!');\n\t\t\t\t\t\$j('.overlayDetails').html('');\n\n\t\t\t\t\t\$('.overlay').addClass(color).show();\n\t\t\t\t\t\n\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\$('.overlay').hide().removeClass(color);\n\t\t\t\t\t}, 1000);\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\tfunction moep(){\n\t\t\t\tif(typeof alex == 'undefined')\n\t\t\t\t\treturn;\n\t\t\t\t\n\t\t\t\talex.beep();\n\n\t\t\t}\n\n\t\t\t//if(typeof alex != 'undefined')\n\t\t\t//\talex.louder(100);\n\t\t\t\n\t\t\tmoep();\n\n\t\t\t\$('html').click(function() {\n\t\t\t\t\$('#chipCode').focus();\n\t\t\t}); \n\n\t\t\t\$(function(){\n\t\t\t\t\$('.touchField').css('height', \$(window).height() - \$('#displayTime').outerHeight() - 40 - 130);\n\t\t\t\t\$('.touchField').hammer().on('touch release', function(ev){\n\t\t\t\t\tswitch(ev.type){\n\t\t\t\t\t\tcase 'touch':\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', 'rgba(255,204,0,0.3)');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 'release':\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').css('background-color', '');\n\t\t\t\t\t\t\taction = \$(ev.target).closest('.touchField').data('action');\n\t\t\t\t\t\t\t\$('.currentAction').removeClass('currentAction');\n\t\t\t\t\t\t\t\$(ev.target).closest('.touchField').addClass('currentAction');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t</script>";
     $I = new HTMLInput("chipCode");
     $I->id("chipCode");
     $I->onEnter("stampp();");
     $I->style("background-color:white;border:1px solid white;font-size:30px;width:96%;position:fixed;bottom:20px;");
     $BK = new Button("Kommen", "arrow_right", "iconic");
     $BK->style("font-size:200px;width:auto;");
     $BG = new Button("Gehen", "arrow_left", "iconic");
     $BG->style("font-size:200px;width:auto;");
     $actschion = "\n\t\t\t<div>\n\t\t\t\t<div data-action=\"G\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Gehen<br />{$BG}</p>\n\t\t\t\t</div>\n\t\t\t\t<div data-action=\"K\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Kommen<br />{$BK}</p>\n\t\t\t\t</div>\n\t\t\t</div>";
     if ($this->switch) {
         $actschion = "\n\t\t\t<div>\n\t\t\t\t<div data-action=\"K\" class=\"touchField\" style=\"width:48%;display:inline-block;margin-right:3.7%;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;\">Kommen<br />{$BG}</p>\n\t\t\t\t</div>\n\t\t\t\t<div data-action=\"G\" class=\"touchField currentAction\" style=\"width:48%;display:inline-block;vertical-align:top;\">\n\t\t\t\t\t<p style=\"padding:30px;font-size:60px;text-align:right;\">Gehen<br />{$BK}</p>\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "\n\t\t\t<div id=\"displayTime\">\n\t\t\t\t<div id=\"clock\" style=\"font-size:190px;text-align:center;margin-top:40px;color:#333;\"></div>\n\t\t\t\t<div id=\"day\" style=\"font-size:35px;text-align:right;padding-right:45px;margin-top:0px;color:#CCC;\"></div>\n\t\t\t</div>\n\t\t\t{$actschion}\n\t\t\t{$I}\n\t\t\t<div class=\"overlay\">\n\t\t\t\t<div class=\"overlayCenter\">\n\t\t\t\t\t<p style=\"font-size:70px;margin-top:60px;font-weight:bold;\" class=\"overlayText\"></p>\n\t\t\t\t\t<p style=\"font-size:50px;margin-top:60px;\" class=\"overlayDetails\"></p>\n\t\t\t\t</div>\n\t\t\t</div>";
     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 "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 "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 .= " 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->hasFocusEvent) {
                     $this->onfocus .= "focusMe(this);";
                     $this->onblur .= "blurMe(this);";
                 }
                 $this->hasFocusEvent = false;
             }
             return "<textarea\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->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":
             $currentId = ($this->id != null ? $this->id : $this->name) . rand(100, 100000000);
             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%;\"></div>\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\tvar QQUploader = new qq.FileUploader({\n\t\t\t\t\t\t\tmaxSizePossible: '" . ini_get("upload_max_filesize") . "B',\n\t\t\t\t\t\t\telement: \$('{$currentId}'),\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},\n\t\t\t\t\t\t\tonSubmit: function(id, fileName){ \$('progress_{$currentId}').style.display = 'block';},\n\t\t\t\t\t\t\tonComplete: function(id, fileName, transport){ \$('progress_{$currentId}').style.display = 'none'; if(checkResponse(transport)) { {$this->onchange} } },\n\t\t\t\t\t\t\tonProgress: function(id, fileName, loaded, total){ \$('progressBar_{$currentId}').style.width = Math.ceil((loaded / total) * 100)+'%'; }});\n\t\t\t\t\t</script>";
             break;
         case "radio1":
         case "date":
         case "text":
         case "hidden":
         case "submit":
         case "button":
         case "password":
         case "checkbox":
         case "readonly":
             $JS = "";
             if ($this->type == "radio1") {
                 $this->type = "radio";
             }
             if ($this->isDisplayMode) {
                 if ($this->type == "checkbox") {
                     return Util::catchParser($this->value);
                 }
                 if ($this->type == "hidden") {
                     return "";
                 }
                 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("", "./images/i2/calendar.gif");
                 $cal->onclick("\$j('#{$this->id}').focus();");
                 $cal->type("icon");
                 $cal->className("calendarIcon");
                 $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 = new Button("Suche", "./images/i2/details.png");
                 $cal->onclick("\$('{$this->id}').style.display = ''; \$('{$this->id}').value = ''; \$('{$this->id}').focus();");
                 $cal->type("icon");
                 $cal->className("calendarIcon");
                 if ($this->autocomplete[4] != null) {
                     $B2 = $this->autocomplete[4];
                     $B2->style("float:right;margin-left:5px;");
                     $this->style .= "width:80%";
                 } else {
                     $this->style .= "width:87%";
                 }
                 if ($this->autocomplete[1] == null) {
                     $cal->onclick("\$('{$this->id}Display').style.display = ''; \$('{$this->id}Display').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(\"autocomplete\")._renderItem = function( ul, item ) {\n\t\t\t\t\t\treturn \$j( \"<li></li>\" )\n\t\t\t\t\t\t\t.data( \"item.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->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->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->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;
     }
 }
Example #10
0
    public function chatPopup($root = "")
    {
        $S = anyC::getFirst("Websocket", "WebsocketUseFor", "phim");
        $I = new HTMLInput("newMessage");
        $I->style("width:100%;background-color:white;");
        $I->onEnter("phimChat.send();");
        $IC = new HTMLInput("channel", "hidden", "0");
        $IC->id("channel");
        $B = new Button("Neue Nachricht", "star", "iconic");
        $B->style("color:orange;float:right;margin-top:-3px;");
        $B->className("newMessage");
        $BOn = new Button("Online", "{$root}../ubiquitous/phim/userOnline.png", "icon");
        $BOn->style("float:left;display:none;margin-right:3px;margin-top:-2px;");
        $BOn->className("online");
        $BOff = new Button("Offline", "{$root}../ubiquitous/phim/userOffline.png", "icon");
        $BOff->style("float:left;margin-right:3px;margin-top:-2px;");
        $BOff->className("offline");
        $AC = anyC::get("phimUserHidden");
        $hidden = array();
        while ($h = $AC->n()) {
            $hidden[$h->A("phimUserHiddenUserID")] = true;
        }
        $Users = Users::getUsersArray();
        $L = new HTMLList();
        $L->setListID("userList");
        $L->addListStyle("overflow:auto;box-sizing:border-box;");
        $L->noDots();
        $L->addItem($B . "Alle");
        $L->addItemEvent("onclick", "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatText0').show(); phimChat.scroll('chatText0'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0'); \$j('#channel').val('0');");
        $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
        $L->addItemClass("backgroundColor0");
        $L->setItemID("user0");
        $content = "";
        $AC = anyC::get("phim");
        $AC->addAssocV3("phimToUserID", "=", "0");
        $AC->addAssocV3("phimphimGruppeID", "=", "0");
        $AC->addOrderV3("phimID", "DESC");
        $AC->setLimitV3(50);
        while ($M = $AC->n()) {
            $content = "<div><span class=\"username\">" . (isset($Users[$M->A("phimFromUserID")]) ? $Users[$M->A("phimFromUserID")] : "Unbekannt") . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
        }
        $chatAll = "<div class=\"chatWindow\" id=\"chatText0\">{$content}</div>";
        $AC = anyC::get("phimGruppe");
        $AC->addAssocV3("INSTR(phimGruppeMembers, ';" . Session::currentUser()->getID() . ";')", ">", "0");
        $groups = array();
        $chatGroups = "";
        while ($G = $AC->n()) {
            $L->addItem($B . $G->A("phimGruppeName"));
            $L->addItemEvent("onclick", "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatTextg" . $G->getID() . "').show(); phimChat.scroll('chatTextg" . $G->getID() . "'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0'); \$j('#channel').val('g" . $G->getID() . "');");
            $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
            #$L->addItemClass("backgroundColor0");
            $L->setItemID("groupg" . $G->getID());
            $content = "";
            $ACS = anyC::get("phim");
            $ACS->addAssocV3("phimToUserID", "=", "0");
            $ACS->addAssocV3("phimphimGruppeID", "=", $G->getID());
            $ACS->addOrderV3("phimID", "DESC");
            $ACS->setLimitV3(50);
            while ($M = $ACS->n()) {
                $content = "<div><span class=\"username\">" . $Users[$M->A("phimFromUserID")] . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
            }
            $groups[] = $G->getID();
            $chatGroups .= "<div class=\"chatWindow\" style=\"display:none;\" id=\"chatTextg" . $G->getID() . "\">{$content}</div>";
        }
        asort($Users);
        $chatUsers = "";
        foreach ($Users as $ID => $U) {
            if ($ID == Session::currentUser()->getID()) {
                continue;
            }
            if (isset($hidden[$ID])) {
                continue;
            }
            $unread = false;
            $content = "";
            $AC = anyC::get("phim");
            $AC->addAssocV3("phimFromUserID", "=", Session::currentUser()->getID(), "AND", "1");
            $AC->addAssocV3("phimToUserID", "=", $ID, "AND", "1");
            $AC->addAssocV3("phimFromUserID", "=", $ID, "OR", "2");
            $AC->addAssocV3("phimToUserID", "=", Session::currentUser()->getID(), "AND", "2");
            $AC->addOrderV3("phimID", "DESC");
            $AC->setLimitV3(50);
            while ($M = $AC->n()) {
                $content = "<div><span class=\"username\">" . $Users[$M->A("phimFromUserID")] . ": </span>" . $M->A("phimMessage") . "</div>" . $content;
                if (!$M->A("phimRead") and $M->A("phimToUserID") == Session::currentUser()->getID()) {
                    $unread = true;
                }
            }
            $L->addItem($BOn . $BOff . $B . $U);
            $L->addItemEvent("onclick", OnEvent::rme("phim", "setRead", $ID) . "\$j(this).removeClass('highlight'); \$j('.chatWindow').hide(); \$j('#chatText{$ID}').show(); phimChat.scroll('chatText{$ID}'); \$j('#userList .backgroundColor0').removeClass('backgroundColor0'); \$j(this).addClass('backgroundColor0');\$j('#channel').val('{$ID}');");
            $L->addItemStyle("cursor:pointer;margin-left:0;padding:5px;");
            $L->setItemID("user{$ID}");
            if ($unread) {
                $L->addItemClass("highlight");
            }
            $chatUsers .= "<div style=\"display:none;\" class=\"chatWindow\" id=\"chatText{$ID}\">{$content}</div>";
        }
        $content = "<div style=\"width:68%;display:inline-block;vertical-align:top;\">\n\t\t\t\t{$chatAll}\n\t\t\t\t{$chatUsers}\n\t\t\t\t{$chatGroups}\n\t\t\t\t<div>{$I}</div>\n\t\t\t</div><div style=\"width:32%;display:inline-block;vertical-align:top;\">{$L}{$IC}</div>";
        $rp = str_replace("interface/rme.php", "", $_SERVER["SCRIPT_NAME"]);
        if (strpos($_SERVER["SCRIPT_NAME"], "phim.php") !== false) {
            $rp = "../../";
        }
        $physion = "default";
        if (isset($_GET["physion"])) {
            $physion = $_GET["physion"];
        }
        echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>phim</title>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery-1.9.1.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery-ui-1.10.1.custom.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/iconic/iconic.min.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/jquery/jquery.qtip.min.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/P2J.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Aspect.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/handler.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/contentManager.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Interface.js"></script>
		<script type="text/javascript" src="' . $root . '../javascript/Overlay.js"></script>
		<script type="text/javascript" src="' . $root . '../libraries/webtoolkit.base64.js"></script>
		
		<script type="text/javascript" src="' . $root . '../ubiquitous/phim/autobahn.min.js"></script>
		<script type="text/javascript" src="' . $root . '../ubiquitous/phim/phimChat.js"></script>
		<script type="text/javascript">
			contentManager.setRoot("' . $rp . '");
			$j(function(){
				Ajax.physion = "' . $physion . '";
					
				phimChat.init(
					"ws' . ($S->A("WebsocketSecure") ? "s" : "") . '://' . $S->A("WebsocketServer") . ":" . $S->A("WebsocketServerPort") . '/",
					"' . $S->A("WebsocketRealm") . '", 
					' . Session::currentUser()->getID() . ', 
					"' . Session::currentUser()->A("name") . '",
					"' . $S->A("WebsocketToken") . '",
					[' . implode(",", $groups) . '],
					"' . $root . '");
						
				phimChat.scroll("chatText0");
				$j("#userList").css("height", $j(window).height());
			});
		</script>
		<link rel="stylesheet" type="text/css" href="' . $root . '../libraries/jquery/jquery.qtip.min.css" />
		<link rel="stylesheet" type="text/css" href="' . $root . '../styles/' . (isset($_COOKIE["phynx_color"]) ? $_COOKIE["phynx_color"] : "standard") . '/colors.css"></link>
		<link rel="stylesheet" type="text/css" href="' . $root . '../styles/standard/general.css"></link>
		<style type="text/css">
			p {
				padding:5px;
			}
			
			body {
				background-color:#ddd;
			}
			
			html {
				overflow-y: auto;
			}

			.username {
				font-weight:bold;
			}
			
			.chatWindow {
				padding:5px;
				box-sizing:border-box;
				overflow-y: auto;
				height:270px;
				background-color:white;
				border-bottom:3px solid grey;
			}
			
			.newMessage {
				display:none;
			}
			
			.highlight .newMessage {
				display:block;
			}
			
			#darkOverlay {
				position:fixed;
				top:0;
				left:0;
			}
			
			#userList li {
				white-space: nowrap;
				overflow:hidden;
				margin-top:0;
			}
		</style>
	</head>
	<body>
		<div id="darkOverlay" style="background-color:rgba(0,0,0,.7);color:white;"></div>
		' . $content . '
	</body>
</html>';
    }
Example #11
0
 public function __toString()
 {
     #$style = "";
     if ($this->type == "date" and strpos($this->style, "width:") === false) {
         $this->style .= "width:calc(100% - 28px)%;";
     }
     #if($this->style != null) $style = " style=\"$this->style\"";
     switch ($this->type) {
         /*case "JSONMultiText":
         			$data = json_decode($this->value);
         			
         			print_r($data);
         			
         			$L = new HTMLList();
         			$L->noDots();
         			$L->addListStyle("padding:0px;");
         			
         			foreach($data AS $k => $v){
         				$IL = new HTMLInput($this->name."_$k", "text", $v);
         				$BL = new Button("Element hinzufügen");
         				$L->addItem($IL);
         				$L->addItemStyle("margin-left:0px;");
         			}
         			
         			$I = new HTMLInput($this->name, "textarea", $this->value);
         			$I->id($this->name);
         			
         			return $L.$I;
         		break;*/
         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]}'";
             }
             if (isset($this->options[3])) {
                 $BO[] = "'{$this->options[3]}'";
             }
             $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", "tinyMCE", "-1", "editInPopup", $BO, "", "Popup.presets.large");
             $B->className("backgroundColor2");
             $ITA = new HTMLInput($this->name, "hidden", $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->isDisabled ? "disabled=\"disabled\"" : "") . "\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: '" . (($this->options != null and isset($this->options["action"])) ? $this->options["action"] : "./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->multiEditOptions != null) {
                 $this->id($this->name . "ID" . $this->multiEditOptions[1]);
             }
             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 "time2":
             if ($this->type == "time2") {
                 $this->type = "time";
             }
         case "radio1":
         case "date":
         case "email":
         case "text":
         case "hidden":
         case "submit":
         case "number":
         case "button":
         case "password":
         case "checkbox":
         case "readonly":
         case "fileold":
         case "color":
             $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);";
             }
             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->type == "date") {
                     $this->onchange .= "saveMultiEditInput('" . $this->multiEditOptions[0] . "','" . $this->multiEditOptions[1] . "','" . $this->name . "'" . ($this->multiEditOptions[2] != null ? ", " . $this->multiEditOptions[2] : "") . ");";
                 }
             }
             $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\"" : "";
             }
             $data = "";
             foreach ($this->data as $k => $v) {
                 $data .= " data-{$k}=\"{$v}\"";
             }
             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:90%";
                     }
                 }
                 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);
                     if ($this->onchange) {
                         $IN->onchange($this->onchange);
                         $this->onchange = "";
                     }
                     $JS .= $IN;
                     $this->autocomplete[1] = "function(selection){ if(!selection) return false; var oldVal = \$j('#{$this->id}').val(); \$j('#{$this->id}').val(selection.value); if(\$j('#{$this->id}').val() != oldVal) \$j('#{$this->id}').trigger('change'); \$('{$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->value, is_array($this->autocomplete[3]) ? $this->autocomplete[3] : array($this->autocomplete[3]))) . "\"";
                     }
                     $this->onkeyup .= "if(\$j('[name={$this->name}Display]').val() == '') {  \$j('[name={$this->name}]').val(''); } ";
                     $this->id .= "Display";
                     $this->name .= "Display";
                     $this->onkeyup .= "\$j('[name={$this->name}]').val(this.value);";
                 }
                 $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", is_array($this->autocomplete[3]) ? "'" . json_encode($this->autocomplete[3]) . "'" : $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, event); " . ($this->autocomplete[2] ? "\$('{$this->id}').style.display = 'none';" : "") . " return r; },\n\t\t\t\t\t\tchange: function(event, ui) { var r = OnSelectCallback{$this->id}(ui.item, event); " . ($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->title != null ? "title=\"{$this->title}\"" : "") . "\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{$data}\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":
             $data = "";
             foreach ($this->data as $k => $v) {
                 $data .= " data-{$k}=\"{$v}\"";
             }
             return "<option" . ($this->style != null ? " style=\"{$this->style}\"" : "") . " {$data} " . ($this->isDisabled ? "disabled=\"disabled\"" : "") . " " . ($this->isSelected ? "selected=\"selected\"" : "") . " value=\"{$this->value}\">{$this->name}</option>";
             break;
         case "optgroup":
             $html = "<optgroup label=\"" . htmlentities($this->name) . "\">";
             foreach ($this->options as $k => $v) {
                 if (is_object($v)) {
                     $v->isSelected(false);
                     if ($this->parentValue == $k or $v->getValue() == $this->parentValue) {
                         $v->isSelected(true);
                     }
                 }
                 $html .= $v;
             }
             $html .= "</optgroup>";
             return $html;
             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;
                             if ($this->value . "" === "" and $k . "" === "0") {
                                 $isThisIt = false;
                             }
                         } else {
                             $isThisIt = in_array($k, $values);
                         }
                         $html .= "<option " . ($isThisIt ? "selected=\"selected\"" : "") . " value=\"{$k}\">{$v}</option>";
                     } else {
                         if ($v->getType() == "optgroup") {
                             $v->parentValue($this->value);
                         }
                         $v->isSelected(false);
                         if ($this->value == $k or $v->getValue() == $this->value) {
                             $v->isSelected(true);
                         }
                         $html .= $v;
                     }
                 }
             }
             $html .= "</select>";
             return $html;
             break;
     }
 }
Example #12
0
 function getCartHTML($previewMode = false)
 {
     $payVia = "";
     if (count($this->payment) > 0) {
         $payVia = "&payVia='+CookieCart.getPayVia()+'";
     }
     #parameters: 'formID=nix&HandlerName=CookieCartHandler&artikelid='+id+'&action=delete&type='+type,
     if ($this->cookie != "") {
         $html = "\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t<!--\n\t\t\t\t\t\tvar CookieCart = {\n\t\t\t\t\t\t\tjoinFormFields: function(formID){\n\t\t\t\t\t\t\t\tsetString = '';\n\t\t\t\t\t\t\t\tfor(i = 0;i < \$(formID).elements.length;i++) {\n\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].type == 'button') continue;\n\n\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].type == 'radio'){\n\t\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].checked) setString += '&'+\$(formID).elements[i].name+'='+encodeURIComponent(\$(formID).elements[i].value);\n\t\t\t\t\t\t\t\t\t} else if(\$(formID).elements[i].type == 'checkbox'){\n\t\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].checked) setString += '&'+\$(formID).elements[i].name+'=1';\n\t\t\t\t\t\t\t\t\t\telse setString += '&'+\$(formID).elements[i].name+'=0';\n\t\t\t\t\t\t\t\t\t} else if(\$(formID).elements[i].type == 'select-multiple'){\n\t\t\t\t\t\t\t\t\t\tsetString += '&'+\$(formID).elements[i].name+'=';\n\t\t\t\t\t\t\t\t\t\tsubString = '';\n\t\t\t\t\t\t\t\t\t\tfor(j = 0; j < \$(formID).elements[i].length; j++)\n\t\t\t\t\t\t\t\t\t\t\tif(\$(formID).elements[i].options[j].selected) subString += (subString != '' ? ';:;' : '')+\$(formID).elements[i].options[j].value;\n\n\t\t\t\t\t\t\t\t\t\tsetString += subString;\n\n\t\t\t\t\t\t\t\t\t} else setString += '&'+\$(formID).elements[i].name+'='+encodeURIComponent(\$(formID).elements[i].value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn setString;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tgetPayVia: function(){\n\t\t\t\t\t\t\t\tfor(i = 0;i < \$('cart').payVia.length; i++)\n\t\t\t\t\t\t\t\t\tif(\$('cart').payVia[i].checked) return \$('cart').payVia[i].value;\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tdeleteMe: function(id, type){\n\t\t\t\t\t\t\t\tnew Ajax.Request('/index.php', {\n\t\t\t\t\t\t\t\t\tmethod:'post',\n\t\t\t\t\t\t\t\t\tparameters:'r=" . mt_rand(0, 10000) . "&formID=nix&HandlerName=CookieCartHandler&artikelid='+id+'&action=delete&type='+type,\n\t\t\t\t\t\t\t\t\tonSuccess: function(transport){\n\t\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\torderNow: function(){\n\t\t\t\t\t\t\t\t\$('cart').action.value = 'order';\n\n\t\t\t\t\t\t\t\t//if(confirm('Jetzt kaufen?'))\n\t\t\t\t\t\t\t\tnew Ajax.Request('/index.php', {\n\t\t\t\t\t\t\t\t\tmethod:'post',\n\t\t\t\t\t\t\t\t\tparameters: 'r=" . mt_rand(0, 10000) . "&formID=nix&HandlerName=CookieCartHandler{$payVia}'+CookieCart.joinFormFields('cart'),\n\t\t\t\t\t\t\t\t\tonSuccess: function(transport){\n\t\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t\t\t}});\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tupdateAmounts: function(){\n\t\t\t\t\t\t\t\tmultiCMS.formHandler('cart', function(transport){\n\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\tinsertCoupon: function(){\n\t\t\t\t\t\t\t\tif(\$('CouponCode').value == '') {\n\t\t\t\t\t\t\t\t\talert('Bitte geben Sie einen Gutscheincode ein!');\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tnew Ajax.Request('/index.php', {\n\t\t\t\t\t\t\t\t\tmethod:'post',\n\t\t\t\t\t\t\t\t\tparameters: 'r=" . mt_rand(0, 10000) . "&formID=nix&HandlerName=CookieCartHandler&action=insertCoupon&couponCode='+encodeURIComponent(\$('CouponCode').value),\n\t\t\t\t\t\t\t\t\tonSuccess: function(transport){\n\t\t\t\t\t\t\t\t\t\tif(multiCMS.checkResponse(transport))\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.reload();}});\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t-->\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t<style type=\"text/css\">\n\t\t\t\t\t#CookieCart .CookieCartBorderColor td {\n\t\t\t\t\t\tborder-width:0px;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t#CookieCart table th {\n\t\t\t\t\t\ttext-align:left;\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t\n\t\t\t\t<form " . (!$previewMode ? "id=\"cart\"" : "") . " onsubmit=\"return false;\">";
     }
     $tab = $this->table;
     $tab->addHeaderRow(array("", "Menge", "Artikel", "Einzelpreis", "Gesamtpreis", ""));
     #$tab->addColStyle(2, "text-align:right;");
     $tab->addColStyle(4, "text-align:right;");
     $tab->addColStyle(5, "text-align:right;");
     $tab->addColStyle(6, "text-align:right;");
     $steuern = array();
     $gesamt = 0;
     $netto = 0;
     $i = 0;
     if ($this->cookie != "") {
         while ($t = $this->getNextElement()) {
             $num = array_search($t[2], $this->useClass);
             if ($t[2] != "CookieCart") {
                 $c = $this->useClass[$num];
                 $A = new $c($t[0], false);
                 $A->loadMe();
                 $mwst = $this->mwstField[$num];
                 $name = $this->nameField[$num];
                 $preis = $this->preisField[$num];
                 $artikelnummer = $this->artikelnummerField[$num];
             } else {
                 $A = $this;
                 $this->PostenID = $t[0];
                 $mwst = "mwst";
                 $name = "artikelname";
                 $preis = "preis";
                 $artikelnummer = "artikelnummer";
             }
             try {
                 new Staffelpreis(-1);
                 if (class_exists("Staffelpreis")) {
                     $ac = new anyC();
                     $ac->setCollectionOf("Staffelpreis");
                     $ac->addAssocV3("StaffelpreisClass", "=", $this->useClass);
                     $ac->addAssocV3("StaffelpreisClassID", "=", $t[0]);
                     $ac->addAssocV3("StaffelpreisAmount", "<=", $t[1]);
                     $ac->addOrderV3("StaffelpreisAmount", "DESC");
                     $ac->setLimitV3("1");
                     $ac2 = $ac->getNextEntry();
                     if ($ac2 != null) {
                         $A->changeA($preis, $ac2->A("StaffelpreisPrice"));
                     }
                 }
             } catch (Exception $e) {
             }
             if (!isset($steuern[$A->getA()->{$mwst}])) {
                 $steuern[$A->getA()->{$mwst}] = 0;
             }
             $steuern[$A->getA()->{$mwst}] += $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100) * $t[1];
             $gesamt += $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1) * $t[1];
             $netto += $A->getA()->{$preis} * 1 * $t[1];
             $image = $this->invokeParser($this->imagePathCallback[$num], $t[0], $A);
             if ($image != "") {
                 $parsedImage = "<img src=\"{$image}\" />";
             } else {
                 $parsedImage = "";
             }
             if ($this->imageParser != null) {
                 $parsedImage = $this->invokeParser($this->imageParser[$num], $t[0], $A);
             }
             #"<input type=\"input\" style=\"text-align:right;width:60px;\" name=\"amountOf_$t[0]_$t[2]\" value=\"$t[1]\" onkeydown=\"if(event.keyCode == 13) CookieCart.updateAmounts();\" />"
             $IMenge = new HTMLInput("amountOf_{$t['0']}_{$t['2']}", "text", $t[1]);
             $IMenge->style("text-align:right;width:60px;");
             $IMenge->onEnter("CookieCart.updateAmounts();");
             if ($t[2] == "CookieCart" and $t[0] == "1") {
                 $IMenge = $t[1];
             }
             $tab->addRow(array($parsedImage, !$previewMode ? $IMenge : "{$t['1']}", $A->getA()->{$name} . ((isset($A->getA()->{$artikelnummer}) and $A->getA()->{$artikelnummer} != "") ? "<br /><small>Art.Nr. " . $A->getA()->{$artikelnummer} . "</small>" : ""), Util::formatCurrency("de_DE", $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1), true) . "<br /><small>" . Util::formatNumber("de_DE", $A->getA()->{$mwst} * 1, 2, true, false) . "%</small>", Util::formatCurrency("de_DE", $A->getA()->{$preis} * 1 * ($A->getA()->{$mwst} / 100 + 1) * $t[1], true), !$previewMode ? "<img style=\"cursor:pointer;\" onclick=\"CookieCart.deleteMe('{$t[0]}','{$t['2']}');\" alt=\"Artikel aus Warenkorb löschen\" title=\"Artikel aus Warenkorb löschen\" src=\"{$this->trashImage}\" />" : ""));
             $tab->addCellStyle(1, "vertical-align:top;");
             $tab->addCellStyle(2, "vertical-align:middle;");
             $tab->addCellStyle(3, "vertical-align:middle;");
             $i++;
         }
         if ($this->versandkostenBrutto != null) {
             $tab->addRow(array("", "1", $this->versandkostenBrutto[0], Util::formatCurrency("de_DE", $this->versandkostenBrutto[1], true), Util::formatCurrency("de_DE", $this->versandkostenBrutto[1], true)));
             $gesamt += $this->versandkostenBrutto[1];
             $netto += Util::kRound($this->versandkostenBrutto[1] / ($this->versandkostenBrutto[2] + 100) * 100, 2);
             $steuern[number_format($this->versandkostenBrutto[2], 2)] += Util::kRound($this->versandkostenBrutto[1] / ($this->versandkostenBrutto[2] + 100) * $this->versandkostenBrutto[2], 2);
         }
         $s = "";
         foreach ($steuern as $key => $value) {
             $s .= ($s != "" ? "<br />" : "") . "" . Util::formatNumber("de_DE", $key * 1, 2, true, false) . "%: " . Util::formatCurrency("de_DE", $value, true);
         }
         $tab->addRow(array(!$previewMode ? "\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvalue=\"Mengen speichern\"\n\t\t\t\t\t\t\t\tonclick=\"CookieCart.updateAmounts();\"\n\t\t\t\t\t\t\t/>" : "", "", "", "Gesamt Netto", Util::formatCurrency("de_DE", $netto, true), ""));
         $tab->addCellStyle(1, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(2, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(3, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(4, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(5, "border-top-width:1px;border-top-style:solid;");
         $tab->addCellStyle(6, "border-top-width:1px;border-top-style:solid;");
         $tab->addRowClass("CookieCartBorderColor");
         $tab->addRowColspan(1, 3);
         $tab->addRow(array("", "", "", "Gesamt MwSt", $s, ""));
         $tab->addRow(array("", "", "", "Gesamt", Util::formatCurrency("de_DE", $gesamt, true), ""));
         $tab->addCellStyle(4, "font-weight:bold;border-top-style:solid;border-top-width:1px;");
         $tab->addCellStyle(5, "font-weight:bold;border-top-style:solid;border-top-width:1px;");
         $tab->addRowClass("CookieCartBorderColor");
         #$tab->addCellStyle(2, "text-align:right;");
         if (!$previewMode) {
             $coupon = "";
             if ($this->couponCallback !== null) {
                 $showCouponField = $this->invokeParser($this->couponCallback, "showCouponField", null);
                 if ($showCouponField === true) {
                     $CI = new HTMLInput("CouponCode");
                     $CI->id("CouponCode");
                     $CI->onEnter("CookieCart.insertCoupon();");
                     $CB = new HTMLInput("CouponInsert", "button", "Gutschein einlösen");
                     $CB->style("margin-top:5px;");
                     $CB->onclick("CookieCart.insertCoupon();");
                 } else {
                     $CI = "";
                     $CB = $showCouponField;
                 }
                 $coupon = "<div class=\"CookieCartCoupon\"><p><b>Gutschein-Code:</b><br />{$CI}<br>{$CB}</p></div>";
             }
             $tab->addRow(array($coupon, "", ""));
             $tab->addRowStyle("height:30px;");
             $tab->addRowColspan(1, 4);
         }
         if (count($this->payment) > 0 and !$previewMode and $this->payNowButton == null) {
             $pay = "";
             foreach ($this->payment as $k => $v) {
                 if ($pay != "") {
                     $pay .= "<br /><br />";
                 }
                 switch ($v) {
                     case "PayPal":
                         $pay .= "<input name=\"payVia\" value=\"{$v}\" type=\"radio\" " . ($pay == "" ? "checked=\"checked\"" : "") . " />\n\t\t\t\t\t\t\t<img src=\"https://www.paypal.com/de_DE/DE/i/logo/logo_80x35.gif\" alt=\"PayPal\">";
                         break;
                     case "Überweisung":
                         $pay .= "<input name=\"payVia\" value=\"{$v}\" type=\"radio\" " . ($pay == "" ? "checked=\"checked\"" : "") . " /> Überweisung";
                         break;
                     case "Kreditkarte":
                         $pay .= "<input name=\"payVia\" value=\"{$v}\" type=\"radio\" " . ($pay == "" ? "checked=\"checked\"" : "") . " /> Kreditkarte";
                         break;
                 }
             }
             $tab->addRow(array("", "", "", "Zahlung via", "{$pay}"));
             $tab->addCellStyle(4, "vertical-align:top;");
             $tab->addRow(array("", "", "", "", ""));
             $tab->addRowStyle("height:30px;");
         }
         if (!$previewMode and $this->payNowButton === null) {
             $tab->addRow(array("", "", "", "\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tvalue=\"Jetzt verbindlich bestellen\"\n\t\t\t\t\t\t\t\tstyle=\"border-color:green;width:220px;height:30px;color:green;\"\n\t\t\t\t\t\t\t\tonclick=\"CookieCart.orderNow();\"\n\t\t\t\t\t\t\t/>"));
             $tab->addRowColspan(4, 3);
         } elseif (!$previewMode and $this->payNowButton != null and $this->payNowButton != "") {
             $tab->addRow(array("<a href=\"{$this->payNowURL}\"><img alt=\"jetzt Bezahlen\" title=\"jetzt Bezahlen\" src=\"{$this->payNowButton}\" /></a>"));
             $tab->addRowColspan(1, 6);
             $tab->addCellStyle(1, "text-align:right;");
         }
         $html .= $tab->getHTML();
         $html .= "<input type=\"hidden\" name=\"returnP\" value=\"{$_GET['p']}\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"HandlerName\" value=\"CookieCartHandler\" />\n\t\t\t\t\t\t<input type=\"hidden\" name=\"action\" value=\"updateAll\" />\n\t\t\t\t</form>";
     } else {
         $html = "<p>Ihr Warenkorb enthält keine Artikel.</p>";
     }
     $_SESSION["CookieCart"] = $this;
     $this->elementPointer = 0;
     /*echo "<pre>";
     		echo $this->getCartText(false);
     		echo "</pre>";*/
     return "<div id=\"CookieCart\">" . $html . "</div>";
 }
Example #13
0
 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;
 }
Example #14
0
 public static function timeTillParser($w, $f, $E)
 {
     if ($f == "") {
         $f = "TodoTillTime";
     }
     $f2 = "TodoFromTime";
     if ($f == "TodoFromTime") {
         $f2 = "TodoTillTime";
     }
     $rawTime = Util::CLTimeParser($w, "store");
     $down = floor($rawTime / (15 * 60)) * 15 * 60;
     $up = ceil($rawTime / (15 * 60)) * 15 * 60;
     if (Util::CLTimeParser($down) == $w) {
         $down -= 15 * 60;
         $up += 15 * 60;
     }
     $I = new HTMLInput($f, "time", $w);
     $I->style("width:50px;text-align:right;");
     $I->id($f);
     if ($f == "TodoFromTime") {
         $I->connectTo("TodoTillTime");
     }
     $values = array($down - 900 * 2, $down - 900, $down, $up, $up + 900);
     if ($f == "TodoFromTime") {
         $values = array($down, $up, $up + 900, $up + 900 * 2, $up + 900 * 3);
     }
     /*$T = new HTMLTable(count($values));
     		$T->setTableStyle("margin-top:5px;display:none;");
     		$val = array_map("Util::CLTimeParser", $values);
     		$T->addRow($val);
     		$T->setTableID("{$f}Table");
     
     		for($i = 1; $i < 6; $i++){
     			#$T->setColClass($i, "");
     			
     			$T->setColWidth($i, (100 / count($values))."%");
     			$T->addCellStyle($i, "cursor:pointer;text-align:center;color:grey;");
     			$T->addCellEvent($i, "mouseover", "this.className = 'backgroundColor0';");
     			$T->addCellEvent($i, "mouseout", "this.className = '';");
     			
     			$T->addCellEvent($i, "click", "$('$f').value = '".Util::CLTimeParser($values[$i-1])."'; ".($f == "TodoFromTime" ? "$('$f2').value = '".Util::CLTimeParser($values[$i-1] + 3600)."';" : ""));
     		}*/
     return "<span id=\"{$f}Display\" style=\"" . ($E->A("TodoAllDay") ? "display:none;" : "") . "\" ><span style=\"color:grey;margin-left:30px;\">um</span> " . $I . "</span>";
     #.($w != "" ? $T : "")
 }
Example #15
0
 public static function parserOrt($w, $l, $p)
 {
     $I1 = new HTMLInput("ort", "text", $w);
     $I1->style("width:185px;");
     $I1->id("ort");
     if (is_object($p)) {
         if ($p instanceof AkquiseGUI) {
             $I1->style("width:170px;");
         }
         $p = $p->A("plz");
     }
     $I2 = new HTMLInput("plz", "text", $p);
     $I2->style("width:50px;text-align:right;margin-right:10px;");
     $I2->id("plz");
     return $I2 . $I1;
 }
Example #16
0
 public function getHTML($id, $page)
 {
     $entries = $_SESSION["CurrentAppPlugins"]->getMenuEntries();
     $icons = $_SESSION["CurrentAppPlugins"]->getIcons();
     $targets = $_SESSION["CurrentAppPlugins"]->getMenuTargets();
     $appMenuDisplayed = MenuGUI::getAppMenuOrder("appMenuDisplayed");
     if ($appMenuDisplayed != "") {
         $appMenuDisplayed = explode(";", $appMenuDisplayed);
     } else {
         $appMenuDisplayed = $entries;
     }
     ksort($entries);
     $request = array_values($entries);
     $xml = self::getSpell($request);
     #$AP3 = new AppPlugins("customer");
     #$plugins = array_merge($plugins, $AP3->getAllPlugins());
     #$menu = array_merge($menu, array_flip($AP3->getAllMenuEntries()));
     #$icons = array_merge($icons, $AP3->getIcons());
     #$plugins3 = array_flip($AP3->getAllPlugins());
     #print_r($plugins3);
     $AP = new AppPlugins(Applications::activeApplication());
     $plugins = array_flip($AP->getAllPlugins());
     $html = "";
     $html .= "<div style=\"float:right;width:160px;padding-top:20px;\" id=\"containerSortTabs\">" . $this->getSortable(false) . "</div>\n\t\t\t<div style=\"margin-right:160px;\">";
     $U = new mUserdata();
     $U->addAssocV3("typ", "=", "TTP");
     $collapsedTabs = Environment::getS("collapsedTabs", "0") == "1";
     foreach ($entries as $key => $value) {
         $text = "";
         if ($xml !== false) {
             foreach ($xml->plugin as $xmlp) {
                 if ($xmlp->name == $value) {
                     $text = $xmlp->description;
                 }
             }
         }
         if (isset($plugins[$value])) {
             unset($plugins[$value]);
         }
         $BG = new Button("Plugin {$key} öffnen", "navigation", "icon");
         $BG->onclick("contentManager.loadPlugin('" . (isset($targets[$value]) ? $targets[$value] : "contentRight") . "', '{$value}', '{$value}GUI;-');");
         $BG->style("float:right;margin-top:-7px;");
         $B = new Button($key, $icons[$value], "icon");
         $B->style("float:left;margin-right:10px;margin-top:-7px;margin-left:-5px;");
         $I = new HTMLInput("usePlugin{$value}", "checkbox", in_array($value, $appMenuDisplayed) ? "1" : "0");
         $I->id("usePlugin{$value}");
         $I->onchange("if(this.checked) { Menu.showTab('{$value}'); \$j('#minPlugin{$value}').prop('disabled', ''); } else { Menu.hideTab('{$value}'); \$j('#minPlugin{$value}').prop('disabled', 'disabled'); }");
         $t = !$_SESSION["S"]->isUserAdmin() ? $U->getUDValueCached("ToggleTab{$value}") : "big";
         if ($t == null and $collapsedTabs) {
             $t = "small";
         }
         if ($t == null) {
             $t = "big";
         }
         $IM = new HTMLInput("minPlugin{$value}", "checkbox", $t == "big" ? "0" : "1");
         $IM->id("minPlugin{$value}");
         $IM->onchange("toggleTab('{$value}');");
         if (isset($_COOKIE["phynx_layout"]) and ($_COOKIE["phynx_layout"] == "vertical" or $_COOKIE["phynx_layout"] == "desktop")) {
             $IM->isDisabled(true);
         }
         if (!in_array($value, $appMenuDisplayed)) {
             $IM->isDisabled(true);
         }
         #border-width:1px;border-style:solid;
         $html .= "\n\t\t\t<div style=\"width:33%;float:left;\">\n\t\t\t\t<div style=\"margin:10px;\" class=\"borderColor1 spell\">\n\t\t\t\t\t<div class=\"backgroundColor2\" style=\"padding:10px;padding-bottom:5px;\">\n\t\t\t\t\t\t{$BG}{$B}<h2 style=\"margin-bottom:0px;margin-top:0px;\">{$key}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"padding:7px;\">\n\t\t\t\t\t\t{$I}<label style=\"float:none;width:200px;text-align:left;display:inline;margin-left:10px;font-wight:normal;\" for=\"usePlugin{$value}\">Plugin verwenden</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"padding:7px;padding-top:0px;\">\n\t\t\t\t\t\t{$IM}<label style=\"float:none;width:200px;text-align:left;display:inline;margin-left:10px;font-wight:normal;\" for=\"minPlugin{$value}\">Reiter minimiert</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t" . ($xml !== false ? "<div style=\"padding:7px;height:115px;overflow:auto;\">{$text}</div>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "</div><h2 style=\"clear:both;padding-top:50px;\">Admin-Plugins und Plugins ohne eigenen Reiter</h2><div style=\"margin-right:160px;\">";
     $icons = $AP->getIcons();
     $plugins = array_flip($plugins);
     $menu = array_flip($AP->getAllMenuEntries());
     $AP2 = new AppPlugins("plugins");
     $plugins = array_merge($plugins, $AP2->getAllPlugins());
     $menu = array_merge($menu, array_flip($AP2->getAllMenuEntries()));
     $icons = array_merge($icons, $AP2->getIcons());
     $plugins2 = array_flip($AP2->getAllPlugins());
     $request = array_values($plugins);
     $xml = self::getSpell($request);
     ksort($plugins);
     foreach ($plugins as $key => $value) {
         if (isset($menu[$value])) {
             $key = $menu[$value];
         }
         $text = "";
         if ($xml !== false) {
             foreach ($xml->plugin as $xmlp) {
                 if ($xmlp->name == $value) {
                     $text = $xmlp->description;
                 }
             }
         }
         if ($text == "" or $text == "-") {
             continue;
         }
         if (!isset($plugins2[$value]) and substr($AP->getFolderOfPlugin($value), 0, 3) == "../") {
             continue;
         }
         if (isset($plugins2[$value]) and substr($AP2->getFolderOfPlugin($value), 0, 3) == "../") {
             continue;
         }
         if (!isset($plugins2[$value])) {
             $isAdmin = $AP->getIsAdminOnly($value);
         }
         if (isset($plugins2[$value])) {
             $isAdmin = $AP2->getIsAdminOnly($value);
         }
         $B = new Button($key, $icons[$value], "icon");
         $B->style("float:left;margin-right:10px;margin-top:-7px;margin-left:-5px;");
         #border-width:1px;border-style:solid;
         $html .= "\n\t\t\t<div style=\"width:33%;float:left;\">\n\t\t\t\t<div style=\"margin:10px;border-radius:5px;\" class=\"borderColor1 spell\">\n\t\t\t\t\t<div class=\"backgroundColor2\" style=\"padding:10px;padding-bottom:5px;\">\n\t\t\t\t\t\t{$B}<span style=\"float:right;margin-top:7px;\">" . ($isAdmin ? "Admin!" : "") . "</span><h2  style=\"margin-bottom:0px;margin-top:0px;\">{$key}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t\t" . ($xml !== false ? "<div style=\"padding:7px;height:115px;overflow:auto;\">{$text}</div>" : "") . "\n\t\t\t\t</div>\n\t\t\t</div>";
     }
     $html .= "</div>";
     #echo "<pre>";
     #print_r($menu);
     #echo "</pre>";
     return $html;
 }
Example #17
0
 public function openInPopup($className, $classID, $fieldName)
 {
     $C = new $className($classID);
     $tinyMCEID = "tinyMCEEditor" . rand(100, 9000000);
     $ITA = new HTMLInput("tinyMCEEditor", "textarea", $C->A($fieldName));
     $ITA->id($tinyMCEID);
     $ITA->style("width:1000px;height:300px;");
     echo "<div style=\"width:1000px;\">" . $ITA . "</div>";
     $buttons = "save | undo redo | pastetext | styleselect fontsizeselect fontselect | bold italic underline forecolor | hr code fullscreen";
     echo OnEvent::script("\n\t\t\t\$j('#{$tinyMCEID}').css('height', contentManager.maxHeight());\nsetTimeout(function(){\n\t" . $this->editorDokument($tinyMCEID, "function(content){" . OnEvent::rme($C, "saveMultiEditField", array("'{$fieldName}'", "content.getContent()")) . "" . OnEvent::closePopup("tinyMCE") . "}", $buttons) . "\n\t\t\t\n\t\t}, 100);");
 }
Example #18
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 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);");
     return $I;
 }
    public function editInPopup($formID, $fieldName, $variablesCallback = null)
    {
        $ITA = new HTMLInput("tinyMCEEditor", "textarea");
        $ITA->id("tinyMCEEditor");
        $ITA->style("width:100%;height:500px;");
        if ($variablesCallback != null) {
            echo "<div style=\"float:right;width:190px;margin:5px;\">\n\t\t\t\t\t<p><small>Sie können folgende Variablen in Ihrem Text verwenden (bitte beachen Sie Groß- und Kleinschreibung):</small></p>\n\t\t\t\t\t<p style=\"margin-top:5px;\" id=\"tinyMCEVars\"></p></div>";
        }
        echo "<div style=\"width:" . ($variablesCallback != null ? "800" : "1000") . "px;\">" . $ITA . "</div>";
        #$rand = rand(100, 13454832910);
        echo '
			<style type="text/css">
				#tinyMCEEditor_toolbargroup table {
					width:auto;
					margin:0px;
				}
			</style>
			<script type="text/javascript">
				tinymce.create("tinymce.plugins.ExamplePlugin", {
					createControl: function(n, cm) {
						switch (n) {
							case "mylistbox":
								var mlb = cm.createListBox("mylistbox", {
									 title : "Variablen",
									 onselect : function(v) {
										 tinyMCE.activeEditor.windowManager.alert("Value selected:" + v);
									 }
								});

								// Add some values to the list box
								mlb.add("Some item 1", "val1");
								mlb.add("some item 2", "val2");
								mlb.add("some item 3", "val3");
								mlb.add("some item 4", "val4");

								// Return the new listbox instance
								return mlb;
						}

						return null;
					}
				});
				
				tinymce.PluginManager.add("variablen", tinymce.plugins.ExamplePlugin);

				if(!$("tinyMCEEditor").value.match("</p>"))
					$("tinyMCEEditor").value = $("' . $formID . '").' . $fieldName . '.value.replace(/\\n/g, "<br />");
				else
					$("tinyMCEEditor").value = $("' . $formID . '").' . $fieldName . '.value;
				$j("#tinyMCEEditor").tinymce({
				mode : "textareas",
				theme : "advanced",
					plugins: "-variablen,save,table,spellchecker,searchreplace,insertdatetime,paste,inlinepopups,pagebreak,preview,media,layer,advimage,style,safari,tabfocus",
					theme_advanced_buttons1 : "save,|,undo,redo,|,cut,copy,paste,pastetext,pasteword,|,search,replace,|,charmap,|,insertdate,inserttime,removeformat,code",
					theme_advanced_buttons2 : "mylistbox,|,bold,italic,underline,|,forecolor",
					theme_advanced_buttons3 : null,
					save_onsavecallback : function(content){ $("' . $formID . '").' . $fieldName . '.value = content.getContent(); },
					theme_advanced_toolbar_location : "top"/*,
					theme_advanced_toolbar_align : "left",
					theme_advanced_statusbar_location : "bottom",
					theme_advanced_resizing : false*/
				});
				' . ($variablesCallback != null ? "{$variablesCallback}();" : "") . '
			</script>';
    }
Example #21
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 = "";
     $tab = new HTMLTable(2);
     $tab->setColWidth(1, "120px;");
     $tab->addLV("Absender:", "{$data['fromName']}<br /><small>&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>&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);
     }
     $tab->addLV("Betreff:", "<input type=\"text\" id=\"EMailSubject{$dataClassID}\" value=\"{$data['subject']}\" />");
     $html .= $tab;
     $html .= "<div style=\"width:94%;margin:auto;\"><textarea 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;");
     $BGo = new Button("E-Mail\nsenden", "okCatch");
     $BGo->style("float:right;margin-top:10px;");
     if (strpos($data["body"], "<p") !== false) {
         $BGo->doBefore("nicEditors.findEditor('EMailBody{$dataClassID}').saveContent(); %AFTER");
     }
     $BGo->rmePCR(str_replace("GUI", "", $dataClass), $dataClassID, "sendEmail", array("\$('EMailSubject{$dataClassID}').value", "\$('EMailBody{$dataClassID}').value", (is_array($data["recipients"]) and 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");
     $html .= $tab;
     if (strpos($data["body"], "<p") !== false) {
         echo OnEvent::script("\n\t\t\t\tsetTimeout(function(){\n\t\t\tnew nicEditor({\n\t\t\t\ticonsPath : './libraries/nicEdit/nicEditorIconsTiny.gif',\n\t\t\t\tbuttonList : ['bold','italic','underline'],\n\t\t\t\tmaxHeight : 400\n\t\t\t}).panelInstance('EMailBody{$dataClassID}');}, 100);");
     }
     if ($return) {
         return $html;
     } else {
         echo $html;
     }
 }
Example #22
0
    $IGo->style("border:1px solid grey;margin-left:10px;padding:2px;");
    #$IGo->onclick("document.location.href='?RSSFilterID=$_GET[RSSFilterID]&manualMultiDL=true&manualMultiDL1='+document.getElementById('manualMultiDL1').value;");#+'&manualMultiDL2='+document.getElementById('manualMultiDL2').value+'&manualMultiDL3='+document.getElementById('manualMultiDL3').value+'&manualMultiDL4='+document.getElementById('manualMultiDL4').value+'&manualMultiDL5='+document.getElementById('manualMultiDL5').value
    $html = emoFatalError("Manual Download</h1><p>Please input the links here one per line:</p><form action=\"./FilteredFeed.php\" method=\"get\">" . implode(" ", $ILinks) . $IGo . "</form>" . "<h1>", $added, "trinityDB automatic downloader", false, false);
    die($html);
}
if (isset($_GET["getLink"]) and isset($_GET["fromPage"]) or isset($_GET["manualDL"])) {
    if (isset($_GET["manualDL"])) {
        $result = $RSF->download($_GET["manualDL"]);
        $dled = $_GET["manualDL"];
    } else {
        $result = $Adapter->download($RSF, $_GET["getLink"], $_GET["fromPage"]);
        $dled = $_GET["getLink"];
    }
    if ($result !== true) {
        $ILink = new HTMLInput("manualDL");
        $ILink->id("manualDL");
        $ILink->style("border:1px solid grey;width:400px;padding:2px;");
        $IGo = new HTMLInput("go", "button", "Go");
        $IGo->style("border:1px solid grey;margin-left:10px;padding:2px;");
        $IGo->onclick("if(document.getElementById('manualDL').value != '') document.location.href='?RSSFilterID={$_GET['RSSFilterID']}&manualDL='+document.getElementById('manualDL').value; else alert('Please input a link!');");
        $html = emoFatalError($result[0] . "</h1><p>Look for <b>" . basename($dled) . "</b></p><p>Please input the link here: " . $ILink . $IGo . "</p><h1>", $result[1], "trinityDB automatic downloader", false, false);
        $html = str_replace("<!-- MORE SPACE -->", "<iframe src=\"{$_GET['fromPage']}\" style=\"width:100%;border:0px;height:550px;margin-top:5px;\"></iframe>", $html);
        die($html);
    } else {
        echo "<!DOCTYPE html>\n\t\t<html lang=\"en\">\n\t\t\t<head>\n\t\t\t\t<meta charset=\"utf-8\" />\n\t\t\t\t<title>trinityDB automatic downloader</title>" . RSSFilter::getStyle() . "\n\t\t\t</head>\n\t\t\t<body>\n\t\t\t\t<div class=\"backgroundColor0\">\n\t\t\t\t\t<h1>Download OK</h1>\n\t\t\t\t\t<p>" . basename($dled) . "</p>\n\t\t\t\t\t<p>From <a href=\"{$_GET['fromPage']}\">{$_GET['fromPage']}</a></p>\n\t\t\t\t</div>\n\t\t\t</body>\n\t\t</html>";
    }
    exit;
}
$tvdbUnavailable = false;
$tvdb = new thetvdbcomAdapter();
$nonupdated = 0;