public static function getItems()
    {
        if (self::$items === null) {
            $items = (new Query())
            ->select(['cms_nav.id', 'nav_item_id' => 'cms_nav_item.id', 'nav_container_id', 'parent_nav_id', 'is_hidden', 'layout_file', 'is_offline', 'is_draft', 'is_home', 'cms_nav_item.title', 'publish_from', 'publish_till'])
            ->from('cms_nav')
            ->leftJoin('cms_nav_item', 'cms_nav.id=cms_nav_item.nav_id')
            ->orderBy(['sort_index' => SORT_ASC])
            ->where(['cms_nav_item.lang_id' => Lang::getDefault()['id'], 'cms_nav.is_deleted' => false, 'cms_nav.is_draft' => false])
            ->all();
            
            self::loadInheritanceData(0);
            
            $data = [];
            
            foreach ($items as $key => $item) {
                $item['is_editable'] = (int) Yii::$app->adminuser->canRoute('cmsadmin/page/update');
                $item['toggle_open'] = (int) Yii::$app->adminuser->identity->setting->get('tree.'.$item['id']);
                
                // the user have "page edit" permission, now we can check if the this group has more fined tuned permisionss from the
                // cms_nav_permissions table or not
                if ($item['is_editable']) {
                    $permitted = false;
                    
                    foreach (Yii::$app->adminuser->identity->groups as $group) {
                        if ($permitted) {
                            continue;
                        }
                        
                        $permitted = self::navGroupPermission($item['id'], $group->id);
                    }

                    if (!$permitted) {
                        $value = (isset(self::$_inheritData[$item['id']])) ? self::$_inheritData[$item['id']] : false;
                        if ($value === true) {
                            $permitted = true;
                        }
                    }
                    
                    $item['is_editable'] = $permitted;
                }
            
                $data[$key] = $item;
            }
            
            self::$items = $data;
        }
        
        return self::$items;
    }
public static function getItems()
    {
        if (self::$items === null) {
            $items = (new Query())
            ->select(['cms_nav.id', 'nav_item_id' => 'cms_nav_item.id', 'nav_container_id', 'parent_nav_id', 'is_hidden', 'layout_file', 'is_offline', 'is_draft', 'is_home', 'cms_nav_item.title', 'publish_from', 'publish_till'])
            ->from('cms_nav')
            ->leftJoin('cms_nav_item', 'cms_nav.id=cms_nav_item.nav_id')
            ->orderBy(['sort_index' => SORT_ASC])
            ->where(['cms_nav_item.lang_id' => Lang::getDefault()['id'], 'cms_nav.is_deleted' => false, 'cms_nav.is_draft' => false])
            ->all();
            
            self::loadInheritanceData(0);
            
            $data = [];
            
            foreach ($items as $key => $item) {
                $item['is_editable'] = (int) Yii::$app->adminuser->canRoute('cmsadmin/page/update');
                $item['toggle_open'] = (int) Yii::$app->adminuser->identity->setting->get('tree.'.$item['id']);
                
                // the user have "page edit" permission, now we can check if the this group has more fined tuned permisionss from the
                // cms_nav_permissions table or not
                if ($item['is_editable']) {
                    $permitted = false;
                    
                    foreach (Yii::$app->adminuser->identity->groups as $group) {
                        if ($permitted) {
                            continue;
                        }
                        
                        $permitted = self::navGroupPermission($item['id'], $group->id);
                    }

                    if (!$permitted) {
                        $value = (isset(self::$_inheritData[$item['id']])) ? self::$_inheritData[$item['id']] : false;
                        if ($value === true) {
                            $permitted = true;
                        }
                    }
                    
                    $item['is_editable'] = $permitted;
                }
            
                $data[$key] = $item;
            }
            
            self::$items = $data;
        }
        
        return self::$items;
    }
public static function getItems ( ) { if ( self :: $ items === null ) { $ items = ( new Query ( ) ) -> select ( [ 'cms_nav.id' , 'nav_item_id' => 'cms_nav_item.id' , 'nav_container_id' , 'parent_nav_id' , 'is_hidden' , 'layout_file' , 'is_offline' , 'is_draft' , 'is_home' , 'cms_nav_item.title' , 'publish_from' , 'publish_till' ] ) -> from ( 'cms_nav' ) -> leftJoin ( 'cms_nav_item' , 'cms_nav.id=cms_nav_item.nav_id' ) -> orderBy ( [ 'sort_index' => SORT_ASC ] ) -> where ( [ 'cms_nav_item.lang_id' => Lang :: getDefault ( ) [ 'id' ] , 'cms_nav.is_deleted' => false , 'cms_nav.is_draft' => false ] ) -> all ( ) ; self :: loadInheritanceData ( 0 ) ; $ data = [ ] ; foreach ( $ items as $ key => $ item ) { $ item [ 'is_editable' ] = ( int ) Yii :: $ app -> adminuser -> canRoute ( 'cmsadmin/page/update' ) ; $ item [ 'toggle_open' ] = ( int ) Yii :: $ app -> adminuser -> identity -> setting -> get ( 'tree.' . $ item [ 'id' ] ) ; // the user have "page edit" permission, now we can check if the this group has more fined tuned permisionss from the // cms_nav_permissions table or not if ( $ item [ 'is_editable' ] ) { $ permitted = false ; foreach ( Yii :: $ app -> adminuser -> identity -> groups as $ group ) { if ( $ permitted ) { continue ; } $ permitted = self :: navGroupPermission ( $ item [ 'id' ] , $ group -> id ) ; } if ( ! $ permitted ) { $ value = ( isset ( self :: $ _inheritData [ $ item [ 'id' ] ] ) ) ? self :: $ _inheritData [ $ item [ 'id' ] ] : false ; if ( $ value === true ) { $ permitted = true ; } } $ item [ 'is_editable' ] = $ permitted ; } $ data [ $ key ] = $ item ; } self :: $ items = $ data ; } return self :: $ items ; }
Get all nav data entries with corresponding item content

@return array
Get all nav data entries with corresponding item content