public function openInPopup($className, $classID, $fieldName) { $T = new tinyMCEGUI(); return $T->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(" \$j('#nicEditor').val('".addslashes($C->A($fieldName))."'.makeHTML()); setTimeout(function(){ new nicEditor({ iconsPath : './libraries/nicEdit/nicEditorIconsTiny.gif', buttonList : ['save','bold','italic','underline','hr'], maxHeight : 400, onSave : function(content, id, instance) { if(content.substr(0, 3) != '<p ' && content.substr(0, 3) != '<p>') content = '<p>'+content+'</p>'; ".OnEvent::rme($C, "saveMultiEditField", array("'$fieldName'", "content.replace(/<br>/g, '<br />')"))." ".OnEvent::closePopup("nicEdit")." } }).panelInstance('nicEditor');}, 100);");*/ }
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")); }
/** * 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;\"><{$data['fromAddress']}></small>"); if (is_array($data["recipients"])) { if (count($data["recipients"]) == 1) { $tab->addLV("Empfänger:", $data["recipients"][0][0] . "<br /><small style=\"color:grey;\"><" . $data["recipients"][0][1] . "></small>"); } else { $recipients = array(); foreach ($data["recipients"] as $ID => $Rec) { $recipients[$ID] = new HTMLInput($Rec[0] . " <" . $Rec[1] . ">", "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; } }