public function before() { parent::before(); if (!defined('IS_SSL')) { define('IS_SSL', Input::protocol() == 'https'); } if (!defined('IS_ADMIN')) { define('IS_ADMIN', $this->check_is_admin_request()); } if (!defined('IS_SP')) { define('IS_SP', \MyAgent\Agent::is_mobile_device()); } if (!defined('IS_API')) { define('IS_API', Site_Util::check_is_api()); } $this->set_default_data(); $this->check_ssl_required_request_and_redirect(); $this->check_remote_ip(); $this->auth_instance = Auth::forge($this->auth_driver); if (!defined('IS_AUTH')) { define('IS_AUTH', $this->check_auth(false)); } $this->check_auth_and_redirect(); $this->set_current_user(); $this->check_required_setting_and_redirect(); self::setup_assets(); }
public function before() { parent::before(); if (!Input::is_ajax()) { $this->_init_assets(); } }
/** * @param none * @throws none * @returns void */ public function before() { if (\Input::is_ajax()) { return parent::before(); } // define the theme template to use for this page, set a default if needed \Theme::instance()->set_template($this->template); }
public function before() { // Make sure we call the parent package before function parent::before(); // Load the config file for this package \Subpackage\Subconfig::subload(static::$_configFile, true); // Now set the view directory for this package static::$_viewPath = \Subpackage\Subconfig::get(static::$_configFile . '.view_directory'); }
public function before() { $this->template = "template"; parent::before(); $this->css .= Asset::css("reset.css"); $this->css .= Asset::css("bootstrap.min.css"); $this->css .= Asset::css("style.css"); $this->js .= Asset::js("vendor/jquery.min.js"); }
public function before() { // Set template $this->theme = \Theme::instance(); $this->theme->set_template($this->template); // Load translation \Lang::load('blog'); // Get current segments $segments = \Uri::segments(); empty($segments) and $segments[0] = 'home'; $this->dataGlobal['segments'] = $segments; // If ajax or content_only, set a theme with an empty layout if (\Input::is_ajax()) { return parent::before(); } // Don't re-set Media if is an HMVC request !\Request::is_hmvc() and $this->setMedia(); }
public function before() { parent::before(); // Check Auth Access if (\Auth::check()) { /* * Get the current user id and email address * */ list(, $userId) = Auth::get_user_id(); $this->user = Model_User::find($userId); } isset($this->title) ? $this->title : ($this->title = "Rodas Net"); $this->template->title = $this->title; // Load translation \Lang::load('application'); // If ajax or content_only, set a theme with an empty layout if (\Input::is_ajax()) { return parent::before(); } }
public function before() { $this->template = $this->newIntranet() ? "templates/layout" : "template"; \Session::set("current_page", \Uri::string()); $segments = implode(\Uri::segments()); if (\Auth::check() || $segments == 'userlogin') { list($driver, $user_id) = \Auth::get_user_id(); $this->current_user = \Model_User::find($user_id); } else { if ($segments != 'userlogin') { \Session::set("lastpage", implode("/", \Uri::segments())); } $this->current_user = null; \Response::redirect('user/login'); } if ($segments != 'userlogin') { \View::set_global('group_name', \Auth_Group_SimpleGroup::instance()->get_name($this->current_user->group)); \View::set_global('current_user', $this->current_user); } parent::before(); // Remove when login implemented }
public function before() { parent::before(); \Session::set("current_page", \Uri::string()); $segments = implode(\Uri::segments()); if (Auth::check() || $segments == 'userlogin') { list($driver, $user_id) = Auth::get_user_id(); $thisUser = \Model_User::find($user_id); if ($segments != 'userlogin') { \Log::write('Action', 'Visit to page ' . \Uri::string() . ' by ' . $thisUser->name, 'Del_Spam'); } $this->current_user = Model_User::find($user_id); } else { if ($segments != 'userlogin') { Session::set("lastpage", implode("/", \Uri::segments())); } $this->current_user = null; Response::redirect('user/login'); } if ($segments != 'userlogin') { View::set_global('group_name', Auth_Group_SimpleGroup::instance()->get_name($this->current_user->group)); View::set_global('current_user', $this->current_user); } }
public function before() { parent::before(); // Load translation \Lang::load('blog'); }
public function before() { parent::before(); //View::set_global('group_name', Auth_Group_SimpleGroup::instance()->get_name($this->current_user->group)); //View::set_global('current_user', $this->current_user); }