Show both empty and full notice search results inside event wrapper

This commit is contained in:
Evan Prodromou 2011-04-12 14:29:12 -04:00
parent 239d92176d
commit 606884385c
1 changed files with 12 additions and 12 deletions

View File

@ -132,19 +132,19 @@ class NoticesearchAction extends SearchAction
*/
function showResults($q, $page)
{
if ($this->notice->N === 0) {
$this->showEmptyResults($q, $page);
}
if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $this->notice))) {
$terms = preg_split('/[\s,]+/', $q);
$nl = new SearchNoticeList($this->notice, $this, $terms);
$cnt = $nl->show();
$this->pagination($page > 1,
$cnt > NOTICES_PER_PAGE,
$page,
'noticesearch',
array('q' => $q));
if ($this->notice->N === 0) {
$this->showEmptyResults($q, $page);
} else {
$terms = preg_split('/[\s,]+/', $q);
$nl = new SearchNoticeList($this->notice, $this, $terms);
$cnt = $nl->show();
$this->pagination($page > 1,
$cnt > NOTICES_PER_PAGE,
$page,
'noticesearch',
array('q' => $q));
}
Event::handle('EndNoticeSearchShowResults', array($this, $q, $this->notice));
}
}