From 069d976fab355be974ce589d5d04494c4c9e000e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 7 Jul 2011 12:06:56 -0400 Subject: [PATCH] SearchSubMenu is a MoreMenu --- plugins/SearchSub/searchsubmenu.php | 34 +++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/plugins/SearchSub/searchsubmenu.php b/plugins/SearchSub/searchsubmenu.php index 684f5c7db2..755a3c9a5b 100644 --- a/plugins/SearchSub/searchsubmenu.php +++ b/plugins/SearchSub/searchsubmenu.php @@ -45,7 +45,7 @@ if (!defined('STATUSNET')) { * @link http://status.net/ */ -class SearchSubMenu extends Menu +class SearchSubMenu extends MoreMenu { protected $user; protected $searches; @@ -57,22 +57,32 @@ class SearchSubMenu extends Menu $this->searches = $searches; } - function show() + function tag() { - $this->out->elementStart('ul', array('class' => 'nav')); + return 'searchsubs'; + } + + function seeAllItem() + { + return array('searchsubs', + array('nickname' => $this->user->nickname), + _('See all'), + _('See all searches you are following')); + } + function getItems() + { + $items = array(); + foreach ($this->searches as $search) { if (!empty($search)) { - $this->out->menuItem(common_local_url('noticesearch', - array('q' => $search)), - sprintf('"%s"', $search), - sprintf(_('Notices including %s'), $search), - $this->actionName == 'noticesearch' && $this->action->arg('q') == $search, - 'nav_streams_search_'.$search); + $items[] = array('noticesearch', + array('q' => $search), + sprintf('"%s"', $search), + sprintf(_('Notices including %s'), $search));; } } - $this->out->elementEnd('ul'); - } - + return $items; + } } -- 2.39.5