BUG 8840 "Next Step and Previous Link are missing when HTML is enable" SOLVED

- Previous and Next step link not found when HTML is enable
- Uncommented lines in the method "get_htmlcode" where this "__DYNAFORM_OPTIONS" this for add the links, when it generate the html file in the HTML tab
- In existing dynaforms with the enabletemplate=1 does not affect the change will only affect the new dynaforms as you have enabletemplate=1 generate the html file with the corresponding links
This commit is contained in:
Victor Saisa Lopez
2012-05-09 12:57:22 -04:00
parent 0c2514c740
commit d30b5a0f2b

View File

@@ -461,33 +461,38 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
function get_htmlcode($A) function get_htmlcode($A)
{ {
try { try {
$script = ''; $script = null;
$file = G::decrypt( $A , URL_KEY ); $fileTmp = G::decrypt($A , URL_KEY);
$form = new Form( $file , PATH_DYNAFORM, SYS_LANG, true ); $form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true);
/* Navigation Bar */
/*$form->fields=G::array_merges( //Navigation Bar
array('__DYNAFORM_OPTIONS' => new XmlForm_Field_XmlMenu( $form->fields = G::array_merges(
new Xml_Node( array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu(
'__DYNAFORM_OPTIONS', new Xml_Node(
'complete', "__DYNAFORM_OPTIONS",
'', "complete",
array('type'=>'xmlmenu','xmlfile'=>'gulliver/dynaforms_Options') "",
),SYS_LANG,PATH_XMLFORM,$form) array("type" => "xmlmenu", "xmlfile" => "gulliver/dynaforms_Options")
), ),
$form->fields);*/ SYS_LANG,
/**/ PATH_XMLFORM,
/* $form
* Loads the stored HTML or the default Template if )
* it doesn't exist. ),
*/ $form->fields
$filename = substr($form->fileName , 0, -3) . );
( $form->type==='xmlform' ? '' : '.' . $form->type ) . 'html';
if (!file_exists( $filename )) { //Loads the stored HTML or the default Template if
$html = $form->printTemplate( $form->template , $script ); //it doesn't exist.
$filename = substr($form->fileName, 0, -3) . ($form->type === "xmlform" ? "" : "." . $form->type) . "html";
if (!file_exists($filename)) {
$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?
@@ -521,6 +526,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) {
@@ -534,21 +540,27 @@ class dynaformEditorAjax extends dynaformEditor implements iDynaformEditorAjax
*/ */
function restore_html($A) function restore_html($A)
{ {
$script = ''; $script = null;
$fileTmp = G::decrypt( $A , URL_KEY ); $fileTmp = G::decrypt($A, URL_KEY);
$file = dynaformEditor::_getFilename($fileTmp); $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(
new Xml_Node( new Xml_Node(
'__DYNAFORM_OPTIONS', "__DYNAFORM_OPTIONS",
'complete', "complete",
'', "",
array('type'=>'xmlmenu','xmlfile'=>'gulliver/dynaforms_Options') array("type" => "xmlmenu", "xmlfile" => "gulliver/dynaforms_Options")
),SYS_LANG,PATH_XMLFORM,$form) ),
), SYS_LANG,
$form->fields); PATH_XMLFORM,
$form
)
),
$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 );
@@ -558,6 +570,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;
} }