Completed
Push — master ( 3dbf17...5762d3 )
by Markus
04:38
created
lib/PageSerieDetail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/PageTagDetail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/LinkNavigation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@
 block discarded – undo
9 9
 class LinkNavigation extends Link
10 10
 {
11 11
     public function __construct($phref, $prel = NULL, $ptitle = NULL) {
12
-        parent::__construct ($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle);
13
-        if (!is_null (GetUrlParam (DB))) $this->href = addURLParameter ($this->href, DB, GetUrlParam (DB));
14
-        if (!preg_match ("#^\?(.*)#", $this->href) && !empty ($this->href)) $this->href = "?" . $this->href;
15
-        if (preg_match ("/(bookdetail|getJSON).php/", parent::getScriptName())) {
12
+        parent::__construct($phref, Link::OPDS_NAVIGATION_TYPE, $prel, $ptitle);
13
+        if (!is_null(GetUrlParam(DB))) $this->href = addURLParameter($this->href, DB, GetUrlParam(DB));
14
+        if (!preg_match("#^\?(.*)#", $this->href) && !empty ($this->href)) $this->href = "?" . $this->href;
15
+        if (preg_match("/(bookdetail|getJSON).php/", parent::getScriptName())) {
16 16
             $this->href = "index.php" . $this->href;
17 17
         } else {
18 18
             $this->href = parent::getScriptName() . $this->href;
Please login to merge, or discard this patch.
lib/Rating.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     const ALL_RATING_ID = "cops:rating";
11 11
 
12 12
     const RATING_COLUMNS = "ratings.id as id, ratings.rating as rating, count(*) as count";
13
-    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";
13
+    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 14
     public $id;
15 15
     public $name;
16 16
 
@@ -19,41 +19,41 @@  discard block
 block discarded – undo
19 19
         $this->name = $pname;
20 20
     }
21 21
 
22
-    public function getUri () {
23
-        return "?page=".parent::PAGE_RATING_DETAIL."&id=$this->id";
22
+    public function getUri() {
23
+        return "?page=" . parent::PAGE_RATING_DETAIL . "&id=$this->id";
24 24
     }
25 25
 
26
-    public function getEntryId () {
27
-        return self::ALL_RATING_ID.":".$this->id;
26
+    public function getEntryId() {
27
+        return self::ALL_RATING_ID . ":" . $this->id;
28 28
     }
29 29
 
30 30
     public static function getCount() {
31 31
         // str_format (localize("ratings", count(array))
32
-        return parent::getCountGeneric ("ratings", self::ALL_RATING_ID, parent::PAGE_ALL_RATINGS, "ratings");
32
+        return parent::getCountGeneric("ratings", self::ALL_RATING_ID, parent::PAGE_ALL_RATINGS, "ratings");
33 33
     }
34 34
 
35 35
     public static function getAllRatings() {
36
-        return self::getEntryArray (self::SQL_ALL_RATINGS, array ());
36
+        return self::getEntryArray(self::SQL_ALL_RATINGS, array());
37 37
     }
38 38
 
39
-    public static function getEntryArray ($query, $params) {
40
-        list (, $result) = parent::executeQuery ($query, self::RATING_COLUMNS, "", $params, -1);
39
+    public static function getEntryArray($query, $params) {
40
+        list (, $result) = parent::executeQuery($query, self::RATING_COLUMNS, "", $params, -1);
41 41
         $entryArray = array();
42
-        while ($post = $result->fetchObject ())
42
+        while ($post = $result->fetchObject())
43 43
         {
44
-            $ratingObj = new Rating ($post->id, $post->rating);
45
-            $rating=$post->rating/2;
46
-            $rating = str_format (localize("ratingword", $rating), $rating);
47
-            array_push ($entryArray, new Entry ($rating, $ratingObj->getEntryId (),
48
-                str_format (localize("bookword", $post->count), $post->count), "text",
49
-                array ( new LinkNavigation ($ratingObj->getUri ())), "", $post->count));
44
+            $ratingObj = new Rating($post->id, $post->rating);
45
+            $rating = $post->rating / 2;
46
+            $rating = str_format(localize("ratingword", $rating), $rating);
47
+            array_push($entryArray, new Entry($rating, $ratingObj->getEntryId(),
48
+                str_format(localize("bookword", $post->count), $post->count), "text",
49
+                array(new LinkNavigation($ratingObj->getUri())), "", $post->count));
50 50
         }
51 51
         return $entryArray;
52 52
     }
53 53
 
54
-    public static function getRatingById ($ratingId) {
55
-        $result = parent::getDb ()->prepare('select rating from ratings where id = ?');
56
-        $result->execute (array ($ratingId));
57
-        return new Rating ($ratingId, $result->fetchColumn ());
54
+    public static function getRatingById($ratingId) {
55
+        $result = parent::getDb()->prepare('select rating from ratings where id = ?');
56
+        $result->execute(array($ratingId));
57
+        return new Rating($ratingId, $result->fetchColumn());
58 58
     }
59 59
 }
Please login to merge, or discard this patch.
lib/Entry.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,21 +31,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/Link.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/PageAllAuthors.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
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 {
Please login to merge, or discard this patch.
lib/PageRecentBooks.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
lib/PageAuthorDetail.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.