$action = $this->trimmed('action');
common_element_start('ul', array('id' => 'nav_views'));
foreach ($menu as $menuaction => $menudesc) {
- common_menu_item(common_local_url($menuaction),
- _($menudesc[0]),
- _($menudesc[1]),
+ common_menu_item(common_local_url($menuaction, isset($menudesc[2]) ? $menudesc[2] : NULL),
+ $menudesc[0],
+ $menudesc[1],
$action == $menuaction);
}
common_element_end('ul');
}
function search_menu() {
- # action => array('prompt', 'title')
- static $menu =
- array('peoplesearch' =>
- array('People',
- 'Find people on this site'),
- 'noticesearch' =>
- array('Text',
- 'Find content of notices'));
+ # action => array('prompt', 'title', $args)
+ $action = $this->trimmed('action');
+ $menu =
+ array('peoplesearch' =>
+ array(
+ _('People'),
+ _('Find people on this site'),
+ ($action != 'peoplesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL),
+ 'noticesearch' =>
+ array( _('Text'),
+ _('Find content of notices'),
+ ($action != 'noticesearch' && $this->trimmed('q')) ? array('q' => $this->trimmed('q')) : NULL)
+ );
$this->nav_menu($menu);
}
}