Merge commit 'refs/merge-requests/45' of https://gitorious.org/social/mainline into merge-requests/45

This commit is contained in:
Mikael Nordfeldth 2015-02-14 16:45:04 +01:00
commit dc0b62f636
4 changed files with 27 additions and 26 deletions

View File

@ -1463,3 +1463,12 @@ StartNotifyMentioned: During notice distribution, we send notifications (email,
EndNotifyMentioned: During notice distribution, we send notifications (email, im...) to the profiles who were somehow mentioned. EndNotifyMentioned: During notice distribution, we send notifications (email, im...) to the profiles who were somehow mentioned.
- $stored: Notice object that is being distributed. - $stored: Notice object that is being distributed.
- $mentioned_ids: Array of profile IDs (not just for local users) who got mentioned by the notice. - $mentioned_ids: Array of profile IDs (not just for local users) who got mentioned by the notice.
StartHomeStubNavItems: Go back Home nav items. Default includes just one item 'home'
- $action: action being executed (for output and params)
- $items: array of items in the nav
EndHomeStubNavItems:
- $action: action being executed (for output and params)
- $items: array of items in the nav

View File

@ -59,24 +59,8 @@ class AdminPanelNav extends Menu
$nickname = $user->nickname; $nickname = $user->nickname;
$name = $user->getProfile()->getBestName(); $name = $user->getProfile()->getBestName();
// Stub section w/ home link $stub = new HomeStubNav($this->action);
$this->action->elementStart('ul'); $this->submenu(_m('MENU','Home'), $stub);
$this->action->elementStart('li');
// TRANS: Header in administrator navigation panel.
$this->action->element('h3', null, _m('HEADER','Home'));
$this->action->elementStart('ul', 'nav');
$this->out->menuItem(common_local_url('all', array('nickname' =>
$nickname)),
// TRANS: Menu item in administrator navigation panel.
_m('MENU','Home'),
// TRANS: Menu item title in administrator navigation panel.
// TRANS: %s is a username.
sprintf(_('%s and friends'), $name),
$this->action == 'all', 'nav_timeline_personal');
$this->action->elementEnd('ul');
$this->action->elementEnd('li');
$this->action->elementEnd('ul');
$this->action->elementStart('ul'); $this->action->elementStart('ul');
$this->action->elementStart('li'); $this->action->elementStart('li');

View File

@ -49,13 +49,18 @@ class HomeStubNav extends Menu
{ {
function getItems() function getItems()
{ {
return array(array('top', $items = array();
array(), if (Event::handle('StartHomeStubNavItems', array($this->action, &$items))) {
// TRANS: Menu item in personal group navigation menu. $items[] = array('top',
_m('MENU','Home'), array(),
// TRANS: Menu item title in personal group navigation menu. // TRANS: Menu item in personal group navigation menu.
// TRANS: %s is a username. _m('MENU','Home'),
_('Back to top'), // TRANS: Menu item title in personal group navigation menu.
'nav_return_top')); // TRANS: %s is a username.
_('Back to top'),
'nav_return_top');
Event::handle('EndHomeStubNavItems', array($this->action, &$items));
}
return $items;
} }
} }

View File

@ -150,6 +150,9 @@ class Menu extends Widget
function submenu($label, $menu) function submenu($label, $menu)
{ {
if (empty($menu->getItems())){
return false;
}
$this->action->elementStart('li'); $this->action->elementStart('li');
$this->action->element('h3', null, $label); $this->action->element('h3', null, $label);
$menu->show(); $menu->show();