@@ -8,10 +8,10 @@ |
||
8 | 8 | |
9 | 9 | class PageRecentBooks extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $this->title = localize ("recent.title"); |
|
14 | - $this->entryArray = Book::getAllRecentBooks (); |
|
13 | + $this->title = localize("recent.title"); |
|
14 | + $this->entryArray = Book::getAllRecentBooks(); |
|
15 | 15 | $this->idPage = Book::ALL_RECENT_BOOKS_ID; |
16 | 16 | } |
17 | 17 | } |
@@ -18,17 +18,17 @@ discard block |
||
18 | 18 | $this->lang_code = $plang_code; |
19 | 19 | } |
20 | 20 | |
21 | - public function getUri () { |
|
22 | - return "?page=".parent::PAGE_LANGUAGE_DETAIL."&id=$this->id"; |
|
21 | + public function getUri() { |
|
22 | + return "?page=" . parent::PAGE_LANGUAGE_DETAIL . "&id=$this->id"; |
|
23 | 23 | } |
24 | 24 | |
25 | - public function getEntryId () { |
|
26 | - return self::ALL_LANGUAGES_ID.":".$this->id; |
|
25 | + public function getEntryId() { |
|
26 | + return self::ALL_LANGUAGES_ID . ":" . $this->id; |
|
27 | 27 | } |
28 | 28 | |
29 | - public static function getLanguageString ($code) { |
|
30 | - $string = localize("languages.".$code); |
|
31 | - if (preg_match ("/^languages/", $string)) { |
|
29 | + public static function getLanguageString($code) { |
|
30 | + $string = localize("languages." . $code); |
|
31 | + if (preg_match("/^languages/", $string)) { |
|
32 | 32 | return $code; |
33 | 33 | } |
34 | 34 | return $string; |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | |
37 | 37 | public static function getCount() { |
38 | 38 | // str_format (localize("languages.alphabetical", count(array)) |
39 | - return parent::getCountGeneric ("languages", self::ALL_LANGUAGES_ID, parent::PAGE_ALL_LANGUAGES); |
|
39 | + return parent::getCountGeneric("languages", self::ALL_LANGUAGES_ID, parent::PAGE_ALL_LANGUAGES); |
|
40 | 40 | } |
41 | 41 | |
42 | - public static function getLanguageById ($languageId) { |
|
43 | - $result = parent::getDb ()->prepare('select id, lang_code from languages where id = ?'); |
|
44 | - $result->execute (array ($languageId)); |
|
45 | - if ($post = $result->fetchObject ()) { |
|
46 | - return new Language ($post->id, Language::getLanguageString ($post->lang_code)); |
|
42 | + public static function getLanguageById($languageId) { |
|
43 | + $result = parent::getDb()->prepare('select id, lang_code from languages where id = ?'); |
|
44 | + $result->execute(array($languageId)); |
|
45 | + if ($post = $result->fetchObject()) { |
|
46 | + return new Language($post->id, Language::getLanguageString($post->lang_code)); |
|
47 | 47 | } |
48 | 48 | return NULL; |
49 | 49 | } |
@@ -51,18 +51,18 @@ discard block |
||
51 | 51 | |
52 | 52 | |
53 | 53 | public static function getAllLanguages() { |
54 | - $result = parent::getDb ()->query('select languages.id as id, languages.lang_code as lang_code, count(*) as count |
|
54 | + $result = parent::getDb()->query('select languages.id as id, languages.lang_code as lang_code, count(*) as count |
|
55 | 55 | from languages, books_languages_link |
56 | 56 | where languages.id = books_languages_link.lang_code |
57 | 57 | group by languages.id, books_languages_link.lang_code |
58 | 58 | order by languages.lang_code'); |
59 | 59 | $entryArray = array(); |
60 | - while ($post = $result->fetchObject ()) |
|
60 | + while ($post = $result->fetchObject()) |
|
61 | 61 | { |
62 | - $language = new Language ($post->id, $post->lang_code); |
|
63 | - array_push ($entryArray, new Entry (Language::getLanguageString ($language->lang_code), $language->getEntryId (), |
|
64 | - str_format (localize("bookword", $post->count), $post->count), "text", |
|
65 | - array ( new LinkNavigation ($language->getUri ())), "", $post->count)); |
|
62 | + $language = new Language($post->id, $post->lang_code); |
|
63 | + array_push($entryArray, new Entry(Language::getLanguageString($language->lang_code), $language->getEntryId(), |
|
64 | + str_format(localize("bookword", $post->count), $post->count), "text", |
|
65 | + array(new LinkNavigation($language->getUri())), "", $post->count)); |
|
66 | 66 | } |
67 | 67 | return $entryArray; |
68 | 68 | } |
@@ -13,20 +13,24 @@ discard block |
||
13 | 13 | public $id; |
14 | 14 | public $lang_code; |
15 | 15 | |
16 | - public function __construct($pid, $plang_code) { |
|
16 | + public function __construct($pid, $plang_code) |
|
17 | + { |
|
17 | 18 | $this->id = $pid; |
18 | 19 | $this->lang_code = $plang_code; |
19 | 20 | } |
20 | 21 | |
21 | - public function getUri () { |
|
22 | + public function getUri () |
|
23 | + { |
|
22 | 24 | return "?page=".parent::PAGE_LANGUAGE_DETAIL."&id=$this->id"; |
23 | 25 | } |
24 | 26 | |
25 | - public function getEntryId () { |
|
27 | + public function getEntryId () |
|
28 | + { |
|
26 | 29 | return self::ALL_LANGUAGES_ID.":".$this->id; |
27 | 30 | } |
28 | 31 | |
29 | - public static function getLanguageString ($code) { |
|
32 | + public static function getLanguageString ($code) |
|
33 | + { |
|
30 | 34 | $string = localize("languages.".$code); |
31 | 35 | if (preg_match ("/^languages/", $string)) { |
32 | 36 | return $code; |
@@ -34,12 +38,14 @@ discard block |
||
34 | 38 | return $string; |
35 | 39 | } |
36 | 40 | |
37 | - public static function getCount() { |
|
41 | + public static function getCount() |
|
42 | + { |
|
38 | 43 | // str_format (localize("languages.alphabetical", count(array)) |
39 | 44 | return parent::getCountGeneric ("languages", self::ALL_LANGUAGES_ID, parent::PAGE_ALL_LANGUAGES); |
40 | 45 | } |
41 | 46 | |
42 | - public static function getLanguageById ($languageId) { |
|
47 | + public static function getLanguageById ($languageId) |
|
48 | + { |
|
43 | 49 | $result = parent::getDb ()->prepare('select id, lang_code from languages where id = ?'); |
44 | 50 | $result->execute (array ($languageId)); |
45 | 51 | if ($post = $result->fetchObject ()) { |
@@ -50,15 +56,15 @@ discard block |
||
50 | 56 | |
51 | 57 | |
52 | 58 | |
53 | - public static function getAllLanguages() { |
|
59 | + public static function getAllLanguages() |
|
60 | + { |
|
54 | 61 | $result = parent::getDb ()->query('select languages.id as id, languages.lang_code as lang_code, count(*) as count |
55 | 62 | from languages, books_languages_link |
56 | 63 | where languages.id = books_languages_link.lang_code |
57 | 64 | group by languages.id, books_languages_link.lang_code |
58 | 65 | order by languages.lang_code'); |
59 | 66 | $entryArray = array(); |
60 | - while ($post = $result->fetchObject ()) |
|
61 | - { |
|
67 | + while ($post = $result->fetchObject ()) { |
|
62 | 68 | $language = new Language ($post->id, $post->lang_code); |
63 | 69 | array_push ($entryArray, new Entry (Language::getLanguageString ($language->lang_code), $language->getEntryId (), |
64 | 70 | str_format (localize("bookword", $post->count), $post->count), "text", |
@@ -45,7 +45,7 @@ |
||
45 | 45 | if ($post = $result->fetchObject ()) { |
46 | 46 | return new Language ($post->id, Language::getLanguageString ($post->lang_code)); |
47 | 47 | } |
48 | - return NULL; |
|
48 | + return null; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | |
42 | 42 | protected function getAllCustomValuesFromDatabase() |
43 | 43 | { |
44 | - return NULL; |
|
44 | + return null; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function getDescription() |
48 | 48 | { |
49 | 49 | $desc = $this->getDatabaseDescription(); |
50 | - if ($desc === NULL || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle()); |
|
50 | + if ($desc === null || empty($desc)) $desc = str_format(localize("customcolumn.description"), $this->getTitle()); |
|
51 | 51 | return $desc; |
52 | 52 | } |
53 | 53 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if ($post = $result->fetchObject()) { |
61 | 61 | return new CustomColumn($post->id, $post->value, $this); |
62 | 62 | } |
63 | - return new CustomColumn(NULL, localize("customcolumn.float.unknown"), $this); |
|
63 | + return new CustomColumn(null, localize("customcolumn.float.unknown"), $this); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | 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 |
@@ -14,12 +14,12 @@ discard block |
||
14 | 14 | * @param Book $book |
15 | 15 | * @return array |
16 | 16 | */ |
17 | - public static function getBookContentArray ($book) { |
|
17 | + public static function getBookContentArray ($book) |
|
18 | + { |
|
18 | 19 | global $config; |
19 | 20 | $i = 0; |
20 | 21 | $preferedData = array (); |
21 | - foreach ($config['cops_prefered_format'] as $format) |
|
22 | - { |
|
22 | + foreach ($config['cops_prefered_format'] as $format) { |
|
23 | 23 | if ($i == 2) { break; } |
24 | 24 | if ($data = $book->getDataFormat ($format)) { |
25 | 25 | $i++; |
@@ -71,7 +71,8 @@ discard block |
||
71 | 71 | * @param Book $book |
72 | 72 | * @return array |
73 | 73 | */ |
74 | - public static function getFullBookContentArray ($book) { |
|
74 | + public static function getFullBookContentArray ($book) |
|
75 | + { |
|
75 | 76 | global $config; |
76 | 77 | $out = self::getBookContentArray ($book); |
77 | 78 | $database = GetUrlParam (DB); |
@@ -106,7 +107,8 @@ discard block |
||
106 | 107 | return $out; |
107 | 108 | } |
108 | 109 | |
109 | - public static function getContentArray ($entry) { |
|
110 | + public static function getContentArray ($entry) |
|
111 | + { |
|
110 | 112 | if ($entry instanceof EntryBook) { |
111 | 113 | $out = array ( "title" => $entry->title); |
112 | 114 | $out ["book"] = self::getBookContentArray ($entry->book); |
@@ -115,7 +117,8 @@ discard block |
||
115 | 117 | return array ( "title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink (), "number" => $entry->numberOfElement ); |
116 | 118 | } |
117 | 119 | |
118 | - public static function getContentArrayTypeahead ($page) { |
|
120 | + public static function getContentArrayTypeahead ($page) |
|
121 | + { |
|
119 | 122 | $out = array (); |
120 | 123 | foreach ($page->entryArray as $entry) { |
121 | 124 | if ($entry instanceof EntryBook) { |
@@ -131,7 +134,8 @@ discard block |
||
131 | 134 | return $out; |
132 | 135 | } |
133 | 136 | |
134 | - public static function addCompleteArray ($in) { |
|
137 | + public static function addCompleteArray ($in) |
|
138 | + { |
|
135 | 139 | global $config; |
136 | 140 | $out = $in; |
137 | 141 | |
@@ -178,7 +182,8 @@ discard block |
||
178 | 182 | return $out; |
179 | 183 | } |
180 | 184 | |
181 | - public static function getJson ($complete = false) { |
|
185 | + public static function getJson ($complete = false) |
|
186 | + { |
|
182 | 187 | global $config; |
183 | 188 | $page = getURLParam ("page", Base::PAGE_INDEX); |
184 | 189 | $query = getURLParam ("query"); |
@@ -247,7 +252,9 @@ discard block |
||
247 | 252 | } |
248 | 253 | |
249 | 254 | $out ["homeurl"] = "index.php"; |
250 | - if ($page != Base::PAGE_INDEX && !is_null ($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter ("", DB, $database); |
|
255 | + if ($page != Base::PAGE_INDEX && !is_null ($database)) { |
|
256 | + $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter ("", DB, $database); |
|
257 | + } |
|
251 | 258 | |
252 | 259 | return $out; |
253 | 260 | } |
@@ -76,8 +76,8 @@ |
||
76 | 76 | $out = self::getBookContentArray ($book); |
77 | 77 | $database = GetUrlParam (DB); |
78 | 78 | |
79 | - $out ["coverurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml (); |
|
80 | - $out ["thumbnailurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml (); |
|
79 | + $out ["coverurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", null)->hrefXhtml (); |
|
80 | + $out ["thumbnailurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", null, null, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml (); |
|
81 | 81 | $out ["content"] = $book->getComment (false); |
82 | 82 | $out ["datas"] = array (); |
83 | 83 | $dataKindle = $book->GetMostInterestingDataToSendToKindle (); |
@@ -51,20 +51,20 @@ discard block |
||
51 | 51 | $cc = $book->getCustomColumnValues($config['cops_calibre_custom_column_list'], true); |
52 | 52 | |
53 | 53 | return array ("id" => $book->id, |
54 | - "hasCover" => $book->hasCover, |
|
55 | - "preferedData" => $preferedData, |
|
56 | - "rating" => $book->getRating (), |
|
57 | - "publisherName" => $pn, |
|
58 | - "publisherurl" => $pu, |
|
59 | - "pubDate" => $book->getPubDate (), |
|
60 | - "languagesName" => $book->getLanguages (), |
|
61 | - "authorsName" => $book->getAuthorsName (), |
|
62 | - "tagsName" => $book->getTagsName (), |
|
63 | - "seriesName" => $sn, |
|
64 | - "seriesIndex" => $book->seriesIndex, |
|
65 | - "seriesCompleteName" => $scn, |
|
66 | - "seriesurl" => $su, |
|
67 | - "customcolumns_list" => $cc); |
|
54 | + "hasCover" => $book->hasCover, |
|
55 | + "preferedData" => $preferedData, |
|
56 | + "rating" => $book->getRating (), |
|
57 | + "publisherName" => $pn, |
|
58 | + "publisherurl" => $pu, |
|
59 | + "pubDate" => $book->getPubDate (), |
|
60 | + "languagesName" => $book->getLanguages (), |
|
61 | + "authorsName" => $book->getAuthorsName (), |
|
62 | + "tagsName" => $book->getTagsName (), |
|
63 | + "seriesName" => $sn, |
|
64 | + "seriesIndex" => $book->seriesIndex, |
|
65 | + "seriesCompleteName" => $scn, |
|
66 | + "seriesurl" => $su, |
|
67 | + "customcolumns_list" => $cc); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -136,44 +136,44 @@ discard block |
||
136 | 136 | $out = $in; |
137 | 137 | |
138 | 138 | $out ["c"] = array ("version" => VERSION, "i18n" => array ( |
139 | - "coverAlt" => localize("i18n.coversection"), |
|
140 | - "authorsTitle" => localize("authors.title"), |
|
141 | - "bookwordTitle" => localize("bookword.title"), |
|
142 | - "tagsTitle" => localize("tags.title"), |
|
143 | - "seriesTitle" => localize("series.title"), |
|
144 | - "customizeTitle" => localize ("customize.title"), |
|
145 | - "aboutTitle" => localize ("about.title"), |
|
146 | - "previousAlt" => localize ("paging.previous.alternate"), |
|
147 | - "nextAlt" => localize ("paging.next.alternate"), |
|
148 | - "searchAlt" => localize ("search.alternate"), |
|
149 | - "sortAlt" => localize ("sort.alternate"), |
|
150 | - "homeAlt" => localize ("home.alternate"), |
|
151 | - "cogAlt" => localize ("cog.alternate"), |
|
152 | - "permalinkAlt" => localize ("permalink.alternate"), |
|
153 | - "publisherName" => localize("publisher.name"), |
|
154 | - "pubdateTitle" => localize("pubdate.title"), |
|
155 | - "languagesTitle" => localize("language.title"), |
|
156 | - "contentTitle" => localize("content.summary"), |
|
157 | - "sortorderAsc" => localize("search.sortorder.asc"), |
|
158 | - "sortorderDesc" => localize("search.sortorder.desc"), |
|
159 | - "customizeEmail" => localize("customize.email")), |
|
160 | - "url" => array ( |
|
161 | - "detailUrl" => "index.php?page=13&id={0}&db={1}", |
|
162 | - "coverUrl" => "fetch.php?id={0}&db={1}", |
|
163 | - "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"), |
|
164 | - "config" => array ( |
|
165 | - "use_fancyapps" => $config ["cops_use_fancyapps"], |
|
166 | - "max_item_per_page" => $config['cops_max_item_per_page'], |
|
167 | - "kindleHack" => "", |
|
168 | - "server_side_rendering" => useServerSideRendering (), |
|
169 | - "html_tag_filter" => $config['cops_html_tag_filter'])); |
|
139 | + "coverAlt" => localize("i18n.coversection"), |
|
140 | + "authorsTitle" => localize("authors.title"), |
|
141 | + "bookwordTitle" => localize("bookword.title"), |
|
142 | + "tagsTitle" => localize("tags.title"), |
|
143 | + "seriesTitle" => localize("series.title"), |
|
144 | + "customizeTitle" => localize ("customize.title"), |
|
145 | + "aboutTitle" => localize ("about.title"), |
|
146 | + "previousAlt" => localize ("paging.previous.alternate"), |
|
147 | + "nextAlt" => localize ("paging.next.alternate"), |
|
148 | + "searchAlt" => localize ("search.alternate"), |
|
149 | + "sortAlt" => localize ("sort.alternate"), |
|
150 | + "homeAlt" => localize ("home.alternate"), |
|
151 | + "cogAlt" => localize ("cog.alternate"), |
|
152 | + "permalinkAlt" => localize ("permalink.alternate"), |
|
153 | + "publisherName" => localize("publisher.name"), |
|
154 | + "pubdateTitle" => localize("pubdate.title"), |
|
155 | + "languagesTitle" => localize("language.title"), |
|
156 | + "contentTitle" => localize("content.summary"), |
|
157 | + "sortorderAsc" => localize("search.sortorder.asc"), |
|
158 | + "sortorderDesc" => localize("search.sortorder.desc"), |
|
159 | + "customizeEmail" => localize("customize.email")), |
|
160 | + "url" => array ( |
|
161 | + "detailUrl" => "index.php?page=13&id={0}&db={1}", |
|
162 | + "coverUrl" => "fetch.php?id={0}&db={1}", |
|
163 | + "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"), |
|
164 | + "config" => array ( |
|
165 | + "use_fancyapps" => $config ["cops_use_fancyapps"], |
|
166 | + "max_item_per_page" => $config['cops_max_item_per_page'], |
|
167 | + "kindleHack" => "", |
|
168 | + "server_side_rendering" => useServerSideRendering (), |
|
169 | + "html_tag_filter" => $config['cops_html_tag_filter'])); |
|
170 | 170 | if ($config['cops_thumbnail_handling'] == "1") { |
171 | 171 | $out ["c"]["url"]["thumbnailUrl"] = $out ["c"]["url"]["coverUrl"]; |
172 | 172 | } else if (!empty ($config['cops_thumbnail_handling'])) { |
173 | 173 | $out ["c"]["url"]["thumbnailUrl"] = $config['cops_thumbnail_handling']; |
174 | 174 | } |
175 | 175 | if (preg_match("/./", $_SERVER['HTTP_USER_AGENT'])) { |
176 | - $out ["c"]["config"]["kindleHack"] = 'style="text-decoration: none !important;"'; |
|
176 | + $out ["c"]["config"]["kindleHack"] = 'style="text-decoration: none !important;"'; |
|
177 | 177 | } |
178 | 178 | return $out; |
179 | 179 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | if (!is_null (getURLParam ("complete")) || $complete) { |
234 | 234 | $out = self::addCompleteArray ($out); |
235 | - } |
|
235 | + } |
|
236 | 236 | |
237 | 237 | $out ["containsBook"] = 0; |
238 | 238 | if ($currentPage->containsBook ()) { |
@@ -14,52 +14,52 @@ discard block |
||
14 | 14 | * @param Book $book |
15 | 15 | * @return array |
16 | 16 | */ |
17 | - public static function getBookContentArray ($book) { |
|
17 | + public static function getBookContentArray($book) { |
|
18 | 18 | global $config; |
19 | 19 | $i = 0; |
20 | - $preferedData = array (); |
|
20 | + $preferedData = array(); |
|
21 | 21 | foreach ($config['cops_prefered_format'] as $format) |
22 | 22 | { |
23 | 23 | if ($i == 2) { break; } |
24 | - if ($data = $book->getDataFormat ($format)) { |
|
24 | + if ($data = $book->getDataFormat($format)) { |
|
25 | 25 | $i++; |
26 | - array_push ($preferedData, array ("url" => $data->getHtmlLink (), "name" => $format)); |
|
26 | + array_push($preferedData, array("url" => $data->getHtmlLink(), "name" => $format)); |
|
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
30 | 30 | $publisher = $book->getPublisher(); |
31 | - if (is_null ($publisher)) { |
|
31 | + if (is_null($publisher)) { |
|
32 | 32 | $pn = ""; |
33 | 33 | $pu = ""; |
34 | 34 | } else { |
35 | 35 | $pn = $publisher->name; |
36 | - $link = new LinkNavigation ($publisher->getUri ()); |
|
37 | - $pu = $link->hrefXhtml (); |
|
36 | + $link = new LinkNavigation($publisher->getUri()); |
|
37 | + $pu = $link->hrefXhtml(); |
|
38 | 38 | } |
39 | 39 | |
40 | - $serie = $book->getSerie (); |
|
41 | - if (is_null ($serie)) { |
|
40 | + $serie = $book->getSerie(); |
|
41 | + if (is_null($serie)) { |
|
42 | 42 | $sn = ""; |
43 | 43 | $scn = ""; |
44 | 44 | $su = ""; |
45 | 45 | } else { |
46 | 46 | $sn = $serie->name; |
47 | - $scn = str_format (localize ("content.series.data"), $book->seriesIndex, $serie->name); |
|
48 | - $link = new LinkNavigation ($serie->getUri ()); |
|
49 | - $su = $link->hrefXhtml (); |
|
47 | + $scn = str_format(localize("content.series.data"), $book->seriesIndex, $serie->name); |
|
48 | + $link = new LinkNavigation($serie->getUri()); |
|
49 | + $su = $link->hrefXhtml(); |
|
50 | 50 | } |
51 | 51 | $cc = $book->getCustomColumnValues($config['cops_calibre_custom_column_list'], true); |
52 | 52 | |
53 | - return array ("id" => $book->id, |
|
53 | + return array("id" => $book->id, |
|
54 | 54 | "hasCover" => $book->hasCover, |
55 | 55 | "preferedData" => $preferedData, |
56 | - "rating" => $book->getRating (), |
|
56 | + "rating" => $book->getRating(), |
|
57 | 57 | "publisherName" => $pn, |
58 | 58 | "publisherurl" => $pu, |
59 | - "pubDate" => $book->getPubDate (), |
|
60 | - "languagesName" => $book->getLanguages (), |
|
61 | - "authorsName" => $book->getAuthorsName (), |
|
62 | - "tagsName" => $book->getTagsName (), |
|
59 | + "pubDate" => $book->getPubDate(), |
|
60 | + "languagesName" => $book->getLanguages(), |
|
61 | + "authorsName" => $book->getAuthorsName(), |
|
62 | + "tagsName" => $book->getTagsName(), |
|
63 | 63 | "seriesName" => $sn, |
64 | 64 | "seriesIndex" => $book->seriesIndex, |
65 | 65 | "seriesCompleteName" => $scn, |
@@ -71,85 +71,85 @@ discard block |
||
71 | 71 | * @param Book $book |
72 | 72 | * @return array |
73 | 73 | */ |
74 | - public static function getFullBookContentArray ($book) { |
|
74 | + public static function getFullBookContentArray($book) { |
|
75 | 75 | global $config; |
76 | - $out = self::getBookContentArray ($book); |
|
77 | - $database = GetUrlParam (DB); |
|
78 | - |
|
79 | - $out ["coverurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml (); |
|
80 | - $out ["thumbnailurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml (); |
|
81 | - $out ["content"] = $book->getComment (false); |
|
82 | - $out ["datas"] = array (); |
|
83 | - $dataKindle = $book->GetMostInterestingDataToSendToKindle (); |
|
76 | + $out = self::getBookContentArray($book); |
|
77 | + $database = GetUrlParam(DB); |
|
78 | + |
|
79 | + $out ["coverurl"] = Data::getLink($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml(); |
|
80 | + $out ["thumbnailurl"] = Data::getLink($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml(); |
|
81 | + $out ["content"] = $book->getComment(false); |
|
82 | + $out ["datas"] = array(); |
|
83 | + $dataKindle = $book->GetMostInterestingDataToSendToKindle(); |
|
84 | 84 | foreach ($book->getDatas() as $data) { |
85 | - $tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0, "readerUrl" => ""); |
|
86 | - if (!empty ($config['cops_mail_configuration']) && !is_null ($dataKindle) && $data->id == $dataKindle->id) { |
|
85 | + $tab = array("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink(), "mail" => 0, "readerUrl" => ""); |
|
86 | + if (!empty ($config['cops_mail_configuration']) && !is_null($dataKindle) && $data->id == $dataKindle->id) { |
|
87 | 87 | $tab ["mail"] = 1; |
88 | 88 | } |
89 | 89 | if ($data->format == "EPUB") { |
90 | 90 | $tab ["readerUrl"] = "epubreader.php?data={$data->id}&db={$database}"; |
91 | 91 | } |
92 | - array_push ($out ["datas"], $tab); |
|
92 | + array_push($out ["datas"], $tab); |
|
93 | 93 | } |
94 | - $out ["authors"] = array (); |
|
95 | - foreach ($book->getAuthors () as $author) { |
|
96 | - $link = new LinkNavigation ($author->getUri ()); |
|
97 | - array_push ($out ["authors"], array ("name" => $author->name, "url" => $link->hrefXhtml ())); |
|
94 | + $out ["authors"] = array(); |
|
95 | + foreach ($book->getAuthors() as $author) { |
|
96 | + $link = new LinkNavigation($author->getUri()); |
|
97 | + array_push($out ["authors"], array("name" => $author->name, "url" => $link->hrefXhtml())); |
|
98 | 98 | } |
99 | - $out ["tags"] = array (); |
|
100 | - foreach ($book->getTags () as $tag) { |
|
101 | - $link = new LinkNavigation ($tag->getUri ()); |
|
102 | - array_push ($out ["tags"], array ("name" => $tag->name, "url" => $link->hrefXhtml ())); |
|
99 | + $out ["tags"] = array(); |
|
100 | + foreach ($book->getTags() as $tag) { |
|
101 | + $link = new LinkNavigation($tag->getUri()); |
|
102 | + array_push($out ["tags"], array("name" => $tag->name, "url" => $link->hrefXhtml())); |
|
103 | 103 | } |
104 | 104 | $out ["customcolumns_preview"] = $book->getCustomColumnValues($config['cops_calibre_custom_column_preview'], true); |
105 | 105 | |
106 | 106 | return $out; |
107 | 107 | } |
108 | 108 | |
109 | - public static function getContentArray ($entry) { |
|
109 | + public static function getContentArray($entry) { |
|
110 | 110 | if ($entry instanceof EntryBook) { |
111 | - $out = array ( "title" => $entry->title); |
|
112 | - $out ["book"] = self::getBookContentArray ($entry->book); |
|
111 | + $out = array("title" => $entry->title); |
|
112 | + $out ["book"] = self::getBookContentArray($entry->book); |
|
113 | 113 | return $out; |
114 | 114 | } |
115 | - return array ( "title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink (), "number" => $entry->numberOfElement ); |
|
115 | + return array("title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink(), "number" => $entry->numberOfElement); |
|
116 | 116 | } |
117 | 117 | |
118 | - public static function getContentArrayTypeahead ($page) { |
|
119 | - $out = array (); |
|
118 | + public static function getContentArrayTypeahead($page) { |
|
119 | + $out = array(); |
|
120 | 120 | foreach ($page->entryArray as $entry) { |
121 | 121 | if ($entry instanceof EntryBook) { |
122 | - array_push ($out, array ("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->book->getDetailUrl ())); |
|
122 | + array_push($out, array("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->book->getDetailUrl())); |
|
123 | 123 | } else { |
124 | - if (empty ($entry->className) xor Base::noDatabaseSelected ()) { |
|
125 | - array_push ($out, array ("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->getNavLink ())); |
|
124 | + if (empty ($entry->className) xor Base::noDatabaseSelected()) { |
|
125 | + array_push($out, array("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->getNavLink())); |
|
126 | 126 | } else { |
127 | - array_push ($out, array ("class" => $entry->className, "title" => $entry->content, "navlink" => $entry->getNavLink ())); |
|
127 | + array_push($out, array("class" => $entry->className, "title" => $entry->content, "navlink" => $entry->getNavLink())); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
131 | 131 | return $out; |
132 | 132 | } |
133 | 133 | |
134 | - public static function addCompleteArray ($in) { |
|
134 | + public static function addCompleteArray($in) { |
|
135 | 135 | global $config; |
136 | 136 | $out = $in; |
137 | 137 | |
138 | - $out ["c"] = array ("version" => VERSION, "i18n" => array ( |
|
138 | + $out ["c"] = array("version" => VERSION, "i18n" => array( |
|
139 | 139 | "coverAlt" => localize("i18n.coversection"), |
140 | 140 | "authorsTitle" => localize("authors.title"), |
141 | 141 | "bookwordTitle" => localize("bookword.title"), |
142 | 142 | "tagsTitle" => localize("tags.title"), |
143 | 143 | "seriesTitle" => localize("series.title"), |
144 | - "customizeTitle" => localize ("customize.title"), |
|
145 | - "aboutTitle" => localize ("about.title"), |
|
146 | - "previousAlt" => localize ("paging.previous.alternate"), |
|
147 | - "nextAlt" => localize ("paging.next.alternate"), |
|
148 | - "searchAlt" => localize ("search.alternate"), |
|
149 | - "sortAlt" => localize ("sort.alternate"), |
|
150 | - "homeAlt" => localize ("home.alternate"), |
|
151 | - "cogAlt" => localize ("cog.alternate"), |
|
152 | - "permalinkAlt" => localize ("permalink.alternate"), |
|
144 | + "customizeTitle" => localize("customize.title"), |
|
145 | + "aboutTitle" => localize("about.title"), |
|
146 | + "previousAlt" => localize("paging.previous.alternate"), |
|
147 | + "nextAlt" => localize("paging.next.alternate"), |
|
148 | + "searchAlt" => localize("search.alternate"), |
|
149 | + "sortAlt" => localize("sort.alternate"), |
|
150 | + "homeAlt" => localize("home.alternate"), |
|
151 | + "cogAlt" => localize("cog.alternate"), |
|
152 | + "permalinkAlt" => localize("permalink.alternate"), |
|
153 | 153 | "publisherName" => localize("publisher.name"), |
154 | 154 | "pubdateTitle" => localize("pubdate.title"), |
155 | 155 | "languagesTitle" => localize("language.title"), |
@@ -157,15 +157,15 @@ discard block |
||
157 | 157 | "sortorderAsc" => localize("search.sortorder.asc"), |
158 | 158 | "sortorderDesc" => localize("search.sortorder.desc"), |
159 | 159 | "customizeEmail" => localize("customize.email")), |
160 | - "url" => array ( |
|
160 | + "url" => array( |
|
161 | 161 | "detailUrl" => "index.php?page=13&id={0}&db={1}", |
162 | 162 | "coverUrl" => "fetch.php?id={0}&db={1}", |
163 | 163 | "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"), |
164 | - "config" => array ( |
|
164 | + "config" => array( |
|
165 | 165 | "use_fancyapps" => $config ["cops_use_fancyapps"], |
166 | 166 | "max_item_per_page" => $config['cops_max_item_per_page'], |
167 | 167 | "kindleHack" => "", |
168 | - "server_side_rendering" => useServerSideRendering (), |
|
168 | + "server_side_rendering" => useServerSideRendering(), |
|
169 | 169 | "html_tag_filter" => $config['cops_html_tag_filter'])); |
170 | 170 | if ($config['cops_thumbnail_handling'] == "1") { |
171 | 171 | $out ["c"]["url"]["thumbnailUrl"] = $out ["c"]["url"]["coverUrl"]; |
@@ -178,32 +178,32 @@ discard block |
||
178 | 178 | return $out; |
179 | 179 | } |
180 | 180 | |
181 | - public static function getJson ($complete = false) { |
|
181 | + public static function getJson($complete = false) { |
|
182 | 182 | global $config; |
183 | - $page = getURLParam ("page", Base::PAGE_INDEX); |
|
184 | - $query = getURLParam ("query"); |
|
185 | - $search = getURLParam ("search"); |
|
186 | - $qid = getURLParam ("id"); |
|
187 | - $n = getURLParam ("n", "1"); |
|
188 | - $database = GetUrlParam (DB); |
|
183 | + $page = getURLParam("page", Base::PAGE_INDEX); |
|
184 | + $query = getURLParam("query"); |
|
185 | + $search = getURLParam("search"); |
|
186 | + $qid = getURLParam("id"); |
|
187 | + $n = getURLParam("n", "1"); |
|
188 | + $database = GetUrlParam(DB); |
|
189 | 189 | |
190 | - $currentPage = Page::getPage ($page, $qid, $query, $n); |
|
191 | - $currentPage->InitializeContent (); |
|
190 | + $currentPage = Page::getPage($page, $qid, $query, $n); |
|
191 | + $currentPage->InitializeContent(); |
|
192 | 192 | |
193 | 193 | if ($search) { |
194 | - return self::getContentArrayTypeahead ($currentPage); |
|
194 | + return self::getContentArrayTypeahead($currentPage); |
|
195 | 195 | } |
196 | 196 | |
197 | - $out = array ( "title" => $currentPage->title); |
|
198 | - $entries = array (); |
|
197 | + $out = array("title" => $currentPage->title); |
|
198 | + $entries = array(); |
|
199 | 199 | foreach ($currentPage->entryArray as $entry) { |
200 | - array_push ($entries, self::getContentArray ($entry)); |
|
200 | + array_push($entries, self::getContentArray($entry)); |
|
201 | 201 | } |
202 | - if (!is_null ($currentPage->book)) { |
|
203 | - $out ["book"] = self::getFullBookContentArray ($currentPage->book); |
|
202 | + if (!is_null($currentPage->book)) { |
|
203 | + $out ["book"] = self::getFullBookContentArray($currentPage->book); |
|
204 | 204 | } |
205 | - $out ["databaseId"] = GetUrlParam (DB, ""); |
|
206 | - $out ["databaseName"] = Base::getDbName (); |
|
205 | + $out ["databaseId"] = GetUrlParam(DB, ""); |
|
206 | + $out ["databaseName"] = Base::getDbName(); |
|
207 | 207 | if ($out ["databaseId"] == "") { |
208 | 208 | $out ["databaseName"] = ""; |
209 | 209 | } |
@@ -212,42 +212,42 @@ discard block |
||
212 | 212 | $out ["fullTitle"] = $out ["databaseName"] . " > " . $out ["fullTitle"]; |
213 | 213 | } |
214 | 214 | $out ["page"] = $page; |
215 | - $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled () ? 1 : 0; |
|
215 | + $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled()?1:0; |
|
216 | 216 | $out ["entries"] = $entries; |
217 | 217 | $out ["isPaginated"] = 0; |
218 | - if ($currentPage->isPaginated ()) { |
|
219 | - $prevLink = $currentPage->getPrevLink (); |
|
220 | - $nextLink = $currentPage->getNextLink (); |
|
218 | + if ($currentPage->isPaginated()) { |
|
219 | + $prevLink = $currentPage->getPrevLink(); |
|
220 | + $nextLink = $currentPage->getNextLink(); |
|
221 | 221 | $out ["isPaginated"] = 1; |
222 | 222 | $out ["prevLink"] = ""; |
223 | - if (!is_null ($prevLink)) { |
|
224 | - $out ["prevLink"] = $prevLink->hrefXhtml (); |
|
223 | + if (!is_null($prevLink)) { |
|
224 | + $out ["prevLink"] = $prevLink->hrefXhtml(); |
|
225 | 225 | } |
226 | 226 | $out ["nextLink"] = ""; |
227 | - if (!is_null ($nextLink)) { |
|
228 | - $out ["nextLink"] = $nextLink->hrefXhtml (); |
|
227 | + if (!is_null($nextLink)) { |
|
228 | + $out ["nextLink"] = $nextLink->hrefXhtml(); |
|
229 | 229 | } |
230 | - $out ["maxPage"] = $currentPage->getMaxPage (); |
|
230 | + $out ["maxPage"] = $currentPage->getMaxPage(); |
|
231 | 231 | $out ["currentPage"] = $currentPage->n; |
232 | 232 | } |
233 | - if (!is_null (getURLParam ("complete")) || $complete) { |
|
234 | - $out = self::addCompleteArray ($out); |
|
233 | + if (!is_null(getURLParam("complete")) || $complete) { |
|
234 | + $out = self::addCompleteArray($out); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | $out ["containsBook"] = 0; |
238 | - if ($currentPage->containsBook ()) { |
|
238 | + if ($currentPage->containsBook()) { |
|
239 | 239 | $out ["containsBook"] = 1; |
240 | 240 | } |
241 | 241 | |
242 | - $out["abouturl"] = "index.php" . addURLParameter ("?page=" . Base::PAGE_ABOUT, DB, $database); |
|
242 | + $out["abouturl"] = "index.php" . addURLParameter("?page=" . Base::PAGE_ABOUT, DB, $database); |
|
243 | 243 | |
244 | 244 | if ($page == Base::PAGE_ABOUT) { |
245 | - $temp = preg_replace ("/\<h1\>About COPS\<\/h1\>/", "<h1>About COPS " . VERSION . "</h1>", file_get_contents('about.html')); |
|
245 | + $temp = preg_replace("/\<h1\>About COPS\<\/h1\>/", "<h1>About COPS " . VERSION . "</h1>", file_get_contents('about.html')); |
|
246 | 246 | $out ["fullhtml"] = $temp; |
247 | 247 | } |
248 | 248 | |
249 | 249 | $out ["homeurl"] = "index.php"; |
250 | - if ($page != Base::PAGE_INDEX && !is_null ($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter ("", DB, $database); |
|
250 | + if ($page != Base::PAGE_INDEX && !is_null($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter("", DB, $database); |
|
251 | 251 | |
252 | 252 | return $out; |
253 | 253 | } |
@@ -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(); |