From 663be9ca638c12d889036d5143fd6553f2575373 Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 25 Mar 2010 10:08:33 +0000 Subject: improvement: dynamically activate all installed themes (with checks on parent availability and so on). git-svn-id: http://piwigo.org/svn/trunk@5340 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_install.inc.php | 15 +++++++++++++++ admin/include/themes.class.php | 6 ++++++ 2 files changed, 21 insertions(+) (limited to 'admin/include') diff --git a/admin/include/functions_install.inc.php b/admin/include/functions_install.inc.php index 7d8ae41e7..8d00a4d36 100644 --- a/admin/include/functions_install.inc.php +++ b/admin/include/functions_install.inc.php @@ -123,4 +123,19 @@ function available_engines() return $engines; } + +/** + * Automatically activate all themes in the "themes" directory. + * + * @return void + */ +function activate_all_themes() +{ + include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php'); + $themes = new themes(); + foreach ($themes->fs_themes as $theme_id => $fs_theme) + { + $themes->perform_action('activate', $theme_id); + } +} ?> \ No newline at end of file diff --git a/admin/include/themes.class.php b/admin/include/themes.class.php index 82622d878..86651f55f 100644 --- a/admin/include/themes.class.php +++ b/admin/include/themes.class.php @@ -81,6 +81,12 @@ class themes break; } + if ('default' == $theme_id) + { + // you can't activate the "default" theme + break; + } + $missing_parent = $this->missing_parent_theme($theme_id); if (isset($missing_parent)) { -- cgit v1.2.3