public static function __callStatic($method, $options) { $content = $options[0]; $tag = $options[1]; $type = $options[2]; switch ($type) { // call text search case 'search': // merge result with status::set() $searchString = argv::search(); $result = textPlugin::search(); if ($result) { // get translation of pages $pages = $result->XPath("./result"); // insert text snippets with highlighted searchString foreach ($pages as $page) { $moduleName = (string) $page->type; $name = (string) $page->name; $value = (string) $page->value; $article = OLIVModule::load_xml("", $moduleName . "/" . "content/", $name . ".xml"); if ($article) { $texts = $article->XPath("//text"); foreach ($texts as $text) { // highlight seachstring if ($highlighted = OLIVText::highlight((string) $text, $searchString, "highlight", 25)) { $page->summary = $highlighted; // add language $page->lang = (string) $text['lang']; } } // insert page name olivxml_insert($page->pagename, OLIVRoute::getName((string) $page->page)); } } olivxml_insert($content, $result); } break; // call renderer // call renderer case 'render': textPlugin::render($content); break; } }
public static function load_content($header, $contentName = "") { $contentPath = (string) $header->content; $moduleName = (string) $header->name; if (!$contentName) { $contentName = (string) $header->param->content; } // if content path but no content defined // use module_name.xml for content if (!$contentName) { $contentName = "default"; } $contentName .= ".xml"; if ($contentPath and $contentName) { return OLIVModule::load_xml($header, $contentPath, $contentName); } }