diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.inc.php | 10 | ||||
-rw-r--r-- | include/functions.inc.php | 4 | ||||
-rw-r--r-- | include/page_header.php | 11 |
3 files changed, 21 insertions, 4 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 8aeafb7bf..4fa11cec3 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -201,9 +201,17 @@ if ($user['is_the_guest']) list($user['template'], $user['theme']) = explode('/', $user['template']); // TODO : replace initial $user['template'] by $user['layout'] +if (IN_ADMIN) +{ + $template_root = 'admin'; +} +else +{ + $template_root = 'public'; +} include( PHPWG_ROOT_PATH - .'template/'.$user['template'] + .'template/'.$template_root.'/'.$user['template'] .'/theme/'.$user['theme'] .'/themeconf.inc.php' ); diff --git a/include/functions.inc.php b/include/functions.inc.php index 12fe7200d..4c2b045c0 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -597,11 +597,11 @@ function url_is_remote($url) /** * returns available template/theme */ -function get_pwg_themes() +function get_pwg_themes($template_root = 'public') { $themes = array(); - $template_dir = PHPWG_ROOT_PATH.'template'; + $template_dir = PHPWG_ROOT_PATH.'template'.'/'.$template_root; foreach (get_dirs($template_dir) as $template) { diff --git a/include/page_header.php b/include/page_header.php index 6a48b4b81..e4833e9c1 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -28,7 +28,16 @@ // // Start output of page // -$template->set_filenames(array('header'=>'header.tpl')); +if (IN_ADMIN) +{ + $template->set_rootdir(PHPWG_ROOT_PATH.'template/admin/'.$user['template']); + $template->set_filenames(array('header'=>'header.tpl')); +} +else +{ + $template->set_rootdir(PHPWG_ROOT_PATH.'template/public/'.$user['template']); + $template->set_filenames(array('header'=>'header.tpl')); +} $template->assign_vars( array( |