Example #1
0
 /**
  * Require login
  * @Developer brandon
  * @Date May 17, 2010
  */
 public function __construct()
 {
     parent::__construct();
     user::require_login();
     // Add the topics to the footer
     layout::add(View::factory('topics/index'), 'footer');
 }
Example #2
0
 /**
  * Clear the cache on an constructive/destructive action
  * Also, make sure only admins can get here
  * @Developer brandon
  * @Date May 27, 2010
  */
 public function __construct()
 {
     parent::__construct();
     if (in_array(Router::$method, array('new_one', 'edit', 'create', 'update', 'delete'))) {
         if (!user::is_admin()) {
             url::redirect('topics');
         }
         Cache::instance()->delete_all();
     }
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
     if (!isset($_SESSION['can_edit']) || !is_array($_SESSION['can_edit'])) {
         $_SESSION['can_edit'] = array();
     }
     if (!isset($_SESSION['can_view']) || !is_array($_SESSION['can_view'])) {
         $_SESSION['can_view'] = array();
     }
 }
Example #4
0
 /**
  * Clear the cache on an constructive/destructive action
  * Also, make sure only admins can get here
  * @Developer brandon
  * @Date May 27, 2010
  */
 public function __construct()
 {
     parent::__construct();
     if (in_array(Router::$method, array('new_one', 'edit', 'create', 'update', 'delete'))) {
         if (!user::is_admin()) {
             url::redirect('blog');
         }
         Cache::instance()->delete_all();
     }
     layout::add(View::factory('shared/mentions')->render(), 'pre_footer');
 }
Example #5
0
 /**
  * Set the title for the cart
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     meta::set_title('Shopping Cart');
     $this->cart = cart::get();
 }
Example #6
0
 /**
  * Set the title for the sessions
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     meta::set_title('Login or Register');
 }
Example #7
0
 public function __construct($action = null)
 {
     parent::__construct($action, $this);
     $this->createSession();
 }
Example #8
0
 /**
  * Initialize the controller
  * @Developer brandon
  * @Date Jul 15, 2010
  */
 public function __construct()
 {
     parent::__construct();
     layout::add(View::factory('shared/mentions')->render(), 'pre_footer');
 }
Example #9
0
 public function __construct()
 {
     parent::__construct();
     require_once Kohana::find_file('vendor', 'twitteroauth/twitteroauth');
 }