WYSIWYG EDITOR comments

WYSIWYG EDITOR comments
This commit is contained in:
norahmollo
2012-12-07 19:28:59 +00:00
parent 5b7eea1154
commit 4471a8b2cc
2 changed files with 36 additions and 78 deletions

View File

@@ -8,6 +8,16 @@ var setVariablePickerJS = function(){
}
});
/**
* Function getVariableList returns a list with all process variables
*
* @access public
* @param string proUid process ID
* @param string queryText text searched
* @param string varType type of variables (System or Process)
* @return array
*/
var getVariableList = function (queryText, proUid, varType){
varType = varType.toLowerCase();
var responseData
@@ -25,6 +35,13 @@ var setVariablePickerJS = function(){
return responseData;
}
/**
* Function getPrefix returns selected prefix
*
* @access public
* @param string prefix
* @return string
*/
var getPrefix = function (prefix) {
if(document.getElementById('prefix').value=='ID_TO_STRING')
prefix='@@';
@@ -41,6 +58,14 @@ var setVariablePickerJS = function(){
return prefix;
}
/**
* Function getPrefixInfo returns a prefix description
*
* @access public
* @param string prefix
* @return string
*/
var getPrefixInfo = function (prefix){
var oRPC = new leimnud.module.rpc.xmlhttp({
url : "../processes/processes_Ajax",
@@ -82,6 +107,14 @@ var setVariablePickerJS = function(){
}
});
/**
* Function generateListValues fills the dropdown with all variables according to filters
*
* @access public
* @param string prefix
* @return array
*/
function generateListValues (prefix){
var list = getVariableList(document.getElementById('search').value, document.getElementById('process').value, document.getElementById('type_variables').value);
var combo = document.getElementById("_Var_Form_");

View File

@@ -51,8 +51,6 @@ $html .= '<label for="variables_label">Search</label>';
$html .= '</td>';
$html .= '</tr>';
//$html = '<form action="uploader.php?'.$_SERVER["QUERY_STRING"].'&q=upload" method="post" enctype="multipart/form-data" onsubmit="">';
$html .= '<tr>';
$html .= '<td width="25%">';
$html .= '<select name="type_variables" id="type_variables">';
@@ -63,7 +61,6 @@ $html .= '</select> &nbsp;&nbsp;&nbsp;&nbsp;';
$html .= '</td>';
$html .= '<td width="25%">';
//$html .= '<select name="prefix" id="prefix" onChange="Seleccionar(this);">';
$html .= '<select name="prefix" id="prefix">';
$html .= '<option value="ID_TO_STRING">@@</option>';
@@ -72,14 +69,7 @@ $html .= '<option value="ID_TO_INTEGER">@%</option>';
$html .= '<option value="ID_TO_URL">@?</option>';
$html .= '<option value="ID_SQL_ESCAPE">@$</option>';
$html .= '<option value="ID_REPLACE_WITHOUT_CHANGES">@=</option>';
/*
$html .= '<option value="@@">@@</option>';
$html .= '<option value="@#">@#</option>';
$html .= '<option value="@%">@%</option>';
$html .= '<option value="@?">@?</option>';
$html .= '<option value="@$">@$</option>';
$html .= '<option value="@=">@=</option>';
*/
$html .= '</select> &nbsp;&nbsp;&nbsp;&nbsp;';
$html .= '</td>';
@@ -90,14 +80,12 @@ $html .= '</tr>';
$html .= '<tr>';
$html .= '<tr><td><label for="prefix_label">Variables</label></td></tr>';
$html .= '<tr>';
//onChange="Seleccionar(this);
$html .= '<td colspan="3">';
G::LoadClass( 'xmlfield_InputPM' );
$aFields = getDynaformsVars( $_REQUEST['sProcess'], true, isset( $_POST['bIncMulSelFields'] ) ? $_POST['bIncMulSelFields'] : 0 );
//$html .= '<select name="_Var_Form_" id="_Var_Form_" size="' . count( $aFields ) . '" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:50%;' : '') . '" ondblclick="insertFormVar(\'' . $_POST['sFieldName'] . '\', this.value);">';
$displayOption = '';
if (isset($_REQUEST['displayOption'])){
$displayOption = 'displayOption="'.$_REQUEST['displayOption'].'"';
@@ -159,66 +147,3 @@ if (isset($_REQUEST['displayOption'])) {
echo $html;
G::RenderPage( 'publish', $display );
/*
$alll = '<script type="text/javascript" language="javascript">';
$alll .= 'function Seleccionar(combo){';
$alll .= 'alert(combo.value);';
$alll .= '}';
$alll .= '</script>';
echo $alll;
*/
//echo var_dump($aFields);
/*
$sHTML = '<select name="_Var_Form_" id="_Var_Form_" size="' . count( $aFields ) . '" style="width:100%;' . (! isset( $_POST['sNoShowLeyend'] ) ? 'height:50%;' : '') . '" ondblclick="insertFormVar(\'' . $_POST['sFieldName'] . '\', this.value);">';
foreach ($aFields as $aField) {
$html .= '<option value="' . $_POST['sSymbol'] . $aField['sName'] . '">' . $_POST['sSymbol'] . $aField['sName'] . ' (' . $aField['sType'] . ')</option>';
}
$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' => '<div class="pm__dynavars"> <a id="dynalink" href=# onclick="insertFormVar(\'' . $_POST['sFieldName'] . '\',\'' . $_POST['sSymbol'] . $aField['sName'] . '\');">' . $_POST['sSymbol'] . $aField['sName'] . '</a></div>','type' => $aField['sType'],'label' => $aField['sLabel']
);
}
$html .= '</select>';
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>';
$html .= '<br>';
$html .= '<div id="desc_variables">';
$html .= '<table border="1" width="90%" align="center">';
$html .= '<tr width="40%">';
$html .= '<td>Result</td>';
$html .= '<td>@#SYS_LANG</td>';
$html .= '</tr>';
$html .= '<tr width="60%">';
$html .= '<td>Description</td>';
$html .= '<td>Description @#SYS_LANG</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>';
$html .= '<br>';
$html .= '<div id="desc_variables">';
$html .= '<table width="90%" align="center">';
$html .= '<tr><td>';
$html .= '<label for="desc_prefix">' . G::LoadTranslation( 'ID_TO_FLOAT' ) . '</label>';
$html .= '</td></tr>';
$html .= '</div>';
$html .= '</form>';
echo $html;
G::RenderPage( 'publish', 'raw' );
/*$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'triggers/dynavars', $oCriteria );
G::RenderPage( 'publish', 'raw' );
*/