TagSubMenu is a MoreMenu

This commit is contained in:
Evan Prodromou 2011-07-07 10:59:00 -04:00
parent 12e0f89155
commit baaad0dc8b
1 changed files with 23 additions and 12 deletions

View File

@ -44,7 +44,7 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/ * @link http://status.net/
*/ */
class TagSubMenu extends Menu class TagSubMenu extends MoreMenu
{ {
protected $user; protected $user;
protected $tags; protected $tags;
@ -56,22 +56,33 @@ class TagSubMenu extends Menu
$this->tags = $tags; $this->tags = $tags;
} }
function show() function getItems()
{ {
$this->out->elementStart('ul', array('class' => 'nav')); $items = array();
foreach ($this->tags as $tag) { foreach ($this->tags as $tag) {
if (!empty($tag)) { if (!empty($tag)) {
$this->out->menuItem(common_local_url('tag', $items[] = array('tag',
array('tag' => $tag)), array('tag' => $tag),
sprintf('#%s', $tag), sprintf('#%s', $tag),
// TRANS: Menu item title. %s is a tag. // TRANS: Menu item title. %s is a tag.
sprintf(_('Notices tagged with "%s".'), $tag), sprintf(_('Notices tagged with "%s".'), $tag));
$this->actionName == 'tag' && $this->action->arg('tag') == $tag,
'nav_streams_tag_'.$tag);
} }
} }
$this->out->elementEnd('ul'); return $items;
}
function tag()
{
return 'tagsubs';
}
function seeAllItem()
{
return array('tagsubs',
array('nickname' => $this->user->nickname),
_('See all'),
_('See all tags you are following'));
} }
} }