@@ -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 | |
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAllAuthors extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | 13 | $this->title = localize("authors.title"); |
| 14 | - if (getCurrentOption ("author_split_first_letter") == 1) { |
|
| 14 | + if (getCurrentOption("author_split_first_letter") == 1) { |
|
| 15 | 15 | $this->entryArray = Author::getAllAuthorsByFirstLetter(); |
| 16 | 16 | } |
| 17 | 17 | else { |
@@ -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 | } |
@@ -8,11 +8,11 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAuthorDetail extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | - $author = Author::getAuthorById ($this->idGet); |
|
| 14 | - $this->idPage = $author->getEntryId (); |
|
| 13 | + $author = Author::getAuthorById($this->idGet); |
|
| 14 | + $this->idPage = $author->getEntryId(); |
|
| 15 | 15 | $this->title = $author->name; |
| 16 | - list ($this->entryArray, $this->totalNumber) = Book::getBooksByAuthor ($this->idGet, $this->n); |
|
| 16 | + list ($this->entryArray, $this->totalNumber) = Book::getBooksByAuthor($this->idGet, $this->n); |
|
| 17 | 17 | } |
| 18 | 18 | } |
@@ -10,135 +10,135 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class JSONRenderer |
| 12 | 12 | { |
| 13 | - public static function getBookContentArray ($book) { |
|
| 13 | + public static function getBookContentArray($book) { |
|
| 14 | 14 | global $config; |
| 15 | 15 | $i = 0; |
| 16 | - $preferedData = array (); |
|
| 16 | + $preferedData = array(); |
|
| 17 | 17 | foreach ($config['cops_prefered_format'] as $format) |
| 18 | 18 | { |
| 19 | 19 | if ($i == 2) { break; } |
| 20 | - if ($data = $book->getDataFormat ($format)) { |
|
| 20 | + if ($data = $book->getDataFormat($format)) { |
|
| 21 | 21 | $i++; |
| 22 | - array_push ($preferedData, array ("url" => $data->getHtmlLink (), "name" => $format)); |
|
| 22 | + array_push($preferedData, array("url" => $data->getHtmlLink(), "name" => $format)); |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | $publisher = $book->getPublisher(); |
| 27 | - if (is_null ($publisher)) { |
|
| 27 | + if (is_null($publisher)) { |
|
| 28 | 28 | $pn = ""; |
| 29 | 29 | $pu = ""; |
| 30 | 30 | } else { |
| 31 | 31 | $pn = $publisher->name; |
| 32 | - $link = new LinkNavigation ($publisher->getUri ()); |
|
| 33 | - $pu = $link->hrefXhtml (); |
|
| 32 | + $link = new LinkNavigation($publisher->getUri()); |
|
| 33 | + $pu = $link->hrefXhtml(); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - $serie = $book->getSerie (); |
|
| 37 | - if (is_null ($serie)) { |
|
| 36 | + $serie = $book->getSerie(); |
|
| 37 | + if (is_null($serie)) { |
|
| 38 | 38 | $sn = ""; |
| 39 | 39 | $scn = ""; |
| 40 | 40 | $su = ""; |
| 41 | 41 | } else { |
| 42 | 42 | $sn = $serie->name; |
| 43 | - $scn = str_format (localize ("content.series.data"), $book->seriesIndex, $serie->name); |
|
| 44 | - $link = new LinkNavigation ($serie->getUri ()); |
|
| 45 | - $su = $link->hrefXhtml (); |
|
| 43 | + $scn = str_format(localize("content.series.data"), $book->seriesIndex, $serie->name); |
|
| 44 | + $link = new LinkNavigation($serie->getUri()); |
|
| 45 | + $su = $link->hrefXhtml(); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - return array ("id" => $book->id, |
|
| 48 | + return array("id" => $book->id, |
|
| 49 | 49 | "hasCover" => $book->hasCover, |
| 50 | 50 | "preferedData" => $preferedData, |
| 51 | - "rating" => $book->getRating (), |
|
| 51 | + "rating" => $book->getRating(), |
|
| 52 | 52 | "publisherName" => $pn, |
| 53 | 53 | "publisherurl" => $pu, |
| 54 | - "pubDate" => $book->getPubDate (), |
|
| 55 | - "languagesName" => $book->getLanguages (), |
|
| 56 | - "authorsName" => $book->getAuthorsName (), |
|
| 57 | - "tagsName" => $book->getTagsName (), |
|
| 54 | + "pubDate" => $book->getPubDate(), |
|
| 55 | + "languagesName" => $book->getLanguages(), |
|
| 56 | + "authorsName" => $book->getAuthorsName(), |
|
| 57 | + "tagsName" => $book->getTagsName(), |
|
| 58 | 58 | "seriesName" => $sn, |
| 59 | 59 | "seriesIndex" => $book->seriesIndex, |
| 60 | 60 | "seriesCompleteName" => $scn, |
| 61 | 61 | "seriesurl" => $su); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - public static function getFullBookContentArray ($book) { |
|
| 64 | + public static function getFullBookContentArray($book) { |
|
| 65 | 65 | global $config; |
| 66 | - $out = self::getBookContentArray ($book); |
|
| 67 | - $database = GetUrlParam (DB); |
|
| 68 | - |
|
| 69 | - $out ["coverurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml (); |
|
| 70 | - $out ["thumbnailurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml (); |
|
| 71 | - $out ["content"] = $book->getComment (false); |
|
| 72 | - $out ["datas"] = array (); |
|
| 73 | - $dataKindle = $book->GetMostInterestingDataToSendToKindle (); |
|
| 66 | + $out = self::getBookContentArray($book); |
|
| 67 | + $database = GetUrlParam(DB); |
|
| 68 | + |
|
| 69 | + $out ["coverurl"] = Data::getLink($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml(); |
|
| 70 | + $out ["thumbnailurl"] = Data::getLink($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml(); |
|
| 71 | + $out ["content"] = $book->getComment(false); |
|
| 72 | + $out ["datas"] = array(); |
|
| 73 | + $dataKindle = $book->GetMostInterestingDataToSendToKindle(); |
|
| 74 | 74 | foreach ($book->getDatas() as $data) { |
| 75 | - $tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0, "readerUrl" => ""); |
|
| 76 | - if (!empty ($config['cops_mail_configuration']) && !is_null ($dataKindle) && $data->id == $dataKindle->id) { |
|
| 75 | + $tab = array("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink(), "mail" => 0, "readerUrl" => ""); |
|
| 76 | + if (!empty ($config['cops_mail_configuration']) && !is_null($dataKindle) && $data->id == $dataKindle->id) { |
|
| 77 | 77 | $tab ["mail"] = 1; |
| 78 | 78 | } |
| 79 | 79 | if ($data->format == "EPUB") { |
| 80 | 80 | $tab ["readerUrl"] = "epubreader.php?data={$data->id}&db={$database}"; |
| 81 | 81 | } |
| 82 | - array_push ($out ["datas"], $tab); |
|
| 82 | + array_push($out ["datas"], $tab); |
|
| 83 | 83 | } |
| 84 | - $out ["authors"] = array (); |
|
| 85 | - foreach ($book->getAuthors () as $author) { |
|
| 86 | - $link = new LinkNavigation ($author->getUri ()); |
|
| 87 | - array_push ($out ["authors"], array ("name" => $author->name, "url" => $link->hrefXhtml ())); |
|
| 84 | + $out ["authors"] = array(); |
|
| 85 | + foreach ($book->getAuthors() as $author) { |
|
| 86 | + $link = new LinkNavigation($author->getUri()); |
|
| 87 | + array_push($out ["authors"], array("name" => $author->name, "url" => $link->hrefXhtml())); |
|
| 88 | 88 | } |
| 89 | - $out ["tags"] = array (); |
|
| 90 | - foreach ($book->getTags () as $tag) { |
|
| 91 | - $link = new LinkNavigation ($tag->getUri ()); |
|
| 92 | - array_push ($out ["tags"], array ("name" => $tag->name, "url" => $link->hrefXhtml ())); |
|
| 89 | + $out ["tags"] = array(); |
|
| 90 | + foreach ($book->getTags() as $tag) { |
|
| 91 | + $link = new LinkNavigation($tag->getUri()); |
|
| 92 | + array_push($out ["tags"], array("name" => $tag->name, "url" => $link->hrefXhtml())); |
|
| 93 | 93 | } |
| 94 | 94 | ; |
| 95 | 95 | return $out; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | - public static function getContentArray ($entry) { |
|
| 98 | + public static function getContentArray($entry) { |
|
| 99 | 99 | if ($entry instanceof EntryBook) { |
| 100 | - $out = array ( "title" => $entry->title); |
|
| 101 | - $out ["book"] = self::getBookContentArray ($entry->book); |
|
| 100 | + $out = array("title" => $entry->title); |
|
| 101 | + $out ["book"] = self::getBookContentArray($entry->book); |
|
| 102 | 102 | return $out; |
| 103 | 103 | } |
| 104 | - return array ( "title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink (), "number" => $entry->numberOfElement ); |
|
| 104 | + return array("title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink(), "number" => $entry->numberOfElement); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - public static function getContentArrayTypeahead ($page) { |
|
| 108 | - $out = array (); |
|
| 107 | + public static function getContentArrayTypeahead($page) { |
|
| 108 | + $out = array(); |
|
| 109 | 109 | foreach ($page->entryArray as $entry) { |
| 110 | 110 | if ($entry instanceof EntryBook) { |
| 111 | - array_push ($out, array ("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->book->getDetailUrl ())); |
|
| 111 | + array_push($out, array("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->book->getDetailUrl())); |
|
| 112 | 112 | } else { |
| 113 | - if (empty ($entry->className) xor Base::noDatabaseSelected ()) { |
|
| 114 | - array_push ($out, array ("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->getNavLink ())); |
|
| 113 | + if (empty ($entry->className) xor Base::noDatabaseSelected()) { |
|
| 114 | + array_push($out, array("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->getNavLink())); |
|
| 115 | 115 | } else { |
| 116 | - array_push ($out, array ("class" => $entry->className, "title" => $entry->content, "navlink" => $entry->getNavLink ())); |
|
| 116 | + array_push($out, array("class" => $entry->className, "title" => $entry->content, "navlink" => $entry->getNavLink())); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | return $out; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - public static function addCompleteArray ($in) { |
|
| 123 | + public static function addCompleteArray($in) { |
|
| 124 | 124 | global $config; |
| 125 | 125 | $out = $in; |
| 126 | 126 | |
| 127 | - $out ["c"] = array ("version" => VERSION, "i18n" => array ( |
|
| 127 | + $out ["c"] = array("version" => VERSION, "i18n" => array( |
|
| 128 | 128 | "coverAlt" => localize("i18n.coversection"), |
| 129 | 129 | "authorsTitle" => localize("authors.title"), |
| 130 | 130 | "bookwordTitle" => localize("bookword.title"), |
| 131 | 131 | "tagsTitle" => localize("tags.title"), |
| 132 | 132 | "seriesTitle" => localize("series.title"), |
| 133 | - "customizeTitle" => localize ("customize.title"), |
|
| 134 | - "aboutTitle" => localize ("about.title"), |
|
| 135 | - "previousAlt" => localize ("paging.previous.alternate"), |
|
| 136 | - "nextAlt" => localize ("paging.next.alternate"), |
|
| 137 | - "searchAlt" => localize ("search.alternate"), |
|
| 138 | - "sortAlt" => localize ("sort.alternate"), |
|
| 139 | - "homeAlt" => localize ("home.alternate"), |
|
| 140 | - "cogAlt" => localize ("cog.alternate"), |
|
| 141 | - "permalinkAlt" => localize ("permalink.alternate"), |
|
| 133 | + "customizeTitle" => localize("customize.title"), |
|
| 134 | + "aboutTitle" => localize("about.title"), |
|
| 135 | + "previousAlt" => localize("paging.previous.alternate"), |
|
| 136 | + "nextAlt" => localize("paging.next.alternate"), |
|
| 137 | + "searchAlt" => localize("search.alternate"), |
|
| 138 | + "sortAlt" => localize("sort.alternate"), |
|
| 139 | + "homeAlt" => localize("home.alternate"), |
|
| 140 | + "cogAlt" => localize("cog.alternate"), |
|
| 141 | + "permalinkAlt" => localize("permalink.alternate"), |
|
| 142 | 142 | "publisherName" => localize("publisher.name"), |
| 143 | 143 | "pubdateTitle" => localize("pubdate.title"), |
| 144 | 144 | "languagesTitle" => localize("language.title"), |
@@ -146,15 +146,15 @@ discard block |
||
| 146 | 146 | "sortorderAsc" => localize("search.sortorder.asc"), |
| 147 | 147 | "sortorderDesc" => localize("search.sortorder.desc"), |
| 148 | 148 | "customizeEmail" => localize("customize.email")), |
| 149 | - "url" => array ( |
|
| 149 | + "url" => array( |
|
| 150 | 150 | "detailUrl" => "index.php?page=13&id={0}&db={1}", |
| 151 | 151 | "coverUrl" => "fetch.php?id={0}&db={1}", |
| 152 | 152 | "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"), |
| 153 | - "config" => array ( |
|
| 153 | + "config" => array( |
|
| 154 | 154 | "use_fancyapps" => $config ["cops_use_fancyapps"], |
| 155 | 155 | "max_item_per_page" => $config['cops_max_item_per_page'], |
| 156 | 156 | "kindleHack" => "", |
| 157 | - "server_side_rendering" => useServerSideRendering (), |
|
| 157 | + "server_side_rendering" => useServerSideRendering(), |
|
| 158 | 158 | "html_tag_filter" => $config['cops_html_tag_filter'])); |
| 159 | 159 | if ($config['cops_thumbnail_handling'] == "1") { |
| 160 | 160 | $out ["c"]["url"]["thumbnailUrl"] = $out ["c"]["url"]["coverUrl"]; |
@@ -167,32 +167,32 @@ discard block |
||
| 167 | 167 | return $out; |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - public static function getJson ($complete = false) { |
|
| 170 | + public static function getJson($complete = false) { |
|
| 171 | 171 | global $config; |
| 172 | - $page = getURLParam ("page", Base::PAGE_INDEX); |
|
| 173 | - $query = getURLParam ("query"); |
|
| 174 | - $search = getURLParam ("search"); |
|
| 175 | - $qid = getURLParam ("id"); |
|
| 176 | - $n = getURLParam ("n", "1"); |
|
| 177 | - $database = GetUrlParam (DB); |
|
| 172 | + $page = getURLParam("page", Base::PAGE_INDEX); |
|
| 173 | + $query = getURLParam("query"); |
|
| 174 | + $search = getURLParam("search"); |
|
| 175 | + $qid = getURLParam("id"); |
|
| 176 | + $n = getURLParam("n", "1"); |
|
| 177 | + $database = GetUrlParam(DB); |
|
| 178 | 178 | |
| 179 | - $currentPage = Page::getPage ($page, $qid, $query, $n); |
|
| 180 | - $currentPage->InitializeContent (); |
|
| 179 | + $currentPage = Page::getPage($page, $qid, $query, $n); |
|
| 180 | + $currentPage->InitializeContent(); |
|
| 181 | 181 | |
| 182 | 182 | if ($search) { |
| 183 | - return self::getContentArrayTypeahead ($currentPage); |
|
| 183 | + return self::getContentArrayTypeahead($currentPage); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - $out = array ( "title" => $currentPage->title); |
|
| 187 | - $entries = array (); |
|
| 186 | + $out = array("title" => $currentPage->title); |
|
| 187 | + $entries = array(); |
|
| 188 | 188 | foreach ($currentPage->entryArray as $entry) { |
| 189 | - array_push ($entries, self::getContentArray ($entry)); |
|
| 189 | + array_push($entries, self::getContentArray($entry)); |
|
| 190 | 190 | } |
| 191 | - if (!is_null ($currentPage->book)) { |
|
| 192 | - $out ["book"] = self::getFullBookContentArray ($currentPage->book); |
|
| 191 | + if (!is_null($currentPage->book)) { |
|
| 192 | + $out ["book"] = self::getFullBookContentArray($currentPage->book); |
|
| 193 | 193 | } |
| 194 | - $out ["databaseId"] = GetUrlParam (DB, ""); |
|
| 195 | - $out ["databaseName"] = Base::getDbName (); |
|
| 194 | + $out ["databaseId"] = GetUrlParam(DB, ""); |
|
| 195 | + $out ["databaseName"] = Base::getDbName(); |
|
| 196 | 196 | if ($out ["databaseId"] == "") { |
| 197 | 197 | $out ["databaseName"] = ""; |
| 198 | 198 | } |
@@ -201,42 +201,42 @@ discard block |
||
| 201 | 201 | $out ["fullTitle"] = $out ["databaseName"] . " > " . $out ["fullTitle"]; |
| 202 | 202 | } |
| 203 | 203 | $out ["page"] = $page; |
| 204 | - $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled () ? 1 : 0; |
|
| 204 | + $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled()?1:0; |
|
| 205 | 205 | $out ["entries"] = $entries; |
| 206 | 206 | $out ["isPaginated"] = 0; |
| 207 | - if ($currentPage->isPaginated ()) { |
|
| 208 | - $prevLink = $currentPage->getPrevLink (); |
|
| 209 | - $nextLink = $currentPage->getNextLink (); |
|
| 207 | + if ($currentPage->isPaginated()) { |
|
| 208 | + $prevLink = $currentPage->getPrevLink(); |
|
| 209 | + $nextLink = $currentPage->getNextLink(); |
|
| 210 | 210 | $out ["isPaginated"] = 1; |
| 211 | 211 | $out ["prevLink"] = ""; |
| 212 | - if (!is_null ($prevLink)) { |
|
| 213 | - $out ["prevLink"] = $prevLink->hrefXhtml (); |
|
| 212 | + if (!is_null($prevLink)) { |
|
| 213 | + $out ["prevLink"] = $prevLink->hrefXhtml(); |
|
| 214 | 214 | } |
| 215 | 215 | $out ["nextLink"] = ""; |
| 216 | - if (!is_null ($nextLink)) { |
|
| 217 | - $out ["nextLink"] = $nextLink->hrefXhtml (); |
|
| 216 | + if (!is_null($nextLink)) { |
|
| 217 | + $out ["nextLink"] = $nextLink->hrefXhtml(); |
|
| 218 | 218 | } |
| 219 | - $out ["maxPage"] = $currentPage->getMaxPage (); |
|
| 219 | + $out ["maxPage"] = $currentPage->getMaxPage(); |
|
| 220 | 220 | $out ["currentPage"] = $currentPage->n; |
| 221 | 221 | } |
| 222 | - if (!is_null (getURLParam ("complete")) || $complete) { |
|
| 223 | - $out = self::addCompleteArray ($out); |
|
| 222 | + if (!is_null(getURLParam("complete")) || $complete) { |
|
| 223 | + $out = self::addCompleteArray($out); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | $out ["containsBook"] = 0; |
| 227 | - if ($currentPage->containsBook ()) { |
|
| 227 | + if ($currentPage->containsBook()) { |
|
| 228 | 228 | $out ["containsBook"] = 1; |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - $out["abouturl"] = "index.php" . addURLParameter ("?page=" . Base::PAGE_ABOUT, DB, $database); |
|
| 231 | + $out["abouturl"] = "index.php" . addURLParameter("?page=" . Base::PAGE_ABOUT, DB, $database); |
|
| 232 | 232 | |
| 233 | 233 | if ($page == Base::PAGE_ABOUT) { |
| 234 | - $temp = preg_replace ("/\<h1\>About COPS\<\/h1\>/", "<h1>About COPS " . VERSION . "</h1>", file_get_contents('about.html')); |
|
| 234 | + $temp = preg_replace("/\<h1\>About COPS\<\/h1\>/", "<h1>About COPS " . VERSION . "</h1>", file_get_contents('about.html')); |
|
| 235 | 235 | $out ["fullhtml"] = $temp; |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | $out ["homeurl"] = "index.php"; |
| 239 | - if ($page != Base::PAGE_INDEX && !is_null ($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter ("", DB, $database); |
|
| 239 | + if ($page != Base::PAGE_INDEX && !is_null($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter("", DB, $database); |
|
| 240 | 240 | |
| 241 | 241 | return $out; |
| 242 | 242 | } |
@@ -24,69 +24,69 @@ |
||
| 24 | 24 | $this->sort = $post->sort; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function getUri () { |
|
| 28 | - return "?page=".parent::PAGE_AUTHOR_DETAIL."&id=$this->id"; |
|
| 27 | + public function getUri() { |
|
| 28 | + return "?page=" . parent::PAGE_AUTHOR_DETAIL . "&id=$this->id"; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function getEntryId () { |
|
| 32 | - return self::ALL_AUTHORS_ID.":".$this->id; |
|
| 31 | + public function getEntryId() { |
|
| 32 | + return self::ALL_AUTHORS_ID . ":" . $this->id; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public static function getEntryIdByLetter ($startingLetter) { |
|
| 36 | - return self::ALL_AUTHORS_ID.":letter:".$startingLetter; |
|
| 35 | + public static function getEntryIdByLetter($startingLetter) { |
|
| 36 | + return self::ALL_AUTHORS_ID . ":letter:" . $startingLetter; |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public static function getCount() { |
| 40 | 40 | // str_format (localize("authors.alphabetical", count(array)) |
| 41 | - return parent::getCountGeneric ("authors", self::ALL_AUTHORS_ID, parent::PAGE_ALL_AUTHORS); |
|
| 41 | + return parent::getCountGeneric("authors", self::ALL_AUTHORS_ID, parent::PAGE_ALL_AUTHORS); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | public static function getAllAuthorsByFirstLetter() { |
| 45 | - list (, $result) = parent::executeQuery ("select {0} |
|
| 45 | + list (, $result) = parent::executeQuery("select {0} |
|
| 46 | 46 | from authors |
| 47 | 47 | group by substr (upper (sort), 1, 1) |
| 48 | -order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array (), -1); |
|
| 48 | +order by substr (upper (sort), 1, 1)", "substr (upper (sort), 1, 1) as title, count(*) as count", "", array(), -1); |
|
| 49 | 49 | $entryArray = array(); |
| 50 | - while ($post = $result->fetchObject ()) |
|
| 50 | + while ($post = $result->fetchObject()) |
|
| 51 | 51 | { |
| 52 | - array_push ($entryArray, new Entry ($post->title, Author::getEntryIdByLetter ($post->title), |
|
| 53 | - str_format (localize("authorword", $post->count), $post->count), "text", |
|
| 54 | - array ( new LinkNavigation ("?page=".parent::PAGE_AUTHORS_FIRST_LETTER."&id=". rawurlencode ($post->title))), "", $post->count)); |
|
| 52 | + array_push($entryArray, new Entry($post->title, Author::getEntryIdByLetter($post->title), |
|
| 53 | + str_format(localize("authorword", $post->count), $post->count), "text", |
|
| 54 | + array(new LinkNavigation("?page=" . parent::PAGE_AUTHORS_FIRST_LETTER . "&id=" . rawurlencode($post->title))), "", $post->count)); |
|
| 55 | 55 | } |
| 56 | 56 | return $entryArray; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | public static function getAuthorsByStartingLetter($letter) { |
| 60 | - return self::getEntryArray (self::SQL_AUTHORS_BY_FIRST_LETTER, array ($letter . "%")); |
|
| 60 | + return self::getEntryArray(self::SQL_AUTHORS_BY_FIRST_LETTER, array($letter . "%")); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | public static function getAuthorsForSearch($query) { |
| 64 | - return self::getEntryArray (self::SQL_AUTHORS_FOR_SEARCH, array ($query . "%", $query . "%")); |
|
| 64 | + return self::getEntryArray(self::SQL_AUTHORS_FOR_SEARCH, array($query . "%", $query . "%")); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | public static function getAllAuthors() { |
| 68 | - return self::getEntryArray (self::SQL_ALL_AUTHORS, array ()); |
|
| 68 | + return self::getEntryArray(self::SQL_ALL_AUTHORS, array()); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - public static function getEntryArray ($query, $params) { |
|
| 72 | - return Base::getEntryArrayWithBookNumber ($query, self::AUTHOR_COLUMNS, $params, "Author"); |
|
| 71 | + public static function getEntryArray($query, $params) { |
|
| 72 | + return Base::getEntryArrayWithBookNumber($query, self::AUTHOR_COLUMNS, $params, "Author"); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - public static function getAuthorById ($authorId) { |
|
| 76 | - $result = parent::getDb ()->prepare('select ' . self::AUTHOR_COLUMNS . ' from authors where id = ?'); |
|
| 77 | - $result->execute (array ($authorId)); |
|
| 78 | - $post = $result->fetchObject (); |
|
| 79 | - return new Author ($post); |
|
| 75 | + public static function getAuthorById($authorId) { |
|
| 76 | + $result = parent::getDb()->prepare('select ' . self::AUTHOR_COLUMNS . ' from authors where id = ?'); |
|
| 77 | + $result->execute(array($authorId)); |
|
| 78 | + $post = $result->fetchObject(); |
|
| 79 | + return new Author($post); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public static function getAuthorByBookId ($bookId) { |
|
| 83 | - $result = parent::getDb ()->prepare('select authors.id as id, authors.name as name, authors.sort as sort from authors, books_authors_link |
|
| 82 | + public static function getAuthorByBookId($bookId) { |
|
| 83 | + $result = parent::getDb()->prepare('select authors.id as id, authors.name as name, authors.sort as sort from authors, books_authors_link |
|
| 84 | 84 | where author = authors.id |
| 85 | 85 | and book = ?'); |
| 86 | - $result->execute (array ($bookId)); |
|
| 87 | - $authorArray = array (); |
|
| 88 | - while ($post = $result->fetchObject ()) { |
|
| 89 | - array_push ($authorArray, new Author ($post)); |
|
| 86 | + $result->execute(array($bookId)); |
|
| 87 | + $authorArray = array(); |
|
| 88 | + while ($post = $result->fetchObject()) { |
|
| 89 | + array_push($authorArray, new Author($post)); |
|
| 90 | 90 | } |
| 91 | 91 | return $authorArray; |
| 92 | 92 | } |
@@ -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 | } |
@@ -20,44 +20,44 @@ |
||
| 20 | 20 | $this->name = $post->name; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function getUri () { |
|
| 24 | - return "?page=".parent::PAGE_SERIE_DETAIL."&id=$this->id"; |
|
| 23 | + public function getUri() { |
|
| 24 | + return "?page=" . parent::PAGE_SERIE_DETAIL . "&id=$this->id"; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function getEntryId () { |
|
| 28 | - return self::ALL_SERIES_ID.":".$this->id; |
|
| 27 | + public function getEntryId() { |
|
| 28 | + return self::ALL_SERIES_ID . ":" . $this->id; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | public static function getCount() { |
| 32 | 32 | // str_format (localize("series.alphabetical", count(array)) |
| 33 | - return parent::getCountGeneric ("series", self::ALL_SERIES_ID, parent::PAGE_ALL_SERIES); |
|
| 33 | + return parent::getCountGeneric("series", self::ALL_SERIES_ID, parent::PAGE_ALL_SERIES); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public static function getSerieByBookId ($bookId) { |
|
| 37 | - $result = parent::getDb ()->prepare('select series.id as id, name |
|
| 36 | + public static function getSerieByBookId($bookId) { |
|
| 37 | + $result = parent::getDb()->prepare('select series.id as id, name |
|
| 38 | 38 | from books_series_link, series |
| 39 | 39 | where series.id = series and book = ?'); |
| 40 | - $result->execute (array ($bookId)); |
|
| 41 | - if ($post = $result->fetchObject ()) { |
|
| 42 | - return new Serie ($post); |
|
| 40 | + $result->execute(array($bookId)); |
|
| 41 | + if ($post = $result->fetchObject()) { |
|
| 42 | + return new Serie($post); |
|
| 43 | 43 | } |
| 44 | 44 | return NULL; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public static function getSerieById ($serieId) { |
|
| 48 | - $result = parent::getDb ()->prepare('select id, name from series where id = ?'); |
|
| 49 | - $result->execute (array ($serieId)); |
|
| 50 | - if ($post = $result->fetchObject ()) { |
|
| 51 | - return new Serie ($post); |
|
| 47 | + public static function getSerieById($serieId) { |
|
| 48 | + $result = parent::getDb()->prepare('select id, name from series where id = ?'); |
|
| 49 | + $result->execute(array($serieId)); |
|
| 50 | + if ($post = $result->fetchObject()) { |
|
| 51 | + return new Serie($post); |
|
| 52 | 52 | } |
| 53 | 53 | return NULL; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public static function getAllSeries() { |
| 57 | - return Base::getEntryArrayWithBookNumber (self::SQL_ALL_SERIES, self::SERIES_COLUMNS, array (), "Serie"); |
|
| 57 | + return Base::getEntryArrayWithBookNumber(self::SQL_ALL_SERIES, self::SERIES_COLUMNS, array(), "Serie"); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public static function getAllSeriesByQuery($query) { |
| 61 | - return Base::getEntryArrayWithBookNumber (self::SQL_SERIES_FOR_SEARCH, self::SERIES_COLUMNS, array ('%' . $query . '%'), "Serie"); |
|
| 61 | + return Base::getEntryArrayWithBookNumber(self::SQL_SERIES_FOR_SEARCH, self::SERIES_COLUMNS, array('%' . $query . '%'), "Serie"); |
|
| 62 | 62 | } |
| 63 | 63 | } |
@@ -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 | } |