/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $page_type page type: album, photo, tags, etc * @param string $theme_name view name * @return void */ public function __construct($name, $page_type) { $theme_name = module::get_var("gallery", "active_site_theme"); if (!file_exists("themes/{$theme_name}")) { module::set_var("gallery", "active_site_theme", "default"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '{$theme_name}', switching to default theme."); } parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); if (user::active()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->item = null; $this->tag = null; $this->set_global("theme", $this); $this->set_global("user", user::active()); $this->set_global("page_type", $page_type); $this->set_global("page_title", null); if ($page_type == "album") { $this->set_global("thumb_proportion", $this->thumb_proportion()); } $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); if ($maintenance_mode) { message::warning(t("This site is currently in maintenance mode")); } }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $theme_name view name * @return void */ public function __construct($name) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_admin_theme"); if (identity::active_user()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->sidebar = ""; $this->set_global(array("theme" => $this, "user" => identity::active_user(), "page_type" => "admin", "page_subtype" => $name, "page_title" => null)); }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $theme_name view name * @return void */ public function __construct($name) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_admin_theme"); if (identity::active_user()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->sidebar = ""; $this->set_global("theme", $this); $this->set_global("user", identity::active_user()); }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $theme_name view name * @return void */ public function __construct($name) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_admin_theme"); if (identity::active_user()->admin) { $theme_name = Input::instance()->get("theme"); if ($theme_name && file_exists(THEMEPATH . $theme_name) && strpos(realpath(THEMEPATH . $theme_name), THEMEPATH) == 0) { $this->theme_name = $theme_name; } } $this->sidebar = ""; $this->set_global(array("theme" => $this, "user" => identity::active_user(), "page_type" => "admin", "page_subtype" => $name, "page_title" => null)); }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $theme_name view name * @return void */ public function __construct($name) { $theme_name = module::get_var("gallery", "active_site_theme"); if (!file_exists("themes/$theme_name")) { module::set_var("gallery", "active_site_theme", "admin_default"); theme::load_themes(); Kohana::log("error", "Unable to locate theme '$theme_name', switching to default theme."); } parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_admin_theme"); if (user::active()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->sidebar = ""; $this->set_global("theme", $this); $this->set_global("user", user::active()); }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $page_type page type: collection, item, or other * @param string $page_subtype page sub type: album, photo, tags, etc * @param string $theme_name view name * @return void */ public function __construct($name, $page_type, $page_subtype) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); if (identity::active_user()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->item = null; $this->tag = null; $this->set_global(array("theme" => $this, "user" => identity::active_user(), "page_type" => $page_type, "page_subtype" => $page_subtype, "page_title" => null)); if ($page_type == "collection") { $this->set_global("thumb_proportion", $this->thumb_proportion()); } if (module::get_var("gallery", "maintenance_mode", 0)) { if (identity::active_user()->admin) { message::warning(t("This site is currently in maintenance mode. Visit the <a href=\"%maintenance_url\">maintenance page</a>", array("maintenance_url" => url::site("admin/maintenance")))); } else { message::warning(t("This site is currently in maintenance mode.")); } } }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $page_type page type: collection, item, or other * @param string $page_subtype page sub type: album, photo, tags, etc * @param string $theme_name view name * @return void */ public function __construct($name, $page_type, $page_subtype) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); if (identity::active_user()->admin) { $theme_name = Input::instance()->get("theme"); if ($theme_name && file_exists(THEMEPATH . $theme_name) && strpos(realpath(THEMEPATH . $theme_name), THEMEPATH) == 0) { $this->theme_name = $theme_name; } } $this->item = null; $this->tag = null; $this->set_global(array("theme" => $this, "theme_info" => theme::get_info($this->theme_name), "user" => identity::active_user(), "page_type" => $page_type, "page_subtype" => $page_subtype, "page_title" => null)); if (module::get_var("gallery", "maintenance_mode", 0)) { if (identity::active_user()->admin) { message::warning(t("This site is currently in maintenance mode. Visit the <a href=\"%maintenance_url\">maintenance page</a>", array("maintenance_url" => url::site("admin/maintenance")))); } else { message::warning(t("This site is currently in maintenance mode.")); } } }
/** * Attempts to load a view and pre-load view data. * * @throws Kohana_Exception if the requested view cannot be found * @param string $name view name * @param string $page_type page type: collection, item, or other * @param string $page_subtype page sub type: album, photo, tags, etc * @param string $theme_name view name * @return void */ public function __construct($name, $page_type, $page_subtype) { parent::__construct($name); $this->theme_name = module::get_var("gallery", "active_site_theme"); if (identity::active_user()->admin) { $this->theme_name = Input::instance()->get("theme", $this->theme_name); } $this->item = null; $this->tag = null; $this->set_global("theme", $this); $this->set_global("user", identity::active_user()); $this->set_global("page_type", $page_type); $this->set_global("page_subtype", $page_subtype); $this->set_global("page_title", null); if ($page_type == "collection") { $this->set_global("thumb_proportion", $this->thumb_proportion()); } $maintenance_mode = Kohana::config("core.maintenance_mode", false, false); if ($maintenance_mode) { message::warning(t("This site is currently in maintenance mode")); } }