public function __construct($menuName, $name, $value = "") { if ($menuName and $name) { // load javascripts OLIVCore::loadScript("jquery-1.7.1.js", system::OLIV_JAVASCRIPT_PATH()); OLIVCore::loadScript("jquery.contextMenu.js", system::OLIV_JAVASCRIPT_PATH()); // load css OLIVTemplate::link_css(system::OLIV_TEMPLATE_PATH() . system::OLIV_TEMPLATE() . "/", "jquery.contextMenu.css"); // load menu item definition $this->context = olivxml_load_file(system::OLIV_CONTEXT_PATH() . "{$menuName}.xml", system::OLIV_CORE_PATH()); //------------------------------------------------------------------------------ // load context menu plugin script OLIVCore::loadScript("{$menuName}.contextMenu.js", system::OLIV_JAVASCRIPT_PATH()); // set javascript action for context display ?> <script language='javascript'> // get function name and parameters menuFunc="<?php echo $menuName; ?> _contextMenu"; menuParam = "<?php echo $name; ?> "; // call contextMenu script window[menuFunc](menuParam); </script> <?php //------------------------------------------------------------------------------ // set context menu name $this->context->addAttribute('name', $name); if ($value) { $this->context->addAttribute('value', $value); } // disable paste if (!OLIVClipboard::_()) { $this->disable("paste"); } } else { return FALSE; } }
private static function parse_methods($page, $methods, $type) { // loop over plugin node names foreach ($methods as $plugin) { // load plugin definition $class = $plugin->XPath("../class"); if (count($class)) { $class = (string) array_pop($class); } else { $class = ""; } /* $editclass = $plugin->XPath("../editclass"); if (count($editclass)) $editclass = (string)array_pop($editclass); else $editclass = ""; */ // loop over plugin methods foreach ($plugin as $method) { $name = $method->getName(); $classMethod = (string) $method; // load plugin script OLIVCore::loadScript($class . ".php", system::OLIV_PLUGIN_PATH() . $class . "/"); //------------------------------------------------------------------------------ // permission to display //TODO use class or editclass, depending on rights // call plugin if (class_exists($class)) { $class::$classMethod($page, $name, $type); } else { OLIVError::fire("postprocessor.php::process - class {$class} not found"); } } } return $page; }
public static function load_js($header, $path, $name) { $filePath = system::OLIV_MODULE_PATH() . (string) $header->name . "/" . $path; // load file if (OLIVCore::loadScript($name, $filePath, session_path(""))) { return TRUE; } return FALSE; }
public function init($session) { // ------------------------------------------------------------------------------ // set session if ($session) { system::set('OLIV_SESSION', $session . "/"); } else { die("***FATAL ERROR: init.php - no session defined"); } // core path for multisession defined if (!system::OLIV_CORE_PATH()) { die("Core path not defined"); } // ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------ // load basic system methods OLIVCore::loadScript("library/init.php"); if (!system::OLIVENV()) { die("Environment not set"); } // ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------ // load system language if (!system::OLIVTEXT()) { die("INIT: OLIVTEXT not found"); } OLIVText::load(system::OLIV_LANGUAGE_PATH(), system::OLIV_CORE_TEXT()); // ------------------------------------------------------------------------------ // initialice main components // ------------------------------------------------------------------------------ // connect to database // $this->daba = new OLIVDatabase($this->coreXml->_("core.database")); // initialise router $this->route = new OLIVRoute(); // initialise html $this->html = new OLIVHtml(); // load module metadata $this->module = new OLIVModule(); // load plugin metadata $this->plugin = new OLIVPlugin(); // load site template $this->template = new OLIVTemplate(system::OLIV_TEMPLATE_PATH() . system::OLIV_TEMPLATE() . "/", system::OLIV_TEMPLATE()); // initialise page $this->page = new OLIVPage(); // initialise preprocessor $this->processor = new OLIVProcessor(); // initialise renderer $this->render = new OLIVRender(); // ------------------------------------------------------------------------------ // set core status // ------------------------------------------------------------------------------ // extract command and value if (status::val()) { // extract cmd and param $cmdArray = explode("/", cut_slash(status::val())); // TODO define commands in system section ??? // search for command and retranslate if (count($cmdArray)) { $cmd = OLIVText::getId($cmdArray[0]); status::set('command', $cmd); // save command } // if command found, extract command from val if (count($cmdArray) > 1 and $cmd) { array_shift($cmdArray); // remove command from val status::set('val', implode("/", $cmdArray)); // save val } } // ------------------------------------------------------------------------------ // initialize clipboard // get content from clipboard parameter if ($clipboard = argv::clipboard()) { OLIVClipboard::_($clipboard); } // get clipboard from cut/copy command $command = status::command(); if ($command) { OLIVClipboard::$command(status::val()); } }
<html> <head> <?php // init core if (file_exists("session.xml")) { $sessionXml = simplexml_load_file("session.xml"); } else { die("session_init.php - session.xml not found"); } // get core system path $corePath = (string) $sessionXml->system->OLIV_CORE_PATH; // include system core include $corePath . "library/core.php"; // create core $core = new OLIVCore($corePath); $core->init("oliv"); // process page $core->loadContent(); // load page content $core->search(); // get search result $core->preProcessor(); // call preprocessor $core->translator(); // call translator $core->render(); // render site $core->postProcessor(); // call postprocessor ?>
//------------------------------------------------------------------------------ // set system constants if ($coreXml) { if ($coreXml->system->children()) { foreach ($coreXml->system->children() as $key => $value) { system::set($key, (string) $value); } } else { die("init.php - no constant definitions found"); } //------------------------------------------------------------------------------ // system includes $part = $coreXml->xpath("includes"); if (count($part[0]->children())) { foreach ($part[0]->children() as $entry) { OLIVCore::loadScript($entry, system::OLIV_INCLUDE_PATH()); } } else { die("init.php - no include definitions found"); } //------------------------------------------------------------------------------ // country definitions if (count($coreXml->country)) { system::set('country', $coreXml->country); } //------------------------------------------------------------------------------ // imagepath definitions if (count($coreXml->imagepath)) { system::set('imagepath', $coreXml->imagepath); } } else {
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Beispiel</title> </head> <body> <?php include "library/core.php"; $core = new OLIVCore(); $core->init("iggmp"); $index = new OLIVIndex(); $url = "index"; $val = ""; $text = "Willkommen beim OLIV Content Management System OLIV ist ein Content-Management-System, das eigentlich für den Ersatz einer bestehenden Internet-Präsentation begonnen wurde, die auf sehr unsauber programmierten und unflexieblen Scripten basierte. Um den gewünschten Anforderungen gerecht zu werden, entstanden einige Vorgaben: Multilingualität in allen Funktionen Multisessionfähigkeit Erweiterbarkeit durch Module Nur PHP > 5.3 aber keine Datenbank nötig Einfachste Bedienung Multilingualtiät Auch andere CM-Systeme beherrschen die Darstellung in mehreren Sprachen. Der Wunsch bei OLIV war jedoch die Integration der Mehrsprachigkeit tief im Grundsystem zu verankern und auf alle Funktionen anzuwenden. So werden zum Beispiel auch die klar lesbaren URLs in die jeweilige Sprache übersetzt. Eine Besonderheit ist auch der mehrsprachige Umgang mit Texten. So wird ein Text von dem ursprünglichen Autor in seiner Sprache verfasst. Der Übersetzer kann nun die einzelnen Teile, wie Überschriften, Absätze, Aufzählungen, etc. einzeln übersetzten. Die Grundstruktur bleibt dabei aber unverändert und ist nur einmal definiert. Wird vom Ursprungsautor eine Änderung vorgenommen, so wird der Übersetzer durch ein internes Messaging-System über diese Änderung benachrichtigt. Bei der Suche ist es so möglich bei der Anzeige der deutschen Version auch anderssprachige Begriffe zu finden, und den entsprechenden deutschen Text anzuzeigen (mit einem Hinweis auf den gesuchten Begriff). Multisession Obwohl OLIV relativ schlank ist, bestand der Wunsch mit einer Installation mehrere Seiten betreiben zu können. Daraus ist ein Session-Modell entstanden. Jede Website kann innerhalb seiner Session alle Inhalte, Templates und Bilder selbst verwalten, nutzt jedoch den nur einmal installierten Core von OLIV. Systemanforderungen OLIV benötigt zum Betrieb lediglich PHP in einer Version nach 5.3. Es ist so ausgelegt, dass jegliche Daten in XML oder INI Files abgelegt werden und somit keine Datenbank benötigt wird. Die Einbindung von Datenbanken ist für Module natürlich möglich und wird in Form eines relationalen Datenbankmoduls auch realisiert. Das OLIV-Grundsystem verzichtet primär auf den Einsatz von JavaScript für die reine Anzeige der Seite. Solche Erweiterungen können nachtrüglich eingeführt werden. Für den Administrator ist JavaScript für die komfortable Bearbeitung der Texte vorgesehen und nutzt den TinyMCE Editor. Bedienung Das Bedienungskonzept ist auf weitestgehende Einfachheit ausgelegt. Ein UNIX/LINUX-artiges Rechtesystem ermöglicht auf Modul- und Seiten- und Artikelebene ein direktes Editieren auf der Seite. Es wird nur für die Systemeinstellungen eine Art Backend genutzt, alle sonstigen Einstellungen erfolgen in der normalen Seitenansicht."; echo $index->insertText($text, $url, $val); print_r($index->find("unix%")); //print_r($index->index); ?> </body> </html>