forked from GNUsocial/gnu-social
GroupsNav uses new Menu class functionality
This commit is contained in:
parent
0e07124a1e
commit
663bc35390
@ -61,33 +61,24 @@ class GroupsNav extends Menu
|
|||||||
return (!empty($this->groups) && ($this->groups->N > 0));
|
return (!empty($this->groups) && ($this->groups->N > 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
function tag()
|
||||||
* Show the menu
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function show()
|
|
||||||
{
|
{
|
||||||
$action = $this->actionName;
|
return 'groups';
|
||||||
|
}
|
||||||
|
|
||||||
$this->out->elementStart('ul', array('class' => 'nav'));
|
function getItems()
|
||||||
|
{
|
||||||
if (Event::handle('StartGroupsNav', array($this))) {
|
$items = array();
|
||||||
|
|
||||||
while ($this->groups->fetch()) {
|
while ($this->groups->fetch()) {
|
||||||
$this->out->menuItem(($this->groups->mainpage) ?
|
$items[] = array('showgroup',
|
||||||
$this->groups->mainpage :
|
array('nickname' => $this->groups->nickname),
|
||||||
common_local_url('showgroup',
|
|
||||||
array('nickname' => $this->groups->nickname)),
|
|
||||||
$this->groups->getBestName(),
|
$this->groups->getBestName(),
|
||||||
'',
|
$this->groups->getBestName()
|
||||||
$action == 'showgroup' &&
|
);
|
||||||
$this->action->arg('nickname') == $this->groups->nickname,
|
|
||||||
'nav_timeline_group_'.$this->groups->nickname);
|
|
||||||
}
|
|
||||||
Event::handle('EndGroupsNav', array($this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->out->elementEnd('ul');
|
return $items;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user