X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FSearchSub%2Fsearchsubmenu.php;h=5973eb8b93af25be4dd5031b22d07dee98efa6c0;hb=9f6adb3f52890a9d4215aaca501d95320a20f252;hp=684f5c7db26742d05b8b66ad6b2b74d595ba08dc;hpb=c97048d01bea468e0cf8865b60c3c250b4515c39;p=quix0rs-gnu-social.git diff --git a/plugins/SearchSub/searchsubmenu.php b/plugins/SearchSub/searchsubmenu.php index 684f5c7db2..5973eb8b93 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,51 @@ 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; + } + + function item($actionName, $args, $label, $description, $id=null, $cls=null) + { + if (empty($id)) { + $id = $this->menuItemID($actionName, $args); + } + + // Add 'q' as a search param, not part of the url path + + $url = common_local_url($actionName, array(), $args); + + $this->out->menuItem($url, + $label, + $description, + $this->isCurrent($actionName, $args), + $id, + $cls); } - } +