예제 #1
0
 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();
 }
예제 #2
0
파일: Game.php 프로젝트: modulargaming/game
 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;
     }
 }
예제 #3
0
 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?
 }
예제 #4
0
파일: Shop.php 프로젝트: modulargaming/item
 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();
 }