aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.inc.php16
-rw-r--r--include/functions_user.inc.php13
2 files changed, 20 insertions, 9 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index db7546da7..c6ae8c8af 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -170,7 +170,21 @@ if (is_a_guest())
}
// template instance
-$template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme'] );
+if
+ (
+ defined('IN_ADMIN') and IN_ADMIN and
+ isset($user['admin_template']) and
+ isset($user['admin_theme'])
+ )
+{
+ // Admin template
+ $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['admin_template'], $user['admin_theme'] );
+}
+else
+{
+ // Classic template
+ $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme'] );
+}
if ($conf['gallery_locked'])
{
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php
index 036f842d9..d3f0b4aa5 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -145,27 +145,24 @@ function setup_style($style)
function build_user( $user_id, $use_cache )
{
global $conf;
+
$user['id'] = $user_id;
$user = array_merge( $user, getuserdata($user_id, $use_cache) );
// calculation of the number of picture to display per page
$user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page'];
- // include template/theme configuration
- if (defined('IN_ADMIN') and IN_ADMIN)
+ list($user['template'], $user['theme']) = explode('/', $user['template']);
+
+ if (is_admin($user['status']))
{
- list($user['template'], $user['theme']) =
+ list($user['admin_template'], $user['admin_theme']) =
explode
(
'/',
isset($conf['default_admin_layout']) ? $conf['default_admin_layout']
: $user['template']
);
- // TODO : replace $conf['admin_layout'] by $user['admin_layout']
- }
- else
- {
- list($user['template'], $user['theme']) = explode('/', $user['template']);
}
return $user;