Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resolved issue 0000708: Error on synchronization
Resolved issue 0000709: Error with $conf['default_admin_layout']



git-svn-id: http://piwigo.org/svn/trunk@2038 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Jun 21, 2007
1 parent abb62a9 commit ebf2bba
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
12 changes: 8 additions & 4 deletions admin/site_update.php
Expand Up @@ -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$
Expand Down Expand Up @@ -127,15 +126,20 @@
// | 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();
Expand Down
16 changes: 15 additions & 1 deletion include/common.inc.php
Expand Up @@ -170,7 +170,21 @@
}

// 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'])
{
Expand Down
13 changes: 5 additions & 8 deletions include/functions_user.inc.php
Expand Up @@ -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;
Expand Down

0 comments on commit ebf2bba

Please sign in to comment.