aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2014-09-03 09:02:07 +0000
committerplegall <plg@piwigo.org>2014-09-03 09:02:07 +0000
commitab00c52430610633768cf3d856f105cad0f52e9d (patch)
treee98b15709b02d1ccd536a52a9ee7c1c3ebea7b2a
parent9639897ae01e12f9a842da83d72cd6edff7aa7b3 (diff)
feature 3133: add colorscheme parameter for themes. This way we can use the
appropriate CSS for selectize (and other things) git-svn-id: http://piwigo.org/svn/trunk@29389 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/themes/clear/themeconf.inc.php1
-rw-r--r--admin/themes/default/template/batch_manager_global.tpl3
-rw-r--r--admin/themes/default/template/batch_manager_unit.tpl3
-rw-r--r--admin/themes/default/template/cat_modify.tpl3
-rw-r--r--admin/themes/default/template/cat_perm.tpl3
-rw-r--r--admin/themes/default/template/include/add_album.inc.tpl3
-rw-r--r--admin/themes/default/template/photos_add_direct.tpl3
-rw-r--r--admin/themes/default/template/picture_modify.tpl3
-rw-r--r--admin/themes/default/template/user_list.tpl3
-rw-r--r--admin/themes/default/themeconf.inc.php1
-rw-r--r--admin/themes/roma/themeconf.inc.php1
-rw-r--r--include/template.class.php8
-rw-r--r--themes/clear/themeconf.inc.php1
-rw-r--r--themes/default/js/plugins/selectize.clear.css (renamed from themes/default/js/plugins/selectize.default.css)0
-rw-r--r--themes/default/template/search.tpl2
15 files changed, 20 insertions, 18 deletions
diff --git a/admin/themes/clear/themeconf.inc.php b/admin/themes/clear/themeconf.inc.php
index a73ebbcec..4b6ccff47 100644
--- a/admin/themes/clear/themeconf.inc.php
+++ b/admin/themes/clear/themeconf.inc.php
@@ -3,5 +3,6 @@ $themeconf = array(
'name' => 'clear',
'parent' => 'default',
'admin_icon_dir' => 'admin/themes/clear/icon',
+ 'colorscheme' => 'clear',
);
?>
diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl
index 9223b4094..648253277 100644
--- a/admin/themes/default/template/batch_manager_global.tpl
+++ b/admin/themes/default/template/batch_manager_global.tpl
@@ -10,9 +10,8 @@
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{combine_script id='jquery.progressBar' load='async' path='themes/default/js/plugins/jquery.progressbar.min.js'}
{combine_script id='jquery.ajaxmanager' load='async' path='themes/default/js/plugins/jquery.ajaxmanager.js'}
diff --git a/admin/themes/default/template/batch_manager_unit.tpl b/admin/themes/default/template/batch_manager_unit.tpl
index ccb7ca152..9bdc996a9 100644
--- a/admin/themes/default/template/batch_manager_unit.tpl
+++ b/admin/themes/default/template/batch_manager_unit.tpl
@@ -4,9 +4,8 @@
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{footer_script}
(function(){
diff --git a/admin/themes/default/template/cat_modify.tpl b/admin/themes/default/template/cat_modify.tpl
index 6d46c9ee1..7d0e01530 100644
--- a/admin/themes/default/template/cat_modify.tpl
+++ b/admin/themes/default/template/cat_modify.tpl
@@ -1,8 +1,7 @@
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{footer_script}
{* <!-- CATEGORIES --> *}
diff --git a/admin/themes/default/template/cat_perm.tpl b/admin/themes/default/template/cat_perm.tpl
index 5154e4a2a..542db1edd 100644
--- a/admin/themes/default/template/cat_perm.tpl
+++ b/admin/themes/default/template/cat_perm.tpl
@@ -1,8 +1,7 @@
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{footer_script}
(function(){
diff --git a/admin/themes/default/template/include/add_album.inc.tpl b/admin/themes/default/template/include/add_album.inc.tpl
index d31cd2da9..988dc1907 100644
--- a/admin/themes/default/template/include/add_album.inc.tpl
+++ b/admin/themes/default/template/include/add_album.inc.tpl
@@ -1,9 +1,8 @@
{if empty($load_mode)}{$load_mode='footer'}{/if}
{include file='include/colorbox.inc.tpl' load_mode=$load_mode}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{combine_script id='addAlbum' load=$load_mode path='admin/themes/default/js/addAlbum.js'}
diff --git a/admin/themes/default/template/photos_add_direct.tpl b/admin/themes/default/template/photos_add_direct.tpl
index 10f861d96..c2ea1cc61 100644
--- a/admin/themes/default/template/photos_add_direct.tpl
+++ b/admin/themes/default/template/photos_add_direct.tpl
@@ -17,9 +17,8 @@
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{footer_script}
{* <!-- CATEGORIES --> *}
diff --git a/admin/themes/default/template/picture_modify.tpl b/admin/themes/default/template/picture_modify.tpl
index c6d556e85..c17ff6dfe 100644
--- a/admin/themes/default/template/picture_modify.tpl
+++ b/admin/themes/default/template/picture_modify.tpl
@@ -3,9 +3,8 @@
{combine_script id='LocalStorageCache' load='footer' path='admin/themes/default/js/LocalStorageCache.js'}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{footer_script}
(function(){
diff --git a/admin/themes/default/template/user_list.tpl b/admin/themes/default/template/user_list.tpl
index 66de20e31..39e3318b9 100644
--- a/admin/themes/default/template/user_list.tpl
+++ b/admin/themes/default/template/user_list.tpl
@@ -3,9 +3,8 @@
{combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'}
{combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"}
-{assign var="selectizeTheme" value=($themeconf.name=='roma')|ternary:'dark':'default'}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.`$selectizeTheme`.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{combine_script id='jquery.underscore' load='footer' path='themes/default/js/plugins/underscore.js'}
diff --git a/admin/themes/default/themeconf.inc.php b/admin/themes/default/themeconf.inc.php
index ac6b40b8a..97ae98542 100644
--- a/admin/themes/default/themeconf.inc.php
+++ b/admin/themes/default/themeconf.inc.php
@@ -4,5 +4,6 @@ $themeconf = array(
'icon_dir' => 'themes/default/icon',
'admin_icon_dir' => 'admin/themes/default/icon',
'mime_icon_dir' => 'themes/default/icon/mimetypes/',
+ 'colorscheme' => 'dark',
);
?>
diff --git a/admin/themes/roma/themeconf.inc.php b/admin/themes/roma/themeconf.inc.php
index f6ec175e2..cebcc9b87 100644
--- a/admin/themes/roma/themeconf.inc.php
+++ b/admin/themes/roma/themeconf.inc.php
@@ -2,5 +2,6 @@
$themeconf = array(
'name' => 'roma',
'parent' => 'default',
+ 'colorscheme' => 'dark',
);
?>
diff --git a/include/template.class.php b/include/template.class.php
index 322a78957..c3fe95a7c 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -177,7 +177,7 @@ class Template
* @param bool $load_css
* @param bool $load_local_head
*/
- function set_theme($root, $theme, $path, $load_css=true, $load_local_head=true)
+ function set_theme($root, $theme, $path, $load_css=true, $load_local_head=true, $colorscheme='dark')
{
$this->set_template_dir($root.'/'.$theme.'/'.$path);
@@ -203,6 +203,12 @@ class Template
$tpl_var['local_head'] = realpath($root.'/'.$theme.'/'.$themeconf['local_head'] );
}
$themeconf['id'] = $theme;
+
+ if (!isset($themeconf['colorscheme']))
+ {
+ $themeconf['colorscheme'] = $colorscheme;
+ }
+
$this->smarty->append('themes', $tpl_var);
$this->smarty->append('themeconf', $themeconf, true);
}
diff --git a/themes/clear/themeconf.inc.php b/themes/clear/themeconf.inc.php
index f7387c2f7..df9aaf73f 100644
--- a/themes/clear/themeconf.inc.php
+++ b/themes/clear/themeconf.inc.php
@@ -10,5 +10,6 @@ Author URI: http://piwigo.org
$themeconf = array(
'name' => 'clear',
'parent' => 'default',
+ 'colorscheme' => 'clear',
);
?>
diff --git a/themes/default/js/plugins/selectize.default.css b/themes/default/js/plugins/selectize.clear.css
index 0d8947e90..0d8947e90 100644
--- a/themes/default/js/plugins/selectize.default.css
+++ b/themes/default/js/plugins/selectize.clear.css
diff --git a/themes/default/template/search.tpl b/themes/default/template/search.tpl
index 9a9ed101d..5f3190d2f 100644
--- a/themes/default/template/search.tpl
+++ b/themes/default/template/search.tpl
@@ -4,7 +4,7 @@
*}
{combine_script id='jquery.selectize' load='footer' path='themes/default/js/plugins/selectize.min.js'}
-{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.dark.css"}
+{combine_css id='jquery.selectize' path="themes/default/js/plugins/selectize.{$themeconf.colorscheme}.css"}
{footer_script}
jQuery(document).ready(function() {