本文整理匯總了PHP中theme::get_info方法的典型用法代碼示例。如果您正苦於以下問題:PHP theme::get_info方法的具體用法?PHP theme::get_info怎麽用?PHP theme::get_info使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類theme
的用法示例。
在下文中一共展示了theme::get_info方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: choose
public function choose($type, $theme_name)
{
access::verify_csrf();
$info = theme::get_info($theme_name);
if ($type == "admin" && $info->admin) {
module::set_var("gallery", "active_admin_theme", $theme_name);
message::success(t("Successfully changed your admin theme to <b>%theme_name</b>", array("theme_name" => $info->name)));
} else {
if ($type == "site" && $info->site) {
module::set_var("gallery", "active_site_theme", $theme_name);
message::success(t("Successfully changed your Gallery theme to <b>%theme_name</b>", array("theme_name" => $info->name)));
}
}
url::redirect("admin/themes");
}
示例2: __construct
/**
* 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."));
}
}
}