function GenerateOdt($template) { require_once "generate_odt.php"; $engine = new XmlTemplateEngine($this->con); return $engine->processOdtTemplate($template); }
static function clean($s) { // debug(" Cleaning $s\n"); $s = xmlTemplateEngine::fixMicrosoft($s); $s = str_replace(array("\n", "\r"), array(" ", ""), trim($s)); $cleaned = htmlspecialchars(utf8_encode($s), ENT_QUOTES, "UTF-8", False); // Now convert a known set of HTML Entities to UTF-8, but leaving < and > // alone, as they're used for structure elements like <p> tags. // [Which is why I can't just call html_entity_decode]. $cleaned = XmlTemplateEngine::htmlEntities2utf8($cleaned); $junkToRemove = array("|<!--[if.*<![endif]-->|Us", "|</?span.*>|Us", "|</?font.*>|Us", "|</?a.*>|Us"); foreach ($junkToRemove as $junk) { $cleaned = preg_replace($junk, "", $cleaned); } return $cleaned; }