function defineNavigation(NavigationInterface $nav)
 {
     $userMenu = ['users-management' => $nav->group()->id('userMenu')->icon('fa ion-person')->title('$APP_USER_MENU')->links(['profile' => $nav->link()->id('profile')->title('$LOGIN_PROFILE')->icon('fa ion-person')->visible($this->settings->enableProfile()), 'users' => $nav->link()->id('users')->title('$APP_SETTINGS_USERS')->icon('fa ion-person-stalker')->visible(function () {
         $user = $this->session->user();
         if (!$user) {
             return false;
         }
         return $this->settings->enableUsersManagement() && $user->roleField() >= UserInterface::USER_ROLE_ADMIN;
     })->links(['@id' => $nav->link()->id('userForm')->title('$APP_SETTINGS_USER')->visibleIfUnavailable(Y)]), '-' => $nav->divider(), '' => $nav->link()->url($this->authenticationSettings->getLogoutUrl())->title('$LOGOUT')->icon('fa ion-log-out')])];
     $nav->add([$nav->group()->id('app_home')->title('$APP_HOME')->icon('fa fa-home')->url($this->settings->urlPrefix())->links(['' => $nav->group()->id('mainMenu')->icon('fa ion-navicon')->title('Main Menu')->links(['' => $nav->link()->id('home')->icon('fa ion-home')->title('Home')]), 'settings' => $nav->group()->id('settings')->icon('fa ion-gear-a')->title('Platform')->links($userMenu)])]);
 }
示例#2
0
 function defineNavigation(NavigationInterface $nav)
 {
     $nav->add(['admin' => $nav->group()->title('Contents')->links(['home' => $nav->link()->title('Homepage'), 'about' => $nav->link()->title('About Us'), 'news' => $nav->link()->title('News')->links(['@id' => $nav->link()->id('article')->title('Article')])])], false, 'mainMenu');
 }