From: Evan Prodromou Date: Wed, 29 Dec 2010 22:02:04 +0000 (-0800) Subject: add hooks for the account-management tools X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=48edbb30231e28b74409e02308f15e38940e5da1;p=quix0rs-gnu-social.git add hooks for the account-management tools --- diff --git a/EVENTS.txt b/EVENTS.txt index 91008f54fa..f7cc7df67c 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1040,3 +1040,8 @@ EndImportActivity: when we finish importing an activity - $activity: The current activity - $trusted: How "trusted" the process is +StartProfileSettingsActions: when we're showing account-management action list +- $action: Action being shown (use for output) + +EndProfileSettingsActions: when we're showing account-management action list +- $action: Action being shown (use for output) diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 8f55a47189..19fbdbd293 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -458,27 +458,32 @@ class ProfilesettingsAction extends AccountSettingsAction $this->elementStart('div', array('id' => 'aside_primary', 'class' => 'aside')); - if ($user->hasRight(Right::BACKUPACCOUNT)) { - $this->elementStart('li'); - $this->element('a', - array('href' => common_local_url('backupaccount')), - _('Backup account')); - $this->elementEnd('li'); - } - if ($user->hasRight(Right::DELETEACCOUNT)) { - $this->elementStart('li'); - $this->element('a', - array('href' => common_local_url('deleteaccount')), - _('Delete account')); - $this->elementEnd('li'); - } - if ($user->hasRight(Right::RESTOREACCOUNT)) { - $this->elementStart('li'); - $this->element('a', - array('href' => common_local_url('restoreaccount')), - _('Restore account')); - $this->elementEnd('li'); + $this->elementStart('ul'); + if (Event::handle('StartProfileSettingsActions', array($this))) { + if ($user->hasRight(Right::BACKUPACCOUNT)) { + $this->elementStart('li'); + $this->element('a', + array('href' => common_local_url('backupaccount')), + _('Backup account')); + $this->elementEnd('li'); + } + if ($user->hasRight(Right::DELETEACCOUNT)) { + $this->elementStart('li'); + $this->element('a', + array('href' => common_local_url('deleteaccount')), + _('Delete account')); + $this->elementEnd('li'); + } + if ($user->hasRight(Right::RESTOREACCOUNT)) { + $this->elementStart('li'); + $this->element('a', + array('href' => common_local_url('restoreaccount')), + _('Restore account')); + $this->elementEnd('li'); + } + Event::handle('EndProfileSettingsActions', array($this)); } + $this->elementEnd('ul'); $this->elementEnd('div'); } }