@@ -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 | } |
@@ -25,69 +25,69 @@ |
||
25 | 25 | $this->sort = $post->sort; |
26 | 26 | } |
27 | 27 | |
28 | - public function getUri () { |
|
29 | - return "?page=".parent::PAGE_AUTHOR_DETAIL."&id=$this->id"; |
|
28 | + public function getUri() { |
|
29 | + return "?page=" . parent::PAGE_AUTHOR_DETAIL . "&id=$this->id"; |
|
30 | 30 | } |
31 | 31 | |
32 | - public function getEntryId () { |
|
33 | - return self::ALL_AUTHORS_ID.":".$this->id; |
|
32 | + public function getEntryId() { |
|
33 | + return self::ALL_AUTHORS_ID . ":" . $this->id; |
|
34 | 34 | } |
35 | 35 | |
36 | - public static function getEntryIdByLetter ($startingLetter) { |
|
37 | - return self::ALL_AUTHORS_ID.":letter:".$startingLetter; |
|
36 | + public static function getEntryIdByLetter($startingLetter) { |
|
37 | + return self::ALL_AUTHORS_ID . ":letter:" . $startingLetter; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public static function getCount() { |
41 | 41 | // str_format (localize("authors.alphabetical", count(array)) |
42 | - return parent::getCountGeneric ("authors", self::ALL_AUTHORS_ID, parent::PAGE_ALL_AUTHORS); |
|
42 | + return parent::getCountGeneric("authors", self::ALL_AUTHORS_ID, parent::PAGE_ALL_AUTHORS); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public static function getAllAuthorsByFirstLetter() { |
46 | - list (, $result) = parent::executeQuery ("select {0} |
|
46 | + list (, $result) = parent::executeQuery("select {0} |
|
47 | 47 | from authors |
48 | 48 | group by substr (upper (sort), 1, 1) |
49 | -order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array (), -1); |
|
49 | +order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array(), -1); |
|
50 | 50 | $entryArray = array(); |
51 | - while ($post = $result->fetchObject ()) |
|
51 | + while ($post = $result->fetchObject()) |
|
52 | 52 | { |
53 | - array_push ($entryArray, new Entry ($post->title, Author::getEntryIdByLetter ($post->title), |
|
54 | - str_format (localize("authorword", $post->count), $post->count), "text", |
|
55 | - array ( new LinkNavigation ("?page=".parent::PAGE_AUTHORS_FIRST_LETTER."&id=". rawurlencode ($post->title))), "", $post->count)); |
|
53 | + array_push($entryArray, new Entry($post->title, Author::getEntryIdByLetter($post->title), |
|
54 | + str_format(localize("authorword", $post->count), $post->count), "text", |
|
55 | + array(new LinkNavigation("?page=" . parent::PAGE_AUTHORS_FIRST_LETTER . "&id=" . rawurlencode($post->title))), "", $post->count)); |
|
56 | 56 | } |
57 | 57 | return $entryArray; |
58 | 58 | } |
59 | 59 | |
60 | 60 | public static function getAuthorsByStartingLetter($letter) { |
61 | - return self::getEntryArray (self::SQL_AUTHORS_BY_FIRST_LETTER, array ($letter . "%")); |
|
61 | + return self::getEntryArray(self::SQL_AUTHORS_BY_FIRST_LETTER, array($letter . "%")); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | public static function getAuthorsForSearch($query) { |
65 | - return self::getEntryArray (self::SQL_AUTHORS_FOR_SEARCH, array ($query . "%", $query . "%")); |
|
65 | + return self::getEntryArray(self::SQL_AUTHORS_FOR_SEARCH, array($query . "%", $query . "%")); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | public static function getAllAuthors() { |
69 | - return self::getEntryArray (self::SQL_ALL_AUTHORS, array ()); |
|
69 | + return self::getEntryArray(self::SQL_ALL_AUTHORS, array()); |
|
70 | 70 | } |
71 | 71 | |
72 | - public static function getEntryArray ($query, $params) { |
|
73 | - return Base::getEntryArrayWithBookNumber ($query, self::AUTHOR_COLUMNS, $params, "Author"); |
|
72 | + public static function getEntryArray($query, $params) { |
|
73 | + return Base::getEntryArrayWithBookNumber($query, self::AUTHOR_COLUMNS, $params, "Author"); |
|
74 | 74 | } |
75 | 75 | |
76 | - public static function getAuthorById ($authorId) { |
|
77 | - $result = parent::getDb ()->prepare('select ' . self::AUTHOR_COLUMNS . ' from authors where id = ?'); |
|
78 | - $result->execute (array ($authorId)); |
|
79 | - $post = $result->fetchObject (); |
|
80 | - return new Author ($post); |
|
76 | + public static function getAuthorById($authorId) { |
|
77 | + $result = parent::getDb()->prepare('select ' . self::AUTHOR_COLUMNS . ' from authors where id = ?'); |
|
78 | + $result->execute(array($authorId)); |
|
79 | + $post = $result->fetchObject(); |
|
80 | + return new Author($post); |
|
81 | 81 | } |
82 | 82 | |
83 | - public static function getAuthorByBookId ($bookId) { |
|
84 | - $result = parent::getDb ()->prepare('select authors.id as id, authors.name as name, authors.sort as sort from authors, books_authors_link |
|
83 | + public static function getAuthorByBookId($bookId) { |
|
84 | + $result = parent::getDb()->prepare('select authors.id as id, authors.name as name, authors.sort as sort from authors, books_authors_link |
|
85 | 85 | where author = authors.id |
86 | 86 | and book = ?'); |
87 | - $result->execute (array ($bookId)); |
|
88 | - $authorArray = array (); |
|
89 | - while ($post = $result->fetchObject ()) { |
|
90 | - array_push ($authorArray, new Author ($post)); |
|
87 | + $result->execute(array($bookId)); |
|
88 | + $authorArray = array(); |
|
89 | + while ($post = $result->fetchObject()) { |
|
90 | + array_push($authorArray, new Author($post)); |
|
91 | 91 | } |
92 | 92 | return $authorArray; |
93 | 93 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | const ALL_RATING_ID = "cops:rating"; |
12 | 12 | |
13 | 13 | const RATING_COLUMNS = "ratings.id as id, ratings.rating as rating, count(*) as count"; |
14 | - const SQL_ALL_RATINGS ="select {0} from ratings, books_ratings_link where books_ratings_link.rating = ratings.id group by ratings.id order by ratings.rating"; |
|
14 | + const SQL_ALL_RATINGS = "select {0} from ratings, books_ratings_link where books_ratings_link.rating = ratings.id group by ratings.id order by ratings.rating"; |
|
15 | 15 | public $id; |
16 | 16 | public $name; |
17 | 17 | |
@@ -20,41 +20,41 @@ discard block |
||
20 | 20 | $this->name = $pname; |
21 | 21 | } |
22 | 22 | |
23 | - public function getUri () { |
|
24 | - return "?page=".parent::PAGE_RATING_DETAIL."&id=$this->id"; |
|
23 | + public function getUri() { |
|
24 | + return "?page=" . parent::PAGE_RATING_DETAIL . "&id=$this->id"; |
|
25 | 25 | } |
26 | 26 | |
27 | - public function getEntryId () { |
|
28 | - return self::ALL_RATING_ID.":".$this->id; |
|
27 | + public function getEntryId() { |
|
28 | + return self::ALL_RATING_ID . ":" . $this->id; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public static function getCount() { |
32 | 32 | // str_format (localize("ratings", count(array)) |
33 | - return parent::getCountGeneric ("ratings", self::ALL_RATING_ID, parent::PAGE_ALL_RATINGS, "ratings"); |
|
33 | + return parent::getCountGeneric("ratings", self::ALL_RATING_ID, parent::PAGE_ALL_RATINGS, "ratings"); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public static function getAllRatings() { |
37 | - return self::getEntryArray (self::SQL_ALL_RATINGS, array ()); |
|
37 | + return self::getEntryArray(self::SQL_ALL_RATINGS, array()); |
|
38 | 38 | } |
39 | 39 | |
40 | - public static function getEntryArray ($query, $params) { |
|
41 | - list (, $result) = parent::executeQuery ($query, self::RATING_COLUMNS, "", $params, -1); |
|
40 | + public static function getEntryArray($query, $params) { |
|
41 | + list (, $result) = parent::executeQuery($query, self::RATING_COLUMNS, "", $params, -1); |
|
42 | 42 | $entryArray = array(); |
43 | - while ($post = $result->fetchObject ()) |
|
43 | + while ($post = $result->fetchObject()) |
|
44 | 44 | { |
45 | - $ratingObj = new Rating ($post->id, $post->rating); |
|
46 | - $rating=$post->rating/2; |
|
47 | - $rating = str_format (localize("ratingword", $rating), $rating); |
|
48 | - array_push ($entryArray, new Entry ($rating, $ratingObj->getEntryId (), |
|
49 | - str_format (localize("bookword", $post->count), $post->count), "text", |
|
50 | - array ( new LinkNavigation ($ratingObj->getUri ())), "", $post->count)); |
|
45 | + $ratingObj = new Rating($post->id, $post->rating); |
|
46 | + $rating = $post->rating / 2; |
|
47 | + $rating = str_format(localize("ratingword", $rating), $rating); |
|
48 | + array_push($entryArray, new Entry($rating, $ratingObj->getEntryId(), |
|
49 | + str_format(localize("bookword", $post->count), $post->count), "text", |
|
50 | + array(new LinkNavigation($ratingObj->getUri())), "", $post->count)); |
|
51 | 51 | } |
52 | 52 | return $entryArray; |
53 | 53 | } |
54 | 54 | |
55 | - public static function getRatingById ($ratingId) { |
|
56 | - $result = parent::getDb ()->prepare('select rating from ratings where id = ?'); |
|
57 | - $result->execute (array ($ratingId)); |
|
58 | - return new Rating ($ratingId, $result->fetchColumn ()); |
|
55 | + public static function getRatingById($ratingId) { |
|
56 | + $result = parent::getDb()->prepare('select rating from ratings where id = ?'); |
|
57 | + $result->execute(array($ratingId)); |
|
58 | + return new Rating($ratingId, $result->fetchColumn()); |
|
59 | 59 | } |
60 | 60 | } |
@@ -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 | } |
@@ -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(); |
@@ -8,11 +8,11 @@ |
||
8 | 8 | |
9 | 9 | class PageTagDetail extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $tag = Tag::getTagById ($this->idGet); |
|
14 | - $this->idPage = $tag->getEntryId (); |
|
13 | + $tag = Tag::getTagById($this->idGet); |
|
14 | + $this->idPage = $tag->getEntryId(); |
|
15 | 15 | $this->title = $tag->name; |
16 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByTag ($this->idGet, $this->n); |
|
16 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByTag($this->idGet, $this->n); |
|
17 | 17 | } |
18 | 18 | } |
@@ -8,11 +8,11 @@ |
||
8 | 8 | |
9 | 9 | class PageLanguageDetail extends Page |
10 | 10 | { |
11 | - public function InitializeContent () |
|
11 | + public function InitializeContent() |
|
12 | 12 | { |
13 | - $language = Language::getLanguageById ($this->idGet); |
|
14 | - $this->idPage = $language->getEntryId (); |
|
13 | + $language = Language::getLanguageById($this->idGet); |
|
14 | + $this->idPage = $language->getEntryId(); |
|
15 | 15 | $this->title = $language->lang_code; |
16 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByLanguage ($this->idGet, $this->n); |
|
16 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByLanguage($this->idGet, $this->n); |
|
17 | 17 | } |
18 | 18 | } |