Enhance the search to have a different output depending on the current page. re #34
This commit is contained in:
parent
a4002e28ae
commit
6a9646bf15
8
base.php
8
base.php
|
@ -499,8 +499,16 @@ class PageQueryResult extends Page
|
|||
public function InitializeContent ()
|
||||
{
|
||||
$this->title = "Search result for query *" . $this->query . "*"; // TODO I18N
|
||||
$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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PageBookDetail extends Page
|
||||
|
|
|
@ -167,11 +167,12 @@
|
|||
<div class="clearer" />
|
||||
<div id="tool" <?php if ($withToolbar) echo 'style="display: none"' ?>>
|
||||
<div style="float: left; width: 60%">
|
||||
<form action="index.php?page=9" method="get">
|
||||
<form action="index.php" method="get">
|
||||
<div style="float: right">
|
||||
<input type="image" src="images/search32.png" alt="Search" />
|
||||
</div>
|
||||
<div class="stop">
|
||||
<input type="hidden" name="current" value="<?php echo $page ?>" />
|
||||
<input type="hidden" name="page" value="9" />
|
||||
<input type="text" name="query" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue