From: Brion Vibber Date: Wed, 9 Mar 2011 20:38:06 +0000 (-0800) Subject: Stub 'home' subsection at top of settings & admin nav panels, so folks always know... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=381ffc3fe8c4048761128103d4dfcb153d75464e;p=quix0rs-gnu-social.git Stub 'home' subsection at top of settings & admin nav panels, so folks always know how to get home. (If we drop the section titles, these'll look a little cleaner since it'll only show 'Home' once :D) --- diff --git a/lib/adminpanelnav.php b/lib/adminpanelnav.php index ceedf6ceac..2c9d83ceba 100644 --- a/lib/adminpanelnav.php +++ b/lib/adminpanelnav.php @@ -56,7 +56,25 @@ class AdminPanelNav extends Menu function show() { $action_name = $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, _('Admin')); $this->action->elementStart('ul', array('class' => 'nav')); if (Event::handle('StartAdminPanelNav', array($this))) { @@ -144,5 +162,6 @@ class AdminPanelNav extends Menu Event::handle('EndAdminPanelNav', array($this)); } $this->action->elementEnd('ul'); + $this->action->elementEnd('ul'); } } diff --git a/lib/settingsnav.php b/lib/settingsnav.php index 697e7ee46b..2987e36ea9 100644 --- a/lib/settingsnav.php +++ b/lib/settingsnav.php @@ -57,6 +57,25 @@ class SettingsNav extends Menu 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))) { @@ -115,5 +134,6 @@ class SettingsNav extends Menu } $this->action->elementEnd('ul'); + $this->action->elementEnd('ul'); } }