Enhance the search to have a different output depending on the current page. re #34

This commit is contained in:
Sébastien Lucas 2013-03-08 09:40:25 +01:00
parent a4002e28ae
commit 6a9646bf15
2 changed files with 11 additions and 2 deletions

View file

@ -499,7 +499,15 @@ class PageQueryResult extends Page
public function InitializeContent ()
{
$this->title = "Search result for query *" . $this->query . "*"; // TODO I18N
list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery ($this->query, $this->n);
$currentPage = getURLParam ("current", NULL);
switch ($currentPage) {
case Base::PAGE_ALL_AUTHORS :
case Base::PAGE_AUTHORS_FIRST_LETTER :
$this->entryArray = Author::getAuthorsByStartingLetter ('%' . $this->query);
break;
default:
list ($this->entryArray, $this->totalNumber) = Book::getBooksByQuery ($this->query, $this->n);
}
}
}