aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-08-17 14:25:38 +0000
committerplegall <plg@piwigo.org>2005-08-17 14:25:38 +0000
commit20f05416971676e5433da86f3f924d4efe2f92df (patch)
tree406375600205f9e264694da57de66a0f14ea1acd /admin
parentde22732f93fad45f94d8c95fdca4cdf6a870327d (diff)
- modification : major simplification of admin.php. Titles are managed by
included page, localized items are managed directly in the template. - new : sub template admin/double_select is included in templates admin/cat_options, admin/user_perm and admin/group_perm. I haven't been able to use it in admin/picture_modify because it seems impossible to have two instance of the same sub-template without interfering. - modification : bug 99, in profile manager, no auto submit when changing language (useless and generate accessibility problem). - improvement : HTML semantically correct for administration menu, simpler syntax, less tags, correct tags (dl/dt/dd instead of div/div). - modification : number of waiting elements and unvalidated comments are displayed in admin/intro instead of administration menu (with a link to the dedicated pages). - deletion : no link to profile from admin/user_list anymore (no need). git-svn-id: http://piwigo.org/svn/trunk@817 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin.php316
-rw-r--r--admin/cat_options.php34
-rw-r--r--admin/cat_perm.php18
-rw-r--r--admin/group_perm.php25
-rw-r--r--admin/intro.php40
-rw-r--r--admin/picture_modify.php18
-rw-r--r--admin/user_perm.php26
7 files changed, 170 insertions, 307 deletions
diff --git a/admin.php b/admin.php
index fa031da6e..28c7dc992 100644
--- a/admin.php
+++ b/admin.php
@@ -37,257 +37,58 @@ include_once( PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php' );
sync_users();
-//--------------------------------------- validating page and creation of title
-$page_valide = false;
-$title = '';
-$username='';
-if (isset($_POST['username']))
-{
- $username = $_POST['username'];
-}
-else if (isset($_POST['userid']))
-{
- $username = get_username($_POST['userid']);
-}
-else if (isset($_GET['user_id']))
-{
- $username = get_username($_GET['user_id']);
-}
-
-$_GET['page'] = isset($_GET['page']) ? $_GET['page'] : 'intro';
-
-switch ( $_GET['page'] )
-{
- case 'user_list' :
- {
- $title = $lang['title_liste_users'];
- $page_valide = true;
- break;
- }
- case 'profile' :
- {
- $title = $lang['title_user_modify'];
- $page_valide = true;
- break;
- }
- case 'user_perm':
- $title = $lang['title_user_perm'].' '.$username;
- $page_valide = true; break;
- case 'group_list' :
- $title = $lang['title_groups']; $page_valide = true; break;
- case 'group_perm' :
- if (!is_numeric($_GET['group_id']))
- {
- $_GET['group_id'] = -1;
- }
- $query = '
-SELECT name
- FROM '.GROUPS_TABLE.'
- WHERE id = '.$_GET['group_id'].'
-;';
- $result = pwg_query($query);
- if (mysql_num_rows($result) > 0 )
- {
- $row = mysql_fetch_array($result);
- $title = $lang['title_group_perm'].' "'.$row['name'].'"';
- $page_valide = true;
- }
- else
- {
- $page_valide = false;
- }
- break;
- case 'stats':
- $title = $lang['title_history']; $page_valide = true; break;
- case 'update':
- $title = $lang['title_update']; $page_valide = true; break;
- case 'configuration':
- $title = $lang['title_configuration']; $page_valide = true; break;
- case 'help':
- $title = $lang['title_instructions']; $page_valide = true; break;
- case 'cat_perm':
- $title = $lang['title_cat_perm'];
- if ( isset( $_GET['cat'] ) )
- {
- check_cat_id( $_GET['cat'] );
- if ( isset( $page['cat'] ) and is_numeric( $page['cat'] ) )
- {
- $result = get_cat_info( $page['cat'] );
- $name = get_cat_display_name($result['name'], '');
- $title.= ' "'.$name.'"';
- }
- }
- $page_valide = true;
- break;
- case 'cat_list':
- $title = $lang['title_categories']; $page_valide = true; break;
- case 'cat_modify':
- $title = $lang['title_edit_cat']; $page_valide = true; break;
- case 'infos_images':
- $title = $lang['title_info_images']; $page_valide = true; break;
- case 'waiting':
- $title = $lang['title_waiting']; $page_valide = true; break;
- case 'thumbnail':
- $title = $lang['title_thumbnails'];
- if ( isset( $_GET['dir'] ) )
- {
- $title.= ' '.$lang['title_thumbnails_2'].' <span class="titreImg">';
- // $_GET['dir'] contains :
- // ./galleries/vieux_lyon ou
- // ./galleries/vieux_lyon/visite ou
- // ./galleries/vieux_lyon/visite/truc ...
- $dir = explode( "/", $_GET['dir'] );
- $title.= $dir[2];
- for ( $i = 2; $i < sizeof( $dir ) - 1; $i++ )
- {
- $title.= ' &gt; '.$dir[$i+1];
- }
- $title.= "</span>";
- }
- $page_valide = true;
- break;
- case 'comments' :
- $title = $lang['title_comments'];
- $page_valide = true;
- break;
- case 'picture_modify' :
- $title = $lang['title_picmod'];
- $page_valide = true;
- break;
- case 'remote_site' :
- {
- $title = $lang['remote_sites'];
- $page_valide = true;
- break;
- }
- case 'cat_options' :
- {
- $title = $lang['title_cat_options'];
- $page_valide = true;
- break;
- }
- case 'element_set' :
- {
- $title = 'batch management';
- $page_valide = true;
- break;
- }
- case 'maintenance' :
- {
- $title = l10n('Maintenance');
- $page_valide = true;
- break;
- }
- case 'representative' :
- {
- $title = l10n('Representative');
- $page_valide = true;
- break;
- }
-// case 'element_set_unit' :
-// {
-// $title = 'batch management';
-// $page_valide = true;
-// break;
-// }
- case 'intro' :
- {
- $_GET['page'] = 'intro';
- $title = $lang['title_default'];
- $page_valide = true;
- break;
- }
- default :
- {
- break;
- }
-}
-if ( $title == '' ) $title = $lang['title_default'];
+// +-----------------------------------------------------------------------+
+// | variables init |
+// +-----------------------------------------------------------------------+
-// waiting
-$query = 'SELECT id FROM '.WAITING_TABLE;
-$query.= " WHERE validated='false'";
-$query.= ';';
-$result = pwg_query( $query );
-$nb_waiting = '';
-if ( mysql_num_rows( $result ) > 0 )
+if (isset($_GET['page'])
+ and preg_match('/^[a-z_]*$/', $_GET['page'])
+ and is_file(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php'))
{
- $nb_waiting = ' [ '.mysql_num_rows( $result ).' ]';
+ $page['page'] = $_GET['page'];
}
-// comments
-$query = 'SELECT id FROM '.COMMENTS_TABLE;
-$query.= " WHERE validated='false'";
-$query.= ';';
-$result = pwg_query( $query );
-$nb_comments = '';
-if ( mysql_num_rows( $result ) > 0 )
+else
{
- $nb_comments = ' [ '.mysql_num_rows( $result ).' ]';
+ $page['page'] = 'intro';
}
$link_start = PHPWG_ROOT_PATH.'admin.php?page=';
$conf_link = $link_start.'configuration&amp;section=';
$opt_link = $link_start.'cat_options&amp;section=';
//----------------------------------------------------- template initialization
+$title = l10n('PhpWebGallery administration'); // for include/page_header.php
include(PHPWG_ROOT_PATH.'include/page_header.php');
-$template->set_filenames( array('admin'=>'admin.tpl') );
-$template->assign_vars(array(
- 'L_TITLE'=>$lang['admin_panel'],
- 'L_LINKS'=>$lang['links'],
- 'L_GALLERY_INDEX'=>$lang['home'],
- 'L_GENERAL'=>$lang['general'],
- 'L_DEFAULT'=>$lang['gallery_default'],
- 'L_HISTORY'=>$lang['history'],
- 'L_FAQ'=>$lang['instructions'],
- 'L_CONFIGURATION'=>$lang['config'],
- 'L_CONFIG_GENERAL'=>$lang['general'],
- 'L_CONFIG_COMMENTS'=>$lang['comments'],
- 'L_CONFIG_DISPLAY'=>$lang['conf_default'],
- 'L_CONFIG_UPLOAD'=>$lang['upload'],
- 'L_CONFIG_SESSION'=>$lang['conf_cookie'],
- 'L_CONFIG_METADATA'=>$lang['metadata'],
- 'L_SITES'=>$lang['remote_sites'],
- 'L_CATEGORIES'=>$lang['categories'],
- 'L_MANAGE'=>$lang['manage'],
- 'L_IMAGES'=>$lang['pictures'],
- 'L_WAITING'=>$lang['waiting'].$nb_waiting,
- 'L_COMMENTS'=>$lang['comments'].$nb_comments,
- 'L_THUMBNAILS'=>$lang['thumbnails'],
- 'L_IDENTIFY'=>$lang['identification'],
- 'L_USERS'=>$lang['users'],
- 'L_GROUPS'=>$lang['groups'],
- 'L_UPDATE'=>$lang['update'],
- 'L_CAT_UPLOAD'=>$lang['upload'],
- 'L_CAT_COMMENTS'=>$lang['comments'],
- 'L_CAT_VISIBLE'=>$lang['lock'],
- 'L_CAT_STATUS'=>$lang['cat_security'],
+$template->set_filenames(array('admin' => 'admin.tpl'));
- 'U_HISTORY'=>add_session_id($link_start.'stats' ),
- 'U_FAQ'=>add_session_id($link_start.'help' ),
- 'U_SITES'=>add_session_id($link_start.'remote_site'),
- 'U_MAINTENANCE'=>add_session_id($link_start.'maintenance'),
- 'U_CONFIG_GENERAL'=>add_session_id($conf_link.'general' ),
- 'U_CONFIG_COMMENTS'=>add_session_id($conf_link.'comments' ),
- 'U_CONFIG_DISPLAY'=>add_session_id($conf_link.'default' ),
- 'U_CONFIG_UPLOAD'=>add_session_id($conf_link.'upload' ),
- 'U_CONFIG_SESSION'=>add_session_id($conf_link.'session' ),
- 'U_CONFIG_METADATA'=>add_session_id($conf_link.'metadata' ),
- 'U_CATEGORIES'=>add_session_id($link_start.'cat_list' ),
- 'U_CAT_UPLOAD'=>add_session_id($opt_link.'upload'),
- 'U_CAT_COMMENTS'=>add_session_id($opt_link.'comments'),
- 'U_CAT_VISIBLE'=>add_session_id($opt_link.'visible'),
- 'U_CAT_STATUS'=>add_session_id($opt_link.'status'),
- 'U_CAT_OPTIONS'=>add_session_id($link_start.'cat_options'),
- 'U_CAT_UPDATE'=>add_session_id($link_start.'update'),
- 'U_WAITING'=>add_session_id($link_start.'waiting' ),
- 'U_COMMENTS'=>add_session_id($link_start.'comments' ),
- 'U_CADDIE'=>add_session_id($link_start.'element_set&amp;cat=caddie'),
- 'U_THUMBNAILS'=>add_session_id($link_start.'thumbnail' ),
- 'U_USERS'=>add_session_id($link_start.'user_list' ),
- 'U_GROUPS'=>add_session_id($link_start.'group_list' ),
- 'U_RETURN'=>add_session_id(PHPWG_ROOT_PATH.'category.php')
- ));
+$template->assign_vars(
+ array(
+ 'U_HISTORY'=>add_session_id($link_start.'stats' ),
+ 'U_FAQ'=>add_session_id($link_start.'help' ),
+ 'U_SITES'=>add_session_id($link_start.'remote_site'),
+ 'U_MAINTENANCE'=>add_session_id($link_start.'maintenance'),
+ 'U_CONFIG_GENERAL'=>add_session_id($conf_link.'general' ),
+ 'U_CONFIG_COMMENTS'=>add_session_id($conf_link.'comments' ),
+ 'U_CONFIG_DISPLAY'=>add_session_id($conf_link.'default' ),
+ 'U_CONFIG_UPLOAD'=>add_session_id($conf_link.'upload' ),
+ 'U_CONFIG_SESSION'=>add_session_id($conf_link.'session' ),
+ 'U_CONFIG_METADATA'=>add_session_id($conf_link.'metadata' ),
+ 'U_CATEGORIES'=>add_session_id($link_start.'cat_list' ),
+ 'U_CAT_UPLOAD'=>add_session_id($opt_link.'upload'),
+ 'U_CAT_COMMENTS'=>add_session_id($opt_link.'comments'),
+ 'U_CAT_VISIBLE'=>add_session_id($opt_link.'visible'),
+ 'U_CAT_STATUS'=>add_session_id($opt_link.'status'),
+ 'U_CAT_OPTIONS'=>add_session_id($link_start.'cat_options'),
+ 'U_CAT_UPDATE'=>add_session_id($link_start.'update'),
+ 'U_WAITING'=>add_session_id($link_start.'waiting' ),
+ 'U_COMMENTS'=>add_session_id($link_start.'comments' ),
+ 'U_CADDIE'=>add_session_id($link_start.'element_set&amp;cat=caddie'),
+ 'U_THUMBNAILS'=>add_session_id($link_start.'thumbnail' ),
+ 'U_USERS'=>add_session_id($link_start.'user_list' ),
+ 'U_GROUPS'=>add_session_id($link_start.'group_list' ),
+ 'U_RETURN'=>add_session_id(PHPWG_ROOT_PATH.'category.php')
+ )
+ );
if ($conf['allow_random_representative'])
{
@@ -299,44 +100,16 @@ if ($conf['allow_random_representative'])
);
}
-//--------------------------------------------------------------------- summary
-$link_start = PHPWG_ROOT_PATH.'admin.php?page=';
//------------------------------------------------------------- content display
$page['errors'] = array();
-$page['infos'] = array();
+$page['infos'] = array();
+
+include(PHPWG_ROOT_PATH.'admin/'.$page['page'].'.php');
-if ($page_valide)
-{
- switch ($_GET['page'])
- {
- case 'comments' :
- {
- include(PHPWG_ROOT_PATH.'comments.php');
- break;
- }
- case 'profile' :
- {
- include(PHPWG_ROOT_PATH.'profile.php');
- break;
- }
- default :
- {
- include(PHPWG_ROOT_PATH.'admin/'.$_GET['page'].'.php');
- }
- }
-}
-else
-{
- $template->assign_vars(
- array(
- 'ADMIN_CONTENT'
- =>'<div style="text-align:center">'.$lang['default_message'].'</div>'
- )
- );
-}
// +-----------------------------------------------------------------------+
// | errors & infos |
// +-----------------------------------------------------------------------+
+
if (count($page['errors']) != 0)
{
$template->assign_block_vars('errors',array());
@@ -345,6 +118,7 @@ if (count($page['errors']) != 0)
$template->assign_block_vars('errors.error',array('ERROR'=>$error));
}
}
+
if (count($page['infos']) != 0)
{
$template->assign_block_vars('infos',array());
@@ -356,9 +130,11 @@ if (count($page['infos']) != 0)
$template->parse('admin');
include(PHPWG_ROOT_PATH.'include/page_tail.php');
+
// +-----------------------------------------------------------------------+
// | order permission refreshment |
// +-----------------------------------------------------------------------+
+
$query = '
UPDATE '.USER_CACHE_TABLE.'
SET need_update = \'true\'
diff --git a/admin/cat_options.php b/admin/cat_options.php
index fc10cbc05..24e0687cd 100644
--- a/admin/cat_options.php
+++ b/admin/cat_options.php
@@ -30,9 +30,11 @@ if (!defined('PHPWG_ROOT_PATH'))
die ("Hacking attempt!");
}
include_once(PHPWG_ROOT_PATH.'admin/include/isadmin.inc.php');
+
// +-----------------------------------------------------------------------+
// | modification registration |
// +-----------------------------------------------------------------------+
+
// print '<pre>';
// print_r($_POST);
// print '</pre>';
@@ -129,21 +131,21 @@ UPDATE '.CATEGORIES_TABLE.'
}
}
}
+
// +-----------------------------------------------------------------------+
// | template init |
// +-----------------------------------------------------------------------+
-$template->set_filenames(array('cat_options'=>'admin/cat_options.tpl'));
-if (!isset($_GET['section']))
-{
- $page['section'] = 'upload';
-}
-else
-{
- $page['section'] = $_GET['section'];
-}
+$template->set_filenames(
+ array(
+ 'cat_options' => 'admin/cat_options.tpl',
+ 'double_select' => 'admin/double_select.tpl'
+ )
+ );
+$page['section'] = isset($_GET['section']) ? $_GET['section'] : 'upload';
$base_url = PHPWG_ROOT_PATH.'admin.php?page=cat_options&amp;section=';
+
$template->assign_vars(
array(
'L_SUBMIT'=>$lang['submit'],
@@ -153,7 +155,6 @@ $template->assign_vars(
)
);
-$template->assign_vars(array(strtoupper($page['section']).'_CLASS'=>'opened'));
// +-----------------------------------------------------------------------+
// | form display |
// +-----------------------------------------------------------------------+
@@ -189,7 +190,7 @@ SELECT id,name,uppercats,global_rank
;';
$template->assign_vars(
array(
- 'L_CAT_TITLE' => $lang['cat_upload_title'],
+ 'L_SECTION' => $lang['cat_upload_title'],
'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
'L_CAT_OPTIONS_INFO' => $lang['cat_upload_info'],
@@ -211,7 +212,7 @@ SELECT id,name,uppercats,global_rank
;';
$template->assign_vars(
array(
- 'L_CAT_TITLE' => $lang['cat_comments_title'],
+ 'L_SECTION' => $lang['cat_comments_title'],
'L_CAT_OPTIONS_TRUE' => $lang['authorized'],
'L_CAT_OPTIONS_FALSE' => $lang['forbidden'],
'L_CAT_OPTIONS_INFO' => $lang['cat_comments_info'],
@@ -233,7 +234,7 @@ SELECT id,name,uppercats,global_rank
;';
$template->assign_vars(
array(
- 'L_CAT_TITLE' => $lang['cat_lock_title'],
+ 'L_SECTION' => $lang['cat_lock_title'],
'L_CAT_OPTIONS_TRUE' => $lang['unlocked'],
'L_CAT_OPTIONS_FALSE' => $lang['locked'],
'L_CAT_OPTIONS_INFO' => $lang['cat_lock_info'],
@@ -255,7 +256,7 @@ SELECT id,name,uppercats,global_rank
;';
$template->assign_vars(
array(
- 'L_CAT_TITLE' => $lang['cat_status_title'],
+ 'L_SECTION' => $lang['cat_status_title'],
'L_CAT_OPTIONS_TRUE' => $lang['cat_public'],
'L_CAT_OPTIONS_FALSE' => $lang['cat_private'],
'L_CAT_OPTIONS_INFO' => $lang['cat_status_info'],
@@ -278,7 +279,7 @@ SELECT id,name,uppercats,global_rank
;';
$template->assign_vars(
array(
- 'L_CAT_TITLE' => l10n('Representative'),
+ 'L_SECTION' => l10n('Representative'),
'L_CAT_OPTIONS_TRUE' => l10n('singly represented'),
'L_CAT_OPTIONS_FALSE' => l10n('randomly represented'),
'L_CAT_OPTIONS_INFO' => l10n('')
@@ -289,8 +290,11 @@ SELECT id,name,uppercats,global_rank
}
display_select_cat_wrapper($query_true,array(),'category_option_true');
display_select_cat_wrapper($query_false,array(),'category_option_false');
+
// +-----------------------------------------------------------------------+
// | sending html code |
// +-----------------------------------------------------------------------+
+
+$template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
$template->assign_var_from_handle('ADMIN_CONTENT', 'cat_options');
?> \ No newline at end of file
diff --git a/admin/cat_perm.php b/admin/cat_perm.php
index 7580cd28c..ca6baf86c 100644
--- a/admin/cat_perm.php
+++ b/admin/cat_perm.php
@@ -196,12 +196,22 @@ SELECT user_id, cat_id
// +-----------------------------------------------------------------------+
// | template initialization |
// +-----------------------------------------------------------------------+
-$template->set_filenames(array('cat_perm'=>'admin/cat_perm.tpl'));
-$form_action = PHPWG_ROOT_PATH.'admin.php';
-$form_action.= '?page=cat_perm&amp;cat='.$page['cat'];
+$template->set_filenames(array('cat_perm'=>'admin/cat_perm.tpl'));
-$template->assign_vars(array('F_ACTION' => $form_action));
+$template->assign_vars(
+ array(
+ 'TITLE' =>
+ sprintf(
+ l10n('Manage permissions for category "%s"'),
+ get_cat_display_name_from_id($page['cat'])
+ )
+ 'F_ACTION' =>
+ add_session_id(
+ PHPWG_ROOT_PATH.'admin.php?page=cat_perm&amp;cat='.$page['cat']
+ )
+ )
+ );
// +-----------------------------------------------------------------------+
// | form construction |
diff --git a/admin/group_perm.php b/admin/group_perm.php
index 7234a5e2f..5c974008e 100644
--- a/admin/group_perm.php
+++ b/admin/group_perm.php
@@ -120,21 +120,31 @@ SELECT cat_id
// | template init |
// +-----------------------------------------------------------------------+
-$template->set_filenames(array('group_perm'=>'admin/cat_options.tpl'));
+$template->set_filenames(
+ array(
+ 'group_perm' => 'admin/group_perm.tpl',
+ 'double_select' => 'admin/double_select.tpl'
+ )
+ );
$template->assign_vars(
array(
- 'L_RESET'=>$lang['reset'],
+ 'TITLE' =>
+ sprintf(
+ l10n('Manage permissions for group "%s"'),
+ get_groupname($page['group']
+ )
+ ),
'L_CAT_OPTIONS_TRUE'=>$lang['authorized'],
'L_CAT_OPTIONS_FALSE'=>$lang['forbidden'],
'L_CAT_OPTIONS_INFO'=>$lang['permuser_info'],
'F_ACTION' =>
- add_session_id(
- PHPWG_ROOT_PATH.
- 'admin.php?page=group_perm&amp;group_id='.
- $page['group']
- )
+ add_session_id(
+ PHPWG_ROOT_PATH.
+ 'admin.php?page=group_perm&amp;group_id='.
+ $page['group']
+ )
)
);
@@ -171,6 +181,7 @@ display_select_cat_wrapper($query_false,array(),'category_option_false');
// | html code display |
// +-----------------------------------------------------------------------+
+$template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
$template->assign_var_from_handle('ADMIN_CONTENT', 'group_perm');
?>
diff --git a/admin/intro.php b/admin/intro.php
index 25369e832..450f39902 100644
--- a/admin/intro.php
+++ b/admin/intro.php
@@ -192,7 +192,45 @@ $template->assign_vars(
add_session_id(PHPWG_ROOT_PATH.'admin.php?action=phpinfo')
)
);
-
+
+// waiting elements
+$query = '
+SELECT COUNT(*)
+ FROM '.WAITING_TABLE.'
+ WHERE validated=\'false\'
+;';
+list($nb_waiting) = mysql_fetch_row(pwg_query($query));
+
+if ($nb_waiting > 0)
+{
+ $template->assign_block_vars(
+ 'waiting',
+ array(
+ 'URL' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=waiting'),
+ 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_waiting)
+ )
+ );
+}
+
+// unvalidated comments
+$query = '
+SELECT COUNT(*)
+ FROM '.COMMENTS_TABLE.'
+ WHERE validated=\'false\'
+;';
+list($nb_comments) = mysql_fetch_row(pwg_query($query));
+
+if ($nb_comments > 0)
+{
+ $template->assign_block_vars(
+ 'unvalidated',
+ array(
+ 'URL' => add_session_id(PHPWG_ROOT_PATH.'admin.php?page=comments'),
+ 'INFO' => sprintf(l10n('%d waiting for validation'), $nb_comments)
+ )
+ );
+}
+
// +-----------------------------------------------------------------------+
// | sending html code |
// +-----------------------------------------------------------------------+
diff --git a/admin/picture_modify.php b/admin/picture_modify.php
index 1533d9f08..a07cfbd75 100644
--- a/admin/picture_modify.php
+++ b/admin/picture_modify.php
@@ -167,7 +167,12 @@ $storage_category = get_cat_display_name_cache($row['uppercats'],
$url,
false);
//----------------------------------------------------- template initialization
-$template->set_filenames(array('picture_modify'=>'admin/picture_modify.tpl'));
+$template->set_filenames(
+ array(
+ 'picture_modify' => 'admin/picture_modify.tpl'
+ )
+ );
+
$template->assign_vars(array(
'TITLE_IMG'=>$title,
'STORAGE_CATEGORY_IMG'=>$storage_category,
@@ -220,7 +225,7 @@ SELECT id,name,uppercats,global_rank
WHERE image_id = '.$_GET['image_id'].'
AND id != '.$storage_category_id.'
;';
-display_select_cat_wrapper($query,array(),'associated_option');
+display_select_cat_wrapper($query, array(), 'associated_option');
$result = pwg_query($query);
$associateds = array($storage_category_id);
@@ -233,7 +238,7 @@ SELECT id,name,uppercats,global_rank
FROM '.CATEGORIES_TABLE.'
WHERE id NOT IN ('.implode(',', $associateds).')
;';
-display_select_cat_wrapper($query,array(),'dissociated_option');
+display_select_cat_wrapper($query, array(), 'dissociated_option');
// representing
$query = '
@@ -241,7 +246,7 @@ SELECT id,name,uppercats,global_rank
FROM '.CATEGORIES_TABLE.'
WHERE representative_picture_id = '.$_GET['image_id'].'
;';
-display_select_cat_wrapper($query,array(),'elected_option');
+display_select_cat_wrapper($query, array(), 'elected_option');
$query = '
SELECT id,name,uppercats,global_rank
@@ -249,7 +254,10 @@ SELECT id,name,uppercats,global_rank
WHERE representative_picture_id != '.$_GET['image_id'].'
OR representative_picture_id IS NULL
;';
-display_select_cat_wrapper($query,array(),'dismissed_option');
+display_select_cat_wrapper($query, array(), 'dismissed_option');
+
//----------------------------------------------------------- sending html code
+
+
$template->assign_var_from_handle('ADMIN_CONTENT', 'picture_modify');
?>
diff --git a/admin/user_perm.php b/admin/user_perm.php
index f23071696..56af243bb 100644
--- a/admin/user_perm.php
+++ b/admin/user_perm.php
@@ -109,15 +109,28 @@ SELECT cat_id
mass_inserts(USER_ACCESS_TABLE, array('user_id','cat_id'), $inserts);
}
-//----------------------------------------------------- template initialization
-$template->set_filenames(array('user_perm'=>'admin/cat_options.tpl'));
+
+// +-----------------------------------------------------------------------+
+// | template init |
+// +-----------------------------------------------------------------------+
+
+$template->set_filenames(
+ array(
+ 'user_perm' => 'admin/user_perm.tpl',
+ 'double_select' => 'admin/double_select.tpl'
+ )
+ );
$template->assign_vars(
array(
- 'L_RESET'=>$lang['reset'],
+ 'TITLE' =>
+ sprintf(
+ l10n('Manage permissions for user "%s"'),
+ get_username($page['user']
+ )
+ ),
'L_CAT_OPTIONS_TRUE'=>$lang['authorized'],
'L_CAT_OPTIONS_FALSE'=>$lang['forbidden'],
- 'L_CAT_OPTIONS_INFO'=>$lang['permuser_info'],
'F_ACTION' =>
add_session_id(
@@ -157,7 +170,10 @@ $query_false.= '
;';
display_select_cat_wrapper($query_false,array(),'category_option_false');
-//----------------------------------------------------------- sending html code
+// +-----------------------------------------------------------------------+
+// | sending html code |
+// +-----------------------------------------------------------------------+
+$template->assign_var_from_handle('DOUBLE_SELECT', 'double_select');
$template->assign_var_from_handle('ADMIN_CONTENT', 'user_perm');
?>