mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-30 03:30:34 -04:00
Create a helper to load the theme information from theme.info
This commit is contained in:
@@ -29,8 +29,8 @@ class theme_Core {
|
||||
* active for any given request.
|
||||
*/
|
||||
static function load_themes() {
|
||||
$path = Input::instance()->server("PATH_INFO");
|
||||
$input = Input::instance();
|
||||
$path = $input->server("PATH_INFO");
|
||||
if (empty($path)) {
|
||||
$path = "/" . $input->get("kohana_uri");
|
||||
}
|
||||
@@ -67,5 +67,15 @@ class theme_Core {
|
||||
$group->submit("")->value(t("Save"));
|
||||
return $form;
|
||||
}
|
||||
|
||||
static function get_info($theme_name) {
|
||||
$theme_name = preg_replace("/[^\w]/", "", $theme_name);
|
||||
$file = THEMEPATH . "$theme_name/theme.info";
|
||||
$theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
|
||||
$theme_info->description = t($theme_info->description);
|
||||
$theme_info->name = t($theme_info->name);
|
||||
|
||||
return $theme_info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user