diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-01-23 03:00:06 +0100 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-01-23 03:00:06 +0100 |
commit | cafc51db093daa652912cd85fe7b40aac26a272d (patch) | |
tree | 9e24a1c3b408b63dd1e9bd7b5603211426de204a /lib | |
parent | df543734111431b175e6c0ac41043d7a812c20a3 (diff) |
Make search actions retain their q values.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/searchaction.php | 7 | ||||
-rw-r--r-- | lib/searchgroupnav.php | 12 |
2 files changed, 10 insertions, 9 deletions
diff --git a/lib/searchaction.php b/lib/searchaction.php index 71ab3a6ef..70e63146a 100644 --- a/lib/searchaction.php +++ b/lib/searchaction.php @@ -73,7 +73,7 @@ class SearchAction extends Action function showLocalNav() { - $nav = new SearchGroupNav($this); + $nav = new SearchGroupNav($this, $this->trimmed('q')); $nav->show(); } @@ -98,11 +98,6 @@ class SearchAction extends Action return null; } - function show_header($arr) - { - return; - } - function showNoticeForm() { // remote post notice form } diff --git a/lib/searchgroupnav.php b/lib/searchgroupnav.php index 2a0f5a6ea..4ea226692 100644 --- a/lib/searchgroupnav.php +++ b/lib/searchgroupnav.php @@ -48,6 +48,7 @@ require_once INSTALLDIR.'/lib/widget.php'; class SearchGroupNav extends Widget { var $action = null; + var $q = null; /** * Construction @@ -55,10 +56,11 @@ class SearchGroupNav extends Widget * @param Action $action current action, used for output */ - function __construct($action=null) + function __construct($action=null, $q = null) { parent::__construct($action); $this->action = $action; + $this->q = $q; } /** @@ -71,9 +73,13 @@ class SearchGroupNav extends Widget { $action_name = $this->action->trimmed('action'); $this->action->elementStart('ul', array('class' => 'nav')); - $this->out->menuItem(common_local_url('peoplesearch'), _('People'), + $args = array(); + if ($this->q) { + $args['q'] = $this->q; + } + $this->out->menuItem(common_local_url('peoplesearch', $args), _('People'), _('Find people on this site'), $action_name == 'peoplesearch', 'nav_search_people'); - $this->out->menuItem(common_local_url('noticesearch'), _('Notice'), + $this->out->menuItem(common_local_url('noticesearch', $args), _('Notice'), _('Find content of notices'), $action_name == 'noticesearch', 'nav_search_notice'); $this->action->elementEnd('ul'); } |