| @@ -189,7 +189,7 @@ discard block | ||
| 189 | 189 | * | 
| 190 | 190 | * Note that the composite custom columns are not supported | 
| 191 | 191 | */ | 
| 192 | - $config['cops_calibre_custom_column_list'] = array (); | |
| 192 | + $config['cops_calibre_custom_column_list'] = array(); | |
| 193 | 193 | |
| 194 | 194 | /* | 
| 195 | 195 | * Custom Columns for the book preview panel | 
| @@ -199,7 +199,7 @@ discard block | ||
| 199 | 199 | * | 
| 200 | 200 | * Note that the composite custom columns are not supported | 
| 201 | 201 | */ | 
| 202 | - $config['cops_calibre_custom_column_preview'] = array (); | |
| 202 | + $config['cops_calibre_custom_column_preview'] = array(); | |
| 203 | 203 | |
| 204 | 204 | /* | 
| 205 | 205 | * Rename .epub to .kepub.epub if downloaded from a Kobo eReader | 
| @@ -15,8 +15,8 @@ discard block | ||
| 15 | 15 | |
| 16 | 16 |  $idData = getURLParam('data', NULL); | 
| 17 | 17 | $add = 'data=' . $idData . '&'; | 
| 18 | -if (!is_null (GetUrlParam (DB))) { | |
| 19 | - $add .= DB . '=' . GetUrlParam (DB) . '&'; | |
| 18 | +if (!is_null(GetUrlParam(DB))) { | |
| 19 | + $add .= DB . '=' . GetUrlParam(DB) . '&'; | |
| 20 | 20 | } | 
| 21 | 21 | $myBook = Book::getBookByDataId($idData); | 
| 22 | 22 | |
| @@ -37,10 +37,10 @@ discard block | ||
| 37 | 37 | Monocle.DEBUG = true; | 
| 38 | 38 |          var bookData = { | 
| 39 | 39 |            getComponents: function() { | 
| 40 | -            <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components ())) . '];'; ?> | |
| 40 | +            <?php echo 'return [' . implode(', ', array_map(function($comp) { return "'" . $comp . "'"; }, $book->components())) . '];'; ?> | |
| 41 | 41 | }, | 
| 42 | 42 |            getContents: function() { | 
| 43 | -            <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '". $content['src'] . "'}"; }, $book->contents())) . '];'; ?> | |
| 43 | +            <?php echo 'return [' . implode(', ', array_map(function($content) { return "{title: '" . addslashes($content['title']) . "', src: '" . $content['src'] . "'}"; }, $book->contents())) . '];'; ?> | |
| 44 | 44 | }, | 
| 45 | 45 |            getComponent: function (componentId) { | 
| 46 | 46 |              return { url: "epubfs.php?<?php echo $add ?>comp="  + componentId }; | 
| @@ -90,7 +90,7 @@ discard block | ||
| 90 | 90 | // Counting down is faster. I'm *so* sorry. | 
| 91 | 91 | $len = $chunk + 1; | 
| 92 | 92 | |
| 93 | -    for ($i = -1; --$len; ) { | |
| 93 | +    for ($i = -1; --$len;) { | |
| 94 | 94 | $c = $str[++$i]; | 
| 95 | 95 |        if ($remaining = $tail_bytes[$c]) { | 
| 96 | 96 | // UTF-8 head byte! | 
| @@ -208,5 +208,5 @@ discard block | ||
| 208 | 208 | |
| 209 | 209 | $ord = $ord & 255; | 
| 210 | 210 | |
| 211 | - return isset($map[$bank][$langcode][$ord]) ? $map[$bank][$langcode][$ord] : $unknown; | |
| 211 | + return isset($map[$bank][$langcode][$ord])?$map[$bank][$langcode][$ord]:$unknown; | |
| 212 | 212 | } | 
| @@ -8,10 +8,10 @@ | ||
| 8 | 8 | |
| 9 | 9 | class PageAllAuthorsLetter extends Page | 
| 10 | 10 |  { | 
| 11 | - public function InitializeContent () | |
| 11 | + public function InitializeContent() | |
| 12 | 12 |      { | 
| 13 | - $this->idPage = Author::getEntryIdByLetter ($this->idGet); | |
| 14 | - $this->entryArray = Author::getAuthorsByStartingLetter ($this->idGet); | |
| 15 | -        $this->title = str_format (localize ("splitByLetter.letter"), str_format (localize ("authorword", count ($this->entryArray)), count ($this->entryArray)), $this->idGet); | |
| 13 | + $this->idPage = Author::getEntryIdByLetter($this->idGet); | |
| 14 | + $this->entryArray = Author::getAuthorsByStartingLetter($this->idGet); | |
| 15 | +        $this->title = str_format(localize("splitByLetter.letter"), str_format(localize("authorword", count($this->entryArray)), count($this->entryArray)), $this->idGet); | |
| 16 | 16 | } | 
| 17 | 17 | } | 
| @@ -11,18 +11,18 @@ discard block | ||
| 11 | 11 | */ | 
| 12 | 12 | abstract class CustomColumnType extends Base | 
| 13 | 13 |  { | 
| 14 | - const ALL_CUSTOMS_ID = "cops:custom"; | |
| 14 | + const ALL_CUSTOMS_ID = "cops:custom"; | |
| 15 | 15 | |
| 16 | - const CUSTOM_TYPE_TEXT = "text"; // type 1 + 2 | |
| 17 | - const CUSTOM_TYPE_COMMENT = "comments"; // type 3 | |
| 18 | - const CUSTOM_TYPE_SERIES = "series"; // type 4 | |
| 16 | + const CUSTOM_TYPE_TEXT = "text"; // type 1 + 2 | |
| 17 | + const CUSTOM_TYPE_COMMENT = "comments"; // type 3 | |
| 18 | + const CUSTOM_TYPE_SERIES = "series"; // type 4 | |
| 19 | 19 | const CUSTOM_TYPE_ENUM = "enumeration"; // type 5 | 
| 20 | - const CUSTOM_TYPE_DATE = "datetime"; // type 6 | |
| 21 | - const CUSTOM_TYPE_FLOAT = "float"; // type 7 | |
| 22 | - const CUSTOM_TYPE_INT = "int"; // type 8 | |
| 23 | - const CUSTOM_TYPE_RATING = "rating"; // type 9 | |
| 24 | - const CUSTOM_TYPE_BOOL = "bool"; // type 10 | |
| 25 | - const CUSTOM_TYPE_COMPOSITE = "composite"; // type 11 + 12 | |
| 20 | + const CUSTOM_TYPE_DATE = "datetime"; // type 6 | |
| 21 | + const CUSTOM_TYPE_FLOAT = "float"; // type 7 | |
| 22 | + const CUSTOM_TYPE_INT = "int"; // type 8 | |
| 23 | + const CUSTOM_TYPE_RATING = "rating"; // type 9 | |
| 24 | + const CUSTOM_TYPE_BOOL = "bool"; // type 10 | |
| 25 | + const CUSTOM_TYPE_COMPOSITE = "composite"; // type 11 + 12 | |
| 26 | 26 | |
| 27 | 27 | /** @var array[integer]CustomColumnType */ | 
| 28 | 28 | private static $customColumnCacheID = array(); | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | $result->execute(array($this->customId)); | 
| 111 | 111 |          if ($post = $result->fetchObject()) { | 
| 112 | 112 | $json = json_decode($post->display); | 
| 113 | - return (isset($json->description) && !empty($json->description)) ? $json->description : NULL; | |
| 113 | + return (isset($json->description) && !empty($json->description))?$json->description:NULL; | |
| 114 | 114 | } | 
| 115 | 115 | return NULL; | 
| 116 | 116 | } | 
| @@ -21,44 +21,44 @@ | ||
| 21 | 21 | $this->name = $post->name; | 
| 22 | 22 | } | 
| 23 | 23 | |
| 24 | -    public function getUri () { | |
| 25 | - return "?page=".parent::PAGE_SERIE_DETAIL."&id=$this->id"; | |
| 24 | +    public function getUri() { | |
| 25 | + return "?page=" . parent::PAGE_SERIE_DETAIL . "&id=$this->id"; | |
| 26 | 26 | } | 
| 27 | 27 | |
| 28 | -    public function getEntryId () { | |
| 29 | - return self::ALL_SERIES_ID.":".$this->id; | |
| 28 | +    public function getEntryId() { | |
| 29 | + return self::ALL_SERIES_ID . ":" . $this->id; | |
| 30 | 30 | } | 
| 31 | 31 | |
| 32 | 32 |      public static function getCount() { | 
| 33 | 33 |          // str_format (localize("series.alphabetical", count(array)) | 
| 34 | -        return parent::getCountGeneric ("series", self::ALL_SERIES_ID, parent::PAGE_ALL_SERIES); | |
| 34 | +        return parent::getCountGeneric("series", self::ALL_SERIES_ID, parent::PAGE_ALL_SERIES); | |
| 35 | 35 | } | 
| 36 | 36 | |
| 37 | -    public static function getSerieByBookId ($bookId) { | |
| 38 | -        $result = parent::getDb ()->prepare('select  series.id as id, name | |
| 37 | +    public static function getSerieByBookId($bookId) { | |
| 38 | +        $result = parent::getDb()->prepare('select  series.id as id, name | |
| 39 | 39 | from books_series_link, series | 
| 40 | 40 | where series.id = series and book = ?'); | 
| 41 | - $result->execute (array ($bookId)); | |
| 42 | -        if ($post = $result->fetchObject ()) { | |
| 43 | - return new Serie ($post); | |
| 41 | + $result->execute(array($bookId)); | |
| 42 | +        if ($post = $result->fetchObject()) { | |
| 43 | + return new Serie($post); | |
| 44 | 44 | } | 
| 45 | 45 | return NULL; | 
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | -    public static function getSerieById ($serieId) { | |
| 49 | -        $result = parent::getDb ()->prepare('select id, name  from series where id = ?'); | |
| 50 | - $result->execute (array ($serieId)); | |
| 51 | -        if ($post = $result->fetchObject ()) { | |
| 52 | - return new Serie ($post); | |
| 48 | +    public static function getSerieById($serieId) { | |
| 49 | +        $result = parent::getDb()->prepare('select id, name  from series where id = ?'); | |
| 50 | + $result->execute(array($serieId)); | |
| 51 | +        if ($post = $result->fetchObject()) { | |
| 52 | + return new Serie($post); | |
| 53 | 53 | } | 
| 54 | 54 | return NULL; | 
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 |      public static function getAllSeries() { | 
| 58 | - return Base::getEntryArrayWithBookNumber (self::SQL_ALL_SERIES, self::SERIES_COLUMNS, array (), "Serie"); | |
| 58 | + return Base::getEntryArrayWithBookNumber(self::SQL_ALL_SERIES, self::SERIES_COLUMNS, array(), "Serie"); | |
| 59 | 59 | } | 
| 60 | 60 | |
| 61 | 61 |      public static function getAllSeriesByQuery($query) { | 
| 62 | -        return Base::getEntryArrayWithBookNumber (self::SQL_SERIES_FOR_SEARCH, self::SERIES_COLUMNS, array ('%' . $query . '%'), "Serie"); | |
| 62 | +        return Base::getEntryArrayWithBookNumber(self::SQL_SERIES_FOR_SEARCH, self::SERIES_COLUMNS, array('%' . $query . '%'), "Serie"); | |
| 63 | 63 | } | 
| 64 | 64 | } | 
| @@ -8,7 +8,7 @@ | ||
| 8 | 8 | |
| 9 | 9 | class PageAllSeries extends Page | 
| 10 | 10 |  { | 
| 11 | - public function InitializeContent () | |
| 11 | + public function InitializeContent() | |
| 12 | 12 |      { | 
| 13 | 13 |          $this->title = localize("series.title"); | 
| 14 | 14 | $this->entryArray = Serie::getAllSeries(); | 
| @@ -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 | } |