Refactor the detection of the case when no database has been selected. re #127

This commit is contained in:
Sébastien Lucas 2013-12-14 11:30:42 +01:00
parent 8a3cc9ed5c
commit a1cb83eea9
4 changed files with 12 additions and 11 deletions

View file

@ -631,7 +631,6 @@ function getJson ($complete = false) {
$page = getURLParam ("page", Base::PAGE_INDEX);
$query = getURLParam ("query");
$search = getURLParam ("search");
$multi = getURLParam ("multi");
$qid = getURLParam ("id");
$n = getURLParam ("n", "1");
$database = GetUrlParam (DB);
@ -641,7 +640,7 @@ function getJson ($complete = false) {
$pagequery = Base::PAGE_OPENSEARCH_QUERY;
// Special case when no databases were chosen, we search on all databases
if (is_array ($config['calibre_directory']) && $multi === "1") {
if (Base::noDatabaseSelected ()) {
$i = 0;
foreach (array_keys ($config['calibre_directory']) as $key) {
Base::clearDb ();