@@ -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 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAllLanguages extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | 13 | $this->title = localize("languages.title"); |
| 14 | 14 | $this->entryArray = Language::getAllLanguages(); |
@@ -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 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageAllPublishers extends Page |
| 10 | 10 | { |
| 11 | - public function InitializeContent () |
|
| 11 | + public function InitializeContent() |
|
| 12 | 12 | { |
| 13 | 13 | $this->title = localize("publishers.title"); |
| 14 | 14 | $this->entryArray = Publisher::getAllPublishers(); |
@@ -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; |
@@ -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 { |
@@ -13,8 +13,7 @@ |
||
| 13 | 13 | $this->title = localize("authors.title"); |
| 14 | 14 | if (getCurrentOption ("author_split_first_letter") == 1) { |
| 15 | 15 | $this->entryArray = Author::getAllAuthorsByFirstLetter(); |
| 16 | - } |
|
| 17 | - else { |
|
| 16 | + } else { |
|
| 18 | 17 | $this->entryArray = Author::getAllAuthors(); |
| 19 | 18 | } |
| 20 | 19 | $this->idPage = Author::ALL_AUTHORS_ID; |