6.X/traits/menus.php
/**
     * Prepare all website menus
     *
     * Read the 'handle_menus' setting and load the appropriate menus, including the 'admin' menu.
     */
Prepare all website menus
Read the 'handle_menus' setting and load the appropriate menus, including the 'admin' menu.
Prepare all website menus Read the ' handle_menus ' setting and load the appropriate menus including the ' admin ' menu .
public function prepare_menus()
    {
        global $smarty;
        if ($this->auth->credentials("admin,author,editor,oper,seo,copywriter,buh,manager,staff,owner")) {
            $menu = $this->section_menu("admin", 0);
            $this->scan_selected($menu);
            $this->menus['admin'] = $menu;
        }
        $r = $this->get_setting('handle_menus');
        if (!$r) {
            return false;
        }
        $nsr = $this->get_setting('no_spath_menus');
        $x = explode(',', $nsr);
        $no_spath = [];
        foreach($x as $ns_code){
            $no_spath[$ns_code] = true;
        }
        $this->no_spath = $no_spath;
        $x = explode(',', $r);
        foreach($x as $v){
            unset($menu);
            $xx = explode('/', $v);
            $code = $xx[0];
            $t = $xx[1];
            $menu = $this->section_menu($code, 0);
            $this->scan_selected($menu);
            if ($t == 'mlv') {
                $mlv = [];
                $mlv = $this->menu_levels($menu, $mlv);
                $this->mlv[$code] = $mlv;
            }
            $this->menus[$code] = $menu;
        }
        $smarty->assign("menus", $this->menus);
        $smarty->assign("mlv", $this->mlv);
        return true;
    }
public function prepare_menus ( ) { global $ smarty ; if ( $ this -> auth -> credentials ( " admin,author,editor,oper,seo,copywriter,buh,manager,staff,owner " ) ) { $ menu = $ this -> section_menu ( " admin " , 0 ) ; $ this -> scan_selected ( $ menu ) ; $ this -> menus [ 'admin' ] = $ menu ; } $ r = $ this -> get_setting ( 'handle_menus' ) ; if ( ! $ r ) { return false ; } $ nsr = $ this -> get_setting ( 'no_spath_menus' ) ; $ x = explode ( ',' , $ nsr ) ; $ no_spath = [ ] ; foreach ( $ x as $ ns_code ) { $ no_spath [ $ ns_code ] = true ; } $ this -> no_spath = $ no_spath ; $ x = explode ( ',' , $ r ) ; foreach ( $ x as $ v ) { unset ( $ menu ) ; $ xx = explode ( '/' , $ v ) ; $ code = $ xx [ 0 ] ; $ t = $ xx [ 1 ] ; $ menu = $ this -> section_menu ( $ code , 0 ) ; $ this -> scan_selected ( $ menu ) ; if ( $ t == 'mlv' ) { $ mlv = [ ] ; $ mlv = $ this -> menu_levels ( $ menu , $ mlv ) ; $ this -> mlv [ $ code ] = $ mlv ; } $ this -> menus [ $ code ] = $ menu ; } $ smarty -> assign ( " menus " , $ this -> menus ) ; $ smarty -> assign ( " mlv " , $ this -> mlv ) ; return true ; }
Prepare all website menus
 Read the 'handle_menus' setting and load the appropriate menus, including the 'admin' menu.
Prepare all website menus Read the ' handle_menus ' setting and load the appropriate menus including the ' admin ' menu .