Properly use constants. re #127
This commit is contained in:
parent
90cfeb57c1
commit
8a3cc9ed5c
12
book.php
12
book.php
|
@ -560,7 +560,11 @@ where data.book = books.id and data.id = ?');
|
||||||
global $config;
|
global $config;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$critArray = array ();
|
$critArray = array ();
|
||||||
foreach (array ("author", "tag", "series", "publisher", "book") as $key) {
|
foreach (array (PageQueryResult::SCOPE_AUTHOR,
|
||||||
|
PageQueryResult::SCOPE_TAG,
|
||||||
|
PageQueryResult::SCOPE_SERIES,
|
||||||
|
PageQueryResult::SCOPE_PUBLISHER,
|
||||||
|
PageQueryResult::SCOPE_BOOK) as $key) {
|
||||||
if (in_array($key, $config ['cops_ignored_search_scope']) ||
|
if (in_array($key, $config ['cops_ignored_search_scope']) ||
|
||||||
(!array_key_exists ($key, $query) && !array_key_exists ("all", $query))) {
|
(!array_key_exists ($key, $query) && !array_key_exists ("all", $query))) {
|
||||||
$critArray [$i] = self::BAD_SEARCH;
|
$critArray [$i] = self::BAD_SEARCH;
|
||||||
|
@ -653,7 +657,11 @@ function getJson ($complete = false) {
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (array ("book", "author", "series", "tag", "publisher") as $key) {
|
foreach (array (PageQueryResult::SCOPE_BOOK,
|
||||||
|
PageQueryResult::SCOPE_AUTHOR,
|
||||||
|
PageQueryResult::SCOPE_SERIES,
|
||||||
|
PageQueryResult::SCOPE_TAG,
|
||||||
|
PageQueryResult::SCOPE_PUBLISHER) as $key) {
|
||||||
if (in_array($key, $config ['cops_ignored_search_scope'])) {
|
if (in_array($key, $config ['cops_ignored_search_scope'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue