]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add hooks for the account-management tools
authorEvan Prodromou <evan@status.net>
Wed, 29 Dec 2010 22:02:04 +0000 (14:02 -0800)
committerEvan Prodromou <evan@status.net>
Wed, 29 Dec 2010 22:02:04 +0000 (14:02 -0800)
EVENTS.txt
actions/profilesettings.php

index 91008f54fa174d9e1e5b7010f17a7b8ae9912894..f7cc7df67c4f8bd3b8f6e74359a465c215080426 100644 (file)
@@ -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)
index 8f55a471890931df2fd174bd9c85abd50537d8dc..19fbdbd29336d3d7393a3157b4c8c9d498ba9115 100644 (file)
@@ -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');
     }
 }