示例#1
0
 function GenerateOdt($template)
 {
     require_once "generate_odt.php";
     $engine = new XmlTemplateEngine($this->con);
     return $engine->processOdtTemplate($template);
 }
示例#2
0
 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("|&lt;!--[if.*&lt;![endif]--&gt;|Us", "|&lt;/?span.*&gt;|Us", "|&lt;/?font.*&gt;|Us", "|&lt;/?a.*&gt;|Us");
     foreach ($junkToRemove as $junk) {
         $cleaned = preg_replace($junk, "", $cleaned);
     }
     return $cleaned;
 }