/** * Handle a navigation.bar event third. * * @return void */ public function onNavigationBarThird() { if ($this->credentials->check()) { // add the view users link if ($this->credentials->hasAccess('mod')) { $this->navigation->addToBar(['title' => trans('navigation.users'), 'slug' => 'users', 'icon' => 'user']); } // add the create user link if ($this->credentials->hasAccess('admin')) { $this->navigation->addToBar(['title' => trans('navigation.new_user'), 'slug' => 'users/create', 'icon' => 'star']); } // add the create page link if ($this->credentials->hasAccess('edit')) { $this->navigation->addToBar(['title' => trans('navigation.new_page'), 'slug' => 'pages/create', 'icon' => 'pencil']); } // add the create post link if (Config::get('cms.blogging')) { if ($this->credentials->hasAccess('blog')) { $this->navigation->addToBar(['title' => trans('navigation.new_post'), 'slug' => 'content/posts/create', 'icon' => 'book']); } } // add the create event link if (Config::get('cms.events')) { if ($this->credentials->hasAccess('edit')) { $this->navigation->addToBar(['title' => trans('navigation.new_event'), 'slug' => 'events/create', 'icon' => 'calendar']); } } } }
/** * Handle a navigation.bar event third. * * @return void */ public function onNavigationBarThird() { if ($this->credentials->check()) { // add the view users link if ($this->credentials->hasAccess('mod')) { $this->navigation->addToBar(['title' => 'View Users', 'slug' => 'users', 'icon' => 'user']); } // add the create user link if ($this->credentials->hasAccess('admin')) { $this->navigation->addToBar(['title' => 'Create User', 'slug' => 'users/create', 'icon' => 'star']); } // add the create page link if ($this->credentials->hasAccess('edit')) { $this->navigation->addToBar(['title' => 'Create Page', 'slug' => 'pages/create', 'icon' => 'pencil']); } // add the create post link if ($this->blogging) { if ($this->credentials->hasAccess('blog')) { $this->navigation->addToBar(['title' => 'Create Post', 'slug' => 'blog/posts/create', 'icon' => 'book']); } } // add the create event link if ($this->events) { if ($this->credentials->hasAccess('edit')) { $this->navigation->addToBar(['title' => 'Create Event', 'slug' => 'events/create', 'icon' => 'calendar']); } } } }
/** * Add an item to the bar navigation array. * * @param array $item * @param string $name * @param bool $first * @return $this * @static */ public static function addToBar($item, $name = 'default', $first = false) { return \GrahamCampbell\Navigation\Navigation::addToBar($item, $name, $first); }