Show both empty and full notice search results inside event wrapper
This commit is contained in:
parent
239d92176d
commit
606884385c
@ -132,11 +132,10 @@ class NoticesearchAction extends SearchAction
|
|||||||
*/
|
*/
|
||||||
function showResults($q, $page)
|
function showResults($q, $page)
|
||||||
{
|
{
|
||||||
|
if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $this->notice))) {
|
||||||
if ($this->notice->N === 0) {
|
if ($this->notice->N === 0) {
|
||||||
$this->showEmptyResults($q, $page);
|
$this->showEmptyResults($q, $page);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (Event::handle('StartNoticeSearchShowResults', array($this, $q, $this->notice))) {
|
|
||||||
$terms = preg_split('/[\s,]+/', $q);
|
$terms = preg_split('/[\s,]+/', $q);
|
||||||
$nl = new SearchNoticeList($this->notice, $this, $terms);
|
$nl = new SearchNoticeList($this->notice, $this, $terms);
|
||||||
$cnt = $nl->show();
|
$cnt = $nl->show();
|
||||||
@ -145,6 +144,7 @@ class NoticesearchAction extends SearchAction
|
|||||||
$page,
|
$page,
|
||||||
'noticesearch',
|
'noticesearch',
|
||||||
array('q' => $q));
|
array('q' => $q));
|
||||||
|
}
|
||||||
Event::handle('EndNoticeSearchShowResults', array($this, $q, $this->notice));
|
Event::handle('EndNoticeSearchShowResults', array($this, $q, $this->notice));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user