public function getMenu(\yii\base\Action $action, ActiveRecord $model, $readOnly = false, $horizontal = true)
    {
        /** @var ActiveController $owner */
        $owner = $this->owner;
        $menu = [
            self::SECT_COMMON => [],
            self::SECT_CURRENT => [],
        ];

        $defaultActions = $this->getDefaultActions();
        $privs = $this->getMenuPrivileges($defaultActions, $model, array_keys($menu), $readOnly);
        $confirms = [
            'leave' => Yii::t('app', 'Are you sure you want to leave this page? Unsaved changes will be discarded.'),
            'delete' => Yii::t('app', 'Are you sure you want to delete this item?'),
            'disable' => Yii::t('app', 'Are you sure you want to disable this item?'),
        ];

        $menu[self::SECT_COMMON] = $owner->getMenuCommon($action, $model, $horizontal, $privs[self::SECT_COMMON], $defaultActions, $confirms);
        $menu[self::SECT_CURRENT] = $owner->getMenuCurrent($action, $model, $horizontal, $privs[self::SECT_CURRENT], $defaultActions, $confirms);


        return $this->processMenu($menu, $horizontal);
    }
public function getMenu(\yii\base\Action $action, ActiveRecord $model, $readOnly = false, $horizontal = true)
    {
        /** @var ActiveController $owner */
        $owner = $this->owner;
        $menu = [
            self::SECT_COMMON => [],
            self::SECT_CURRENT => [],
        ];

        $defaultActions = $this->getDefaultActions();
        $privs = $this->getMenuPrivileges($defaultActions, $model, array_keys($menu), $readOnly);
        $confirms = [
            'leave' => Yii::t('app', 'Are you sure you want to leave this page? Unsaved changes will be discarded.'),
            'delete' => Yii::t('app', 'Are you sure you want to delete this item?'),
            'disable' => Yii::t('app', 'Are you sure you want to disable this item?'),
        ];

        $menu[self::SECT_COMMON] = $owner->getMenuCommon($action, $model, $horizontal, $privs[self::SECT_COMMON], $defaultActions, $confirms);
        $menu[self::SECT_CURRENT] = $owner->getMenuCurrent($action, $model, $horizontal, $privs[self::SECT_CURRENT], $defaultActions, $confirms);


        return $this->processMenu($menu, $horizontal);
    }
public function getMenu ( \ yii \ base \ Action $ action , ActiveRecord $ model , $ readOnly = false , $ horizontal = true ) { /** @var ActiveController $owner */ $ owner = $ this -> owner ; $ menu = [ self :: SECT_COMMON => [ ] , self :: SECT_CURRENT => [ ] , ] ; $ defaultActions = $ this -> getDefaultActions ( ) ; $ privs = $ this -> getMenuPrivileges ( $ defaultActions , $ model , array_keys ( $ menu ) , $ readOnly ) ; $ confirms = [ 'leave' => Yii :: t ( 'app' , 'Are you sure you want to leave this page? Unsaved changes will be discarded.' ) , 'delete' => Yii :: t ( 'app' , 'Are you sure you want to delete this item?' ) , 'disable' => Yii :: t ( 'app' , 'Are you sure you want to disable this item?' ) , ] ; $ menu [ self :: SECT_COMMON ] = $ owner -> getMenuCommon ( $ action , $ model , $ horizontal , $ privs [ self :: SECT_COMMON ] , $ defaultActions , $ confirms ) ; $ menu [ self :: SECT_CURRENT ] = $ owner -> getMenuCurrent ( $ action , $ model , $ horizontal , $ privs [ self :: SECT_CURRENT ] , $ defaultActions , $ confirms ) ; return $ this -> processMenu ( $ menu , $ horizontal ) ; }
Builds navigation items like the sidebar menu.
@param \yii\base\Action       $action
@param ActiveRecord $model
@param boolean      $readOnly   should the method generate links for create/update/delete actions
@param boolean $horizontal if menu will be displayed as horizontal pills,
in that case group titles are not added
@return array
Builds navigation items like the sidebar menu .