@@ -22,55 +22,55 @@ discard block |
||
| 22 | 22 | public $totalNumber = -1; |
| 23 | 23 | public $entryArray = array(); |
| 24 | 24 | |
| 25 | - public static function getPage ($pageId, $id, $query, $n) |
|
| 25 | + public static function getPage($pageId, $id, $query, $n) |
|
| 26 | 26 | { |
| 27 | 27 | switch ($pageId) { |
| 28 | 28 | case Base::PAGE_ALL_AUTHORS : |
| 29 | - return new PageAllAuthors ($id, $query, $n); |
|
| 29 | + return new PageAllAuthors($id, $query, $n); |
|
| 30 | 30 | case Base::PAGE_AUTHORS_FIRST_LETTER : |
| 31 | - return new PageAllAuthorsLetter ($id, $query, $n); |
|
| 31 | + return new PageAllAuthorsLetter($id, $query, $n); |
|
| 32 | 32 | case Base::PAGE_AUTHOR_DETAIL : |
| 33 | - return new PageAuthorDetail ($id, $query, $n); |
|
| 33 | + return new PageAuthorDetail($id, $query, $n); |
|
| 34 | 34 | case Base::PAGE_ALL_TAGS : |
| 35 | - return new PageAllTags ($id, $query, $n); |
|
| 35 | + return new PageAllTags($id, $query, $n); |
|
| 36 | 36 | case Base::PAGE_TAG_DETAIL : |
| 37 | - return new PageTagDetail ($id, $query, $n); |
|
| 37 | + return new PageTagDetail($id, $query, $n); |
|
| 38 | 38 | case Base::PAGE_ALL_LANGUAGES : |
| 39 | - return new PageAllLanguages ($id, $query, $n); |
|
| 39 | + return new PageAllLanguages($id, $query, $n); |
|
| 40 | 40 | case Base::PAGE_LANGUAGE_DETAIL : |
| 41 | - return new PageLanguageDetail ($id, $query, $n); |
|
| 41 | + return new PageLanguageDetail($id, $query, $n); |
|
| 42 | 42 | case Base::PAGE_ALL_CUSTOMS : |
| 43 | - return new PageAllCustoms ($id, $query, $n); |
|
| 43 | + return new PageAllCustoms($id, $query, $n); |
|
| 44 | 44 | case Base::PAGE_CUSTOM_DETAIL : |
| 45 | - return new PageCustomDetail ($id, $query, $n); |
|
| 45 | + return new PageCustomDetail($id, $query, $n); |
|
| 46 | 46 | case Base::PAGE_ALL_RATINGS : |
| 47 | - return new PageAllRating ($id, $query, $n); |
|
| 47 | + return new PageAllRating($id, $query, $n); |
|
| 48 | 48 | case Base::PAGE_RATING_DETAIL : |
| 49 | - return new PageRatingDetail ($id, $query, $n); |
|
| 49 | + return new PageRatingDetail($id, $query, $n); |
|
| 50 | 50 | case Base::PAGE_ALL_SERIES : |
| 51 | - return new PageAllSeries ($id, $query, $n); |
|
| 51 | + return new PageAllSeries($id, $query, $n); |
|
| 52 | 52 | case Base::PAGE_ALL_BOOKS : |
| 53 | - return new PageAllBooks ($id, $query, $n); |
|
| 53 | + return new PageAllBooks($id, $query, $n); |
|
| 54 | 54 | case Base::PAGE_ALL_BOOKS_LETTER: |
| 55 | - return new PageAllBooksLetter ($id, $query, $n); |
|
| 55 | + return new PageAllBooksLetter($id, $query, $n); |
|
| 56 | 56 | case Base::PAGE_ALL_RECENT_BOOKS : |
| 57 | - return new PageRecentBooks ($id, $query, $n); |
|
| 57 | + return new PageRecentBooks($id, $query, $n); |
|
| 58 | 58 | case Base::PAGE_SERIE_DETAIL : |
| 59 | - return new PageSerieDetail ($id, $query, $n); |
|
| 59 | + return new PageSerieDetail($id, $query, $n); |
|
| 60 | 60 | case Base::PAGE_OPENSEARCH_QUERY : |
| 61 | - return new PageQueryResult ($id, $query, $n); |
|
| 61 | + return new PageQueryResult($id, $query, $n); |
|
| 62 | 62 | case Base::PAGE_BOOK_DETAIL : |
| 63 | - return new PageBookDetail ($id, $query, $n); |
|
| 63 | + return new PageBookDetail($id, $query, $n); |
|
| 64 | 64 | case Base::PAGE_ALL_PUBLISHERS: |
| 65 | - return new PageAllPublishers ($id, $query, $n); |
|
| 65 | + return new PageAllPublishers($id, $query, $n); |
|
| 66 | 66 | case Base::PAGE_PUBLISHER_DETAIL : |
| 67 | - return new PagePublisherDetail ($id, $query, $n); |
|
| 67 | + return new PagePublisherDetail($id, $query, $n); |
|
| 68 | 68 | case Base::PAGE_ABOUT : |
| 69 | - return new PageAbout ($id, $query, $n); |
|
| 69 | + return new PageAbout($id, $query, $n); |
|
| 70 | 70 | case Base::PAGE_CUSTOMIZE : |
| 71 | - return new PageCustomize ($id, $query, $n); |
|
| 71 | + return new PageCustomize($id, $query, $n); |
|
| 72 | 72 | default: |
| 73 | - $page = new Page ($id, $query, $n); |
|
| 73 | + $page = new Page($id, $query, $n); |
|
| 74 | 74 | $page->idPage = "cops:catalog"; |
| 75 | 75 | return $page; |
| 76 | 76 | } |
@@ -83,96 +83,96 @@ discard block |
||
| 83 | 83 | $this->query = $pquery; |
| 84 | 84 | $this->n = $pn; |
| 85 | 85 | $this->favicon = $config['cops_icon']; |
| 86 | - $this->authorName = empty($config['cops_author_name']) ? utf8_encode('Sébastien Lucas') : $config['cops_author_name']; |
|
| 87 | - $this->authorUri = empty($config['cops_author_uri']) ? 'http://blog.slucas.fr' : $config['cops_author_uri']; |
|
| 88 | - $this->authorEmail = empty($config['cops_author_email']) ? '[email protected]' : $config['cops_author_email']; |
|
| 86 | + $this->authorName = empty($config['cops_author_name'])?utf8_encode('Sébastien Lucas'):$config['cops_author_name']; |
|
| 87 | + $this->authorUri = empty($config['cops_author_uri'])?'http://blog.slucas.fr':$config['cops_author_uri']; |
|
| 88 | + $this->authorEmail = empty($config['cops_author_email'])?'[email protected]':$config['cops_author_email']; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - public function InitializeContent () |
|
| 91 | + public function InitializeContent() |
|
| 92 | 92 | { |
| 93 | 93 | global $config; |
| 94 | 94 | $this->title = $config['cops_title_default']; |
| 95 | 95 | $this->subtitle = $config['cops_subtitle_default']; |
| 96 | - if (Base::noDatabaseSelected ()) { |
|
| 96 | + if (Base::noDatabaseSelected()) { |
|
| 97 | 97 | $i = 0; |
| 98 | - foreach (Base::getDbNameList () as $key) { |
|
| 99 | - $nBooks = Book::getBookCount ($i); |
|
| 100 | - array_push ($this->entryArray, new Entry ($key, "cops:{$i}:catalog", |
|
| 101 | - str_format (localize ("bookword", $nBooks), $nBooks), "text", |
|
| 102 | - array ( new LinkNavigation ("?" . DB . "={$i}")), "", $nBooks)); |
|
| 98 | + foreach (Base::getDbNameList() as $key) { |
|
| 99 | + $nBooks = Book::getBookCount($i); |
|
| 100 | + array_push($this->entryArray, new Entry($key, "cops:{$i}:catalog", |
|
| 101 | + str_format(localize("bookword", $nBooks), $nBooks), "text", |
|
| 102 | + array(new LinkNavigation("?" . DB . "={$i}")), "", $nBooks)); |
|
| 103 | 103 | $i++; |
| 104 | - Base::clearDb (); |
|
| 104 | + Base::clearDb(); |
|
| 105 | 105 | } |
| 106 | 106 | } else { |
| 107 | - if (!in_array (PageQueryResult::SCOPE_AUTHOR, getCurrentOption ('ignored_categories'))) { |
|
| 108 | - array_push ($this->entryArray, Author::getCount()); |
|
| 107 | + if (!in_array(PageQueryResult::SCOPE_AUTHOR, getCurrentOption('ignored_categories'))) { |
|
| 108 | + array_push($this->entryArray, Author::getCount()); |
|
| 109 | 109 | } |
| 110 | - if (!in_array (PageQueryResult::SCOPE_SERIES, getCurrentOption ('ignored_categories'))) { |
|
| 110 | + if (!in_array(PageQueryResult::SCOPE_SERIES, getCurrentOption('ignored_categories'))) { |
|
| 111 | 111 | $series = Serie::getCount(); |
| 112 | - if (!is_null ($series)) array_push ($this->entryArray, $series); |
|
| 112 | + if (!is_null($series)) array_push($this->entryArray, $series); |
|
| 113 | 113 | } |
| 114 | - if (!in_array (PageQueryResult::SCOPE_PUBLISHER, getCurrentOption ('ignored_categories'))) { |
|
| 114 | + if (!in_array(PageQueryResult::SCOPE_PUBLISHER, getCurrentOption('ignored_categories'))) { |
|
| 115 | 115 | $publisher = Publisher::getCount(); |
| 116 | - if (!is_null ($publisher)) array_push ($this->entryArray, $publisher); |
|
| 116 | + if (!is_null($publisher)) array_push($this->entryArray, $publisher); |
|
| 117 | 117 | } |
| 118 | - if (!in_array (PageQueryResult::SCOPE_TAG, getCurrentOption ('ignored_categories'))) { |
|
| 118 | + if (!in_array(PageQueryResult::SCOPE_TAG, getCurrentOption('ignored_categories'))) { |
|
| 119 | 119 | $tags = Tag::getCount(); |
| 120 | - if (!is_null ($tags)) array_push ($this->entryArray, $tags); |
|
| 120 | + if (!is_null($tags)) array_push($this->entryArray, $tags); |
|
| 121 | 121 | } |
| 122 | - if (!in_array (PageQueryResult::SCOPE_RATING, getCurrentOption ('ignored_categories'))) { |
|
| 122 | + if (!in_array(PageQueryResult::SCOPE_RATING, getCurrentOption('ignored_categories'))) { |
|
| 123 | 123 | $rating = Rating::getCount(); |
| 124 | - if (!is_null ($rating)) array_push ($this->entryArray, $rating); |
|
| 124 | + if (!is_null($rating)) array_push($this->entryArray, $rating); |
|
| 125 | 125 | } |
| 126 | - if (!in_array ("language", getCurrentOption ('ignored_categories'))) { |
|
| 126 | + if (!in_array("language", getCurrentOption('ignored_categories'))) { |
|
| 127 | 127 | $languages = Language::getCount(); |
| 128 | - if (!is_null ($languages)) array_push ($this->entryArray, $languages); |
|
| 128 | + if (!is_null($languages)) array_push($this->entryArray, $languages); |
|
| 129 | 129 | } |
| 130 | 130 | foreach ($config['cops_calibre_custom_column'] as $lookup) { |
| 131 | - $customId = CustomColumn::getCustomId ($lookup); |
|
| 132 | - if (!is_null ($customId)) { |
|
| 133 | - array_push ($this->entryArray, CustomColumn::getCount($customId)); |
|
| 131 | + $customId = CustomColumn::getCustomId($lookup); |
|
| 132 | + if (!is_null($customId)) { |
|
| 133 | + array_push($this->entryArray, CustomColumn::getCount($customId)); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | - $this->entryArray = array_merge ($this->entryArray, Book::getCount()); |
|
| 136 | + $this->entryArray = array_merge($this->entryArray, Book::getCount()); |
|
| 137 | 137 | |
| 138 | - if (Base::isMultipleDatabaseEnabled ()) $this->title = Base::getDbName (); |
|
| 138 | + if (Base::isMultipleDatabaseEnabled()) $this->title = Base::getDbName(); |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - public function isPaginated () |
|
| 142 | + public function isPaginated() |
|
| 143 | 143 | { |
| 144 | - return (getCurrentOption ("max_item_per_page") != -1 && |
|
| 144 | + return (getCurrentOption("max_item_per_page") != -1 && |
|
| 145 | 145 | $this->totalNumber != -1 && |
| 146 | - $this->totalNumber > getCurrentOption ("max_item_per_page")); |
|
| 146 | + $this->totalNumber > getCurrentOption("max_item_per_page")); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - public function getNextLink () |
|
| 149 | + public function getNextLink() |
|
| 150 | 150 | { |
| 151 | - $currentUrl = preg_replace ("/\&n=.*?$/", "", "?" . getQueryString ()); |
|
| 152 | - if (($this->n) * getCurrentOption ("max_item_per_page") < $this->totalNumber) { |
|
| 153 | - return new LinkNavigation ($currentUrl . "&n=" . ($this->n + 1), "next", localize ("paging.next.alternate")); |
|
| 151 | + $currentUrl = preg_replace("/\&n=.*?$/", "", "?" . getQueryString()); |
|
| 152 | + if (($this->n) * getCurrentOption("max_item_per_page") < $this->totalNumber) { |
|
| 153 | + return new LinkNavigation($currentUrl . "&n=" . ($this->n + 1), "next", localize("paging.next.alternate")); |
|
| 154 | 154 | } |
| 155 | 155 | return NULL; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - public function getPrevLink () |
|
| 158 | + public function getPrevLink() |
|
| 159 | 159 | { |
| 160 | - $currentUrl = preg_replace ("/\&n=.*?$/", "", "?" . getQueryString ()); |
|
| 160 | + $currentUrl = preg_replace("/\&n=.*?$/", "", "?" . getQueryString()); |
|
| 161 | 161 | if ($this->n > 1) { |
| 162 | - return new LinkNavigation ($currentUrl . "&n=" . ($this->n - 1), "previous", localize ("paging.previous.alternate")); |
|
| 162 | + return new LinkNavigation($currentUrl . "&n=" . ($this->n - 1), "previous", localize("paging.previous.alternate")); |
|
| 163 | 163 | } |
| 164 | 164 | return NULL; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - public function getMaxPage () |
|
| 167 | + public function getMaxPage() |
|
| 168 | 168 | { |
| 169 | - return ceil ($this->totalNumber / getCurrentOption ("max_item_per_page")); |
|
| 169 | + return ceil($this->totalNumber / getCurrentOption("max_item_per_page")); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - public function containsBook () |
|
| 172 | + public function containsBook() |
|
| 173 | 173 | { |
| 174 | - if (count ($this->entryArray) == 0) return false; |
|
| 175 | - if (get_class ($this->entryArray [0]) == "EntryBook") return true; |
|
| 174 | + if (count($this->entryArray) == 0) return false; |
|
| 175 | + if (get_class($this->entryArray [0]) == "EntryBook") return true; |
|
| 176 | 176 | return false; |
| 177 | 177 | } |
| 178 | 178 | } |
@@ -76,7 +76,8 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - public function __construct($pid, $pquery, $pn) { |
|
| 79 | + public function __construct($pid, $pquery, $pn) |
|
| 80 | + { |
|
| 80 | 81 | global $config; |
| 81 | 82 | |
| 82 | 83 | $this->idGet = $pid; |
@@ -109,23 +110,33 @@ discard block |
||
| 109 | 110 | } |
| 110 | 111 | if (!in_array (PageQueryResult::SCOPE_SERIES, getCurrentOption ('ignored_categories'))) { |
| 111 | 112 | $series = Serie::getCount(); |
| 112 | - if (!is_null ($series)) array_push ($this->entryArray, $series); |
|
| 113 | + if (!is_null ($series)) { |
|
| 114 | + array_push ($this->entryArray, $series); |
|
| 115 | + } |
|
| 113 | 116 | } |
| 114 | 117 | if (!in_array (PageQueryResult::SCOPE_PUBLISHER, getCurrentOption ('ignored_categories'))) { |
| 115 | 118 | $publisher = Publisher::getCount(); |
| 116 | - if (!is_null ($publisher)) array_push ($this->entryArray, $publisher); |
|
| 119 | + if (!is_null ($publisher)) { |
|
| 120 | + array_push ($this->entryArray, $publisher); |
|
| 121 | + } |
|
| 117 | 122 | } |
| 118 | 123 | if (!in_array (PageQueryResult::SCOPE_TAG, getCurrentOption ('ignored_categories'))) { |
| 119 | 124 | $tags = Tag::getCount(); |
| 120 | - if (!is_null ($tags)) array_push ($this->entryArray, $tags); |
|
| 125 | + if (!is_null ($tags)) { |
|
| 126 | + array_push ($this->entryArray, $tags); |
|
| 127 | + } |
|
| 121 | 128 | } |
| 122 | 129 | if (!in_array (PageQueryResult::SCOPE_RATING, getCurrentOption ('ignored_categories'))) { |
| 123 | 130 | $rating = Rating::getCount(); |
| 124 | - if (!is_null ($rating)) array_push ($this->entryArray, $rating); |
|
| 131 | + if (!is_null ($rating)) { |
|
| 132 | + array_push ($this->entryArray, $rating); |
|
| 133 | + } |
|
| 125 | 134 | } |
| 126 | 135 | if (!in_array ("language", getCurrentOption ('ignored_categories'))) { |
| 127 | 136 | $languages = Language::getCount(); |
| 128 | - if (!is_null ($languages)) array_push ($this->entryArray, $languages); |
|
| 137 | + if (!is_null ($languages)) { |
|
| 138 | + array_push ($this->entryArray, $languages); |
|
| 139 | + } |
|
| 129 | 140 | } |
| 130 | 141 | foreach ($config['cops_calibre_custom_column'] as $lookup) { |
| 131 | 142 | $customId = CustomColumn::getCustomId ($lookup); |
@@ -135,7 +146,9 @@ discard block |
||
| 135 | 146 | } |
| 136 | 147 | $this->entryArray = array_merge ($this->entryArray, Book::getCount()); |
| 137 | 148 | |
| 138 | - if (Base::isMultipleDatabaseEnabled ()) $this->title = Base::getDbName (); |
|
| 149 | + if (Base::isMultipleDatabaseEnabled ()) { |
|
| 150 | + $this->title = Base::getDbName (); |
|
| 151 | + } |
|
| 139 | 152 | } |
| 140 | 153 | } |
| 141 | 154 | |
@@ -171,8 +184,12 @@ discard block |
||
| 171 | 184 | |
| 172 | 185 | public function containsBook () |
| 173 | 186 | { |
| 174 | - if (count ($this->entryArray) == 0) return false; |
|
| 175 | - if (get_class ($this->entryArray [0]) == "EntryBook") return true; |
|
| 187 | + if (count ($this->entryArray) == 0) { |
|
| 188 | + return false; |
|
| 189 | + } |
|
| 190 | + if (get_class ($this->entryArray [0]) == "EntryBook") { |
|
| 191 | + return true; |
|
| 192 | + } |
|
| 176 | 193 | return false; |
| 177 | 194 | } |
| 178 | 195 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ($post = $result->fetchObject ()) { |
| 61 | 61 | return $post->id; |
| 62 | 62 | } |
| 63 | - return NULL; |
|
| 63 | + return null; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | public static function getCount($customId) { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | if ($post = $result->fetchObject ()) { |
| 78 | 78 | return new CustomColumn ($post->id, $post->name, $customId); |
| 79 | 79 | } |
| 80 | - return NULL; |
|
| 80 | + return null; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | public static function getAllCustoms($customId) { |
@@ -8,15 +8,15 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAllBooksLetter extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByStartingLetter ($this->idGet, $this->n); |
|
| 14 | - $this->idPage = Book::getEntryIdByLetter ($this->idGet); |
|
| 13 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByStartingLetter($this->idGet, $this->n); |
|
| 14 | + $this->idPage = Book::getEntryIdByLetter($this->idGet); |
|
| 15 | 15 | |
| 16 | 16 | $count = $this->totalNumber; |
| 17 | 17 | if ($count == -1) |
| 18 | - $count = count ($this->entryArray); |
|
| 18 | + $count = count($this->entryArray); |
|
| 19 | 19 | |
| 20 | - $this->title = str_format (localize ("splitByLetter.letter"), str_format (localize ("bookword", $count), $count), $this->idGet); |
|
| 20 | + $this->title = str_format(localize("splitByLetter.letter"), str_format(localize("bookword", $count), $count), $this->idGet); |
|
| 21 | 21 | } |
| 22 | 22 | } |
@@ -14,8 +14,9 @@ |
||
| 14 | 14 | $this->idPage = Book::getEntryIdByLetter ($this->idGet); |
| 15 | 15 | |
| 16 | 16 | $count = $this->totalNumber; |
| 17 | - if ($count == -1) |
|
| 18 | - $count = count ($this->entryArray); |
|
| 17 | + if ($count == -1) { |
|
| 18 | + $count = count ($this->entryArray); |
|
| 19 | + } |
|
| 19 | 20 | |
| 20 | 21 | $this->title = str_format (localize ("splitByLetter.letter"), str_format (localize ("bookword", $count), $count), $this->idGet); |
| 21 | 22 | } |
@@ -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 | } |
@@ -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,23 +11,23 @@ |
||
| 11 | 11 | public $book; |
| 12 | 12 | |
| 13 | 13 | public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook) { |
| 14 | - parent::__construct ($ptitle, $pid, $pcontent, $pcontentType, $plinkArray); |
|
| 14 | + parent::__construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray); |
|
| 15 | 15 | $this->book = $pbook; |
| 16 | 16 | $this->localUpdated = $pbook->timestamp; |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - public function getCoverThumbnail () { |
|
| 19 | + public function getCoverThumbnail() { |
|
| 20 | 20 | foreach ($this->linkArray as $link) { |
| 21 | 21 | if ($link->rel == Link::OPDS_THUMBNAIL_TYPE) |
| 22 | - return $link->hrefXhtml (); |
|
| 22 | + return $link->hrefXhtml(); |
|
| 23 | 23 | } |
| 24 | 24 | return null; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function getCover () { |
|
| 27 | + public function getCover() { |
|
| 28 | 28 | foreach ($this->linkArray as $link) { |
| 29 | 29 | if ($link->rel == Link::OPDS_IMAGE_TYPE) |
| 30 | - return $link->hrefXhtml (); |
|
| 30 | + return $link->hrefXhtml(); |
|
| 31 | 31 | } |
| 32 | 32 | return null; |
| 33 | 33 | } |
@@ -10,24 +10,29 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public $book; |
| 12 | 12 | |
| 13 | - public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook) { |
|
| 13 | + public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pbook) |
|
| 14 | + { |
|
| 14 | 15 | parent::__construct ($ptitle, $pid, $pcontent, $pcontentType, $plinkArray); |
| 15 | 16 | $this->book = $pbook; |
| 16 | 17 | $this->localUpdated = $pbook->timestamp; |
| 17 | 18 | } |
| 18 | 19 | |
| 19 | - public function getCoverThumbnail () { |
|
| 20 | + public function getCoverThumbnail () |
|
| 21 | + { |
|
| 20 | 22 | foreach ($this->linkArray as $link) { |
| 21 | - if ($link->rel == Link::OPDS_THUMBNAIL_TYPE) |
|
| 22 | - return $link->hrefXhtml (); |
|
| 23 | + if ($link->rel == Link::OPDS_THUMBNAIL_TYPE) { |
|
| 24 | + return $link->hrefXhtml (); |
|
| 25 | + } |
|
| 23 | 26 | } |
| 24 | 27 | return null; |
| 25 | 28 | } |
| 26 | 29 | |
| 27 | - public function getCover () { |
|
| 30 | + public function getCover () |
|
| 31 | + { |
|
| 28 | 32 | foreach ($this->linkArray as $link) { |
| 29 | - if ($link->rel == Link::OPDS_IMAGE_TYPE) |
|
| 30 | - return $link->hrefXhtml (); |
|
| 33 | + if ($link->rel == Link::OPDS_IMAGE_TYPE) { |
|
| 34 | + return $link->hrefXhtml (); |
|
| 35 | + } |
|
| 31 | 36 | } |
| 32 | 37 | return null; |
| 33 | 38 | } |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageSerieDetail extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | - $serie = Serie::getSerieById ($this->idGet); |
|
| 13 | + $serie = Serie::getSerieById($this->idGet); |
|
| 14 | 14 | $this->title = $serie->name; |
| 15 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksBySeries ($this->idGet, $this->n); |
|
| 16 | - $this->idPage = $serie->getEntryId (); |
|
| 15 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksBySeries($this->idGet, $this->n); |
|
| 16 | + $this->idPage = $serie->getEntryId(); |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -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 | } |
@@ -31,21 +31,21 @@ discard block |
||
| 31 | 31 | Publisher::ALL_PUBLISHERS_ID => 'images/publisher.png' |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - public function getUpdatedTime () { |
|
| 35 | - if (!is_null ($this->localUpdated)) { |
|
| 36 | - return date (DATE_ATOM, $this->localUpdated); |
|
| 34 | + public function getUpdatedTime() { |
|
| 35 | + if (!is_null($this->localUpdated)) { |
|
| 36 | + return date(DATE_ATOM, $this->localUpdated); |
|
| 37 | 37 | } |
| 38 | - if (is_null (self::$updated)) { |
|
| 38 | + if (is_null(self::$updated)) { |
|
| 39 | 39 | self::$updated = time(); |
| 40 | 40 | } |
| 41 | - return date (DATE_ATOM, self::$updated); |
|
| 41 | + return date(DATE_ATOM, self::$updated); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function getNavLink () { |
|
| 44 | + public function getNavLink() { |
|
| 45 | 45 | foreach ($this->linkArray as $link) { |
| 46 | 46 | if ($link->type != Link::OPDS_NAVIGATION_TYPE) { continue; } |
| 47 | 47 | |
| 48 | - return $link->hrefXhtml (); |
|
| 48 | + return $link->hrefXhtml(); |
|
| 49 | 49 | } |
| 50 | 50 | return "#"; |
| 51 | 51 | } |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | foreach (self::$icons as $reg => $image) |
| 66 | 66 | { |
| 67 | - if (preg_match ("/" . $reg . "/", $pid)) { |
|
| 68 | - array_push ($this->linkArray, new Link (getUrlWithVersion ($image), "image/png", Link::OPDS_THUMBNAIL_TYPE)); |
|
| 67 | + if (preg_match("/" . $reg . "/", $pid)) { |
|
| 68 | + array_push($this->linkArray, new Link(getUrlWithVersion($image), "image/png", Link::OPDS_THUMBNAIL_TYPE)); |
|
| 69 | 69 | break; |
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if (!is_null (GetUrlParam (DB))) $this->id = str_replace ("cops:", "cops:" . GetUrlParam (DB) . ":", $this->id); |
|
| 74 | + if (!is_null(GetUrlParam(DB))) $this->id = str_replace("cops:", "cops:" . GetUrlParam(DB) . ":", $this->id); |
|
| 75 | 75 | } |
| 76 | 76 | } |
@@ -31,7 +31,8 @@ discard block |
||
| 31 | 31 | Publisher::ALL_PUBLISHERS_ID => 'images/publisher.png' |
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | - public function getUpdatedTime () { |
|
| 34 | + public function getUpdatedTime () |
|
| 35 | + { |
|
| 35 | 36 | if (!is_null ($this->localUpdated)) { |
| 36 | 37 | return date (DATE_ATOM, $this->localUpdated); |
| 37 | 38 | } |
@@ -41,7 +42,8 @@ discard block |
||
| 41 | 42 | return date (DATE_ATOM, self::$updated); |
| 42 | 43 | } |
| 43 | 44 | |
| 44 | - public function getNavLink () { |
|
| 45 | + public function getNavLink () |
|
| 46 | + { |
|
| 45 | 47 | foreach ($this->linkArray as $link) { |
| 46 | 48 | if ($link->type != Link::OPDS_NAVIGATION_TYPE) { continue; } |
| 47 | 49 | |
@@ -50,7 +52,8 @@ discard block |
||
| 50 | 52 | return "#"; |
| 51 | 53 | } |
| 52 | 54 | |
| 53 | - public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pclass = "", $pcount = 0) { |
|
| 55 | + public function __construct($ptitle, $pid, $pcontent, $pcontentType, $plinkArray, $pclass = "", $pcount = 0) |
|
| 56 | + { |
|
| 54 | 57 | global $config; |
| 55 | 58 | $this->title = $ptitle; |
| 56 | 59 | $this->id = $pid; |
@@ -60,10 +63,8 @@ discard block |
||
| 60 | 63 | $this->className = $pclass; |
| 61 | 64 | $this->numberOfElement = $pcount; |
| 62 | 65 | |
| 63 | - if ($config['cops_show_icons'] == 1) |
|
| 64 | - { |
|
| 65 | - foreach (self::$icons as $reg => $image) |
|
| 66 | - { |
|
| 66 | + if ($config['cops_show_icons'] == 1) { |
|
| 67 | + foreach (self::$icons as $reg => $image) { |
|
| 67 | 68 | if (preg_match ("/" . $reg . "/", $pid)) { |
| 68 | 69 | array_push ($this->linkArray, new Link (getUrlWithVersion ($image), "image/png", Link::OPDS_THUMBNAIL_TYPE)); |
| 69 | 70 | break; |
@@ -71,6 +72,8 @@ discard block |
||
| 71 | 72 | } |
| 72 | 73 | } |
| 73 | 74 | |
| 74 | - if (!is_null (GetUrlParam (DB))) $this->id = str_replace ("cops:", "cops:" . GetUrlParam (DB) . ":", $this->id); |
|
| 75 | + if (!is_null (GetUrlParam (DB))) { |
|
| 76 | + $this->id = str_replace ("cops:", "cops:" . GetUrlParam (DB) . ":", $this->id); |
|
| 77 | + } |
|
| 75 | 78 | } |
| 76 | 79 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public $linkArray; |
| 17 | 17 | public $localUpdated; |
| 18 | 18 | public $className; |
| 19 | - private static $updated = NULL; |
|
| 19 | + private static $updated = null; |
|
| 20 | 20 | |
| 21 | 21 | public static $icons = array( |
| 22 | 22 | Author::ALL_AUTHORS_ID => 'images/author.png', |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $this->activeFacet = $pactiveFacet; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - public function hrefXhtml () { |
|
| 33 | + public function hrefXhtml() { |
|
| 34 | 34 | return $this->href; |
| 35 | 35 | } |
| 36 | 36 | |
@@ -21,7 +21,8 @@ discard block |
||
| 21 | 21 | public $facetGroup; |
| 22 | 22 | public $activeFacet; |
| 23 | 23 | |
| 24 | - public function __construct($phref, $ptype, $prel = NULL, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) { |
|
| 24 | + public function __construct($phref, $ptype, $prel = NULL, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) |
|
| 25 | + { |
|
| 25 | 26 | $this->href = $phref; |
| 26 | 27 | $this->type = $ptype; |
| 27 | 28 | $this->rel = $prel; |
@@ -30,11 +31,13 @@ discard block |
||
| 30 | 31 | $this->activeFacet = $pactiveFacet; |
| 31 | 32 | } |
| 32 | 33 | |
| 33 | - public function hrefXhtml () { |
|
| 34 | + public function hrefXhtml () |
|
| 35 | + { |
|
| 34 | 36 | return $this->href; |
| 35 | 37 | } |
| 36 | 38 | |
| 37 | - public function getScriptName() { |
|
| 39 | + public function getScriptName() |
|
| 40 | + { |
|
| 38 | 41 | $parts = explode('/', $_SERVER["SCRIPT_NAME"]); |
| 39 | 42 | return $parts[count($parts) - 1]; |
| 40 | 43 | } |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | public $facetGroup; |
| 22 | 22 | public $activeFacet; |
| 23 | 23 | |
| 24 | - public function __construct($phref, $ptype, $prel = NULL, $ptitle = NULL, $pfacetGroup = NULL, $pactiveFacet = FALSE) { |
|
| 24 | + public function __construct($phref, $ptype, $prel = null, $ptitle = null, $pfacetGroup = null, $pactiveFacet = false) { |
|
| 25 | 25 | $this->href = $phref; |
| 26 | 26 | $this->type = $ptype; |
| 27 | 27 | $this->rel = $prel; |