]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add hook for showing account settings menu
authorEvan Prodromou <evan@controlyourself.ca>
Tue, 4 Aug 2009 11:08:10 +0000 (07:08 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Tue, 4 Aug 2009 11:08:10 +0000 (07:08 -0400)
EVENTS.txt
lib/accountsettingsaction.php

index d07c31f8dc5125eb3ed587d5526bfb0364006a05..e1dd7350827b055ab95178be21a74d070ab7f92d 100644 (file)
@@ -128,3 +128,9 @@ StartLoginGroupNav: Before showing the login and register navigation menu
 
 EndLoginGroupNav: After showing the login and register navigation menu
 - $action: the current action
+
+StartAccountSettingsNav: Before showing the account settings menu
+- $action: the current action
+
+EndAccountSettingsNav: After showing the account settings menu
+- $action: the current action
index 4ab50abcef1134a50282bbdfb64a45a4696fa972..9814c48ab7c72c47b230b3df03057774b71849a8 100644 (file)
@@ -98,38 +98,42 @@ class AccountSettingsNav extends Widget
 
     function show()
     {
-        # action => array('prompt', 'title')
-        $menu =
-          array('profilesettings' =>
-                array(_('Profile'),
-                      _('Change your profile settings')),
-                'avatarsettings' =>
-                array(_('Avatar'),
-                      _('Upload an avatar')),
-                'passwordsettings' =>
-                array(_('Password'),
-                      _('Change your password')),
-                'emailsettings' =>
-                array(_('Email'),
-                      _('Change email handling')),
-                'openidsettings' =>
-                array(_('OpenID'),
-                      _('Add or remove OpenIDs')),
-                'userdesignsettings' =>
-                array(_('Design'),
-                      _('Design your profile')),
-                'othersettings' =>
-                array(_('Other'),
-                      _('Other options')));
-
         $action_name = $this->action->trimmed('action');
         $this->action->elementStart('ul', array('class' => 'nav'));
 
-        foreach ($menu as $menuaction => $menudesc) {
-            $this->action->menuItem(common_local_url($menuaction),
-                                   $menudesc[0],
-                                   $menudesc[1],
-                                   $action_name === $menuaction);
+        if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
+
+            $menu =
+              array('profilesettings' =>
+                    array(_('Profile'),
+                          _('Change your profile settings')),
+                    'avatarsettings' =>
+                    array(_('Avatar'),
+                          _('Upload an avatar')),
+                    'passwordsettings' =>
+                    array(_('Password'),
+                          _('Change your password')),
+                    'emailsettings' =>
+                    array(_('Email'),
+                          _('Change email handling')),
+                    'openidsettings' =>
+                    array(_('OpenID'),
+                          _('Add or remove OpenIDs')),
+                    'userdesignsettings' =>
+                    array(_('Design'),
+                          _('Design your profile')),
+                    'othersettings' =>
+                    array(_('Other'),
+                          _('Other options')));
+
+            foreach ($menu as $menuaction => $menudesc) {
+                $this->action->menuItem(common_local_url($menuaction),
+                                        $menudesc[0],
+                                        $menudesc[1],
+                                        $action_name === $menuaction);
+            }
+
+            Event::handle('EndAccountSettingsNav', array(&$this->action));
         }
 
         $this->action->elementEnd('ul');