aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/include/functions_install.inc.php15
-rw-r--r--admin/include/themes.class.php6
-rw-r--r--install.php5
-rw-r--r--install/config.sql4
4 files changed, 26 insertions, 4 deletions
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))
{
diff --git a/install.php b/install.php
index f51d7d593..6e47bafe8 100644
--- a/install.php
+++ b/install.php
@@ -376,6 +376,11 @@ INSERT INTO '.$prefixeTable.'config (param,value,comment)
// fill $conf global array
load_conf_from_db();
+ // PWG_CHARSET is required for building the fs_themes array in the
+ // themes class
+ define('PWG_CHARSET', $pwg_charset);
+ activate_all_themes();
+
$insert = array(
'id' => 1,
'galleries_url' => PHPWG_ROOT_PATH.'galleries/',
diff --git a/install/config.sql b/install/config.sql
index 5bd5df4a9..6847c340b 100644
--- a/install/config.sql
+++ b/install/config.sql
@@ -51,7 +51,3 @@ INSERT INTO piwigo_config (param,value,comment)
'a:11:{s:6:"author";b:1;s:10:"created_on";b:1;s:9:"posted_on";b:1;s:10:"dimensions";b:1;s:4:"file";b:1;s:8:"filesize";b:1;s:4:"tags";b:1;s:10:"categories";b:1;s:6:"visits";b:1;s:12:"average_rate";b:1;s:13:"privacy_level";b:1;}',
'Information displayed on picture page'
);
-
-INSERT INTO piwigo_themes (id, name) VALUES ('Sylvia', 'Sylvia');
-INSERT INTO piwigo_themes (id, name) VALUES ('clear', 'clear');
-INSERT INTO piwigo_themes (id, name) VALUES ('dark', 'dark');