diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/editor_plugin_src.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/editor_plugin_src.js new file mode 100644 index 000000000..90487919b --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/editor_plugin_src.js @@ -0,0 +1,69 @@ +/** +* Name: editor_plugin_src.js (for pmSimpleUploader tinyMCE plugin) +**/ + +(function(){ + var strPluginURL; + tinymce.create('tinymce.plugins.pmSimpleUploaderPlugin', { + init: function(ed, url) + { + strPluginURL = url; // store the URL for future use.. + ed.addCommand('mcepmSimpleUploader', function() { + pmSimpleUploader(); + }); + ed.addButton('pmSimpleUploader', { + title: 'pmSimpleUploader', + label : 'Upload File', + cmd: 'mcepmSimpleUploader', + image: url + '/img/pmSimpleUploader.png' + }); + }, + createControl: function(n, cm) { + return null; + }, + getPluginURL: function() { + return strPluginURL; + } + }); + tinymce.PluginManager.add('pmSimpleUploader', tinymce.plugins.pmSimpleUploaderPlugin); +})(); + +// this function can get called from the plugin inint (above) or from the callback on advlink/advimg plugins.. +// in the latter case, win and type will be set.. In the rist case, we will just update the main editor window +// with the path of the uploaded file +function pmSimpleUploader(field_name, url, type, win) { + var strPluginPath = tinyMCE.activeEditor.plugins.pmSimpleUploader.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_pmSimpleUploader_upload_path'); // get the relative upload path + var strSubstitutePath = tinyMCE.activeEditor.getParam('plugin_pmSimpleUploader_upload_substitute_path'); // get the path we'll substitute for the for the upload path (i.e. fully qualified) + + if (strUploaderURL.indexOf("?") < 0){ // if we were called without any GET params + strUploaderURL = strUploaderURL + "?type=" + type + "&d=" + strUploadPath + "&subs=" + strSubstitutePath; // add our own params + } else { + strUploaderURL = strUploaderURL + "&type=" + type + "&d=" + strUploadPath + "&subs=" + strSubstitutePath; + } + tinyMCE.activeEditor.windowManager.open({ // open the plugin popup + file : strUploaderURL, + title : 'Upload from file', + width : 500, + height : 100, + resizable : "yes", + inline : 1, // This parameter only has an effect if you use the inlinepopups plugin! + close_previous : "no" + }, { + window : win, + input : field_name + }); + + return false; +} +// This function will get called when the uploader is done uploading the file and ready to update +// calling dialog and close the upload popup +// strReturnURL should be the string with the path to the uploaded file +function closePluginPopup(){ + tinyMCEPopup.close(); // close popup window +} + +function updateEditorContent(serializedHTML){ + tinyMCE.activeEditor.execCommand('mceSetContent', false, serializedHTML); +} \ No newline at end of file diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/img/pmSimpleUploader.png b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/img/pmSimpleUploader.png new file mode 100644 index 000000000..18bfb66a2 Binary files /dev/null and b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/img/pmSimpleUploader.png differ diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/langs/en.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/langs/en.js new file mode 100644 index 000000000..0716a4c86 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/langs/en.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('en.pmSimpleUploader', { + desc:"Upload File to Server" +}); diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/langs/es.js b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/langs/es.js new file mode 100644 index 000000000..074c458c2 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/langs/es.js @@ -0,0 +1,3 @@ +tinyMCE.addI18n('es.pmSimpleUploader', { + desc:"Subir Archivo al Servidor" +}); diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/progress.gif b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/progress.gif new file mode 100644 index 000000000..2aea68c8e Binary files /dev/null and b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/progress.gif differ diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/uploader.php b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/uploader.php new file mode 100644 index 000000000..ac69e2a34 --- /dev/null +++ b/gulliver/js/tinymce/jscripts/tiny_mce/plugins/pmSimpleUploader/uploader.php @@ -0,0 +1,62 @@ + + Upload an Output Document + + + + + + + + + +' + .'File Name:
' + .'
' + .'' + .' ' + .''; +} +// uploads the file to the destination path, and returns a link with link path substituted for destination path +function uploadContentFile() +{ + $StatusMessage = ""; + $ActualFileName = ""; + $FileObject = $_FILES["upload_file"]; // find data on the file + $DestPath = sys_get_temp_dir(); + updateEditorContent(trim(file_get_contents($FileObject['tmp_name']))); + closeWindow(); +} + + +function showPopUp($PopupText) +{ + echo ""; +} + +function updateEditorContent($serializedHTML) +{ + echo ""; +} + +function closeWindow() +{ + echo ' + + '; +} +?> + diff --git a/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js b/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js index 36727eeb6..460afcec6 100755 --- a/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js +++ b/gulliver/js/tinymce/jscripts/tiny_mce/tiny_mce_src.js @@ -4233,12 +4233,18 @@ tinymce.html.Styles = function(settings, schema) { // Remove already removed children fi = nodes.length; while (fi--) { - if (!nodes[fi].parent) - nodes.splice(fi, 1); + if(list.name!='toStr'&&list.name!='concat'&&list.name!='get_by_key'&&list.name!='expand'&&list.name!='setParent'&&list.name!='isset_key'){ +// if (!nodes[fi].parent){ + nodes.splice(fi, 1); +// } + } } - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) - list.callbacks[fi](nodes, list.name, args); + for (fi = 0, fl = list.callbacks.length; fi < fl; fi++){ + if(list.name!='toStr'&&list.name!='concat'&&list.name!='get_by_key'&&list.name!='expand'&&list.name!='setParent'&&list.name!='isset_key'){ + list.callbacks[fi](nodes, list.name, args); + } + } } } } diff --git a/gulliver/system/class.wysiwygEditor.php b/gulliver/system/class.wysiwygEditor.php index a62348c1e..17f3061d6 100755 --- a/gulliver/system/class.wysiwygEditor.php +++ b/gulliver/system/class.wysiwygEditor.php @@ -119,22 +119,22 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field break; case 'OUTPUT_DOCUMENT': $editorDefinition = ' - //delete Array.prototype.toStr; - //delete Object.prototype.toStr; - //delete Object.prototype.concat; - //delete Object.prototype.get_by_key; - //delete Object.prototype.expand; - //delete Object.prototype.setParent; - //delete Object.prototype.isset_key; - - tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce" - tinyMCE.init({ - theme : "advanced", + //delete Array.prototype.toStr; + //delete Object.prototype.toStr; + //delete Object.prototype.concat; + //delete Object.prototype.get_by_key; + //delete Object.prototype.expand; + //delete Object.prototype.setParent; + //delete Object.prototype.isset_key; + + tinyMCE.baseURL = "/js/tinymce/jscripts/tiny_mce" + tinyMCE.init({ + theme : "advanced", plugins : "fullpage", - mode : "specific_textareas", - editor_selector : "tmceEditor", - width : "770", - height : "305", + mode : "specific_textareas", + editor_selector : "tmceEditor", + width : "770", + height : "305", theme_advanced_buttons1 : "fontselect,bold,italic,underline,forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,numlist,bullist,|,insertfile", handle_event_callback : function(e) { @@ -143,8 +143,8 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field } return true; } - - }); + + }); '; break; @@ -231,4 +231,4 @@ class XmlForm_Field_WYSIWYG_EDITOR extends XmlForm_Field return $editorDefinition; } -} \ No newline at end of file +} diff --git a/workflow/engine/classes/model/OutputDocument.php b/workflow/engine/classes/model/OutputDocument.php index 642851f5a..490e55ba9 100755 --- a/workflow/engine/classes/model/OutputDocument.php +++ b/workflow/engine/classes/model/OutputDocument.php @@ -108,6 +108,7 @@ class OutputDocument extends BaseOutputDocument if (!is_null($oOutputDocument)) { $aFields = $oOutputDocument->toArray(BasePeer::TYPE_FIELDNAME); $aFields['OUT_DOC_TITLE'] = $oOutputDocument->getOutDocTitle(); + $aFields['PRO_UID'] = $oOutputDocument->getProUid(); $aFields['OUT_DOC_DESCRIPTION'] = $oOutputDocument->getOutDocDescription(); $aFields['OUT_DOC_FILENAME'] = $oOutputDocument->getOutDocFilename(); $aFields['OUT_DOC_TEMPLATE'] = $oOutputDocument->getOutDocTemplate(); diff --git a/workflow/engine/methods/outputdocs/outputdocs_Ajax.php b/workflow/engine/methods/outputdocs/outputdocs_Ajax.php index 9311e77f4..a075149dc 100755 --- a/workflow/engine/methods/outputdocs/outputdocs_Ajax.php +++ b/workflow/engine/methods/outputdocs/outputdocs_Ajax.php @@ -2,16 +2,16 @@ $action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] :''; -// Function call from ajax_function for calling to lookForNameOutput. +// Function call from ajax_function for calling to lookForNameOutput. if ($action == '') { $action = isset( $_REQUEST['function'] ) ? $_REQUEST['function'] : ''; } switch ($action) { case 'setTemplateFile': - //print_r($_FILES); + //print_r($_FILES); $_SESSION['outpudocs_tmpFile'] = PATH_DATA . $_FILES['templateFile']['name']; - // file_put_contents($_FILES['templateFile']['name'], file_get_contents($_FILES['templateFile']['tmp_name'])); + // file_put_contents($_FILES['templateFile']['name'], file_get_contents($_FILES['templateFile']['tmp_name'])); copy( $_FILES['templateFile']['tmp_name'], $_SESSION['outpudocs_tmpFile'] ); $result = new stdClass(); @@ -73,17 +73,32 @@ switch ($action) { $flag = false; } echo $flag; - // G::json_encode($flag); + // G::json_encode($flag); break; case 'loadOutputEditor': global $G_PUBLISH; $G_PUBLISH = new Publisher(); - $aData = ""; + $fcontent = ''; + $proUid = ''; + $filename = ''; + $title = ''; + + require_once 'classes/model/OutputDocument.php'; + $oOutputDocument = new OutputDocument(); + if (isset( $_REQUEST['OUT_DOC_UID'] )) { + $aFields = $oOutputDocument->load( $_REQUEST['OUT_DOC_UID'] ); + $fcontent = $aFields['OUT_DOC_TEMPLATE']; + $proUid = $aFields['PRO_UID']; + $filename = $aFields['OUT_DOC_FILENAME']; + $title = $aFields['OUT_DOC_TITLE']; + } + + $aData = Array ( 'PRO_UID' => $proUid,'OUT_DOC_TEMPLATE' => $fcontent, 'FILENAME' => $filename, 'OUT_DOC_UID'=> $_REQUEST['OUT_DOC_UID'], 'OUT_DOC_TITLE'=> $title); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aData ); - //$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'outputdocs/outputdocs_Edit', '', $aData ); + G::RenderPage( 'publish', 'raw' ); - //echo '

outputss

'; + break; } \ No newline at end of file diff --git a/workflow/engine/templates/outputdocs/testOut.php b/workflow/engine/templates/outputdocs/testOut.php index 74563f0f8..8f898847d 100644 --- a/workflow/engine/templates/outputdocs/testOut.php +++ b/workflow/engine/templates/outputdocs/testOut.php @@ -86,7 +86,7 @@ echo ' '; ?> - + - + @# @@ -8,8 +8,9 @@ + - + Save diff --git a/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml b/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml index 2e9675cc5..7150481d4 100755 --- a/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml +++ b/workflow/engine/xmlform/outputdocs/outputdocs_Options.xml @@ -52,9 +52,9 @@ var outputdocsEditor; outputdocsEditor.make(); - var oRPC = new leimnud.module.rpc.xmlhttp({ + var oRPC = new leimnud.module.rpc.xmlhttp({ url : '../outputdocs/outputdocs_Ajax', - args: 'action=loadOutputEditor' + args: 'action=loadOutputEditor&OUT_DOC_UID='+uid+'&OUT_DOC_TYPE='+typ }); outputdocsEditor.loader.show(); @@ -92,10 +92,9 @@ var outputdocsEditor; } function outputdocsSave( form ) { - alert(form.action); + form.action = '../outputdocs/outputdocs_Save'; ajax_post( form.action, form, 'POST' ); outputdocsEditor.remove(); - @#PAGED_TABLE_ID.refresh(); }