GroupsNav uses new Menu class functionality

This commit is contained in:
Evan Prodromou 2011-07-06 11:10:26 -04:00
parent 0e07124a1e
commit 663bc35390

View File

@ -61,33 +61,24 @@ class GroupsNav extends Menu
return (!empty($this->groups) && ($this->groups->N > 0));
}
/**
* Show the menu
*
* @return void
*/
function show()
function tag()
{
$action = $this->actionName;
return 'groups';
}
$this->out->elementStart('ul', array('class' => 'nav'));
if (Event::handle('StartGroupsNav', array($this))) {
function getItems()
{
$items = array();
while ($this->groups->fetch()) {
$this->out->menuItem(($this->groups->mainpage) ?
$this->groups->mainpage :
common_local_url('showgroup',
array('nickname' => $this->groups->nickname)),
$items[] = array('showgroup',
array('nickname' => $this->groups->nickname),
$this->groups->getBestName(),
'',
$action == 'showgroup' &&
$this->action->arg('nickname') == $this->groups->nickname,
'nav_timeline_group_'.$this->groups->nickname);
}
Event::handle('EndGroupsNav', array($this));
$this->groups->getBestName()
);
}
$this->out->elementEnd('ul');
return $items;
}
}