aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/site_update.php12
-rw-r--r--include/common.inc.php16
-rw-r--r--include/functions_user.inc.php13
3 files changed, 28 insertions, 13 deletions
diff --git a/admin/site_update.php b/admin/site_update.php
index 96d4e78b9..7e83d62fb 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -4,8 +4,7 @@
// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
// +-----------------------------------------------------------------------+
-// | branch : BSF (Best So Far)
-// | file : $RCSfile$
+// | file : $Id$
// | last update : $Date$
// | last modifier : $Author$
// | revision : $Revision$
@@ -127,15 +126,20 @@ if (isset($_POST['submit']))
// | directories / categories |
// +-----------------------------------------------------------------------+
if (isset($_POST['submit'])
- and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files')
- and !$general_failure)
+ and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files'))
{
$counts['new_categories'] = 0;
$counts['del_categories'] = 0;
$counts['del_elements'] = 0;
$counts['new_elements'] = 0;
$counts['upd_elements'] = 0;
+}
+
+if (isset($_POST['submit'])
+ and ($_POST['sync'] == 'dirs' or $_POST['sync'] == 'files')
+ and !$general_failure)
+{
$start = get_moment();
// which categories to update ?
$cat_ids = array();
diff --git a/include/common.inc.php b/include/common.inc.php
index 1ab44143f..db94ed740 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -171,7 +171,21 @@ if ($user['is_the_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 5ed6c169f..564b4b2c7 100644
--- a/include/functions_user.inc.php
+++ b/include/functions_user.inc.php
@@ -144,6 +144,7 @@ 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) );
$user['is_the_guest'] = ($user['id'] == $conf['guest_id']);
@@ -152,23 +153,19 @@ function build_user( $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)
+ 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']);
}
+ list($user['template'], $user['theme']) = explode('/', $user['template']);
+
return $user;
}