@@ -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( |
@@ -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; |
@@ -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) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | function notFound() |
| 61 | 61 | { |
| 62 | - header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found'); |
|
| 62 | + header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); |
|
| 63 | 63 | header('Status: 404 Not Found'); |
| 64 | 64 | |
| 65 | 65 | $_SERVER['REDIRECT_STATUS'] = 404; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | function xml2xhtml($xml) |
| 109 | 109 | { |
| 110 | - return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', function ($m) { |
|
| 110 | + return preg_replace_callback('#<(\w+)([^>]*)\s*/>#s', function($m) { |
|
| 111 | 111 | $xhtml_tags = ['br', 'hr', 'input', 'frame', 'img', 'area', 'link', 'col', 'base', 'basefont', 'param']; |
| 112 | 112 | if (in_array($m[1], $xhtml_tags)) { |
| 113 | 113 | return '<' . $m[1] . $m[2] . ' />'; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | libxml_use_internal_errors(true); |
| 164 | 164 | |
| 165 | 165 | $doc->loadHTML('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>' . |
| 166 | - $html . '</body></html>'); // Load the HTML |
|
| 166 | + $html . '</body></html>'); // Load the HTML |
|
| 167 | 167 | $output = $doc->saveXML($doc->documentElement); // Transform to an Ansi xml stream |
| 168 | 168 | $output = xml2xhtml($output); |
| 169 | 169 | if (preg_match('#<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></meta></head><body>(.*)</body></html>#ms', $output, $matches)) { |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | //echo var_dump($langs); |
| 271 | 271 | $lang_file = null; |
| 272 | 272 | foreach ($langs as $language => $val) { |
| 273 | - $temp_file = dirname(__FILE__). '/lang/Localization_' . $language . '.json'; |
|
| 273 | + $temp_file = dirname(__FILE__) . '/lang/Localization_' . $language . '.json'; |
|
| 274 | 274 | if (file_exists($temp_file)) { |
| 275 | 275 | $lang = $language; |
| 276 | 276 | $lang_file = $temp_file; |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | if (empty($lang_file)) { |
| 281 | - $lang_file = dirname(__FILE__). '/lang/Localization_' . $lang . '.json'; |
|
| 281 | + $lang_file = dirname(__FILE__) . '/lang/Localization_' . $lang . '.json'; |
|
| 282 | 282 | } |
| 283 | 283 | return [$lang, $lang_file]; |
| 284 | 284 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | * This method is based on this page |
| 288 | 288 | * http://www.mind-it.info/2010/02/22/a-simple-approach-to-localization-in-php/ |
| 289 | 289 | */ |
| 290 | -function localize($phrase, $count=-1, $reset=false) |
|
| 290 | +function localize($phrase, $count = -1, $reset = false) |
|
| 291 | 291 | { |
| 292 | 292 | global $config; |
| 293 | 293 | if ($count == 0) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | $lang_file_en = null; |
| 311 | 311 | [$lang, $lang_file] = getLangAndTranslationFile(); |
| 312 | 312 | if ($lang != 'en') { |
| 313 | - $lang_file_en = dirname(__FILE__). '/lang/' . 'Localization_en.json'; |
|
| 313 | + $lang_file_en = dirname(__FILE__) . '/lang/' . 'Localization_en.json'; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | $lang_file_content = file_get_contents($lang_file); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | <h4> |
| 202 | 202 | <?php |
| 203 | 203 | try { |
| 204 | - $db = new PDO('sqlite:'. Base::getDbFileName($i)); |
|
| 204 | + $db = new PDO('sqlite:' . Base::getDbFileName($i)); |
|
| 205 | 205 | echo $name . ' OK'; |
| 206 | 206 | } catch (Exception $e) { |
| 207 | 207 | echo $name . ' If the file is readable, check your php configuration. Exception detail : ' . $e; |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | <h4> |
| 215 | 215 | <?php |
| 216 | 216 | try { |
| 217 | - $db = new PDO('sqlite:'. Base::getDbFileName($i)); |
|
| 217 | + $db = new PDO('sqlite:' . Base::getDbFileName($i)); |
|
| 218 | 218 | $count = $db->query('select count(*) FROM sqlite_master WHERE type="table" AND name in ("books", "authors", "tags", "series")')->fetchColumn(); |
| 219 | 219 | if ($count == 4) { |
| 220 | 220 | echo $name . ' OK'; |