Add this page, and all it's submenus, to the admin sidebar.

Internally used when the admin_menu action is called.
This function is called by AdminPage::register().
420807
public function add_menu_page()
    {
        extract( $this->config );
        $icon .= '' != $class ? '" class="'.$class : '';
        $icon .= array() != $style ? '" style="'.$this->array_to_css($style) : '';
        $page = $this->config['submenu-pages'][0];
        
        \add_menu_page( 
            $title, 
            $title, 
            $page['capability'], 
            $slug,
            $page['content'],
            $icon,
            $position
        );
        
        if( count($this->config['submenu-pages']) > 1 )
        {
            $this->add_submenu_pages();
        }
    }
73987
public function registerEditorPage()
    {
        $this->register(
            $pageTitle = __('Modularity editor'),
            $menuTitle = __('Editor'),
            $capability = 'edit_posts',
            $menuSlug = 'modularity-editor',
            $iconUrl = null,
            $position = 1,
            $parent = 'options.php'
        );
    }
421980
public function addSidebarsMetaBoxes()
    {
        global $wp_registered_sidebars;

        $template = \Modularity\Helper\Post::getPostTemplate();
        $sidebars = null;

        $activeAreas = $this->getActiveAreas($template);


        // Add no active sidebars message if no active sidebars exists
        if (is_array($activeAreas) && count($activeAreas) === 0) {
            add_meta_box(
                'no-sidebars',
                __('No active sidebar areas', 'modularity'),
                function () {
                    echo '<p>' . __('There\'s no active sidebars. Please activate sidebar areas in the Modularity Options to add modules.', 'modularity') . '</p>';
                },
                $this->screenHook,
                'normal',
                'low',
                null
            );

            return;
        }

        if (is_array($activeAreas) && !empty($activeAreas)) {
            foreach ($activeAreas as $area) {
                if (isset($wp_registered_sidebars[$area])) {
                    $sidebars[$area] = $wp_registered_sidebars[$area];
                }
            }

            if (is_array($sidebars)) {
                foreach ($sidebars as $sidebar) {
                    $this->sidebarMetaBox($sidebar);
                }
            }
        }
    }
1193908
public function addAction()
    {
        $isPosted = $this->request->getPost('doCreate');
        
        if (!$isPosted) {
            $this->response->redirect($this->request->getPost('redirect'));
        }

        $comment = [
            'content'   => $this->request->getPost('content'),
            'name'      => $this->request->getPost('name'),
            'web'       => $this->request->getPost('web'),
            'mail'      => $this->request->getPost('mail'),
            'timestamp' => time(),
            'ip'        => $this->request->getServer('REMOTE_ADDR'),
        ];

        $comments = new \Phpmvc\Comment\CommentsInSession();
        $comments->setDI($this->di);

        $comments->add($comment);

        $this->response->redirect($this->request->getPost('redirect'));
    }
1268111
public function AddSideMenu($CurrentUrl = '') {
      if (!$this->User)
         return;
      
      // Make sure to add the "Edit Profile" buttons.
      $this->AddModule('ProfileOptionsModule');
      
      // Show edit menu if in edit mode
      // Show profile pic & filter menu otherwise
      $SideMenu = new SideMenuModule($this);
      $this->EventArguments['SideMenu'] = &$SideMenu; // Doing this out here for backwards compatibility.
      if ($this->EditMode) {
         $this->AddModule('UserBoxModule');
         $this->BuildEditMenu($SideMenu, $CurrentUrl);
         $this->FireEvent('AfterAddSideMenu');
         $this->AddModule($SideMenu, 'Panel');
      } else {
         // Make sure the userphoto module gets added to the page
         $this->AddModule('UserPhotoModule');

         // And add the filter menu module
         $this->FireEvent('AfterAddSideMenu');
         $this->AddModule('ProfileFilterModule');
      }
   }
1208839
protected function _addFromConfigure()
    {
        $configure = Configure::read('Menu.Register');

        if (!is_array($configure)) {
            $configure = [];
        }

        foreach ($configure as $key => $item) {
            $this->add($key, $item);
        }
    }
893356
protected function registerBreadcrumb()
    {
        BreadcrumbFacade::make(
            'admin.dashboard',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('avored-framework::breadcrumb.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.page.index',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Page')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.page.create',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.page.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.page.edit',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.page.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.page.show',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.page.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.menu.index',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Menu')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.category.index',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Category')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.category.create',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.category.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.category.edit',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.category.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.category.show',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.category.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.product.index',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Product')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.product.create',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.product.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.product.edit', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.product.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.product.show', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.product.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.order.index', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Order')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.order.view', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('View')
                    ->parent('admin.dashboard')
                    ->parent('admin.order.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.order-status.index', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Order Status')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.order-status.create', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.order-status.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.order-status.edit', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.order-status.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.order-status.show', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.order-status.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.attribute.index', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Attribute')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.attribute.create', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.attribute.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.attribute.edit', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.attribute.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.attribute.show', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.attribute.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.property.index', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Property')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.property.create', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.property.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.property.edit', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.property.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.property.show', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.property.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.user.index', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('User')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.user.create', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.user.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.user.edit', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.user.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.user.show', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.user.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.user-group.index', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('User Group')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.user-group.create', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.user-group.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.user-group.edit', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.user-group.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.user-group.show', function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.user-group.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.admin-user.index', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Admin User')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.admin-user.create',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.admin-user.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.admin-user.edit',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.admin-user.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.admin-user.show',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.admin-user.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.role.index',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Role')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.role.create',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.role.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.role.edit',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.role.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.role.show', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.role.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.configuration', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Configuration')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.site-currency.index', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Site Currency')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.site-currency.create', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.site-currency.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.site-currency.edit', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.site-currency.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.site-currency.show', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.site-currency.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.country.index', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Country')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.country.create', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.country.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.country.edit', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.country.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.country.show', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Show')
                    ->parent('admin.dashboard')
                    ->parent('admin.country.index');
            }
        );
        BreadcrumbFacade::make(
            'admin.state.index', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('State')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.state.create', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Create')
                    ->parent('admin.dashboard')
                    ->parent('admin.state.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.state.edit', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.state.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.state.show', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Edit')
                    ->parent('admin.dashboard')
                    ->parent('admin.state.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.module.index', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Module')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.module.create',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Upload')
                    ->parent('admin.dashboard')
                    ->parent('admin.module.index');
            }
        );

        BreadcrumbFacade::make(
            'admin.theme.index',
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Theme')
                    ->parent('admin.dashboard');
            }
        );

        BreadcrumbFacade::make(
            'admin.theme.create', 
            function (Breadcrumb $breadcrumb) {
                $breadcrumb->label('Upload')
                    ->parent('admin.dashboard')
                    ->parent('admin.theme.index');
            }
        );
    }
1118858
private function AddMenuAccessField()
    {
        $name = 'MenuAccess';
        $value = $this->page->Exists() ? $this->page->GetMenuAccess() : (string)MenuAccess::Authorized();
        $select = new Select($name, $value);
        foreach (MenuAccess::AllowedValues() as $access)
        {
            $select->AddOption($access, Trans("Core.PageForm.$name.$access"));
        }
        $this->AddField($select);
        $this->SetRequired($name);
    }
1046752
protected function registerAdminMenu()
    {
        AdminMenuFacade::add(
            'shop',
            function (AdminMenu $shopMenu) {
                $shopMenu
                    ->label('avored-framework::system.admin_menu.catalog')
                    ->route('#')
                    ->icon('ti-shopping-cart');
            }
        );

        $shopMenu = AdminMenuFacade::get('shop');
        $shopMenu->subMenu(
            'category',
            function (AdminMenu $menu) {
                $menu->key('category')
                    ->label('avored-framework::system.admin_menu.categories')
                    ->route('admin.category.index');
            }
        );

        $shopMenu->subMenu(
            'product',
            function (AdminMenu $menu) {
                $menu->key('category')
                    ->label('avored-framework::system.admin_menu.products')
                    ->route('admin.product.index');
            }
        );

        $shopMenu->subMenu(
            'attribute',
            function (AdminMenu $menu) {
                $menu->key('attribute')
                    ->label('avored-framework::system.admin_menu.products_attributes')
                    ->route('admin.attribute.index');
            }
        );

        $shopMenu->subMenu(
            'property',
            function (AdminMenu $menu) {
                $menu->key('property')
                    ->label('avored-framework::system.admin_menu.property')
                    ->route('admin.property.index');
            }
        );

        AdminMenuFacade::add(
            'content', 
            function (AdminMenu $menu) {
                $menu->label('avored-framework::system.admin_menu.content')
                    ->route('#')
                    ->icon('ti-files');
            }
        );

        $contentMenu = AdminMenuFacade::get('content');
        $contentMenu->subMenu(
            'page',
            function (AdminMenu $menu) {
                $menu->key('page')
                    ->label('avored-framework::system.admin_menu.pages')
                    ->route('admin.page.index');
            }
        );

        $contentMenu->subMenu(
            'menu', 
            function (AdminMenu $menu) {
                $menu->key('menu')
                    ->label('avored-framework::system.admin_menu.menu')
                    ->route('admin.menu.index');
            }
        );

        AdminMenuFacade::add(
            'user',
            function (AdminMenu $menu) {
                $menu->label('avored-framework::system.admin_menu.customers')
                    ->route('#')
                    ->icon('ti-user');
            }
        );

        $userMenu = AdminMenuFacade::get('user');

        $userMenu->subMenu(
            'user',
            function (AdminMenu $menu) {
                $menu->key('user')
                    ->label('avored-framework::system.admin_menu.overview')
                    ->route('admin.user.index');
            }
        );
        $userMenu->subMenu(
            'user_group', 
            function (AdminMenu $menu) {
                $menu->key('user_group')
                    ->label('avored-framework::system.admin_menu.customers_groups')
                    ->route('admin.user-group.index');
            }
        );

        $userMenu->subMenu(
            'user_delete_request',
            function (AdminMenu $menu) {
                $menu->key('user_delete_request')
                    ->label('avored-framework::system.admin_menu.user_delete_request')
                    ->route('admin.user-delete-request.index')
                    ->icon('ti-users');
            }
        );

        AdminMenuFacade::add(
            'orders',
            function (AdminMenu $menu) {
                $menu->label('avored-framework::system.admin_menu.orders')
                    ->route('#')
                    ->icon('ti-truck');
            }
        );

        $orderMenu = AdminMenuFacade::get('orders');
        $orderMenu->subMenu(
            'order',
            function (AdminMenu $menu) {
                $menu->key('order')
                    ->label('avored-framework::system.admin_menu.overview')
                    ->route('admin.order.index');
            }
        );
        $orderMenu->subMenu(
            'order_return_request',
            function (AdminMenu $menu) {
                $menu->key('order_return_request')
                    ->label('avored-framework::system.admin_menu.order_return_request')
                    ->route('admin.order-return-request.index');
            }
        );

        $orderMenu->subMenu(
            'order_status', function (AdminMenu $menu) {
                $menu->key('order')
                    ->label('avored-framework::system.admin_menu.order_status')
                    ->route('admin.order-status.index');
            }
        );

        AdminMenuFacade::add(
            'system',
            function (AdminMenu $systemMenu) {
                $systemMenu->label('avored-framework::system.admin_menu.settings')
                    ->route('#')
                    ->icon('ti-settings');
            }
        );

        $systemMenu = AdminMenuFacade::get('system');
        $systemMenu->subMenu(
            'configuration',
            function (AdminMenu $menu) {
                $menu->key('configuration')
                    ->label('avored-framework::system.admin_menu.configuration')
                    ->route('admin.configuration')
                    ->icon('ti-settings');
            }
        );

        $systemMenu->subMenu(
            'language',
            function (AdminMenu $menu) {
                $menu->key('language')
                    ->label('avored-framework::system.admin_menu.language')
                    ->route('admin.language.index')
                    ->icon('ti-settings');
            }
        );

        $systemMenu->subMenu(
            'site_currency_setup',
            function (AdminMenu $menu) {
                $menu->key('site_currency_setup')
                    ->label('avored-framework::system.admin_menu.currencies')
                    ->route('admin.site-currency.index');
            }
        );

        $systemMenu->subMenu(
            'country',
            function (AdminMenu $menu) {
                $menu->key('country')
                    ->label('avored-framework::system.admin_menu.country')
                    ->route('admin.country.index');
            }
        );

        $systemMenu->subMenu(
            'state',
            function (AdminMenu $menu) {
                $menu->key('state')
                    ->label('avored-framework::system.admin_menu.state')
                    ->route('admin.state.index');
            }
        );
        $systemMenu->subMenu(
            'tax_group',
            function (AdminMenu $menu) {
                $menu->key('tax_group')
                    ->label('avored-framework::system.admin_menu.tax_group')
                    ->route('admin.tax-group.index');
            }
        );
        $systemMenu->subMenu(
            'tax_rate',
            function (AdminMenu $menu) {
                $menu->key('tax_rate')
                    ->label('avored-framework::system.admin_menu.tax_rate')
                    ->route('admin.tax-rate.index');
            }
        );

        $systemMenu->subMenu(
            'module',
            function (AdminMenu $menu) {
                $menu->key('module')
                    ->label('avored-framework::system.admin_menu.modules')
                    ->route('admin.module.index');
            }
        );

        $systemMenu->subMenu(
            'admin-user',
            function (AdminMenu $menu) {
                $menu->key('admin-user')
                    ->label('avored-framework::system.admin_menu.staff')
                    ->route('admin.admin-user.index');
            }
        );

        $systemMenu->subMenu(
            'role',
            function (AdminMenu $menu) {
                $menu->key('role')
                    ->label('avored-framework::system.admin_menu.roles_permissions')
                    ->route('admin.role.index');
            }
        );

        $systemMenu->subMenu(
            'themes', 
            function (AdminMenu $menu) {
                $menu->key('themes')
                    ->label('avored-framework::system.admin_menu.themes')
                    ->route('admin.theme.index');
            }
        );
    }
526952
public function registerMenuSubPage($slug, $parent_slug, $title, $permissions = null, $link = null, $icon = null)
    {
        $slug = trim(Str::slug($slug));
        $title = trim($title);
        if ( ! is_array($permissions)) {
            $permissions = (array)$permissions;
        }
        $link = trim($link);

        if ( ! $this->menuPageExists($parent_slug)) {
            return false;
        }

        if (empty($permissions)) {
            $permissions = $this->getMenuPage($parent_slug)[ 'permissions' ];
        }

        $this->menuLinks[ $parent_slug ][ 'subMenu' ][ $slug ] = [
            'title'       => $title,
            'permissions' => $permissions,
            'link'        => $link,
            'icon'        => $icon,
        ];

        return $slug;
    }
985401
function admin_menu() 
	{
	
		global $pagenow;

		
		// validate page
		if( ! $this->validate_page() ) return;
		
		
		// set page type
		$filter = array();
		
		if( $pagenow == "admin.php" && isset( $_GET['page'], $_GET['id'] ) && $_GET['page'] == "shopp-categories" )
		{
			// filter
			$_GET['id'] = filter_var($_GET['id'], FILTER_SANITIZE_STRING);
			
			
			$this->data['page_type'] = "shopp_category";
			$filter['ef_taxonomy'] = "shopp_category";
			
			$this->data['page_action'] = "add";
			$this->data['option_name'] = "";
			
			if( $_GET['id'] != "new" )
			{
				$this->data['page_action'] = "edit";
				$this->data['option_name'] = "shopp_category_" . $_GET['id'];
			}
			
		}
		if( $pagenow == "edit-tags.php" && isset($_GET['taxonomy']) )
		{
			// filter
			$_GET['taxonomy'] = filter_var($_GET['taxonomy'], FILTER_SANITIZE_STRING);
			
			
			$this->data['page_type'] = "taxonomy";
			$filter['ef_taxonomy'] = $_GET['taxonomy'];
			
			$this->data['page_action'] = "add";
			$this->data['option_name'] = "";
			
			if( isset($_GET['action']) && $_GET['action'] == "edit" )
			{
				// filter
				$_GET['tag_ID'] = filter_var($_GET['tag_ID'], FILTER_SANITIZE_NUMBER_INT);
			
				$this->data['page_action'] = "edit";
				$this->data['option_name'] = $_GET['taxonomy'] . "_" . $_GET['tag_ID'];
			}
			
		}
		elseif( $pagenow == "profile.php" )
		{
			
			$this->data['page_type'] = "user";
			$filter['ef_user'] = get_current_user_id();
			
			$this->data['page_action'] = "edit";
			$this->data['option_name'] = "user_" . get_current_user_id();
			
		}
		elseif( $pagenow == "user-edit.php" && isset($_GET['user_id']) )
		{
			// filter
			$_GET['user_id'] = filter_var($_GET['user_id'], FILTER_SANITIZE_NUMBER_INT);

			
			$this->data['page_type'] = "user";
			$filter['ef_user'] = $_GET['user_id'];
			
			$this->data['page_action'] = "edit";
			$this->data['option_name'] = "user_" . $_GET['user_id'];
			
		}
		elseif( $pagenow == "user-new.php" )
		{
			$this->data['page_type'] = "user";
			$filter['ef_user'] ='all';
			
			$this->data['page_action'] = "add";
			$this->data['option_name'] = "";

		}
		elseif( $pagenow == "media.php" || $pagenow == 'upload.php' )
		{
			
			$this->data['page_type'] = "media";
			$filter['post_type'] = 'attachment';
			
			$this->data['page_action'] = "add";
			$this->data['option_name'] = "";
			
			if(isset($_GET['attachment_id']))
			{
				// filter
				$_GET['attachment_id'] = filter_var($_GET['attachment_id'], FILTER_SANITIZE_NUMBER_INT);
			
			
				$this->data['page_action'] = "edit";
				$this->data['option_name'] = $_GET['attachment_id'];
			}

		}
		
		
		// get field groups
		$metabox_ids = array();
		$this->data['metabox_ids'] = apply_filters( 'acf/location/match_field_groups', $metabox_ids, $filter );

		
		// dont continue if no ids were found
		if( empty( $this->data['metabox_ids'] ) )
		{
			return false;	
		}
		
		
		// actions
		add_action('admin_enqueue_scripts', array($this,'admin_enqueue_scripts'));
		add_action('admin_head', array($this,'admin_head'));
		
		
	}
269391
protected function _addNotificationMenu()
    {
        $this->Menu->area('headerLeft');

        $this->Menu->add('notifier.notifications', [
            'title' => __d('CakeAdmin', 'Notifications ({0})', $this->Notifier->countNotifications(null, true)),
            'url' => '#',
            'weight' => 5
        ]);

        $notifications = $this->Notifier->getNotifications(null, true);

        foreach ($notifications as $not) {
            $this->Menu->add('notifier.notifications.' . $not->id, [
                'parent' => 'notifier.notifications',
                'title' => $not->title,
                'url' => [
                    'prefix' => 'admin',
                    'plugin' => 'CakeAdmin',
                    'controller' => 'Notifications',
                    'action' => 'index'
                ]
            ]);
        }

        $this->Menu->add('notifier.notifications.url', [
            'parent' => 'notifier.notifications',
            'title' => '> ' . __d('CakeAdmin', 'All Notifications'),
            'url' => [
                'prefix' => 'admin',
                'plugin' => 'CakeAdmin',
                'controller' => 'Notifications',
                'action' => 'index'
            ]
        ]);
    }
896400
public function add()
    {
        $this->request->allowMethod(['get', 'post']);

        $menu = $this->Menus->newEntity();
        if ($this->request->is('post') && !empty($this->request->data)) {
            $this->Menus->patchEntity($menu, $this->request->data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been created.', $this->request->data['name']));
                $this->redirect(['action' => 'index']);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set('menu', $menu);
    }
1340506
protected function addPage()
    {
        try {
            $values = $this->defaultPage;
            $values['TemplateName'] = $this->templateManager->getTemplate()->getTemplateName();

            $result = $this->pageManager
                ->set(null)
                ->save($values)
            ;

            if (! $result) {
                $this->errorMessage = "An error occoured during the saving of the new page";
            }

            return $result;
        } catch (\Exception $ex) {
            $this->errorMessage = "An error occoured during the saving of the new page. The reported error is: " . $ex->getMessage();

            return false;
        }
    }
1173959
public function adminBar()
    {
        if (isset($_GET['id'])) {
            if (is_numeric($_GET['id']) && $_GET['id'] > 0) {
                $post = get_post($_GET['id']);

                if (!$post) {
                    return;
                }

                setup_postdata($post);

                add_action('admin_bar_menu', function () use ($post) {
                    global $wp_admin_bar;
                    $wp_admin_bar->add_node(array(
                        'id' => 'view_page',
                        'title' => __('View Page'),
                        'href' => get_permalink($post->ID),
                        'meta' => array(
                            'target' => '_blank'
                        )
                    ));
                }, 1050);

                self::$isEditing = array(
                    'id' => $post->ID,
                    'title' => $post->post_title
                );

                wp_reset_postdata();
            } else {
                global $archive;
                $archive = $_GET['id'];

                self::$isEditing = array(
                    'id' => null,
                    'title' => $archive
                );
            }

            self::$isEditing = apply_filters('Modularity/is_editing', self::$isEditing);

            add_action('Modularity/options_page_title_suffix', function () {
                echo ': ' . self::$isEditing['title'];
            });
        }
    }
676729
public function addMenu()
    {
        $menuLocations = $this->wpProvider
            ->getNavMenuLocations();

        $data = [];

        foreach ($menuLocations as $menuLocation => $menuId) {
            $menu = $this->wpProvider
                ->wpGetNavMenuItems($menuId);

            foreach ($menu as $menuItem) {
                $item = new stdClass();

                /**
                 * @var WpPost $menuItem
                 */
                $item->item = $menuItem->title;
                $item->link = $menuItem->url;
                $item->active = (Path::getCurrentUrl() === $menuItem->url) ? true : false;

                $data[$menuLocation][] = $item;
            }
        }

        $this->mergeToTheData($data);
        return $this;
    }
1260939
public function actionAdd ()
		{

			$menu = new Menu();
			$this->_tpl = '@menuViews/add';
			$this->setTitle(Yii::tr('Add menu item', [], 'menu'));
			$type = MenuType::findOne(Yii::$app->request->get('type'));
			if ($type == null)
				return;
			$root = null;
			$parentId = Yii::$app->request->get('parentID');
			if (!is_null($parentId))
			{
				$root = Menu::findOne([ 'id' => $parentId, 'typeID' => $type->id ]);
				$this->setTitle(Yii::tr('Add menu subitem to {title}', [ 'title' => $root->title ], 'menu'));
			}

			if (Yii::$app->request->isPost)
			{
				$post = Yii::$app->request->post('Menu');

				if (is_null($root))
				{
					$root = Menu::findOne([ 'title' => $type->guid . '_ROOT', 'typeID' => $type->id ]);
					if ($root == null)
					{
						$root = new Menu([ 'title' => $type->guid . '_ROOT', 'typeID' => $type->id ]);
						$root->makeRoot();
					}
				}

				$menu->setAttributes([
					'title'  => $post[ 'title' ],
					'url'    => $post[ 'url' ],
					'path'   => $post[ 'path' ],
					'typeID' => $type->id
				]);

				$menu->appendTo($root);
				Yii::$app->notification->messageToSession(Yii::tr('Menu item was saved.', [], 'menu'));
				$this->redirect(Url::toRoute([ '/menu/index', 'type' => $type->id ]));
			}
			$this->data('model', $menu);
		}