/** * Restore the html code * * @param object $A * @return code html */ public function restore_html($A) { $script = null; $fileTmp = G::decrypt($A, URL_KEY); $form = new Form($fileTmp, PATH_DYNAFORM, SYS_LANG, true); //Navigation Bar $form->fields = G::array_merges(array("__DYNAFORM_OPTIONS" => new XmlForm_Field_XmlMenu(new Xml_Node("__DYNAFORM_OPTIONS", "complete", "", array("type" => "xmlmenu", "xmlfile" => "gulliver/dynaforms_Options")), SYS_LANG, PATH_XMLFORM, $form)), $form->fields); $form->enableTemplate = false; $html = $form->printTemplate($form->template, $script); $html = str_replace('{$form_className}', 'formDefault', $html); if (file_exists(PATH_DYNAFORM . $fileTmp . '.html')) { unlink(PATH_DYNAFORM . $fileTmp . '.html'); } $fp = fopen(PATH_DYNAFORM . $fileTmp . '.html', 'w'); fwrite($fp, $html); fclose($fp); return $html; }
fclose($fcopy); /* End Comment */ //Removes any other CURRENT_DYNAFORM that could be pending because of a page refresh or a failure unset($_SESSION['CURRENT_DYNAFORM']); define('DB_XMLDB_HOST', PATH_DYNAFORM . $file . '.xml'); define('DB_XMLDB_USER', ''); define('DB_XMLDB_PASS', ''); define('DB_XMLDB_NAME', ''); define('DB_XMLDB_TYPE', 'myxml'); $title = $process->Fields['PRO_TITLE'] . ' : ' . $dynaform->Fields['DYN_TITLE']; $Parameters = array('SYS_LANG' => SYS_LANG, 'URL' => G::encrypt($file, URL_KEY), 'DYN_UID' => $dynaform->Fields['DYN_UID'], 'DYNAFORM_NAME' => $title); $openDoc = new Xml_Document(); $openDoc->parseXmlFile(PATH_DYNAFORM . $file . '.xml'); $XmlEditor = array('URL' => G::encrypt($file, URL_KEY), 'XML' => $openDoc->getXml()); $form = new Form($file, PATH_DYNAFORM, SYS_LANG, true); $HtmlEditor = array('URL' => G::encrypt($file, URL_KEY), 'HTML' => $form->printTemplate($form->template, $script)); $JSEditor = array('URL' => G::encrypt($file, URL_KEY), 'HTML' => $form->printTemplate($form->template, $script)); /* Block : Loads the Editor configuration */ $defaultConfig = array('Editor' => array('left' => '0', 'top' => '0', 'width' => 'document.body.clientWidth-4', 'height' => 'document.body.clientHeight-2'), 'Toolbar' => array('left' => 'document.body.clientWidth-2-toolbar.clientWidth-24-3+7', 'top' => '52'), 'FieldsList' => array('left' => '4+toolbar.clientWidth+24', 'top' => 'getAbsoluteTop(document.getElementById("dynaformEditor[0]"))', 'width' => 268 - 24, 'height' => 400)); /*$configuration = new Configuration($dbc); $configuration->load( array('CFG_UID'=>'DynaformEditor') ); if ($configuration->is_new) { $config = $defaultConfig; $configuration->Fields['CFG_UID']='DynaformEditor'; $configuration->Fields['CFG_VALUE']=serialize( $config ); //$configuration->Save(); } else { $config = unserialize( $configuration->Fields['CFG_VALUE'] ); $config = G::array_merges( $defaultConfig , $config ); }*/ $config = $defaultConfig;