Ejemplo n.º 1
0
 protected function viewModel(ViewModel $viewModel)
 {
     $settings = $viewModel->adminSettings = $this->adminSettings;
     if ($settings->showMenu()) {
         $target = $settings->topMenuTarget();
         $viewModel->topMenu = exists($target) ? isset($this->navigation[$target]) ? $this->navigation[$target] : null : $this->navigation;
     }
     $viewModel->sideMenu = get($this->navigation->getCurrentTrail($settings->sideMenuOffset()), 0);
     $user = $this->session->user();
     $viewModel->devMode = $user && $user->roleField() == UserInterface::USER_ROLE_DEVELOPER;
 }
Ejemplo n.º 2
0
 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)])]);
 }
Ejemplo n.º 3
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');
 }
 protected function getTitle()
 {
     return coalesce($this->pageTitle, ($link = $this->navigation->selectedLink()) ? $link->title() : null);
 }
Ejemplo n.º 5
0
 function request(ServerRequestInterface $request = null)
 {
     return $this->navigation->request();
 }