summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/admin_themes.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-04 10:04:35 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-04 10:12:22 -0700
commit2634a683b30982963264faf9867d32d1aa71a182 (patch)
treeccb493b33e72b286b6b64e95e55b5720529a7b3d /modules/gallery/controllers/admin_themes.php
parentaa0529d557ed0609bf7e5b23a5cf2437f7998c4b (diff)
Revert "Create a gallery::plugin_path which returns the appropriate path to the module or theme. This checks for the existence of an application/modules or application/themes first."
This reverts commit e1e1461a77caf5bff457927f098366497de6ffff.
Diffstat (limited to 'modules/gallery/controllers/admin_themes.php')
-rw-r--r--modules/gallery/controllers/admin_themes.php31
1 files changed, 14 insertions, 17 deletions
diff --git a/modules/gallery/controllers/admin_themes.php b/modules/gallery/controllers/admin_themes.php
index 722cfb45..24f91aba 100644
--- a/modules/gallery/controllers/admin_themes.php
+++ b/modules/gallery/controllers/admin_themes.php
@@ -29,20 +29,17 @@ class Admin_Themes_Controller extends Admin_Controller {
private function _get_themes() {
$themes = array();
- foreach (array(APPPATH . "themes/", THEMEPATH) as $themepath) {
- foreach (scandir($themepath) as $theme_name) {
- if ($theme_name[0] == ".") {
- continue;
- }
- $file = $themepath . "$theme_name/theme.info";
- if (file_exists($file)) {
- $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);
-
- $themes[$theme_name] = $theme_info;
- }
+ foreach (scandir(THEMEPATH) as $theme_name) {
+ if ($theme_name[0] == ".") {
+ continue;
}
+
+ $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);
+
+ $themes[$theme_name] = $theme_info;
}
return $themes;
}
@@ -50,8 +47,8 @@ class Admin_Themes_Controller extends Admin_Controller {
public function preview($type, $theme_name) {
$view = new View("admin_themes_preview.html");
$theme_name = preg_replace("/[^\w]/", "", $theme_name);
- $view->info = new ArrayObject(parse_ini_file(
- gallery::plugin_path("$theme_name/theme.info", "theme")), ArrayObject::ARRAY_AS_PROPS);
+ $view->info = new ArrayObject(
+ parse_ini_file(THEMEPATH . "$theme_name/theme.info"), ArrayObject::ARRAY_AS_PROPS);
$view->theme_name = $theme_name;
$view->type = $type;
if ($type == "admin") {
@@ -66,8 +63,8 @@ class Admin_Themes_Controller extends Admin_Controller {
access::verify_csrf();
$theme_name = preg_replace("/[^\w]/", "", $theme_name);
- $info = new ArrayObject(parse_ini_file(
- gallery::plugin_path("$theme_name/theme.info", "theme")), ArrayObject::ARRAY_AS_PROPS);
+ $info = new ArrayObject(
+ parse_ini_file(THEMEPATH . "$theme_name/theme.info"), ArrayObject::ARRAY_AS_PROPS);
if ($type == "admin" && $info->admin) {
module::set_var("gallery", "active_admin_theme", $theme_name);