Merge branch 'pm_wysiwyg'

This commit is contained in:
Gustavo Cruz
2012-12-12 17:32:13 -04:00
11 changed files with 317 additions and 16 deletions

View File

@@ -416,8 +416,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
} else {
$error = 0;
}
$HtmlEditor = array('URL' => $A, 'HTML' => $html
);
$HtmlEditor = array('URL' => $A, 'HTML' => $html, 'DYN_UID' => $file );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'dynaforms/dynaforms_HtmlEditor', '', $HtmlEditor, '', '');
G::RenderPage("publish", 'raw');
return array('error' => $error, 'html' => ob_get_clean()

View File

@@ -551,16 +551,16 @@ try {
}
echo Bootstrap::json_encode( $aVariables );
break;
/**
* returns the prefix mean
*
/**
* returns the prefix mean
*
*/
case 'getVariablePrefix':
$_REQUEST['prefix'] = $_REQUEST['prefix']!=null?$_REQUEST['prefix']:'ID_TO_STRING';
echo G::LoadTranslation($_REQUEST['prefix']);
break;
/**
* return an array with all Variables of Grid type
/**
* return an array with all Variables of Grid type
*/
case 'getGridList':
G::LoadClass('xmlfield_InputPM');
@@ -574,8 +574,8 @@ try {
}
echo Bootstrap::json_encode( $aVariables );
break;
/**
* return an array with all Grid Variables according to Grid
/**
* return an array with all Grid Variables according to Grid
*/
case 'getVariableGrid':
G::LoadClass('xmlfield_InputPM');
@@ -593,6 +593,24 @@ try {
echo Bootstrap::json_encode( $aVariables );
break;
case 'getDynaformFieldList':
G::LoadClass( 'dynaformhandler' );
$dynaformFields = array ();
$resultArray = array ();
$proUid= isset( $_REQUEST['PRO_UID'] )?$_REQUEST['PRO_UID']:'';
$dynUid= isset( $_REQUEST['DYN_UID'] )?$_REQUEST['DYN_UID']:'';
if (is_file( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'.$dynUid. '.xml' ) && filesize( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/'. $proUid .'/'. $dynUid .'.xml' ) > 0) {
$dyn = new dynaFormHandler( PATH_DATA . '/sites/'. SYS_SYS .'/xmlForms/' .$proUid. '/' . $dynUid .'.xml' );
$dynaformFields[] = $dyn->getFields();
}
foreach ($dynaformFields as $aDynFormFields) {
foreach ($aDynFormFields as $field) {
$resultArray[] = array ("id"=>$field->nodeName, "name"=>$field->nodeName );
}
}
echo Bootstrap::json_encode( $resultArray );
// var_dump($resultArray);
break;
/*
case 'saveFile':
global $G_PUBLISH;

View File

@@ -3,7 +3,7 @@
<URL type="phpvariable"/>
<DYN_UID type="phpvariable"/>
<PME_HTML_ENABLETEMPLATE type="checkbox" value="1" defaultvalue="0" labelOnRight="0">
<en>Enable HTML Editing</en>
@@ -21,7 +21,7 @@
<en>HTML View</en>
</HTML -->
<HTML type="wysiwyg_editor" editorType="DYNAFORM_TEMPLATE" width="100%" height="300px">
<HTML type="wysiwyg_editor" editorType="DYNAFORM_TEMPLATE" dynUID="@@DYN_UID" width="100%" height="300px">
<en>HTML View</en>
</HTML>