]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/settingsnav.php
copy-paste TagSub to SearchSub :D
[quix0rs-gnu-social.git] / lib / settingsnav.php
index a73f73f86a0d0a22b2969e07a866573d5abce7f3..2987e36ea947d63564c9373b7aa4f792ef175a0a 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * StatusNet - the distributed open-source microblogging tool
- * Copyright (C) 2010, StatusNet, Inc.
+ * Copyright (C) 2010,2011, StatusNet, Inc.
  *
  * Settings menu
  * 
@@ -23,7 +23,7 @@
  * @category  Widget
  * @package   StatusNet
  * @author    Evan Prodromou <evan@status.net>
- * @copyright 2010 StatusNet, Inc.
+ * @copyright 2010,2011 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  * @link      http://status.net/
  */
@@ -46,21 +46,8 @@ if (!defined('STATUSNET')) {
  * @see      HTMLOutputter
  */
 
-class SettingsNav extends Widget
+class SettingsNav extends Menu
 {
-    var $action = null;
-
-    /**
-     * Construction
-     *
-     * @param Action $action current action, used for output
-     */
-    function __construct($action=null)
-    {
-        parent::__construct($action);
-        $this->action = $action;
-    }
-
     /**
      * Show the menu
      *
@@ -70,6 +57,25 @@ class SettingsNav extends Widget
     function show()
     {
         $actionName = $this->action->trimmed('action');
+        $user = common_current_user();
+        $nickname = $user->nickname;
+        $name = $user->getProfile()->getBestName();
+
+        // Stub section w/ home link
+        $this->action->elementStart('ul');
+        $this->action->element('h3', null, _('Home'));
+        $this->action->elementStart('ul', 'nav');
+        $this->out->menuItem(common_local_url('all', array('nickname' =>
+                                                           $nickname)),
+                             _('Home'),
+                             sprintf(_('%s and friends'), $name),
+                             $this->action == 'all', 'nav_timeline_personal');
+
+        $this->action->elementEnd('ul');
+        $this->action->elementEnd('ul');
+
+        $this->action->elementStart('ul');
+        $this->action->element('h3', null, _('Settings'));
         $this->action->elementStart('ul', array('class' => 'nav'));
 
         if (Event::handle('StartAccountSettingsNav', array(&$this->action))) {
@@ -128,5 +134,6 @@ class SettingsNav extends Widget
         }
 
         $this->action->elementEnd('ul');
+        $this->action->elementEnd('ul');
     }
 }