From 4d4e81ca267cf6dd4fd48c2185d6e24949e0568f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 18 Nov 2009 08:38:11 -0800 Subject: Create a helper to load the theme information from theme.info --- modules/gallery/helpers/theme.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules/gallery/helpers') 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; + } } -- cgit v1.2.3