/**
  * Overload to reroute to view-action if a gallery is defined
  */
 public function before()
 {
     parent::before();
     if ($galleri = $this->request->param('galleri')) {
         $this->request->action = 'view';
     }
 }
 public function before()
 {
     parent::before();
     $param = $this->request->param('forum');
     $forum = Model_Forum::factory($param)->load();
     try {
         if (!$forum->loaded()) {
             throw new Kohana_Exception('Forumet :forum existerar inte.', array(':forum' => $param));
         }
         $roles = $forum->roles->as_array(NULL, 'name');
         if (!$this->auth->has_roles($roles)) {
             throw new Kohana_Exception('Du måste vara inloggad för att ha tillgång till forum/:forum.', array(':forum' => $forum->name));
         }
     } catch (Kohana_Exception $e) {
         $this->message_add($e->getMessage(), 'error');
         $this->request->redirect('forum');
     }
     // Save forum for later use
     $this->_forum = $forum;
     // REST-thingy
     switch (Request::$method) {
         case 'POST':
             $this->request->action = 'create';
             break;
         case 'DELETE':
             $this->request->action = 'delete';
             break;
     }
 }
 public function before()
 {
     // For nagivation active link show
     $path = $this->request->param('path');
     $this->request->controller = substr($path, strpos($path, '/'));
     parent::before();
 }
 public function before()
 {
     parent::before();
     // Automatically set request status
     $status = $this->request->param('status', 500);
     if (isset(Request::$messages[$status])) {
         $this->request->status = $status;
     }
     // View variables
     $this->template->title = __(Request::$messages[$this->request->status]);
 }