From baaad0dc8b0c568d28eed22793030bf1e56732a6 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 7 Jul 2011 10:59:00 -0400 Subject: [PATCH] TagSubMenu is a MoreMenu --- plugins/TagSub/tagsubmenu.php | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/plugins/TagSub/tagsubmenu.php b/plugins/TagSub/tagsubmenu.php index 9a8215ee51..01fa372dd9 100644 --- a/plugins/TagSub/tagsubmenu.php +++ b/plugins/TagSub/tagsubmenu.php @@ -44,7 +44,7 @@ if (!defined('STATUSNET')) { * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ -class TagSubMenu extends Menu +class TagSubMenu extends MoreMenu { protected $user; protected $tags; @@ -56,22 +56,33 @@ class TagSubMenu extends Menu $this->tags = $tags; } - function show() + function getItems() { - $this->out->elementStart('ul', array('class' => 'nav')); - + $items = array(); + foreach ($this->tags as $tag) { if (!empty($tag)) { - $this->out->menuItem(common_local_url('tag', - array('tag' => $tag)), - sprintf('#%s', $tag), - // TRANS: Menu item title. %s is a tag. - sprintf(_('Notices tagged with "%s".'), $tag), - $this->actionName == 'tag' && $this->action->arg('tag') == $tag, - 'nav_streams_tag_'.$tag); + $items[] = array('tag', + array('tag' => $tag), + sprintf('#%s', $tag), + // TRANS: Menu item title. %s is a tag. + sprintf(_('Notices tagged with "%s".'), $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')); } } -- 2.39.5