diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-18 08:38:11 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-18 08:38:11 -0800 |
commit | 4d4e81ca267cf6dd4fd48c2185d6e24949e0568f (patch) | |
tree | 935ca8d4f4d834fb8fc0de22a708227806107206 /modules/gallery/helpers | |
parent | 9d45cc040d76f86fe990e4c759fdd863c382ec87 (diff) |
Create a helper to load the theme information from theme.info
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r-- | modules/gallery/helpers/theme.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php index 5a3a328a..16ed104e 100644 --- a/modules/gallery/helpers/theme.php +++ b/modules/gallery/helpers/theme.php @@ -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; + } } |