From b647aa0f74e66548d6d69fc4585b89220ce60043 Mon Sep 17 00:00:00 2001 From: Felix Rabinovich Date: Fri, 9 Jan 2009 23:31:46 +0000 Subject: Theme Administration v. 2. Doesn't distinguish between regular and admin themes yet --- core/controllers/admin_themes.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'core/controllers') diff --git a/core/controllers/admin_themes.php b/core/controllers/admin_themes.php index 6641221f..8943f588 100644 --- a/core/controllers/admin_themes.php +++ b/core/controllers/admin_themes.php @@ -21,12 +21,27 @@ class Admin_Themes_Controller extends Admin_Controller { public function index() { $view = new Admin_View("admin.html"); $view->content = new View("admin_themes.html"); - $themes = scandir(THEMEPATH); - $view->content->themes = array_diff($themes, array(".", "..", ".svn")); + $themeDir = scandir(THEMEPATH); + $themes = array(); + foreach ($themeDir as $theme_name) { + if (substr($theme_name, 0, 1) == ".") continue; + $file = THEMEPATH . $theme_name . "/theme.info"; + $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); + $details = theme::get_edit_form_admin($theme_info); + $theme_info['details'] = $details; + $themes[$theme_name] = $theme_info; + } + $view->content->themes = $themes; $view->content->active = module::get_var("core", "active_theme"); print $view; } + public function edit($theme_name) { + $file = THEMEPATH . $theme_name . "/theme.info"; + $theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS); + print theme::get_edit_form_admin($theme_info); + } + public function save() { access::verify_csrf(); $theme = $this->input->post("theme"); -- cgit v1.2.3