@@ -8,11 +8,11 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAllCustoms extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | - $customId = getURLParam ("custom", NULL); |
|
| 14 | - $this->title = CustomColumn::getAllTitle ($customId); |
|
| 13 | + $customId = getURLParam("custom", NULL); |
|
| 14 | + $this->title = CustomColumn::getAllTitle($customId); |
|
| 15 | 15 | $this->entryArray = CustomColumn::getAllCustoms($customId); |
| 16 | - $this->idPage = CustomColumn::getAllCustomsId ($customId); |
|
| 16 | + $this->idPage = CustomColumn::getAllCustomsId($customId); |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public function InitializeContent () |
| 12 | 12 | { |
| 13 | - $customId = getURLParam ("custom", NULL); |
|
| 13 | + $customId = getURLParam ("custom", null); |
|
| 14 | 14 | $this->title = CustomColumn::getAllTitle ($customId); |
| 15 | 15 | $this->entryArray = CustomColumn::getAllCustoms($customId); |
| 16 | 16 | $this->idPage = CustomColumn::getAllCustomsId ($customId); |
@@ -16,25 +16,30 @@ discard block |
||
| 16 | 16 | public $id; |
| 17 | 17 | public $name; |
| 18 | 18 | |
| 19 | - public function __construct($post) { |
|
| 19 | + public function __construct($post) |
|
| 20 | + { |
|
| 20 | 21 | $this->id = $post->id; |
| 21 | 22 | $this->name = $post->name; |
| 22 | 23 | } |
| 23 | 24 | |
| 24 | - public function getUri () { |
|
| 25 | + public function getUri () |
|
| 26 | + { |
|
| 25 | 27 | return "?page=".parent::PAGE_SERIE_DETAIL."&id=$this->id"; |
| 26 | 28 | } |
| 27 | 29 | |
| 28 | - public function getEntryId () { |
|
| 30 | + public function getEntryId () |
|
| 31 | + { |
|
| 29 | 32 | return self::ALL_SERIES_ID.":".$this->id; |
| 30 | 33 | } |
| 31 | 34 | |
| 32 | - public static function getCount() { |
|
| 35 | + public static function getCount() |
|
| 36 | + { |
|
| 33 | 37 | // str_format (localize("series.alphabetical", count(array)) |
| 34 | 38 | return parent::getCountGeneric ("series", self::ALL_SERIES_ID, parent::PAGE_ALL_SERIES); |
| 35 | 39 | } |
| 36 | 40 | |
| 37 | - public static function getSerieByBookId ($bookId) { |
|
| 41 | + public static function getSerieByBookId ($bookId) |
|
| 42 | + { |
|
| 38 | 43 | $result = parent::getDb ()->prepare('select series.id as id, name |
| 39 | 44 | from books_series_link, series |
| 40 | 45 | where series.id = series and book = ?'); |
@@ -45,7 +50,8 @@ discard block |
||
| 45 | 50 | return NULL; |
| 46 | 51 | } |
| 47 | 52 | |
| 48 | - public static function getSerieById ($serieId) { |
|
| 53 | + public static function getSerieById ($serieId) |
|
| 54 | + { |
|
| 49 | 55 | $result = parent::getDb ()->prepare('select id, name from series where id = ?'); |
| 50 | 56 | $result->execute (array ($serieId)); |
| 51 | 57 | if ($post = $result->fetchObject ()) { |
@@ -54,11 +60,13 @@ discard block |
||
| 54 | 60 | return NULL; |
| 55 | 61 | } |
| 56 | 62 | |
| 57 | - public static function getAllSeries() { |
|
| 63 | + public static function getAllSeries() |
|
| 64 | + { |
|
| 58 | 65 | return Base::getEntryArrayWithBookNumber (self::SQL_ALL_SERIES, self::SERIES_COLUMNS, array (), "Serie"); |
| 59 | 66 | } |
| 60 | 67 | |
| 61 | - public static function getAllSeriesByQuery($query) { |
|
| 68 | + public static function getAllSeriesByQuery($query) |
|
| 69 | + { |
|
| 62 | 70 | return Base::getEntryArrayWithBookNumber (self::SQL_SERIES_FOR_SEARCH, self::SERIES_COLUMNS, array ('%' . $query . '%'), "Serie"); |
| 63 | 71 | } |
| 64 | 72 | } |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageRatingDetail extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | - $rating = Rating::getRatingById ($this->idGet); |
|
| 14 | - $this->idPage = $rating->getEntryId (); |
|
| 15 | - $this->title =str_format (localize ("ratingword", $rating->name/2), $rating->name/2); |
|
| 16 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByRating ($this->idGet, $this->n); |
|
| 13 | + $rating = Rating::getRatingById($this->idGet); |
|
| 14 | + $this->idPage = $rating->getEntryId(); |
|
| 15 | + $this->title = str_format(localize("ratingword", $rating->name / 2), $rating->name / 2); |
|
| 16 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByRating($this->idGet, $this->n); |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -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 | } |
@@ -15,25 +15,30 @@ discard block |
||
| 15 | 15 | public $id; |
| 16 | 16 | public $name; |
| 17 | 17 | |
| 18 | - public function __construct($post) { |
|
| 18 | + public function __construct($post) |
|
| 19 | + { |
|
| 19 | 20 | $this->id = $post->id; |
| 20 | 21 | $this->name = $post->name; |
| 21 | 22 | } |
| 22 | 23 | |
| 23 | - public function getUri () { |
|
| 24 | + public function getUri () |
|
| 25 | + { |
|
| 24 | 26 | return "?page=".parent::PAGE_TAG_DETAIL."&id=$this->id"; |
| 25 | 27 | } |
| 26 | 28 | |
| 27 | - public function getEntryId () { |
|
| 29 | + public function getEntryId () |
|
| 30 | + { |
|
| 28 | 31 | return self::ALL_TAGS_ID.":".$this->id; |
| 29 | 32 | } |
| 30 | 33 | |
| 31 | - public static function getCount() { |
|
| 34 | + public static function getCount() |
|
| 35 | + { |
|
| 32 | 36 | // str_format (localize("tags.alphabetical", count(array)) |
| 33 | 37 | return parent::getCountGeneric ("tags", self::ALL_TAGS_ID, parent::PAGE_ALL_TAGS); |
| 34 | 38 | } |
| 35 | 39 | |
| 36 | - public static function getTagById ($tagId) { |
|
| 40 | + public static function getTagById ($tagId) |
|
| 41 | + { |
|
| 37 | 42 | $result = parent::getDb ()->prepare('select id, name from tags where id = ?'); |
| 38 | 43 | $result->execute (array ($tagId)); |
| 39 | 44 | if ($post = $result->fetchObject ()) { |
@@ -42,17 +47,18 @@ discard block |
||
| 42 | 47 | return NULL; |
| 43 | 48 | } |
| 44 | 49 | |
| 45 | - public static function getAllTags() { |
|
| 50 | + public static function getAllTags() |
|
| 51 | + { |
|
| 46 | 52 | return Base::getEntryArrayWithBookNumber (self::SQL_ALL_TAGS, self::TAG_COLUMNS, array (), "Tag"); |
| 47 | 53 | } |
| 48 | 54 | |
| 49 | - public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL) { |
|
| 55 | + public static function getAllTagsByQuery($query, $n, $database = NULL, $numberPerPage = NULL) |
|
| 56 | + { |
|
| 50 | 57 | $columns = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count"; |
| 51 | 58 | $sql = 'select {0} from tags where upper (tags.name) like ? {1} order by tags.name'; |
| 52 | 59 | list ($totalNumber, $result) = parent::executeQuery ($sql, $columns, "", array ('%' . $query . '%'), $n, $database, $numberPerPage); |
| 53 | 60 | $entryArray = array(); |
| 54 | - while ($post = $result->fetchObject ()) |
|
| 55 | - { |
|
| 61 | + while ($post = $result->fetchObject ()) { |
|
| 56 | 62 | $tag = new Tag ($post); |
| 57 | 63 | array_push ($entryArray, new Entry ($tag->name, $tag->getEntryId (), |
| 58 | 64 | str_format (localize("bookword", $post->count), $post->count), "text", |
@@ -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; |
@@ -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,8 +8,8 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAbout extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | - $this->title = localize ("about.title"); |
|
| 13 | + $this->title = localize("about.title"); |
|
| 14 | 14 | } |
| 15 | 15 | } |
@@ -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 | } |