Пример #1
0
 function __construct($header)
 {
     $menuName = "";
     $templateName = "";
     // load menu items
     $access = $header->access;
     $menuName = (string) $header->param->menu;
     $templateName = (string) $header->param->template;
     if ($templateName and $menuName) {
         $menu = status::pagestructure();
         // permission to display menu
         if (OLIVRight::r($menu->{$menuName})) {
             // load menu template
             $template = OLIVModule::load_template($header);
             // call menu parser
             $menuXml = $this->parse($menu, $menuName, $templateName, $access, status::url());
             $this->template = $template;
             $this->content = $menuXml;
             //echoall($menuXml);
         }
     }
 }
Пример #2
0
 private static function _makePath($page, $path)
 {
     $struct = status::pagestructure();
     $parent = "";
     $parentName = "";
     if ($page) {
         // insert friendly_url of page in path array
         array_push($path, $page);
         // if parent => recursion
         $node = $struct->{$page}->XPath("//*[@submenu = '{$page}']");
         if ($node) {
             $parent = $node[0]->XPath("..");
         }
         if ($parent) {
             $parentName = $parent[0]->getName();
         }
         if ($parentName) {
             return OLIVRoute::_makePath($parentName, $path);
         }
     }
     return $path;
 }