mirror of
https://github.com/standardebooks/web.git
synced 2025-07-20 22:33:57 -04:00
More refactoring for static analysis
This commit is contained in:
parent
5939195955
commit
ba53958596
9 changed files with 55 additions and 36 deletions
|
@ -5,6 +5,8 @@ try{
|
|||
$page = HttpInput::GetInt('page') ?? 1;
|
||||
$query = HttpInput::GetString('query', false);
|
||||
$sort = HttpInput::GetString('sort', false) ?? SORT_NEWEST;
|
||||
$pages = 0;
|
||||
$totalEbooks = 0;
|
||||
|
||||
if($page <= 0){
|
||||
$page = 1;
|
||||
|
@ -14,11 +16,7 @@ try{
|
|||
$sort = SORT_NEWEST;
|
||||
}
|
||||
|
||||
if($query !== null){
|
||||
$ebooks = Library::Search($query);
|
||||
$pageDescription = 'Search results';
|
||||
}
|
||||
else{
|
||||
if($query === null){
|
||||
$ebooks = Library::GetEbooks($sort);
|
||||
|
||||
$pages = ceil(sizeof($ebooks) / EBOOKS_PER_PAGE);
|
||||
|
@ -37,6 +35,10 @@ try{
|
|||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
$ebooks = Library::Search($query);
|
||||
$pageDescription = 'Search results';
|
||||
}
|
||||
|
||||
$pageTitle = 'Browse Standard Ebooks';
|
||||
if($query !== null){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue