public function banners()
    {
        //Only admins and managers can access these controllers
        if (!$this->Auth->isGroup(['admin', 'manager'])) {
            return;
        }

        $links[] = [__d('me_cms', 'List banners'), [
            'controller' => 'Banners',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Upload banners'), [
            'controller' => 'Banners',
            'action' => 'upload',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admin can access this controller
        if ($this->Auth->isGroup('admin')) {
            $links[] = [__d('me_cms', 'List positions'), [
                'controller' => 'BannersPositions',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add position'), [
                'controller' => 'BannersPositions',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        return [$links, __d('me_cms', 'Banners'), ['icon' => 'shopping-cart']];
    }
public function banners()
    {
        //Only admins and managers can access these controllers
        if (!$this->Auth->isGroup(['admin', 'manager'])) {
            return;
        }

        $links[] = [__d('me_cms', 'List banners'), [
            'controller' => 'Banners',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Upload banners'), [
            'controller' => 'Banners',
            'action' => 'upload',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admin can access this controller
        if ($this->Auth->isGroup('admin')) {
            $links[] = [__d('me_cms', 'List positions'), [
                'controller' => 'BannersPositions',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add position'), [
                'controller' => 'BannersPositions',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        return [$links, __d('me_cms', 'Banners'), ['icon' => 'shopping-cart']];
    }
public function banners ( ) { //Only admins and managers can access these controllers if ( ! $ this -> Auth -> isGroup ( [ 'admin' , 'manager' ] ) ) { return ; } $ links [ ] = [ __d ( 'me_cms' , 'List banners' ) , [ 'controller' => 'Banners' , 'action' => 'index' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; $ links [ ] = [ __d ( 'me_cms' , 'Upload banners' ) , [ 'controller' => 'Banners' , 'action' => 'upload' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; //Only admin can access this controller if ( $ this -> Auth -> isGroup ( 'admin' ) ) { $ links [ ] = [ __d ( 'me_cms' , 'List positions' ) , [ 'controller' => 'BannersPositions' , 'action' => 'index' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; $ links [ ] = [ __d ( 'me_cms' , 'Add position' ) , [ 'controller' => 'BannersPositions' , 'action' => 'add' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; } return [ $ links , __d ( 'me_cms' , 'Banners' ) , [ 'icon' => 'shopping-cart' ] ] ; }
Internal function to generate the menu for "banners" actions
@return mixed Array with links, title and title options
Internal function to generate the menu for banners actions