function SaveXmlToDoc() { // get the source result $this->Show(TBS_NOTHING); // Some variables $xmlfilename = $this->_ooo_basename . '/' . $this->_xml_filename; $ooofilename = $this->_ooo_basename . '.' . $this->_ooo_file_ext; // store the merge result in place of the XML source file $fdw = fopen($xmlfilename, "w"); fwrite($fdw, $this->Source, strlen($this->Source)); fclose($fdw); // test if XML file exist if (!file_exists($xmlfilename)) { atkerror('clsTinyButStrongOOo->SaveXmlToDoc: File not found : ' . $xmlfilename); return false; } // test if ZIP file exist if (!file_exists($ooofilename)) { atkerror('clsTinyButStrongOOo->SaveXmlToDoc: File not found : ' . $ooofilename); return false; } // Fix the dirname to be more compatible with ODT files $path_parts = pathinfo($this->_xml_filename); if ($path_parts['dirname'] === '.') { $path_parts['dirname'] = ''; } else { $path_parts['dirname'] .= '/'; } // zip and remove the file $atkzip =& atkNew("atk.utils.atkzip"); $added = $atkzip->add($ooofilename, $xmlfilename, $path_parts['dirname']); unlink($xmlfilename); if (!$added) { atkerror("clsTinyButStrongOOo->SaveXmlToDoc: Error while integrating data into the document file"); return false; } return true; }
* @author Ivo Jansch <*****@*****.**> * * @copyright (c)2000-2004 Ibuildings.nl BV * @license http://www.achievo.org/atk/licensing ATK Open Source License * * @version $Revision: 5036 $ * $Id: top.php 6354 2009-04-15 02:41:21Z mvdam $ */ /** * @internal includes. */ $config_atkroot = "./"; include_once "atk.inc"; atksession(); atksecure(); $page =& atkNew("atk.ui.atkpage"); $ui =& atkInstance("atk.ui.atkui"); $theme =& atkInstance("atk.ui.atktheme"); $output =& atkInstance("atk.ui.atkoutput"); $page->register_style($theme->stylePath("style.css")); $page->register_style($theme->stylePath("top.css")); $vars = array("logintext" => atkText("logged_in_as", "atk"), "logouttext" => ucfirst(atkText("logout", "atk")), "logoutlink" => "app.php?atklogout=1", "logouttarget" => "_top", "centerpiece" => "", "searchpiece" => "", "title" => atkText("app_title"), "user" => atkArrayNvl(atkGetUser(), "name")); // Backwards compatible $vars[content], that is what will render when the // box.tpl is used instead of a top.tpl. This happens in old themes. $contenttpl = '<br />[logintext]: <b>[user]</b> <a href="[logoutlink]" target="[logouttarget]">[logouttext] </a> <br /><br />'; $stringparser =& atkNew("atk.utils.atkstringparser", $contenttpl); $vars["content"] = $stringparser->parse($vars); $top = $ui->renderBox($vars, "top"); $page->addContent($top); $output->output($page->render($vars["title"], true)); $output->outputFlush();