Пример #1
0
 public function getSearch()
 {
     $content = new simpleXmlElement("<search></search>");
     if (argv::action() == "search") {
         OLIVPlugin::call($content, "search");
         status::set("search_result", $content);
     }
 }
Пример #2
0
    $user = $_SESSION['user'] = "";
}
// change user login state
switch (argv::action()) {
    case 'login':
        if (OLIVUser::checkPassword(argv::login(), argv::password())) {
            $user = argv::login();
            // remove login parameters
            argv::remove('action');
            argv::remove('login');
            argv::remove('password');
        }
        break;
    case 'logout':
        $user = "";
        break;
    default:
        break;
}
// set user status
$_SESSION['user'] = $user;
status::set('OLIV_USER', $_SESSION['user']);
// set superuser state
if (OLIVUser::superUser(status::OLIV_USER())) {
    status::set('OLIV_SU', TRUE);
} else {
    status::set('OLIV_SU', FALSE);
}
//echoall(system::getAll());
//echoall(status::getAll());
//------------------------------------------------------------------------------
Пример #3
0
 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());
     }
 }
Пример #4
0
 public function scan($lang)
 {
     $path = system::OLIV_PAGE_PATH() . "page.xml";
     if (sessionfile_exists($path)) {
         $pageXml = sessionxml_load_file($path);
         status::set("pages", $pageXml->define);
         status::set("pagestructure", $pageXml->structure);
         OLIVText::writeSource(status::pages(), $path);
     } else {
         OLIVError::fire("page::scan - page.xml not found -> rescan");
     }
 }