summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/user_profile.php
diff options
context:
space:
mode:
authorAndy Staudacher <andy.st@gmail.com>2010-02-14 19:26:34 -0800
committerAndy Staudacher <andy.st@gmail.com>2010-02-14 19:26:34 -0800
commit409121942590e12692eaf4e6e9e8b71bfe5ed60c (patch)
treeb7dc7ce68fa89008a583b01b4e4f79445d2e8788 /modules/gallery/controllers/user_profile.php
parent667d65aea460ea601858c54976495d294d93f017 (diff)
Fix for ticket #491: Make user and group names translatable.
Also fixed a UI bug: No longer showing the edit user buttons to admins in the profile view (to be consistent with the requirements in the controller).
Diffstat (limited to 'modules/gallery/controllers/user_profile.php')
-rw-r--r--modules/gallery/controllers/user_profile.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gallery/controllers/user_profile.php b/modules/gallery/controllers/user_profile.php
index 327d2ff1..05373466 100644
--- a/modules/gallery/controllers/user_profile.php
+++ b/modules/gallery/controllers/user_profile.php
@@ -23,7 +23,8 @@ class User_Profile_Controller extends Controller {
$user = identity::lookup_user($id);
$active_user = identity::active_user();
$is_current_active = $active_user->id == $id;
- $display_all = $active_user->admin || ($is_current_active && !$active_user->guest);
+ $can_edit = $is_current_active && !$active_user->guest;
+ $display_all = $active_user->admin || $can_edit;
$v = new Theme_View("page.html", "other", "profile");
$v->page_title = t("%name Profile", array("name" => $user->display_name()));
@@ -32,7 +33,7 @@ class User_Profile_Controller extends Controller {
// @todo modify user_home to supply a link to their album,
$v->content->user = $user;
$v->content->not_current = !$is_current_active;
- $v->content->editable = identity::is_writable() && $display_all;
+ $v->content->editable = identity::is_writable() && $can_edit;
$event_data = (object)array("user" => $user, "display_all" => $display_all, "content" => array());
module::event("show_user_profile", $event_data);