BUG 9399 Edito de Dynaforms cuando se tiene javascripts en el dyanform... SOLVED

Was added a new parameter without default value
Added default value
This commit is contained in:
Julio Cesar Laura
2012-07-03 09:50:34 -04:00
parent cb6bd6bbf3
commit 2f218c4cc2

View File

@@ -465,7 +465,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
$script = null; $script = null;
$fileTmp = G::decrypt($A , URL_KEY); $fileTmp = G::decrypt($A , URL_KEY);
$form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true); $form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true);
//Navigation Bar //Navigation Bar
$form->fields = G::array_merges( $form->fields = G::array_merges(
array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu( array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu(
@@ -486,14 +486,14 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
//Loads the stored HTML or the default Template if //Loads the stored HTML or the default Template if
//it doesn't exist. //it doesn't exist.
$filename = substr($form->fileName, 0, -3) . ($form->type === "xmlform" ? "" : "." . $form->type) . "html"; $filename = substr($form->fileName, 0, -3) . ($form->type === "xmlform" ? "" : "." . $form->type) . "html";
if (!file_exists($filename)) { if (!file_exists($filename)) {
$html = $form->printTemplate($form->template, $script); $html = $form->printTemplate($form->template, $script);
} }
else { else {
$html = implode("", file($filename)); $html = implode("", file($filename));
} }
/* /*
* It adds the new fields automatically at the bottom of the form. * It adds the new fields automatically at the bottom of the form.
* TODO: <20>TOP OR BOTTOM? * TODO: <20>TOP OR BOTTOM?
@@ -527,7 +527,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
self::_setTmpData($tmp); self::_setTmpData($tmp);
//$html=str_replace('{$form_className}','formDefault', $html ); //$html=str_replace('{$form_className}','formDefault', $html );
$html=str_replace('{$form_className}','formDefault', $aAux[0] . '</form>' ); $html=str_replace('{$form_className}','formDefault', $aAux[0] . '</form>' );
return $html; return $html;
} }
catch (Exception $e) { catch (Exception $e) {
@@ -544,7 +544,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
$script = null; $script = null;
$fileTmp = G::decrypt($A, URL_KEY); $fileTmp = G::decrypt($A, URL_KEY);
$form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true); $form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true);
//Navigation Bar //Navigation Bar
$form->fields = G::array_merges( $form->fields = G::array_merges(
array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu( array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu(
@@ -561,7 +561,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
), ),
$form->fields $form->fields
); );
$form->enableTemplate = false; $form->enableTemplate = false;
$html = $form->printTemplate( $form->template , $script ); $html = $form->printTemplate( $form->template , $script );
$html = str_replace('{$form_className}','formDefault', $html ); $html = str_replace('{$form_className}','formDefault', $html );
@@ -571,7 +571,7 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
$fp=fopen(PATH_DYNAFORM . $fileTmp . '.html','w'); $fp=fopen(PATH_DYNAFORM . $fileTmp . '.html','w');
fwrite($fp, $html); fwrite($fp, $html);
fclose($fp); fclose($fp);
return $html; return $html;
} }
@@ -665,12 +665,12 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
* @param string $sCode * @param string $sCode
* @return array * @return array
*/ */
function set_javascript($A,$fieldName,$sCode,$meta) function set_javascript($A,$fieldName,$sCode,$meta='')
{ {
if ($fieldName == '___pm_boot_strap___') { if ($fieldName == '___pm_boot_strap___') {
return 0; return 0;
} }
$sCode = urldecode($sCode) ; $sCode = urldecode($sCode) ;
try { try {
$sCode = rtrim($sCode); $sCode = rtrim($sCode);