From b50e8023913f2fb5357081868bdb22615e49f2e7 Mon Sep 17 00:00:00 2001 From: norahmollo Date: Fri, 23 Nov 2012 14:05:44 +0000 Subject: [PATCH] WYSIWYG EDITOR Variable Picker Layout WYSIWYG EDITOR Variable Picker Layout --- .../pmVariablePicker/VariablePicker.html | 66 ++++++ .../pmVariablePicker/editor_plugin_src.js | 9 +- .../plugins/pmVariablePicker/uploader.php | 75 ++++++- .../engine/classes/class.xmlfield_InputPM.php | 13 +- workflow/engine/methods/controls/varsAjax.php | 192 +++++++++++++++--- workflow/engine/xmlform/triggers/dynavars.xml | 4 - .../xmlform/triggers/triggersCustom.xml | 3 +- .../xmlform/triggers/triggersNarrowEdit.xml | 3 +- .../xmlform/triggers/triggersProperties.xml | 3 +- .../engine/xmlform/triggers/triggers_Edit.xml | 2 +- 10 files changed, 312 insertions(+), 58 deletions(-) create mode 100644 gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html new file mode 100644 index 000000000..1210d28e6 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/VariablePicker.html @@ -0,0 +1,66 @@ + + + + + + + + +
' +
+ + + + + + + + + + + + +
+ + +      + + +
+
+ +
+ +
+ + + + + + + + + +
Result@#SYS_LANG
DescriptionDescription @#SYS_LANG
+
+ +
+ +
+ +
+
+ + \ No newline at end of file diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin_src.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin_src.js index 2046710d2..27126648a 100644 --- a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin_src.js +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/editor_plugin_src.js @@ -44,10 +44,11 @@ function pmVariablePicker(field_name, url, type, win) { strUploaderURL = strUploaderURL + "&type=" + type + "&d=" + strUploadPath + "&subs=" + strSubstitutePath; } tinyMCE.activeEditor.windowManager.open({ // open the plugin popup - file : strUploaderURL, - title : 'Upload Variable', - width : 500, - height : 100, + //file : strUploaderURL, + file : strPluginPath + '/VariablePicker.html', + title : 'Upload Variable', + width : '600px', + height : '150px', resizable : "yes", inline : 1, // This parameter only has an effect if you use the inlinepopups plugin! close_previous : "no" diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/uploader.php b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/uploader.php index 38fe7e3c8..857caf9a6 100644 --- a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/uploader.php +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmVariablePicker/uploader.php @@ -21,13 +21,78 @@ // displays the upload form function displayUploadForm() -{ +{/* echo '
' - .'Variable Name:
' - .'
             ' - .'' - .' ' + //.'Variable Name:
' + .'
' + .'' + + .'' + .'' + + .'' + + .'' + .'' + + .'' + .'' + + .'' + + .'' + .'' + .'
' + .'' + .'' + .'' + .'' + .'' + .'
' + .'     ' + .'' + .'     ' + .'' + .'' + .'
' + .'
' + + .'
' + .'
' + .'' + .'' + .'' + .'' + .'' + .'' + .'' + .'' + .'' + .'
Result@#SYS_LANG
DescriptionDescription @#SYS_LANG
' + .'
' + + .'
' + .'
' + .'' + .'
' + + //.'
' + // .'' + //.' ' .'
'; + */ } // uploads the file to the destination path, and returns a link with link path substituted for destination path function uploadVariablePicker() diff --git a/workflow/engine/classes/class.xmlfield_InputPM.php b/workflow/engine/classes/class.xmlfield_InputPM.php index fd9ac6851..c9109f607 100755 --- a/workflow/engine/classes/class.xmlfield_InputPM.php +++ b/workflow/engine/classes/class.xmlfield_InputPM.php @@ -207,7 +207,7 @@ class XmlForm_Field_TextareaPM extends XmlForm_Field * @param eter string owner * @return string */ - public function renderGrid ($values = null, $owner) + public function renderGrid ($owner, $values = null) { $result = array (); $r = 1; @@ -320,7 +320,7 @@ class XmlForm_Field_hours extends XmlForm_Field_SimpleText * @param eter string owner * @return string */ - public function renderGrid ($values = array(), $owner) + public function renderGrid ($values = array(),$owner) { $result = array (); $r = 1; @@ -380,17 +380,14 @@ function getDynaformsVars ($sProcessUID, $bSystemVars = true, $bIncMulSelFields if ($bSystemVars) { $aAux = G::getSystemConstants(); foreach ($aAux as $sName => $sValue) { - $aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => 'System variable' - ); + $aFields[] = array ('sName' => $sName,'sType' => 'system','sLabel' => 'System variable'); } //we're adding the ping variable to the system list $aFields[] = array ('sName' => 'PIN','sType' => 'system','sLabel' => 'System variable' ); } - $aInvalidTypes = array ('title','subtitle','link','file','button','reset','submit','javascript' - ); - $aMultipleSelectionFields = array ('listbox','checkgroup','grid' - ); + $aInvalidTypes = array ('title','subtitle','link','file','button','reset','submit','javascript'); + $aMultipleSelectionFields = array ('listbox','checkgroup','grid'); if ($bIncMulSelFields != 0) { $aInvalidTypes = array_merge( $aInvalidTypes, $aMultipleSelectionFields ); } diff --git a/workflow/engine/methods/controls/varsAjax.php b/workflow/engine/methods/controls/varsAjax.php index 27004572c..c423dd3df 100755 --- a/workflow/engine/methods/controls/varsAjax.php +++ b/workflow/engine/methods/controls/varsAjax.php @@ -21,9 +21,134 @@ * For more information, contact Colosa Inc, 2566 Le Jeune Rd., * Coral Gables, FL, 33134, USA, or email info@colosa.com. */ -G::LoadClass( 'xmlfield_InputPM' ); -$aFields = getDynaformsVars( $_POST['sProcess'], true, isset( $_POST['bIncMulSelFields'] ) ? $_POST['bIncMulSelFields'] : 0 ); +$html = '
'; + +$html .= '
'; +$html .= ''; +$html .= ''; +$html .= ''; + +$html .= ''; + +$html .= ''; +$html .= ''; + + +$html .= ''; +$html .= ''; + +$html .= ''; + +$html .= ''; +$html .= ''; + +$html .= '
'; +$html .= ''; +$html .= ''; + +$html .= '
'; +$html .= ''; +$html .= ''; +//onChange="Seleccionar(this); +$html .= ''; +$html .= ''; +$html .= ''; +$html .= '
'; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= '
'; +$html .= '     '; +$html .= ''; +$html .= '     '; +$html .= ''; +$html .= ''; +$html .= '
 
'; + +G::LoadClass( 'xmlfield_InputPM' ); +$aFields = getDynaformsVars( $_POST['sProcess'], true, isset( $_POST['bIncMulSelFields'] ) ? $_POST['bIncMulSelFields'] : 0 ); + +//$html .= ''; + +foreach ($aFields as $aField) { + $html .= ''; +} + +$aRows[0] = Array ('fieldname' => 'char','variable' => 'char','type' => 'type','label' => 'char' +); +foreach ($aFields as $aField) { + $aRows[] = Array ('fieldname' => $_POST['sFieldName'],'variable' => $_POST['sSymbol'] . $aField['sName'],'variable_label' => '','type' => $aField['sType'],'label' => $aField['sLabel'] + ); +} + +$html .= ''; + + +/* +$html .= '     '; +$html .= ''; +$html .= '';*/ +$html .= '
'; +$html .= '
'; + +$html .= '
'; +$html .= '
'; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= ''; +$html .= '
Result@#SYS_LANG
DescriptionDescription @#SYS_LANG
'; +$html .= '
'; +$html .= '
'; +$html .= '
'; +$html .= ''; +$html .= ''; +$html .= ''; + +$html .= ''; + +echo $html; +/* +$alll = ''; + +echo $alll; +*/ + + + +//echo var_dump($aFields); +/* $sHTML = ''; $sHTML .= ''; - /*$sHTML .= ''; - $sHTML .= ''; - $sHTML .= ''; - $sHTML .= ''; - $sHTML .= '';*/ + //$sHTML .= ''; + //$sHTML .= ''; + //$sHTML .= ''; + //$sHTML .= ''; + //$sHTML .= ''; } else { $sHTML .= ''; $sHTML .= ''; @@ -70,48 +195,48 @@ $sStyle = " "; $cssTabs = "
@@ -129,11 +254,11 @@ echo $sStyle; echo "
"; -echo $cssTabs; +//echo $cssTabs; G::LoadClass( 'ArrayPeer' ); global $_DBArray; -$_DBArray['dynavars'] = $aRows; +//$_DBArray['dynavars'] = $aRows; $_SESSION['_DBArray'] = $_DBArray; G::LoadClass( 'ArrayPeer' ); @@ -150,3 +275,4 @@ G::RenderPage( 'publish', 'raw' ); echo "
"; +*/ \ No newline at end of file diff --git a/workflow/engine/xmlform/triggers/dynavars.xml b/workflow/engine/xmlform/triggers/dynavars.xml index f749f157f..fbd7edcc1 100755 --- a/workflow/engine/xmlform/triggers/dynavars.xml +++ b/workflow/engine/xmlform/triggers/dynavars.xml @@ -11,12 +11,8 @@ Variable - - - - \ No newline at end of file diff --git a/workflow/engine/xmlform/triggers/triggersCustom.xml b/workflow/engine/xmlform/triggers/triggersCustom.xml index a95773b5b..0adb94c8a 100755 --- a/workflow/engine/xmlform/triggers/triggersCustom.xml +++ b/workflow/engine/xmlform/triggers/triggersCustom.xml @@ -36,7 +36,8 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) _oVarsPanel_ = new leimnud.module.panel(); _oVarsPanel_.options = { limit : true, - size : {w:550,h:645}, + //size : {w:550,h:645}, + size : {w:600,h:340}, position : {x:0,y:0,center:true}, title : '', theme : 'processmaker', diff --git a/workflow/engine/xmlform/triggers/triggersNarrowEdit.xml b/workflow/engine/xmlform/triggers/triggersNarrowEdit.xml index b71f83e23..c6454e56c 100755 --- a/workflow/engine/xmlform/triggers/triggersNarrowEdit.xml +++ b/workflow/engine/xmlform/triggers/triggersNarrowEdit.xml @@ -32,7 +32,8 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) _oVarsPanel_ = new leimnud.module.panel(); _oVarsPanel_.options = { limit : true, - size : {w:550,h:645}, + //size : {w:550,h:645}, + size : {w:600,h:340}, position : {x:0,y:0,center:true}, title : '', theme : 'processmaker', diff --git a/workflow/engine/xmlform/triggers/triggersProperties.xml b/workflow/engine/xmlform/triggers/triggersProperties.xml index 5d883f2cb..352e925b4 100755 --- a/workflow/engine/xmlform/triggers/triggersProperties.xml +++ b/workflow/engine/xmlform/triggers/triggersProperties.xml @@ -26,7 +26,8 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) _oVarsPanel_ = new leimnud.module.panel(); _oVarsPanel_.options = { limit : true, - size : {w:550,h:645}, + //size : {w:550,h:645}, + size : {w:600,h:340}, position : {x:0,y:0,center:true}, title : '', theme : 'processmaker', diff --git a/workflow/engine/xmlform/triggers/triggers_Edit.xml b/workflow/engine/xmlform/triggers/triggers_Edit.xml index 254780232..ebe489ad5 100755 --- a/workflow/engine/xmlform/triggers/triggers_Edit.xml +++ b/workflow/engine/xmlform/triggers/triggers_Edit.xml @@ -24,7 +24,7 @@ var showDynaformsFormVars = function(sFieldName, sAjaxServer, sProcess, sSymbol) _oVarsPanel_ = new leimnud.module.panel(); _oVarsPanel_.options = { limit : true, - size : {w:550,h:675}, + size : {w:600,h:340}, position : {x:0,y:0,center:true}, title : '', theme : 'processmaker',
'; +$html .= ''; +$html .= '
' . G::LoadTranslation( 'ID_ESC' ) . '
' . G::LoadTranslation( 'ID_NONEC' ) . '
' . G::LoadTranslation('ID_EURL') . '
' . G::LoadTranslation('ID_EVAL') . '
' . G::LoadTranslation('ID_ESCJS') . '
' . G::LoadTranslation('ID_ESCSJS') . '
' . G::LoadTranslation('ID_FUNCTION') . '
' . G::LoadTranslation('ID_EURL') . '
' . G::LoadTranslation('ID_EVAL') . '
' . G::LoadTranslation('ID_ESCJS') . '
' . G::LoadTranslation('ID_ESCSJS') . '
' . G::LoadTranslation('ID_FUNCTION') . '
@@' . G::LoadTranslation( 'ID_TO_STRING' ) . '
@#' . G::LoadTranslation( 'ID_TO_FLOAT' ) . '