/** * 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'); }
/** * 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(); } }
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(); } }
/** * 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'); }
/** * 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(); }
/** * Set the title for the sessions * @Developer brandon * @Date Oct 11, 2010 */ public function __construct() { parent::__construct(); meta::set_title('Login or Register'); }
public function __construct($action = null) { parent::__construct($action, $this); $this->createSession(); }
/** * Initialize the controller * @Developer brandon * @Date Jul 15, 2010 */ public function __construct() { parent::__construct(); layout::add(View::factory('shared/mentions')->render(), 'pre_footer'); }
public function __construct() { parent::__construct(); require_once Kohana::find_file('vendor', 'twitteroauth/twitteroauth'); }