Skip to content

Commit

Permalink
feature 1502: Add $themeconf['load_parent_local_head'] parameter
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@6006 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
patdenice committed Apr 29, 2010
1 parent 6506716 commit 0a5b096
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions include/template.class.php
Expand Up @@ -110,26 +110,28 @@ function Template($root = ".", $theme= "", $path = "template")
/**
* Load theme's parameters.
*/
function set_theme($root, $theme, $path, $load_css=true)
function set_theme($root, $theme, $path, $load_css=true, $load_local_head=true)
{
$this->set_template_dir($root.'/'.$theme.'/'.$path);

$themeconf = $this->load_themeconf($root.'/'.$theme);

if (isset($themeconf['parent']) and $themeconf['parent'] != $theme)
{
if (!isset($themeconf['load_parent_css']))
{
$themeconf['load_parent_css'] = $load_css;
}
$this->set_theme($root, $themeconf['parent'], $path, $themeconf['load_parent_css']);
$this->set_theme(
$root,
$themeconf['parent'],
$path,
isset($themeconf['load_parent_css']) ? $themeconf['load_parent_css'] : $load_css,
isset($themeconf['load_parent_local_head']) ? $themeconf['load_parent_local_head'] : $load_local_head
);
}

$tpl_var = array(
'id' => $theme,
'load_css' => $load_css,
);
if (!empty($themeconf['local_head']) )
if (!empty($themeconf['local_head']) and $load_local_head)
{
$tpl_var['local_head'] = realpath($root.'/'.$theme.'/'.$themeconf['local_head'] );
}
Expand Down

0 comments on commit 0a5b096

Please sign in to comment.