public function after() { // if no subnav has been defined search for one if ($this->view !== NULL and !$this->view->has_subnav()) { $this->_nav(strtolower($this->request->controller()), $this->request->action()); } parent::after(); }
public function before() { parent::before(); if ($this->game_id) { $game = ORM::factory('User_Game')->where('game_id', '=', $this->game_id)->where('user_id', '=', $this->user->id)->find(); if (!$game->loaded()) { $game = ORM::factory('User_Game')->create_game(array('game_id' => $this->game_id, 'user_id' => $this->user->id), array('game_id', 'user_id')); } $this->game = $game; } }
public function before() { $this->config = Kohana::$config->load('forum'); // Set forum to protected if we do not allow guests. // TODO: improve this check, database based depending on category? // Perhapse we should use policies? if ($this->protected === FALSE and $this->config['guest'] === FALSE) { $this->protected = TRUE; } parent::before(); // TODO: Check if user can view forum? }
public function after() { if ($this->view !== NULL) { $map_links = array('index' => 0, 'stock' => 1, 'logs' => 2); $this->view->links = array(array('name' => 'Shop', 'link' => Route::url('item.user_shop.index')), array('name' => 'Stock', 'link' => Route::url('item.user_shop.stock')), array('name' => 'Logs', 'link' => Route::url('item.user_shop.logs')), array('name' => 'View', 'link' => $this->_view_shop())); if (array_key_exists($this->request->action(), $map_links)) { $this->view->links[$map_links[$this->request->action()]]['active'] = TRUE; } } parent::after(); }