content = new View("admin_themes.html"); $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("themes"); if ($theme != module::get_var("core", "active_theme")) { module::set_var("core", "active_theme", $theme); message::success(t("Updated Theme")); log::success("graphics", t("Changed theme to {{theme_name}}", array("theme_name" => $theme))); } url::redirect("admin/themes"); } }