diff options
author | rub <rub@piwigo.org> | 2006-03-16 22:58:16 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2006-03-16 22:58:16 +0000 |
commit | 9b521760af7639310742d7817c4fb91b88471c5c (patch) | |
tree | 9260a834a927131ba184de330d4f8ecdfaafdcef /include | |
parent | 5980db248ab4cc05e8596e07d7efc31048bcb8e8 (diff) |
Step 7 improvement issue 0000301:
o can attribute status <= current user
o define mode adviser
=> buttons disabled (gray on IE, not on FF)
=> truncated actions
=> display info mode adviser
git-svn-id: http://piwigo.org/svn/trunk@1085 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include')
-rw-r--r-- | include/common.inc.php | 12 | ||||
-rw-r--r-- | include/functions_user.inc.php | 31 | ||||
-rw-r--r-- | include/page_header.php | 5 |
3 files changed, 41 insertions, 7 deletions
diff --git a/include/common.inc.php b/include/common.inc.php index 86c5c7a70..27949fd17 100644 --- a/include/common.inc.php +++ b/include/common.inc.php @@ -232,6 +232,18 @@ include( .'/themeconf.inc.php' ); +if (is_adviser()) +{ + echo ' + <div class="titrePage"> + <h2> + <div style="text-align:center;">'.$lang['adviser_mode_enabled'].' + </div> + </h2> + </div> + '; +} + // template instance $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']); ?> diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 44f1a1cf7..7af517980 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -548,11 +548,11 @@ function log_user($user_id, $remember_me) } /* - * Return if current user have access to access_type definition + * Return access_type definition of uuser * Test does with user status * @return bool */ -function is_autorize_status($access_type, $user_status = '') +function get_access_type_status($user_status = '') { global $user; @@ -587,11 +587,21 @@ function is_autorize_status($access_type, $user_status = '') } } - return ($access_type_status >= $access_type); + return $access_type_status; +} + +/* + * Return if user have access to access_type definition + * Test does with user status + * @return bool +*/ +function is_autorize_status($access_type, $user_status = '') +{ + return (get_access_type_status($user_status) >= $access_type); } /* - * Check if current user have access to access_type definition + * Check if user have access to access_type definition * Stop action if there are not access * Test does with user status * @return none @@ -609,7 +619,7 @@ function check_status($access_type, $user_status = '') } /* - * Return if current user is an administrator + * Return if user is an administrator * @return bool */ function is_admin($user_status = '') @@ -617,4 +627,15 @@ function is_admin($user_status = '') return is_autorize_status(ACCESS_ADMINISTRATOR, $user_status); } +/* + * Return if current user is an adviser + * @return bool +*/ +function is_adviser() +{ + global $user; + + return ($user['adviser'] == 'true'); +} + ?>
\ No newline at end of file diff --git a/include/page_header.php b/include/page_header.php index d4c3b9e3d..778d5661c 100644 --- a/include/page_header.php +++ b/include/page_header.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | PhpWebGallery - a PHP based picture gallery | // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | -// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net | +// | Copyright (C) 2003-2006 PhpWebGallery Team - http://phpwebgallery.net | // +-----------------------------------------------------------------------+ // | branch : BSF (Best So Far) // | file : $RCSfile$ @@ -52,7 +52,8 @@ $template->assign_vars( 'LANG'=>$lang_info['code'], 'DIR'=>$lang_info['direction'], - 'T_STYLE' => $css + 'T_STYLE' => $css, + 'TAG_INPUT_ENABLED' => ((is_adviser()) ? 'disabled' : '') )); // refresh |