Fixed the variable picker in the wysiwyg editor now correctly shows the process variables, and also the maborak.js has been rebuild in order to add the tinymce library

This commit is contained in:
Gustavo Cruz
2012-11-29 12:46:24 -04:00
parent f55ff5bdae
commit 05d6a3181b
6 changed files with 1681 additions and 16 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -36,8 +36,7 @@ function pmVariablePicker(field_name, url, type, win) {
var uloc=String(location);
//alert(uloc);
var new_text = uloc.split('/');
var loc='/'+new_text[3]+'/'+new_text[4]+'/'+new_text[5]+'/controls/varsAjax?displayOption=tinyMCE&sSymbol=@@';
var loc='/'+new_text[3]+'/'+new_text[4]+'/'+new_text[5]+'/controls/varsAjax?displayOption=tinyMCE&sSymbol=@@&&sProcess='+tinyMCE.activeEditor.processID;
var strPluginPath = tinyMCE.activeEditor.plugins.pmVariablePicker.getPluginURL(); // get the path to the uploader plugin
var strUploaderURL = strPluginPath + "/uploader.php"; // generate the path to the uploader script
var strUploadPath = tinyMCE.activeEditor.getParam('plugin_pmVariablePicker_upload_path'); // get the relative upload path

View File

@@ -42,6 +42,7 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
public $height = '300';
public $defaultValue = '<br/>';
public $editorType = '';
public $processID = '';
/**
* render function returns the HTML definition for the Dynaform Field
*
@@ -81,6 +82,8 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
switch ($this->editorType){
case 'EMAIL_TEMPLATE':
$editorDefinition .= '
// is necessary the process uid variable in order to load the picker correctly
var formProcessID = document.getElementById("form[pro_uid]").value;
tinyMCE.init({
theme : "advanced",
plugins : "advhr,advimage,advlink,advlist,autolink,autoresize,autosave,contextmenu,directionality,emotions,example,example_dependency,fullpage,fullscreen,iespell,inlinepopups,insertdatetime,layer,legacyoutput,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,print,save,searchreplace,spellchecker,style,tabfocus,table,template,visualblocks,visualchars,wordcount,xhtmlxtras,pmSimpleUploader,pmVariablePicker",
@@ -93,7 +96,9 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
theme_advanced_buttons1 : "pmSimpleUploader,|,pmVariablePicker,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,cut,copy,paste,|,bullist,numlist,|,outdent,indent,blockquote",
theme_advanced_buttons2 : "tablecontrols,|,undo,redo,|,link,unlink,image,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,sub,sup,|,ltr,rtl,|,code",
oninit: function (){
tinyMCE.activeEditor.processID =formProcessID;
},
onchange_callback: function(inst) {
if(inst.isDirty()) {
inst.save();
@@ -110,9 +115,9 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
';
break;
case 'OUTPUT_DOCUMENT':
$editorDefinition .= '
tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce"
// is necessary the process uid variable in order to load the picker correctly
var formProcessID = document.getElementById("form[PRO_UID]").value;
tinyMCE.init({
theme : "advanced",
plugins : "advhr,advimage,advlink,advlist,autolink,autoresize,autosave,contextmenu,directionality,emotions,example,example_dependency,fullpage,fullscreen,iespell,inlinepopups,insertdatetime,layer,legacyoutput,lists,media,nonbreaking,noneditable,pagebreak,paste,preview,print,save,searchreplace,spellchecker,style,tabfocus,table,template,visualblocks,visualchars,wordcount,xhtmlxtras,pmSimpleUploader,pmVariablePicker",
@@ -125,7 +130,9 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field
theme_advanced_buttons1 : "pmSimpleUploader,|,pmVariablePicker,|,bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,fontselect,fontsizeselect,|,cut,copy,paste,|,bullist,numlist,|,outdent,indent,blockquote",
theme_advanced_buttons2 : "tablecontrols,|,undo,redo,|,link,unlink,image,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,sub,sup,|,ltr,rtl,|,code",
oninit: function (){
tinyMCE.activeEditor.processID=formProcessID;
},
onchange_callback: function(inst) {
if(inst.isDirty()) {
inst.save();

View File

@@ -79,6 +79,12 @@
"full": "gulliver/js/widgets/tooltip/pmtooltip.js",
"mini": "gulliver/js/widgets/tooltip/pmtooltip.js",
"minify": true
},
{
"name": "tinymce",
"full": "gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js",
"mini": "gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js",
"minify": true
}
],
"build" : true,

View File

@@ -23,9 +23,9 @@
*/
G::pr($_SERVER);
$_SERVER["QUERY_STRING"] = isset($_SERVER["QUERY_STRING"])?$_SERVER["QUERY_STRING"]:'';
$_REQUEST["sProcess"] = isset($_REQUEST["sProcess"])?$_REQUEST["sProcess"]:'';
$_REQUEST["sFieldName"] = isset($_REQUEST["sFieldName"])?$_REQUEST["sFieldName"]:'';
$_REQUEST['sSymbol']= isset($_REQUEST["sSymbol"])?$_REQUEST["sSymbol"]:'';
$_POST["sProcess"] = isset($_POST["sProcess"])?$_POST["sProcess"]:$_SESSION['PROCESS'];
$_POST["sFieldName"] = isset($_POST["sFieldName"])?$_POST["sFieldName"]:'';
$_POST['sSymbol']= isset($_POST["sSymbol"])?$_POST["sSymbol"]:'';
$html = '<form action="uploader.php?'.$_SERVER["QUERY_STRING"].'&q=upload" onLoad="onLoad()" method="post" enctype="multipart/form-data" onsubmit="">';
$html .= '<div id="d_variables">';

View File

@@ -79,8 +79,17 @@ getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").onclick=function()
/*getField("ENABLETEMPLATE","dynaforms_Properties").checked=this.checked;
dynaformEditor.saveProperties();*/
//if (getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").checked == true) {
/*if (getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").checked == true) {
new leimnud.module.app.confirm().make(
{
label: "@G::LoadTranslation(ID_MSG_ENABLE_HTML_EDITING)",
size:{ w: 350, h: 150 },
action: function() { },
cancel: function () {
getField("PME_HTML_ENABLETEMPLATE","dynaforms_HtmlEditor").checked = false;
}
});
*/
dynaformEditor.setEnableTemplate(this.checked);
// }
}