From 3be120571446880cb71a57845204b3213e6df67e Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Mon, 9 Nov 2009 17:43:37 -0500 Subject: Add a new event: CanUserChangeField --- EVENTS.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index 25a51516b..c3fe73134 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -489,6 +489,10 @@ ChangePassword: Handle a password change request - $newpassword: the desired new password - &$errormsg: set this to an error message if the password could not be changed. If the password was changed, leave this as false +CanUserChangeField: Determines if a user is allowed to change a specific profile field +- $nickname: nickname of the user who would like to know which of their profile fields are mutable +- $field: name of the field the user wants to change (nickname, fullname, password, avatar, etc) + UserDeleteRelated: Specify additional tables to delete entries from when deleting users - $user: User object - &$related: array of DB_DataObject class names to delete entries on matching user_id. -- cgit v1.2.3-54-g00ecf From 069d3f2b2f912f2e7d2289bc58270341c9b1ecc5 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Tue, 10 Nov 2009 13:52:47 +0000 Subject: Added hook for the Group navigation items --- EVENTS.txt | 6 +++++ lib/groupnav.php | 79 +++++++++++++++++++++++++++++--------------------------- 2 files changed, 47 insertions(+), 38 deletions(-) (limited to 'EVENTS.txt') diff --git a/EVENTS.txt b/EVENTS.txt index c3fe73134..af686b9cd 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -191,6 +191,12 @@ StartPersonalGroupNav: beginning of personal group nav menu EndPersonalGroupNav: end of personal group nav menu (good place to add a menu item) - $action: action object being shown +StartGroupGroupNav: Showing the group nav menu +- $action: the current action + +EndGroupGroupNav: At the end of the group nav menu +- $action: the current action + StartEndHTML: just before the tag - $action: action object being shown diff --git a/lib/groupnav.php b/lib/groupnav.php index 31cf378c8..131b38fa2 100644 --- a/lib/groupnav.php +++ b/lib/groupnav.php @@ -79,46 +79,49 @@ class GroupNav extends Widget $nickname = $this->group->nickname; $this->out->elementStart('ul', array('class' => 'nav')); - $this->out->menuItem(common_local_url('showgroup', array('nickname' => - $nickname)), - _('Group'), - sprintf(_('%s group'), $nickname), - $action_name == 'showgroup', - 'nav_group_group'); - $this->out->menuItem(common_local_url('groupmembers', array('nickname' => - $nickname)), - _('Members'), - sprintf(_('%s group members'), $nickname), - $action_name == 'groupmembers', - 'nav_group_members'); + if (Event::handle('StartGroupGroupNav', array($this))) { + $this->out->menuItem(common_local_url('showgroup', array('nickname' => + $nickname)), + _('Group'), + sprintf(_('%s group'), $nickname), + $action_name == 'showgroup', + 'nav_group_group'); + $this->out->menuItem(common_local_url('groupmembers', array('nickname' => + $nickname)), + _('Members'), + sprintf(_('%s group members'), $nickname), + $action_name == 'groupmembers', + 'nav_group_members'); - $cur = common_current_user(); + $cur = common_current_user(); - if ($cur && $cur->isAdmin($this->group)) { - $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' => - $nickname)), - _('Blocked'), - sprintf(_('%s blocked users'), $nickname), - $action_name == 'blockedfromgroup', - 'nav_group_blocked'); - $this->out->menuItem(common_local_url('editgroup', array('nickname' => - $nickname)), - _('Admin'), - sprintf(_('Edit %s group properties'), $nickname), - $action_name == 'editgroup', - 'nav_group_admin'); - $this->out->menuItem(common_local_url('grouplogo', array('nickname' => - $nickname)), - _('Logo'), - sprintf(_('Add or edit %s logo'), $nickname), - $action_name == 'grouplogo', - 'nav_group_logo'); - $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' => - $nickname)), - _('Design'), - sprintf(_('Add or edit %s design'), $nickname), - $action_name == 'groupdesignsettings', - 'nav_group_design'); + if ($cur && $cur->isAdmin($this->group)) { + $this->out->menuItem(common_local_url('blockedfromgroup', array('nickname' => + $nickname)), + _('Blocked'), + sprintf(_('%s blocked users'), $nickname), + $action_name == 'blockedfromgroup', + 'nav_group_blocked'); + $this->out->menuItem(common_local_url('editgroup', array('nickname' => + $nickname)), + _('Admin'), + sprintf(_('Edit %s group properties'), $nickname), + $action_name == 'editgroup', + 'nav_group_admin'); + $this->out->menuItem(common_local_url('grouplogo', array('nickname' => + $nickname)), + _('Logo'), + sprintf(_('Add or edit %s logo'), $nickname), + $action_name == 'grouplogo', + 'nav_group_logo'); + $this->out->menuItem(common_local_url('groupdesignsettings', array('nickname' => + $nickname)), + _('Design'), + sprintf(_('Add or edit %s design'), $nickname), + $action_name == 'groupdesignsettings', + 'nav_group_design'); + } + Event::handle('EndGroupGroupNav', array($this)); } $this->out->elementEnd('ul'); } -- cgit v1.2.3-54-g00ecf