]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/profilesettings.php
add hooks for the account-management tools
[quix0rs-gnu-social.git] / actions / profilesettings.php
index 28b1d20f34125fab3b39b60281de0b08458dfeb2..19fbdbd29336d3d7393a3157b4c8c9d498ba9115 100644 (file)
@@ -452,4 +452,38 @@ class ProfilesettingsAction extends AccountSettingsAction
             return $other->id != $user->id;
         }
     }
+
+    function showAside() {
+        $user = common_current_user();
+
+        $this->elementStart('div', array('id' => 'aside_primary',
+                                         'class' => 'aside'));
+        $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');
+    }
 }