diff options
author | patdenice <patdenice@piwigo.org> | 2010-04-29 12:45:27 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2010-04-29 12:45:27 +0000 |
commit | a2ccb9a5c9394d83876fb76a97e2dc0b8557737b (patch) | |
tree | d62ddeb776512ebaa059a5d7f9d46320ad1c54e5 | |
parent | e7487082c32de87efd756bf05ae8539d38cda373 (diff) |
feature 1502: Add $themeconf['load_parent_css'] parameter
git-svn-id: http://piwigo.org/svn/trunk@5991 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/themes/default/template/header.tpl | 4 | ||||
-rw-r--r-- | include/template.class.php | 13 | ||||
-rw-r--r-- | themes/default/template/header.tpl | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/admin/themes/default/template/header.tpl b/admin/themes/default/template/header.tpl index 61eb3602b..7bef274d9 100644 --- a/admin/themes/default/template/header.tpl +++ b/admin/themes/default/template/header.tpl @@ -14,8 +14,10 @@ <link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}{$themeconf.icon_dir}/favicon.ico"> {foreach from=$themes item=theme} -{if isset($theme.local_head)}{include file=$theme.local_head}{/if} +{if $theme.load_css} <link rel="stylesheet" type="text/css" href="{$ROOT_URL}admin/themes/{$theme.id}/theme.css"> +{/if} +{if isset($theme.local_head)}{include file=$theme.local_head}{/if} {/foreach} {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} {*jQuery is always available by default*} diff --git a/include/template.class.php b/include/template.class.php index ec813efb3..7a5baf5ef 100644 --- a/include/template.class.php +++ b/include/template.class.php @@ -102,7 +102,7 @@ class Template { /** * Load theme's parameters. */ - function set_theme($root, $theme, $path) + function set_theme($root, $theme, $path, $load_css=true) { $this->set_template_dir($root.'/'.$theme.'/'.$path); @@ -110,10 +110,17 @@ class Template { if (isset($themeconf['parent']) and $themeconf['parent'] != $theme) { - $this->set_theme($root, $themeconf['parent'], $path); + if (!isset($themeconf['load_parent_css'])) + { + $themeconf['load_parent_css'] = true; + } + $this->set_theme($root, $themeconf['parent'], $path, $themeconf['load_parent_css']); } - $tpl_var = array('id' => $theme); + $tpl_var = array( + 'id' => $theme, + 'load_css' => $load_css, + ); if (!empty($themeconf['local_head']) ) { $tpl_var['local_head'] = realpath($root.'/'.$theme.'/'.$themeconf['local_head'] ); diff --git a/themes/default/template/header.tpl b/themes/default/template/header.tpl index 604c228e9..434895819 100644 --- a/themes/default/template/header.tpl +++ b/themes/default/template/header.tpl @@ -31,7 +31,9 @@ {if isset($U_UP) }<link rel="up" title="{'Thumbnails'|@translate}" href="{$U_UP}" >{/if} {foreach from=$themes item=theme} +{if $theme.load_css} <link rel="stylesheet" type="text/css" href="{$ROOT_URL}themes/{$theme.id}/theme.css"> +{/if} {if isset($theme.local_head)}{include file=$theme.local_head}{/if} {/foreach} {* the next css is used to fix khtml (Konqueror/Safari) issue the "text/nonsense" prevents gecko based browsers to load it *} |