@@ -8,14 +8,14 @@ |
||
8 | 8 | |
9 | 9 | class PageAllBooks extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $this->title = localize ("allbooks.title"); |
|
14 | - if (getCurrentOption ("titles_split_first_letter") == 1) { |
|
13 | + $this->title = localize("allbooks.title"); |
|
14 | + if (getCurrentOption("titles_split_first_letter") == 1) { |
|
15 | 15 | $this->entryArray = Book::getAllBooks(); |
16 | 16 | } |
17 | 17 | else { |
18 | - list ($this->entryArray, $this->totalNumber) = Book::getBooks ($this->n); |
|
18 | + list ($this->entryArray, $this->totalNumber) = Book::getBooks($this->n); |
|
19 | 19 | } |
20 | 20 | $this->idPage = Book::ALL_BOOKS_ID; |
21 | 21 | } |
@@ -13,8 +13,7 @@ |
||
13 | 13 | $this->title = localize ("allbooks.title"); |
14 | 14 | if (getCurrentOption ("titles_split_first_letter") == 1) { |
15 | 15 | $this->entryArray = Book::getAllBooks(); |
16 | - } |
|
17 | - else { |
|
16 | + } else { |
|
18 | 17 | list ($this->entryArray, $this->totalNumber) = Book::getBooks ($this->n); |
19 | 18 | } |
20 | 19 | $this->idPage = Book::ALL_BOOKS_ID; |
@@ -22,45 +22,45 @@ |
||
22 | 22 | $this->name = $post->name; |
23 | 23 | } |
24 | 24 | |
25 | - public function getUri () { |
|
26 | - return "?page=".parent::PAGE_PUBLISHER_DETAIL."&id=$this->id"; |
|
25 | + public function getUri() { |
|
26 | + return "?page=" . parent::PAGE_PUBLISHER_DETAIL . "&id=$this->id"; |
|
27 | 27 | } |
28 | 28 | |
29 | - public function getEntryId () { |
|
30 | - return self::ALL_PUBLISHERS_ID.":".$this->id; |
|
29 | + public function getEntryId() { |
|
30 | + return self::ALL_PUBLISHERS_ID . ":" . $this->id; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public static function getCount() { |
34 | 34 | // str_format (localize("publishers.alphabetical", count(array)) |
35 | - return parent::getCountGeneric ("publishers", self::ALL_PUBLISHERS_ID, parent::PAGE_ALL_PUBLISHERS); |
|
35 | + return parent::getCountGeneric("publishers", self::ALL_PUBLISHERS_ID, parent::PAGE_ALL_PUBLISHERS); |
|
36 | 36 | } |
37 | 37 | |
38 | - public static function getPublisherByBookId ($bookId) { |
|
39 | - $result = parent::getDb ()->prepare('select publishers.id as id, name |
|
38 | + public static function getPublisherByBookId($bookId) { |
|
39 | + $result = parent::getDb()->prepare('select publishers.id as id, name |
|
40 | 40 | from books_publishers_link, publishers |
41 | 41 | where publishers.id = publisher and book = ?'); |
42 | - $result->execute (array ($bookId)); |
|
43 | - if ($post = $result->fetchObject ()) { |
|
44 | - return new Publisher ($post); |
|
42 | + $result->execute(array($bookId)); |
|
43 | + if ($post = $result->fetchObject()) { |
|
44 | + return new Publisher($post); |
|
45 | 45 | } |
46 | 46 | return NULL; |
47 | 47 | } |
48 | 48 | |
49 | - public static function getPublisherById ($publisherId) { |
|
50 | - $result = parent::getDb ()->prepare('select id, name |
|
49 | + public static function getPublisherById($publisherId) { |
|
50 | + $result = parent::getDb()->prepare('select id, name |
|
51 | 51 | from publishers where id = ?'); |
52 | - $result->execute (array ($publisherId)); |
|
53 | - if ($post = $result->fetchObject ()) { |
|
54 | - return new Publisher ($post); |
|
52 | + $result->execute(array($publisherId)); |
|
53 | + if ($post = $result->fetchObject()) { |
|
54 | + return new Publisher($post); |
|
55 | 55 | } |
56 | 56 | return NULL; |
57 | 57 | } |
58 | 58 | |
59 | 59 | public static function getAllPublishers() { |
60 | - return Base::getEntryArrayWithBookNumber (self::SQL_ALL_PUBLISHERS, self::PUBLISHERS_COLUMNS, array (), "Publisher"); |
|
60 | + return Base::getEntryArrayWithBookNumber(self::SQL_ALL_PUBLISHERS, self::PUBLISHERS_COLUMNS, array(), "Publisher"); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public static function getAllPublishersByQuery($query) { |
64 | - return Base::getEntryArrayWithBookNumber (self::SQL_PUBLISHERS_FOR_SEARCH, self::PUBLISHERS_COLUMNS, array ('%' . $query . '%'), "Publisher"); |
|
64 | + return Base::getEntryArrayWithBookNumber(self::SQL_PUBLISHERS_FOR_SEARCH, self::PUBLISHERS_COLUMNS, array('%' . $query . '%'), "Publisher"); |
|
65 | 65 | } |
66 | 66 | } |
@@ -17,25 +17,30 @@ discard block |
||
17 | 17 | public $id; |
18 | 18 | public $name; |
19 | 19 | |
20 | - public function __construct($post) { |
|
20 | + public function __construct($post) |
|
21 | + { |
|
21 | 22 | $this->id = $post->id; |
22 | 23 | $this->name = $post->name; |
23 | 24 | } |
24 | 25 | |
25 | - public function getUri () { |
|
26 | + public function getUri () |
|
27 | + { |
|
26 | 28 | return "?page=".parent::PAGE_PUBLISHER_DETAIL."&id=$this->id"; |
27 | 29 | } |
28 | 30 | |
29 | - public function getEntryId () { |
|
31 | + public function getEntryId () |
|
32 | + { |
|
30 | 33 | return self::ALL_PUBLISHERS_ID.":".$this->id; |
31 | 34 | } |
32 | 35 | |
33 | - public static function getCount() { |
|
36 | + public static function getCount() |
|
37 | + { |
|
34 | 38 | // str_format (localize("publishers.alphabetical", count(array)) |
35 | 39 | return parent::getCountGeneric ("publishers", self::ALL_PUBLISHERS_ID, parent::PAGE_ALL_PUBLISHERS); |
36 | 40 | } |
37 | 41 | |
38 | - public static function getPublisherByBookId ($bookId) { |
|
42 | + public static function getPublisherByBookId ($bookId) |
|
43 | + { |
|
39 | 44 | $result = parent::getDb ()->prepare('select publishers.id as id, name |
40 | 45 | from books_publishers_link, publishers |
41 | 46 | where publishers.id = publisher and book = ?'); |
@@ -46,7 +51,8 @@ discard block |
||
46 | 51 | return NULL; |
47 | 52 | } |
48 | 53 | |
49 | - public static function getPublisherById ($publisherId) { |
|
54 | + public static function getPublisherById ($publisherId) |
|
55 | + { |
|
50 | 56 | $result = parent::getDb ()->prepare('select id, name |
51 | 57 | from publishers where id = ?'); |
52 | 58 | $result->execute (array ($publisherId)); |
@@ -56,11 +62,13 @@ discard block |
||
56 | 62 | return NULL; |
57 | 63 | } |
58 | 64 | |
59 | - public static function getAllPublishers() { |
|
65 | + public static function getAllPublishers() |
|
66 | + { |
|
60 | 67 | return Base::getEntryArrayWithBookNumber (self::SQL_ALL_PUBLISHERS, self::PUBLISHERS_COLUMNS, array (), "Publisher"); |
61 | 68 | } |
62 | 69 | |
63 | - public static function getAllPublishersByQuery($query) { |
|
70 | + public static function getAllPublishersByQuery($query) |
|
71 | + { |
|
64 | 72 | return Base::getEntryArrayWithBookNumber (self::SQL_PUBLISHERS_FOR_SEARCH, self::PUBLISHERS_COLUMNS, array ('%' . $query . '%'), "Publisher"); |
65 | 73 | } |
66 | 74 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | if ($post = $result->fetchObject ()) { |
44 | 44 | return new Publisher ($post); |
45 | 45 | } |
46 | - return NULL; |
|
46 | + return null; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public static function getPublisherById ($publisherId) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | if ($post = $result->fetchObject ()) { |
54 | 54 | return new Publisher ($post); |
55 | 55 | } |
56 | - return NULL; |
|
56 | + return null; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | public static function getAllPublishers() { |
@@ -60,6 +60,9 @@ |
||
60 | 60 | return Base::getEntryArrayWithBookNumber (self::SQL_ALL_PUBLISHERS, self::PUBLISHERS_COLUMNS, array (), "Publisher"); |
61 | 61 | } |
62 | 62 | |
63 | + /** |
|
64 | + * @param string $query |
|
65 | + */ |
|
63 | 66 | public static function getAllPublishersByQuery($query) { |
64 | 67 | return Base::getEntryArrayWithBookNumber (self::SQL_PUBLISHERS_FOR_SEARCH, self::PUBLISHERS_COLUMNS, array ('%' . $query . '%'), "Publisher"); |
65 | 68 | } |
@@ -8,11 +8,11 @@ |
||
8 | 8 | |
9 | 9 | class PagePublisherDetail extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $publisher = Publisher::getPublisherById ($this->idGet); |
|
13 | + $publisher = Publisher::getPublisherById($this->idGet); |
|
14 | 14 | $this->title = $publisher->name; |
15 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByPublisher ($this->idGet, $this->n); |
|
16 | - $this->idPage = $publisher->getEntryId (); |
|
15 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByPublisher($this->idGet, $this->n); |
|
16 | + $this->idPage = $publisher->getEntryId(); |
|
17 | 17 | } |
18 | 18 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class PageAllRating extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | 13 | $this->title = localize("ratings.title"); |
14 | 14 | $this->entryArray = Rating::getAllRatings(); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | class PageAllTags extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | 13 | $this->title = localize("tags.title"); |
14 | 14 | $this->entryArray = Tag::getAllTags(); |
@@ -8,11 +8,11 @@ |
||
8 | 8 | |
9 | 9 | class PageTagDetail extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $tag = Tag::getTagById ($this->idGet); |
|
14 | - $this->idPage = $tag->getEntryId (); |
|
13 | + $tag = Tag::getTagById($this->idGet); |
|
14 | + $this->idPage = $tag->getEntryId(); |
|
15 | 15 | $this->title = $tag->name; |
16 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByTag ($this->idGet, $this->n); |
|
16 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByTag($this->idGet, $this->n); |
|
17 | 17 | } |
18 | 18 | } |
@@ -8,11 +8,11 @@ |
||
8 | 8 | |
9 | 9 | class PageLanguageDetail extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $language = Language::getLanguageById ($this->idGet); |
|
14 | - $this->idPage = $language->getEntryId (); |
|
13 | + $language = Language::getLanguageById($this->idGet); |
|
14 | + $this->idPage = $language->getEntryId(); |
|
15 | 15 | $this->title = $language->lang_code; |
16 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByLanguage ($this->idGet, $this->n); |
|
16 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByLanguage($this->idGet, $this->n); |
|
17 | 17 | } |
18 | 18 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function getDescription() |
56 | 56 | { |
57 | 57 | $desc = $this->getDatabaseDescription(); |
58 | - if ($desc === NULL || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle()); |
|
58 | + if ($desc === null || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle()); |
|
59 | 59 | return $desc; |
60 | 60 | } |
61 | 61 | |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($post = $result->fetchObject()) { |
69 | 69 | return new CustomColumn($post->value, $post->value, $this); |
70 | 70 | } |
71 | - return new CustomColumn(NULL, localize("customcolumn.float.unknown"), $this); |
|
71 | + return new CustomColumn(null, localize("customcolumn.float.unknown"), $this); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function isSearchable() |
@@ -55,7 +55,9 @@ |
||
55 | 55 | public function getDescription() |
56 | 56 | { |
57 | 57 | $desc = $this->getDatabaseDescription(); |
58 | - if ($desc === NULL || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle()); |
|
58 | + if ($desc === NULL || empty($desc)) { |
|
59 | + $desc = str_format(localize("customcolumn.description"), $this->getTitle()); |
|
60 | + } |
|
59 | 61 | return $desc; |
60 | 62 | } |
61 | 63 |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | const SCOPE_BOOK = "book"; |
16 | 16 | const SCOPE_PUBLISHER = "publisher"; |
17 | 17 | |
18 | - private function useTypeahead () { |
|
19 | - return !is_null (getURLParam ("search")); |
|
18 | + private function useTypeahead() { |
|
19 | + return !is_null(getURLParam("search")); |
|
20 | 20 | } |
21 | 21 | |
22 | - private function searchByScope ($scope, $limit = FALSE) { |
|
22 | + private function searchByScope($scope, $limit = FALSE) { |
|
23 | 23 | $n = $this->n; |
24 | 24 | $numberPerPage = NULL; |
25 | 25 | $queryNormedAndUp = trim($this->query); |
26 | - if (useNormAndUp ()) { |
|
27 | - $queryNormedAndUp = normAndUp ($this->query); |
|
26 | + if (useNormAndUp()) { |
|
27 | + $queryNormedAndUp = normAndUp($this->query); |
|
28 | 28 | } |
29 | 29 | if ($limit) { |
30 | 30 | $n = 1; |
@@ -32,59 +32,59 @@ discard block |
||
32 | 32 | } |
33 | 33 | switch ($scope) { |
34 | 34 | case self::SCOPE_BOOK : |
35 | - $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, NULL, $numberPerPage); |
|
35 | + $array = Book::getBooksByStartingLetter('%' . $queryNormedAndUp, $n, NULL, $numberPerPage); |
|
36 | 36 | break; |
37 | 37 | case self::SCOPE_AUTHOR : |
38 | - $array = Author::getAuthorsForSearch ('%' . $queryNormedAndUp); |
|
38 | + $array = Author::getAuthorsForSearch('%' . $queryNormedAndUp); |
|
39 | 39 | break; |
40 | 40 | case self::SCOPE_SERIES : |
41 | - $array = Serie::getAllSeriesByQuery ($queryNormedAndUp); |
|
41 | + $array = Serie::getAllSeriesByQuery($queryNormedAndUp); |
|
42 | 42 | break; |
43 | 43 | case self::SCOPE_TAG : |
44 | - $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, NULL, $numberPerPage); |
|
44 | + $array = Tag::getAllTagsByQuery($queryNormedAndUp, $n, NULL, $numberPerPage); |
|
45 | 45 | break; |
46 | 46 | case self::SCOPE_PUBLISHER : |
47 | - $array = Publisher::getAllPublishersByQuery ($queryNormedAndUp); |
|
47 | + $array = Publisher::getAllPublishersByQuery($queryNormedAndUp); |
|
48 | 48 | break; |
49 | 49 | default: |
50 | - $array = Book::getBooksByQuery ( |
|
51 | - array ("all" => "%" . $queryNormedAndUp . "%"), $n); |
|
50 | + $array = Book::getBooksByQuery( |
|
51 | + array("all" => "%" . $queryNormedAndUp . "%"), $n); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return $array; |
55 | 55 | } |
56 | 56 | |
57 | - public function doSearchByCategory () { |
|
58 | - $database = GetUrlParam (DB); |
|
59 | - $out = array (); |
|
57 | + public function doSearchByCategory() { |
|
58 | + $database = GetUrlParam(DB); |
|
59 | + $out = array(); |
|
60 | 60 | $pagequery = Base::PAGE_OPENSEARCH_QUERY; |
61 | - $dbArray = array (""); |
|
61 | + $dbArray = array(""); |
|
62 | 62 | $d = $database; |
63 | 63 | $query = $this->query; |
64 | 64 | // Special case when no databases were chosen, we search on all databases |
65 | - if (Base::noDatabaseSelected ()) { |
|
66 | - $dbArray = Base::getDbNameList (); |
|
65 | + if (Base::noDatabaseSelected()) { |
|
66 | + $dbArray = Base::getDbNameList(); |
|
67 | 67 | $d = 0; |
68 | 68 | } |
69 | 69 | foreach ($dbArray as $key) { |
70 | - if (Base::noDatabaseSelected ()) { |
|
71 | - array_push ($this->entryArray, new Entry ($key, DB . ":query:{$d}", |
|
70 | + if (Base::noDatabaseSelected()) { |
|
71 | + array_push($this->entryArray, new Entry($key, DB . ":query:{$d}", |
|
72 | 72 | " ", "text", |
73 | - array ( new LinkNavigation ("?" . DB . "={$d}")), "tt-header")); |
|
74 | - Base::getDb ($d); |
|
73 | + array(new LinkNavigation("?" . DB . "={$d}")), "tt-header")); |
|
74 | + Base::getDb($d); |
|
75 | 75 | } |
76 | - foreach (array (PageQueryResult::SCOPE_BOOK, |
|
76 | + foreach (array(PageQueryResult::SCOPE_BOOK, |
|
77 | 77 | PageQueryResult::SCOPE_AUTHOR, |
78 | 78 | PageQueryResult::SCOPE_SERIES, |
79 | 79 | PageQueryResult::SCOPE_TAG, |
80 | 80 | PageQueryResult::SCOPE_PUBLISHER) as $key) { |
81 | - if (in_array($key, getCurrentOption ('ignored_categories'))) { |
|
81 | + if (in_array($key, getCurrentOption('ignored_categories'))) { |
|
82 | 82 | continue; |
83 | 83 | } |
84 | - $array = $this->searchByScope ($key, TRUE); |
|
84 | + $array = $this->searchByScope($key, TRUE); |
|
85 | 85 | |
86 | 86 | $i = 0; |
87 | - if (count ($array) == 2 && is_array ($array [0])) { |
|
87 | + if (count($array) == 2 && is_array($array [0])) { |
|
88 | 88 | $total = $array [1]; |
89 | 89 | $array = $array [0]; |
90 | 90 | } else { |
@@ -97,32 +97,32 @@ discard block |
||
97 | 97 | // str_format (localize("seriesword", count($array)) |
98 | 98 | // str_format (localize("tagword", count($array)) |
99 | 99 | // str_format (localize("publisherword", count($array)) |
100 | - array_push ($this->entryArray, new Entry (str_format (localize ("search.result.{$key}"), $this->query), DB . ":query:{$d}:{$key}", |
|
101 | - str_format (localize("{$key}word", $total), $total), "text", |
|
102 | - array ( new LinkNavigation ("?page={$pagequery}&query={$query}&db={$d}&scope={$key}")), |
|
103 | - Base::noDatabaseSelected () ? "" : "tt-header", $total)); |
|
100 | + array_push($this->entryArray, new Entry(str_format(localize("search.result.{$key}"), $this->query), DB . ":query:{$d}:{$key}", |
|
101 | + str_format(localize("{$key}word", $total), $total), "text", |
|
102 | + array(new LinkNavigation("?page={$pagequery}&query={$query}&db={$d}&scope={$key}")), |
|
103 | + Base::noDatabaseSelected()?"":"tt-header", $total)); |
|
104 | 104 | } |
105 | - if (!Base::noDatabaseSelected () && $this->useTypeahead ()) { |
|
105 | + if (!Base::noDatabaseSelected() && $this->useTypeahead()) { |
|
106 | 106 | foreach ($array as $entry) { |
107 | - array_push ($this->entryArray, $entry); |
|
107 | + array_push($this->entryArray, $entry); |
|
108 | 108 | $i++; |
109 | 109 | if ($i > 4) { break; }; |
110 | 110 | } |
111 | 111 | } |
112 | 112 | } |
113 | 113 | $d++; |
114 | - if (Base::noDatabaseSelected ()) { |
|
115 | - Base::clearDb (); |
|
114 | + if (Base::noDatabaseSelected()) { |
|
115 | + Base::clearDb(); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | return $out; |
119 | 119 | } |
120 | 120 | |
121 | - public function InitializeContent () |
|
121 | + public function InitializeContent() |
|
122 | 122 | { |
123 | - $scope = getURLParam ("scope"); |
|
123 | + $scope = getURLParam("scope"); |
|
124 | 124 | if (empty ($scope)) { |
125 | - $this->title = str_format (localize ("search.result"), $this->query); |
|
125 | + $this->title = str_format(localize("search.result"), $this->query); |
|
126 | 126 | } else { |
127 | 127 | // Comment to help the perl i18n script |
128 | 128 | // str_format (localize ("search.result.author"), $this->query) |
@@ -130,31 +130,31 @@ discard block |
||
130 | 130 | // str_format (localize ("search.result.series"), $this->query) |
131 | 131 | // str_format (localize ("search.result.book"), $this->query) |
132 | 132 | // str_format (localize ("search.result.publisher"), $this->query) |
133 | - $this->title = str_format (localize ("search.result.{$scope}"), $this->query); |
|
133 | + $this->title = str_format(localize("search.result.{$scope}"), $this->query); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | $crit = "%" . $this->query . "%"; |
137 | 137 | |
138 | 138 | // Special case when we are doing a search and no database is selected |
139 | - if (Base::noDatabaseSelected () && !$this->useTypeahead ()) { |
|
139 | + if (Base::noDatabaseSelected() && !$this->useTypeahead()) { |
|
140 | 140 | $i = 0; |
141 | - foreach (Base::getDbNameList () as $key) { |
|
142 | - Base::clearDb (); |
|
143 | - list ($array, $totalNumber) = Book::getBooksByQuery (array ("all" => $crit), 1, $i, 1); |
|
144 | - array_push ($this->entryArray, new Entry ($key, DB . ":query:{$i}", |
|
145 | - str_format (localize ("bookword", $totalNumber), $totalNumber), "text", |
|
146 | - array ( new LinkNavigation ("?" . DB . "={$i}&page=9&query=" . $this->query)), "", $totalNumber)); |
|
141 | + foreach (Base::getDbNameList() as $key) { |
|
142 | + Base::clearDb(); |
|
143 | + list ($array, $totalNumber) = Book::getBooksByQuery(array("all" => $crit), 1, $i, 1); |
|
144 | + array_push($this->entryArray, new Entry($key, DB . ":query:{$i}", |
|
145 | + str_format(localize("bookword", $totalNumber), $totalNumber), "text", |
|
146 | + array(new LinkNavigation("?" . DB . "={$i}&page=9&query=" . $this->query)), "", $totalNumber)); |
|
147 | 147 | $i++; |
148 | 148 | } |
149 | 149 | return; |
150 | 150 | } |
151 | 151 | if (empty ($scope)) { |
152 | - $this->doSearchByCategory (); |
|
152 | + $this->doSearchByCategory(); |
|
153 | 153 | return; |
154 | 154 | } |
155 | 155 | |
156 | - $array = $this->searchByScope ($scope); |
|
157 | - if (count ($array) == 2 && is_array ($array [0])) { |
|
156 | + $array = $this->searchByScope($scope); |
|
157 | + if (count($array) == 2 && is_array($array [0])) { |
|
158 | 158 | list ($this->entryArray, $this->totalNumber) = $array; |
159 | 159 | } else { |
160 | 160 | $this->entryArray = $array; |
@@ -15,11 +15,13 @@ discard block |
||
15 | 15 | const SCOPE_BOOK = "book"; |
16 | 16 | const SCOPE_PUBLISHER = "publisher"; |
17 | 17 | |
18 | - private function useTypeahead () { |
|
18 | + private function useTypeahead () |
|
19 | + { |
|
19 | 20 | return !is_null (getURLParam ("search")); |
20 | 21 | } |
21 | 22 | |
22 | - private function searchByScope ($scope, $limit = FALSE) { |
|
23 | + private function searchByScope ($scope, $limit = FALSE) |
|
24 | + { |
|
23 | 25 | $n = $this->n; |
24 | 26 | $numberPerPage = NULL; |
25 | 27 | $queryNormedAndUp = trim($this->query); |
@@ -54,7 +56,8 @@ discard block |
||
54 | 56 | return $array; |
55 | 57 | } |
56 | 58 | |
57 | - public function doSearchByCategory () { |
|
59 | + public function doSearchByCategory () |
|
60 | + { |
|
58 | 61 | $database = GetUrlParam (DB); |
59 | 62 | $out = array (); |
60 | 63 | $pagequery = Base::PAGE_OPENSEARCH_QUERY; |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | return !is_null (getURLParam ("search")); |
20 | 20 | } |
21 | 21 | |
22 | - private function searchByScope ($scope, $limit = FALSE) { |
|
22 | + private function searchByScope ($scope, $limit = false) { |
|
23 | 23 | $n = $this->n; |
24 | - $numberPerPage = NULL; |
|
24 | + $numberPerPage = null; |
|
25 | 25 | $queryNormedAndUp = trim($this->query); |
26 | 26 | if (useNormAndUp ()) { |
27 | 27 | $queryNormedAndUp = normAndUp ($this->query); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | } |
33 | 33 | switch ($scope) { |
34 | 34 | case self::SCOPE_BOOK : |
35 | - $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, NULL, $numberPerPage); |
|
35 | + $array = Book::getBooksByStartingLetter ('%' . $queryNormedAndUp, $n, null, $numberPerPage); |
|
36 | 36 | break; |
37 | 37 | case self::SCOPE_AUTHOR : |
38 | 38 | $array = Author::getAuthorsForSearch ('%' . $queryNormedAndUp); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $array = Serie::getAllSeriesByQuery ($queryNormedAndUp); |
42 | 42 | break; |
43 | 43 | case self::SCOPE_TAG : |
44 | - $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, NULL, $numberPerPage); |
|
44 | + $array = Tag::getAllTagsByQuery ($queryNormedAndUp, $n, null, $numberPerPage); |
|
45 | 45 | break; |
46 | 46 | case self::SCOPE_PUBLISHER : |
47 | 47 | $array = Publisher::getAllPublishersByQuery ($queryNormedAndUp); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if (in_array($key, getCurrentOption ('ignored_categories'))) { |
82 | 82 | continue; |
83 | 83 | } |
84 | - $array = $this->searchByScope ($key, TRUE); |
|
84 | + $array = $this->searchByScope ($key, true); |
|
85 | 85 | |
86 | 86 | $i = 0; |
87 | 87 | if (count ($array) == 2 && is_array ($array [0])) { |