@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | |
22 | 22 | public function getUri() |
23 | 23 | { |
24 | - return "?page=".parent::PAGE_LANGUAGE_DETAIL."&id=$this->id"; |
|
24 | + return "?page=" . parent::PAGE_LANGUAGE_DETAIL . "&id=$this->id"; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function getEntryId() |
28 | 28 | { |
29 | - return self::ALL_LANGUAGES_ID.":".$this->id; |
|
29 | + return self::ALL_LANGUAGES_ID . ":" . $this->id; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public static function getLanguageString($code) |
33 | 33 | { |
34 | - $string = localize("languages.".$code); |
|
34 | + $string = localize("languages." . $code); |
|
35 | 35 | if (preg_match("/^languages/", $string)) { |
36 | 36 | return $code; |
37 | 37 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $language->getEntryId(), |
72 | 72 | str_format(localize("bookword", $post->count), $post->count), |
73 | 73 | "text", |
74 | - [ new LinkNavigation($language->getUri())], |
|
74 | + [new LinkNavigation($language->getUri())], |
|
75 | 75 | "", |
76 | 76 | $post->count |
77 | 77 | )); |
@@ -117,7 +117,7 @@ |
||
117 | 117 | $content = ""; |
118 | 118 | foreach ($ignoredBaseArray as $key) { |
119 | 119 | $keyPlural = preg_replace('/(ss)$/', 's', $key . "s"); |
120 | - $content .= '<input type="checkbox" name="ignored_categories[]" onchange="updateCookieFromCheckboxGroup (this);" id="ignored_categories_' . $key . '" ' . $this->isChecked("ignored_categories", $key) . ' > ' . localize("{$keyPlural}.title") . '</input> '; |
|
120 | + $content .= '<input type="checkbox" name="ignored_categories[]" onchange="updateCookieFromCheckboxGroup (this);" id="ignored_categories_' . $key . '" ' . $this->isChecked("ignored_categories", $key) . ' > ' . localize("{$keyPlural}.title") . '</input> '; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | array_push($this->entryArray, new Entry( |
@@ -59,11 +59,11 @@ |
||
59 | 59 | $this->entryArray = []; |
60 | 60 | |
61 | 61 | $ignoredBaseArray = [PageQueryResult::SCOPE_AUTHOR, |
62 | - PageQueryResult::SCOPE_TAG, |
|
63 | - PageQueryResult::SCOPE_SERIES, |
|
64 | - PageQueryResult::SCOPE_PUBLISHER, |
|
65 | - PageQueryResult::SCOPE_RATING, |
|
66 | - "language"]; |
|
62 | + PageQueryResult::SCOPE_TAG, |
|
63 | + PageQueryResult::SCOPE_SERIES, |
|
64 | + PageQueryResult::SCOPE_PUBLISHER, |
|
65 | + PageQueryResult::SCOPE_RATING, |
|
66 | + "language"]; |
|
67 | 67 | |
68 | 68 | $content = ""; |
69 | 69 | if (!preg_match("/(Kobo|Kindle\/3.0|EBRD1101)/", $_SERVER['HTTP_USER_AGENT'])) { |
@@ -24,12 +24,12 @@ |
||
24 | 24 | |
25 | 25 | public function getUri() |
26 | 26 | { |
27 | - return "?page=".parent::PAGE_SERIE_DETAIL."&id=$this->id"; |
|
27 | + return "?page=" . parent::PAGE_SERIE_DETAIL . "&id=$this->id"; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function getEntryId() |
31 | 31 | { |
32 | - return self::ALL_SERIES_ID.":".$this->id; |
|
32 | + return self::ALL_SERIES_ID . ":" . $this->id; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public static function getCount() |
@@ -25,12 +25,12 @@ |
||
25 | 25 | |
26 | 26 | public function getUri() |
27 | 27 | { |
28 | - return "?page=".parent::PAGE_PUBLISHER_DETAIL."&id=$this->id"; |
|
28 | + return "?page=" . parent::PAGE_PUBLISHER_DETAIL . "&id=$this->id"; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public function getEntryId() |
32 | 32 | { |
33 | - return self::ALL_PUBLISHERS_ID.":".$this->id; |
|
33 | + return self::ALL_PUBLISHERS_ID . ":" . $this->id; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public static function getCount() |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | public static function getContentArray($entry) |
119 | 119 | { |
120 | 120 | if ($entry instanceof EntryBook) { |
121 | - $out = [ "title" => $entry->title]; |
|
121 | + $out = ["title" => $entry->title]; |
|
122 | 122 | $out ["book"] = self::getBookContentArray($entry->book); |
123 | 123 | return $out; |
124 | 124 | } |
125 | - return [ "title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink(), "number" => $entry->numberOfElement ]; |
|
125 | + return ["title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink(), "number" => $entry->numberOfElement]; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | public static function getContentArrayTypeahead($page) |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | return self::getContentArrayTypeahead($currentPage); |
209 | 209 | } |
210 | 210 | |
211 | - $out = [ "title" => $currentPage->title]; |
|
211 | + $out = ["title" => $currentPage->title]; |
|
212 | 212 | $entries = []; |
213 | 213 | foreach ($currentPage->entryArray as $entry) { |
214 | 214 | array_push($entries, self::getContentArray($entry)); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $out ["fullTitle"] = $out ["databaseName"] . " > " . $out ["fullTitle"]; |
227 | 227 | } |
228 | 228 | $out ["page"] = $page; |
229 | - $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled() ? 1 : 0; |
|
229 | + $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled()?1:0; |
|
230 | 230 | $out ["entries"] = $entries; |
231 | 231 | $out ["isPaginated"] = 0; |
232 | 232 | if ($currentPage->isPaginated()) { |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | |
263 | 263 | $out ["homeurl"] = "index.php"; |
264 | 264 | if ($page != Base::PAGE_INDEX && !is_null($database)) { |
265 | - $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter("", DB, $database); |
|
265 | + $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter("", DB, $database); |
|
266 | 266 | } |
267 | 267 | |
268 | 268 | return $out; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | if ($data = $book->getDataFormat($format)) { |
27 | 27 | $i++; |
28 | 28 | array_push($preferedData, ["url" => $data->getHtmlLink(), |
29 | - "viewUrl" => $data->getViewHtmlLink(), "name" => $format]); |
|
29 | + "viewUrl" => $data->getViewHtmlLink(), "name" => $format]); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
@@ -54,20 +54,20 @@ discard block |
||
54 | 54 | $cc = $book->getCustomColumnValues($config['cops_calibre_custom_column_list'], true); |
55 | 55 | |
56 | 56 | return ["id" => $book->id, |
57 | - "hasCover" => $book->hasCover, |
|
58 | - "preferedData" => $preferedData, |
|
59 | - "rating" => $book->getRating(), |
|
60 | - "publisherName" => $pn, |
|
61 | - "publisherurl" => $pu, |
|
62 | - "pubDate" => $book->getPubDate(), |
|
63 | - "languagesName" => $book->getLanguages(), |
|
64 | - "authorsName" => $book->getAuthorsName(), |
|
65 | - "tagsName" => $book->getTagsName(), |
|
66 | - "seriesName" => $sn, |
|
67 | - "seriesIndex" => $book->seriesIndex, |
|
68 | - "seriesCompleteName" => $scn, |
|
69 | - "seriesurl" => $su, |
|
70 | - "customcolumns_list" => $cc]; |
|
57 | + "hasCover" => $book->hasCover, |
|
58 | + "preferedData" => $preferedData, |
|
59 | + "rating" => $book->getRating(), |
|
60 | + "publisherName" => $pn, |
|
61 | + "publisherurl" => $pu, |
|
62 | + "pubDate" => $book->getPubDate(), |
|
63 | + "languagesName" => $book->getLanguages(), |
|
64 | + "authorsName" => $book->getAuthorsName(), |
|
65 | + "tagsName" => $book->getTagsName(), |
|
66 | + "seriesName" => $sn, |
|
67 | + "seriesIndex" => $book->seriesIndex, |
|
68 | + "seriesCompleteName" => $scn, |
|
69 | + "seriesurl" => $su, |
|
70 | + "customcolumns_list" => $cc]; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -154,39 +154,39 @@ discard block |
||
154 | 154 | $out = $in; |
155 | 155 | |
156 | 156 | $out ["c"] = ["version" => VERSION, "i18n" => [ |
157 | - "coverAlt" => localize("i18n.coversection"), |
|
158 | - "authorsTitle" => localize("authors.title"), |
|
159 | - "bookwordTitle" => localize("bookword.title"), |
|
160 | - "tagsTitle" => localize("tags.title"), |
|
161 | - "linksTitle" => localize("links.title"), |
|
162 | - "seriesTitle" => localize("series.title"), |
|
163 | - "customizeTitle" => localize("customize.title"), |
|
164 | - "aboutTitle" => localize("about.title"), |
|
165 | - "previousAlt" => localize("paging.previous.alternate"), |
|
166 | - "nextAlt" => localize("paging.next.alternate"), |
|
167 | - "searchAlt" => localize("search.alternate"), |
|
168 | - "sortAlt" => localize("sort.alternate"), |
|
169 | - "homeAlt" => localize("home.alternate"), |
|
170 | - "cogAlt" => localize("cog.alternate"), |
|
171 | - "permalinkAlt" => localize("permalink.alternate"), |
|
172 | - "publisherName" => localize("publisher.name"), |
|
173 | - "pubdateTitle" => localize("pubdate.title"), |
|
174 | - "languagesTitle" => localize("language.title"), |
|
175 | - "contentTitle" => localize("content.summary"), |
|
176 | - "filterClearAll" => localize("filter.clearall"), |
|
177 | - "sortorderAsc" => localize("search.sortorder.asc"), |
|
178 | - "sortorderDesc" => localize("search.sortorder.desc"), |
|
179 | - "customizeEmail" => localize("customize.email")], |
|
180 | - "url" => [ |
|
181 | - "detailUrl" => "index.php?page=13&id={0}&db={1}", |
|
182 | - "coverUrl" => "fetch.php?id={0}&db={1}", |
|
183 | - "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"], |
|
184 | - "config" => [ |
|
185 | - "use_fancyapps" => $config ["cops_use_fancyapps"], |
|
186 | - "max_item_per_page" => $config['cops_max_item_per_page'], |
|
187 | - "kindleHack" => "", |
|
188 | - "server_side_rendering" => useServerSideRendering(), |
|
189 | - "html_tag_filter" => $config['cops_html_tag_filter']]]; |
|
157 | + "coverAlt" => localize("i18n.coversection"), |
|
158 | + "authorsTitle" => localize("authors.title"), |
|
159 | + "bookwordTitle" => localize("bookword.title"), |
|
160 | + "tagsTitle" => localize("tags.title"), |
|
161 | + "linksTitle" => localize("links.title"), |
|
162 | + "seriesTitle" => localize("series.title"), |
|
163 | + "customizeTitle" => localize("customize.title"), |
|
164 | + "aboutTitle" => localize("about.title"), |
|
165 | + "previousAlt" => localize("paging.previous.alternate"), |
|
166 | + "nextAlt" => localize("paging.next.alternate"), |
|
167 | + "searchAlt" => localize("search.alternate"), |
|
168 | + "sortAlt" => localize("sort.alternate"), |
|
169 | + "homeAlt" => localize("home.alternate"), |
|
170 | + "cogAlt" => localize("cog.alternate"), |
|
171 | + "permalinkAlt" => localize("permalink.alternate"), |
|
172 | + "publisherName" => localize("publisher.name"), |
|
173 | + "pubdateTitle" => localize("pubdate.title"), |
|
174 | + "languagesTitle" => localize("language.title"), |
|
175 | + "contentTitle" => localize("content.summary"), |
|
176 | + "filterClearAll" => localize("filter.clearall"), |
|
177 | + "sortorderAsc" => localize("search.sortorder.asc"), |
|
178 | + "sortorderDesc" => localize("search.sortorder.desc"), |
|
179 | + "customizeEmail" => localize("customize.email")], |
|
180 | + "url" => [ |
|
181 | + "detailUrl" => "index.php?page=13&id={0}&db={1}", |
|
182 | + "coverUrl" => "fetch.php?id={0}&db={1}", |
|
183 | + "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"], |
|
184 | + "config" => [ |
|
185 | + "use_fancyapps" => $config ["cops_use_fancyapps"], |
|
186 | + "max_item_per_page" => $config['cops_max_item_per_page'], |
|
187 | + "kindleHack" => "", |
|
188 | + "server_side_rendering" => useServerSideRendering(), |
|
189 | + "html_tag_filter" => $config['cops_html_tag_filter']]]; |
|
190 | 190 | if ($config['cops_thumbnail_handling'] == "1") { |
191 | 191 | $out ["c"]["url"]["thumbnailUrl"] = $out ["c"]["url"]["coverUrl"]; |
192 | 192 | } elseif (!empty($config['cops_thumbnail_handling'])) { |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | public static function getDbFileName($database = null) |
113 | 113 | { |
114 | - return self::getDbDirectory($database) .'metadata.db'; |
|
114 | + return self::getDbDirectory($database) . 'metadata.db'; |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | private static function error($database) |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | if (is_null(self::$db)) { |
128 | 128 | try { |
129 | 129 | if (is_readable(self::getDbFileName($database))) { |
130 | - self::$db = new PDO('sqlite:'. self::getDbFileName($database)); |
|
130 | + self::$db = new PDO('sqlite:' . self::getDbFileName($database)); |
|
131 | 131 | if (useNormAndUp()) { |
132 | 132 | self::$db->sqliteCreateFunction('normAndUp', 'normAndUp', 1); |
133 | 133 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $id, |
179 | 179 | str_format(localize($numberOfString, $count), $count), |
180 | 180 | "text", |
181 | - [ new LinkNavigation("?page=".$pageId)], |
|
181 | + [new LinkNavigation("?page=" . $pageId)], |
|
182 | 182 | "", |
183 | 183 | $count |
184 | 184 | ); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $instance->getEntryId(), |
206 | 206 | str_format(localize("bookword", $post->count), $post->count), |
207 | 207 | "text", |
208 | - [ new LinkNavigation($instance->getUri())], |
|
208 | + [new LinkNavigation($instance->getUri())], |
|
209 | 209 | "", |
210 | 210 | $post->count |
211 | 211 | )); |
@@ -11,8 +11,8 @@ |
||
11 | 11 | // PHP pre 5.6 does not support const arrays |
12 | 12 | private $BOOLEAN_NAMES = [ |
13 | 13 | -1 => "customcolumn.boolean.unknown", // localize("customcolumn.boolean.unknown") |
14 | - 0 => "customcolumn.boolean.no", // localize("customcolumn.boolean.no") |
|
15 | - +1 => "customcolumn.boolean.yes", // localize("customcolumn.boolean.yes") |
|
14 | + 0 => "customcolumn.boolean.no", // localize("customcolumn.boolean.no") |
|
15 | + +1 => "customcolumn.boolean.yes", // localize("customcolumn.boolean.yes") |
|
16 | 16 | ]; |
17 | 17 | |
18 | 18 | protected function __construct($pcustomId) |
@@ -37,13 +37,13 @@ |
||
37 | 37 | Monocle.DEBUG = true; |
38 | 38 | var bookData = { |
39 | 39 | getComponents: function() { |
40 | - <?php echo 'return [' . implode(', ', array_map(function ($comp) { |
|
40 | + <?php echo 'return [' . implode(', ', array_map(function($comp) { |
|
41 | 41 | return "'" . $comp . "'"; |
42 | 42 | }, $book->components())) . '];'; ?> |
43 | 43 | }, |
44 | 44 | getContents: function() { |
45 | - <?php echo 'return [' . implode(', ', array_map(function ($content) { |
|
46 | - return "{title: '" . addslashes($content['title']) . "', src: '". $content['src'] . "'}"; |
|
45 | + <?php echo 'return [' . implode(', ', array_map(function($content) { |
|
46 | + return "{title: '" . addslashes($content['title']) . "', src: '" . $content['src'] . "'}"; |
|
47 | 47 | }, $book->contents())) . '];'; ?> |
48 | 48 | }, |
49 | 49 | getComponent: function (componentId) { |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | } |
14 | 14 | /** @var array $config */ |
15 | 15 | |
16 | -$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ''; |
|
16 | +$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER)?$_SERVER['PHP_AUTH_USER']:''; |
|
17 | 17 | // Clean username, only allow a-z, A-Z, 0-9, -_ chars |
18 | 18 | $remote_user = preg_replace('/[^a-zA-Z0-9_-]/', '', $remote_user); |
19 | 19 | $user_config_file = 'config_local.' . $remote_user . '.php'; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | is_array($config['cops_basic_authentication'])) { |
26 | 26 | if (!isset($_SERVER['PHP_AUTH_USER']) || |
27 | 27 | (isset($_SERVER['PHP_AUTH_USER']) && |
28 | - ($_SERVER['PHP_AUTH_USER']!=$config['cops_basic_authentication']['username'] || |
|
28 | + ($_SERVER['PHP_AUTH_USER'] != $config['cops_basic_authentication']['username'] || |
|
29 | 29 | $_SERVER['PHP_AUTH_PW'] != $config['cops_basic_authentication']['password']))) { |
30 | 30 | header('WWW-Authenticate: Basic realm="COPS Authentication"'); |
31 | 31 | header('HTTP/1.0 401 Unauthorized'); |