Test Setup Failed
Pull Request — master (#424)
by
unknown
50:02
created
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/Entry.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -31,23 +31,23 @@  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
             /* @var $link LinkNavigation */
47 47
 
48 48
             if ($link->type != Link::OPDS_NAVIGATION_TYPE) { continue; }
49 49
 
50
-            return $link->hrefXhtml ();
50
+            return $link->hrefXhtml();
51 51
         }
52 52
         return "#";
53 53
     }
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
         {
67 67
             foreach (self::$icons as $reg => $image)
68 68
             {
69
-                if (preg_match ("/" . $reg . "/", $pid)) {
70
-                    array_push ($this->linkArray, new Link (getUrlWithVersion ($image), "image/png", Link::OPDS_THUMBNAIL_TYPE));
69
+                if (preg_match("/" . $reg . "/", $pid)) {
70
+                    array_push($this->linkArray, new Link(getUrlWithVersion($image), "image/png", Link::OPDS_THUMBNAIL_TYPE));
71 71
                     break;
72 72
                 }
73 73
             }
74 74
         }
75 75
 
76
-        if (!is_null (GetUrlParam (DB))) $this->id = str_replace ("cops:", "cops:" . GetUrlParam (DB) . ":", $this->id);
76
+        if (!is_null(GetUrlParam(DB))) $this->id = str_replace("cops:", "cops:" . GetUrlParam(DB) . ":", $this->id);
77 77
     }
78 78
 }
Please login to merge, or discard this patch.
epubfs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -72,11 +72,11 @@
 block discarded – undo
72 72
 try {
73 73
     $data = getComponentContent($book, $component, $add);
74 74
 
75
-    $expires = 60*60*24*14;
75
+    $expires = 60 * 60 * 24 * 14;
76 76
     header('Pragma: public');
77
-    header('Cache-Control: maxage='.$expires);
78
-    header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$expires) . ' GMT');
79
-    header ('Content-Type: ' . $book->componentContentType($component));
77
+    header('Cache-Control: maxage=' . $expires);
78
+    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT');
79
+    header('Content-Type: ' . $book->componentContentType($component));
80 80
     echo $data;
81 81
 } catch (Exception $e) {
82 82
     error_log($e);
Please login to merge, or discard this patch.
checkconfig.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     <meta charset="utf-8">
27 27
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
28 28
     <title>COPS Configuration Check</title>
29
-    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss ()) ?>" media="screen" />
29
+    <link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion(getCurrentCss()) ?>" media="screen" />
30 30
 </head>
31 31
 <body>
32 32
 <div class="container">
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             <h2>Check if the rendering will be done on client side or server side</h2>
152 152
             <h4>
153 153
             <?php
154
-            if (useServerSideRendering ()) {
154
+            if (useServerSideRendering()) {
155 155
                 echo 'Server side rendering';
156 156
             } else {
157 157
                 echo 'Client side rendering';
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             <h2>Check if Calibre database path is not an URL</h2>
168 168
             <h4>
169 169
             <?php
170
-            if (!preg_match ('#^http#', $database)) {
170
+            if (!preg_match('#^http#', $database)) {
171 171
                 echo $name . ' OK';
172 172
             } else {
173 173
                 echo $name . ' Calibre path has to be local (no URL allowed)';
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             <h4>
201 201
             <?php
202 202
             try {
203
-                $db = new PDO('sqlite:'. Base::getDbFileName($i));
203
+                $db = new PDO('sqlite:' . Base::getDbFileName($i));
204 204
                 echo $name . ' OK';
205 205
             } catch (Exception $e) {
206 206
                 echo $name . ' If the file is readable, check your php configuration. Exception detail : ' . $e;
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             <h4>
214 214
             <?php
215 215
             try {
216
-                $db = new PDO('sqlite:'. Base::getDbFileName($i));
216
+                $db = new PDO('sqlite:' . Base::getDbFileName($i));
217 217
                 $count = $db->query('select count(*) FROM sqlite_master WHERE type="table" AND name in ("books", "authors", "tags", "series")')->fetchColumn();
218 218
                 if ($count == 4) {
219 219
                     echo $name . ' OK';
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                 $result->execute();
238 238
                 while ($post = $result->fetchObject())
239 239
                 {
240
-                    if (!is_file (Base::getDbDirectory($i) . $post->fullpath)) {
240
+                    if (!is_file(Base::getDbDirectory($i) . $post->fullpath)) {
241 241
                         echo '<p>' . Base::getDbDirectory($i) . $post->fullpath . '</p>';
242 242
                     }
243 243
                 }
Please login to merge, or discard this patch.
sendtomail.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
 require_once dirname(__FILE__) . '/config.php';
4 4
 require_once dirname(__FILE__) . '/base.php';
5 5
 
6
-function checkConfiguration () {
6
+function checkConfiguration() {
7 7
     global $config;
8 8
 
9
-    if (is_null ($config['cops_mail_configuration']) ||
10
-        !is_array ($config['cops_mail_configuration']) ||
9
+    if (is_null($config['cops_mail_configuration']) ||
10
+        !is_array($config['cops_mail_configuration']) ||
11 11
         empty ($config['cops_mail_configuration']["smtp.host"]) ||
12 12
         empty ($config['cops_mail_configuration']["address.from"])) {
13 13
         return "NOK. bad configuration.";
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     return False;
16 16
 }
17 17
 
18
-function checkRequest ($idData, $emailDest) {
18
+function checkRequest($idData, $emailDest) {
19 19
     if (empty ($idData)) {
20 20
         return 'No data sent.';
21 21
     }
@@ -29,22 +29,22 @@  discard block
 block discarded – undo
29 29
 
30 30
 global $config;
31 31
 
32
-if ($error = checkConfiguration ()) {
32
+if ($error = checkConfiguration()) {
33 33
     echo $error;
34 34
     exit;
35 35
 }
36 36
 
37 37
 $idData = $_REQUEST["data"];
38 38
 $emailDest = $_REQUEST["email"];
39
-if ($error = checkRequest ($idData, $emailDest)) {
39
+if ($error = checkRequest($idData, $emailDest)) {
40 40
     echo $error;
41 41
     exit;
42 42
 }
43 43
 
44 44
 $book = Book::getBookByDataId($idData);
45
-$data = $book->getDataById ($idData);
45
+$data = $book->getDataById($idData);
46 46
 
47
-if (filesize ($data->getLocalPath ()) > 10 * 1024 * 1024) {
47
+if (filesize($data->getLocalPath()) > 10 * 1024 * 1024) {
48 48
     echo 'Attachment too big';
49 49
     exit;
50 50
 }
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
 $mail->From = $config['cops_mail_configuration']["address.from"];
67 67
 $mail->FromName = $config['cops_title_default'];
68 68
 
69
-foreach (explode (";", $emailDest) as $emailAddress) {
69
+foreach (explode(";", $emailDest) as $emailAddress) {
70 70
     if (empty ($emailAddress)) { continue; }
71 71
     $mail->AddAddress($emailAddress);
72 72
 }
73 73
 
74
-$mail->AddAttachment($data->getLocalPath ());
74
+$mail->AddAttachment($data->getLocalPath());
75 75
 
76 76
 $mail->IsHTML(true);
77 77
 $mail->CharSet = "UTF-8";
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
 if (!empty ($config['cops_mail_configuration']["subject"])) {
80 80
     $mail->Subject = $config['cops_mail_configuration']["subject"];
81 81
 }
82
-$mail->Subject .= $data->getUpdatedFilename ();
83
-$mail->Body    = "<h1>" . $book->title . "</h1><h2>" . $book->getAuthorsName () . "</h2>" . $book->getComment ();
82
+$mail->Subject .= $data->getUpdatedFilename();
83
+$mail->Body    = "<h1>" . $book->title . "</h1><h2>" . $book->getAuthorsName() . "</h2>" . $book->getComment();
84 84
 $mail->AltBody = "Sent by COPS";
85 85
 
86 86
 if (!$mail->Send()) {
87
-   echo localize ("mail.messagenotsent");
87
+   echo localize("mail.messagenotsent");
88 88
    echo 'Mailer Error: ' . $mail->ErrorInfo;
89 89
    exit;
90 90
 }
91 91
 
92
-echo localize ("mail.messagesent");
92
+echo localize("mail.messagesent");
93 93
 
Please login to merge, or discard this patch.
config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,20 +12,20 @@
 block discarded – undo
12 12
     require dirname(__FILE__) . '/config_local.php';
13 13
 }
14 14
 
15
-$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : '';
15
+$remote_user = array_key_exists('PHP_AUTH_USER', $_SERVER)?$_SERVER['PHP_AUTH_USER']:'';
16 16
 // Clean username, only allow a-z, A-Z, 0-9, -_ chars
17
-$remote_user = preg_replace( '/[^a-zA-Z0-9_-]/', '', $remote_user);
17
+$remote_user = preg_replace('/[^a-zA-Z0-9_-]/', '', $remote_user);
18 18
 $user_config_file = 'config_local.' . $remote_user . '.php';
19 19
 if (file_exists(dirname(__FILE__) . '/' . $user_config_file) && (php_sapi_name() !== 'cli')) {
20 20
     require dirname(__FILE__) . '/' . $user_config_file;
21 21
 }
22 22
 
23
-if(!is_null($config['cops_basic_authentication']) &&
23
+if (!is_null($config['cops_basic_authentication']) &&
24 24
     is_array($config['cops_basic_authentication']))
25 25
 {
26 26
     if (!isset($_SERVER['PHP_AUTH_USER']) ||
27 27
         (isset($_SERVER['PHP_AUTH_USER']) &&
28
-        ($_SERVER['PHP_AUTH_USER']!=$config['cops_basic_authentication']['username'] ||
28
+        ($_SERVER['PHP_AUTH_USER'] != $config['cops_basic_authentication']['username'] ||
29 29
         $_SERVER['PHP_AUTH_PW'] != $config['cops_basic_authentication']['password'])))
30 30
     {
31 31
         header('WWW-Authenticate: Basic realm="COPS Authentication"');
Please login to merge, or discard this patch.
lib/Page.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -24,55 +24,55 @@  discard block
 block discarded – undo
24 24
     /* @var Entry[] */
25 25
     public $entryArray = array();
26 26
 
27
-    public static function getPage ($pageId, $id, $query, $n)
27
+    public static function getPage($pageId, $id, $query, $n)
28 28
     {
29 29
         switch ($pageId) {
30 30
             case Base::PAGE_ALL_AUTHORS :
31
-                return new PageAllAuthors ($id, $query, $n);
31
+                return new PageAllAuthors($id, $query, $n);
32 32
             case Base::PAGE_AUTHORS_FIRST_LETTER :
33
-                return new PageAllAuthorsLetter ($id, $query, $n);
33
+                return new PageAllAuthorsLetter($id, $query, $n);
34 34
             case Base::PAGE_AUTHOR_DETAIL :
35
-                return new PageAuthorDetail ($id, $query, $n);
35
+                return new PageAuthorDetail($id, $query, $n);
36 36
             case Base::PAGE_ALL_TAGS :
37
-                return new PageAllTags ($id, $query, $n);
37
+                return new PageAllTags($id, $query, $n);
38 38
             case Base::PAGE_TAG_DETAIL :
39
-                return new PageTagDetail ($id, $query, $n);
39
+                return new PageTagDetail($id, $query, $n);
40 40
             case Base::PAGE_ALL_LANGUAGES :
41
-                return new PageAllLanguages ($id, $query, $n);
41
+                return new PageAllLanguages($id, $query, $n);
42 42
             case Base::PAGE_LANGUAGE_DETAIL :
43
-                return new PageLanguageDetail ($id, $query, $n);
43
+                return new PageLanguageDetail($id, $query, $n);
44 44
             case Base::PAGE_ALL_CUSTOMS :
45
-                return new PageAllCustoms ($id, $query, $n);
45
+                return new PageAllCustoms($id, $query, $n);
46 46
             case Base::PAGE_CUSTOM_DETAIL :
47
-                return new PageCustomDetail ($id, $query, $n);
47
+                return new PageCustomDetail($id, $query, $n);
48 48
             case Base::PAGE_ALL_RATINGS :
49
-                return new PageAllRating ($id, $query, $n);
49
+                return new PageAllRating($id, $query, $n);
50 50
             case Base::PAGE_RATING_DETAIL :
51
-                return new PageRatingDetail ($id, $query, $n);
51
+                return new PageRatingDetail($id, $query, $n);
52 52
             case Base::PAGE_ALL_SERIES :
53
-                return new PageAllSeries ($id, $query, $n);
53
+                return new PageAllSeries($id, $query, $n);
54 54
             case Base::PAGE_ALL_BOOKS :
55
-                return new PageAllBooks ($id, $query, $n);
55
+                return new PageAllBooks($id, $query, $n);
56 56
             case Base::PAGE_ALL_BOOKS_LETTER:
57
-                return new PageAllBooksLetter ($id, $query, $n);
57
+                return new PageAllBooksLetter($id, $query, $n);
58 58
             case Base::PAGE_ALL_RECENT_BOOKS :
59
-                return new PageRecentBooks ($id, $query, $n);
59
+                return new PageRecentBooks($id, $query, $n);
60 60
             case Base::PAGE_SERIE_DETAIL :
61
-                return new PageSerieDetail ($id, $query, $n);
61
+                return new PageSerieDetail($id, $query, $n);
62 62
             case Base::PAGE_OPENSEARCH_QUERY :
63
-                return new PageQueryResult ($id, $query, $n);
63
+                return new PageQueryResult($id, $query, $n);
64 64
             case Base::PAGE_BOOK_DETAIL :
65
-                return new PageBookDetail ($id, $query, $n);
65
+                return new PageBookDetail($id, $query, $n);
66 66
             case Base::PAGE_ALL_PUBLISHERS:
67
-                return new PageAllPublishers ($id, $query, $n);
67
+                return new PageAllPublishers($id, $query, $n);
68 68
             case Base::PAGE_PUBLISHER_DETAIL :
69
-                return new PagePublisherDetail ($id, $query, $n);
69
+                return new PagePublisherDetail($id, $query, $n);
70 70
             case Base::PAGE_ABOUT :
71
-                return new PageAbout ($id, $query, $n);
71
+                return new PageAbout($id, $query, $n);
72 72
             case Base::PAGE_CUSTOMIZE :
73
-                return new PageCustomize ($id, $query, $n);
73
+                return new PageCustomize($id, $query, $n);
74 74
             default:
75
-                $page = new Page ($id, $query, $n);
75
+                $page = new Page($id, $query, $n);
76 76
                 $page->idPage = "cops:catalog";
77 77
                 return $page;
78 78
         }
@@ -85,96 +85,96 @@  discard block
 block discarded – undo
85 85
         $this->query = $pquery;
86 86
         $this->n = $pn;
87 87
         $this->favicon = $config['cops_icon'];
88
-        $this->authorName = empty($config['cops_author_name']) ? utf8_encode('Sébastien Lucas') : $config['cops_author_name'];
89
-        $this->authorUri = empty($config['cops_author_uri']) ? 'http://blog.slucas.fr' : $config['cops_author_uri'];
90
-        $this->authorEmail = empty($config['cops_author_email']) ? '[email protected]' : $config['cops_author_email'];
88
+        $this->authorName = empty($config['cops_author_name'])? utf8_encode('Sébastien Lucas'):$config['cops_author_name'];
89
+        $this->authorUri = empty($config['cops_author_uri'])?'http://blog.slucas.fr':$config['cops_author_uri'];
90
+        $this->authorEmail = empty($config['cops_author_email'])?'[email protected]':$config['cops_author_email'];
91 91
     }
92 92
 
93
-    public function InitializeContent ()
93
+    public function InitializeContent()
94 94
     {
95 95
         global $config;
96 96
         $this->title = $config['cops_title_default'];
97 97
         $this->subtitle = $config['cops_subtitle_default'];
98
-        if (Base::noDatabaseSelected ()) {
98
+        if (Base::noDatabaseSelected()) {
99 99
             $i = 0;
100
-            foreach (Base::getDbNameList () as $key) {
101
-                $nBooks = Book::getBookCount ($i);
102
-                array_push ($this->entryArray, new Entry ($key, "cops:{$i}:catalog",
103
-                                        str_format (localize ("bookword", $nBooks), $nBooks), "text",
104
-                                        array ( new LinkNavigation ("?" . DB . "={$i}")), "", $nBooks));
100
+            foreach (Base::getDbNameList() as $key) {
101
+                $nBooks = Book::getBookCount($i);
102
+                array_push($this->entryArray, new Entry($key, "cops:{$i}:catalog",
103
+                                        str_format(localize("bookword", $nBooks), $nBooks), "text",
104
+                                        array(new LinkNavigation("?" . DB . "={$i}")), "", $nBooks));
105 105
                 $i++;
106
-                Base::clearDb ();
106
+                Base::clearDb();
107 107
             }
108 108
         } else {
109
-            if (!in_array (PageQueryResult::SCOPE_AUTHOR, getCurrentOption ('ignored_categories'))) {
110
-                array_push ($this->entryArray, Author::getCount());
109
+            if (!in_array(PageQueryResult::SCOPE_AUTHOR, getCurrentOption('ignored_categories'))) {
110
+                array_push($this->entryArray, Author::getCount());
111 111
             }
112
-            if (!in_array (PageQueryResult::SCOPE_SERIES, getCurrentOption ('ignored_categories'))) {
112
+            if (!in_array(PageQueryResult::SCOPE_SERIES, getCurrentOption('ignored_categories'))) {
113 113
                 $series = Serie::getCount();
114
-                if (!is_null ($series)) array_push ($this->entryArray, $series);
114
+                if (!is_null($series)) array_push($this->entryArray, $series);
115 115
             }
116
-            if (!in_array (PageQueryResult::SCOPE_PUBLISHER, getCurrentOption ('ignored_categories'))) {
116
+            if (!in_array(PageQueryResult::SCOPE_PUBLISHER, getCurrentOption('ignored_categories'))) {
117 117
                 $publisher = Publisher::getCount();
118
-                if (!is_null ($publisher)) array_push ($this->entryArray, $publisher);
118
+                if (!is_null($publisher)) array_push($this->entryArray, $publisher);
119 119
             }
120
-            if (!in_array (PageQueryResult::SCOPE_TAG, getCurrentOption ('ignored_categories'))) {
120
+            if (!in_array(PageQueryResult::SCOPE_TAG, getCurrentOption('ignored_categories'))) {
121 121
                 $tags = Tag::getCount();
122
-                if (!is_null ($tags)) array_push ($this->entryArray, $tags);
122
+                if (!is_null($tags)) array_push($this->entryArray, $tags);
123 123
             }
124
-            if (!in_array (PageQueryResult::SCOPE_RATING, getCurrentOption ('ignored_categories'))) {
124
+            if (!in_array(PageQueryResult::SCOPE_RATING, getCurrentOption('ignored_categories'))) {
125 125
                 $rating = Rating::getCount();
126
-                if (!is_null ($rating)) array_push ($this->entryArray, $rating);
126
+                if (!is_null($rating)) array_push($this->entryArray, $rating);
127 127
             }
128
-            if (!in_array ("language", getCurrentOption ('ignored_categories'))) {
128
+            if (!in_array("language", getCurrentOption('ignored_categories'))) {
129 129
                 $languages = Language::getCount();
130
-                if (!is_null ($languages)) array_push ($this->entryArray, $languages);
130
+                if (!is_null($languages)) array_push($this->entryArray, $languages);
131 131
             }
132 132
             foreach ($config['cops_calibre_custom_column'] as $lookup) {
133 133
                 $customColumn = CustomColumnType::createByLookup($lookup);
134
-                if (!is_null ($customColumn) && $customColumn->isSearchable()) {
135
-                    array_push ($this->entryArray, $customColumn->getCount());
134
+                if (!is_null($customColumn) && $customColumn->isSearchable()) {
135
+                    array_push($this->entryArray, $customColumn->getCount());
136 136
                 }
137 137
             }
138
-            $this->entryArray = array_merge ($this->entryArray, Book::getCount());
138
+            $this->entryArray = array_merge($this->entryArray, Book::getCount());
139 139
 
140
-            if (Base::isMultipleDatabaseEnabled ()) $this->title =  Base::getDbName ();
140
+            if (Base::isMultipleDatabaseEnabled()) $this->title = Base::getDbName();
141 141
         }
142 142
     }
143 143
 
144
-    public function isPaginated ()
144
+    public function isPaginated()
145 145
     {
146
-        return (getCurrentOption ("max_item_per_page") != -1 &&
146
+        return (getCurrentOption("max_item_per_page") != -1 &&
147 147
                 $this->totalNumber != -1 &&
148
-                $this->totalNumber > getCurrentOption ("max_item_per_page"));
148
+                $this->totalNumber > getCurrentOption("max_item_per_page"));
149 149
     }
150 150
 
151
-    public function getNextLink ()
151
+    public function getNextLink()
152 152
     {
153
-        $currentUrl = preg_replace ("/\&n=.*?$/", "", "?" . getQueryString ());
154
-        if (($this->n) * getCurrentOption ("max_item_per_page") < $this->totalNumber) {
155
-            return new LinkNavigation ($currentUrl . "&n=" . ($this->n + 1), "next", localize ("paging.next.alternate"));
153
+        $currentUrl = preg_replace("/\&n=.*?$/", "", "?" . getQueryString());
154
+        if (($this->n) * getCurrentOption("max_item_per_page") < $this->totalNumber) {
155
+            return new LinkNavigation($currentUrl . "&n=" . ($this->n + 1), "next", localize("paging.next.alternate"));
156 156
         }
157 157
         return NULL;
158 158
     }
159 159
 
160
-    public function getPrevLink ()
160
+    public function getPrevLink()
161 161
     {
162
-        $currentUrl = preg_replace ("/\&n=.*?$/", "", "?" . getQueryString ());
162
+        $currentUrl = preg_replace("/\&n=.*?$/", "", "?" . getQueryString());
163 163
         if ($this->n > 1) {
164
-            return new LinkNavigation ($currentUrl . "&n=" . ($this->n - 1), "previous", localize ("paging.previous.alternate"));
164
+            return new LinkNavigation($currentUrl . "&n=" . ($this->n - 1), "previous", localize("paging.previous.alternate"));
165 165
         }
166 166
         return NULL;
167 167
     }
168 168
 
169
-    public function getMaxPage ()
169
+    public function getMaxPage()
170 170
     {
171
-        return ceil ($this->totalNumber / getCurrentOption ("max_item_per_page"));
171
+        return ceil($this->totalNumber / getCurrentOption("max_item_per_page"));
172 172
     }
173 173
 
174
-    public function containsBook ()
174
+    public function containsBook()
175 175
     {
176
-        if (count ($this->entryArray) == 0) return false;
177
-        if (get_class ($this->entryArray [0]) == "EntryBook") return true;
176
+        if (count($this->entryArray) == 0) return false;
177
+        if (get_class($this->entryArray [0]) == "EntryBook") return true;
178 178
         return false;
179 179
     }
180 180
 }
Please login to merge, or discard this patch.
base.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 
9 9
 require 'config.php';
10 10
 
11
-define ('VERSION', '1.1.3');
12
-define ('DB', 'db');
11
+define('VERSION', '1.1.3');
12
+define('DB', 'db');
13 13
 date_default_timezone_set($config['default_timezone']);
14 14
 
15 15
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 function serverSideRender($data)
23 23
 {
24 24
     // Get the templates
25
-    $theme = getCurrentTemplate ();
25
+    $theme = getCurrentTemplate();
26 26
     $header = file_get_contents('templates/' . $theme . '/header.html');
27 27
     $footer = file_get_contents('templates/' . $theme . '/footer.html');
28 28
     $main = file_get_contents('templates/' . $theme . '/main.html');
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
     $page = file_get_contents('templates/' . $theme . '/page.html');
31 31
 
32 32
     // Generate the function for the template
33
-    $template = new doT ();
34
-    $dot = $template->template ($page, array ('bookdetail' => $bookdetail,
33
+    $template = new doT();
34
+    $dot = $template->template($page, array('bookdetail' => $bookdetail,
35 35
                                               'header' => $header,
36 36
                                               'footer' => $footer,
37 37
                                               'main' => $main));
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     }
43 43
     // Execute the template
44 44
     if (!empty ($data)) {
45
-        return $dot ($data);
45
+        return $dot($data);
46 46
     }
47 47
 
48 48
     return NULL;
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 function notFound()
60 60
 {
61
-    header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
61
+    header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
62 62
     header('Status: 404 Not Found');
63 63
 
64 64
     $_SERVER['REDIRECT_STATUS'] = 404;
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 {
77 77
     global $config;
78 78
     if (isset($_COOKIE[$option])) {
79
-        if (isset($config ['cops_' . $option]) && is_array ($config ['cops_' . $option])) {
80
-            return explode (',', $_COOKIE[$option]);
79
+        if (isset($config ['cops_' . $option]) && is_array($config ['cops_' . $option])) {
80
+            return explode(',', $_COOKIE[$option]);
81 81
         } else {
82 82
             return $_COOKIE[$option];
83 83
         }
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
 
92 92
 function getCurrentCss()
93 93
 {
94
-    return 'templates/' . getCurrentTemplate () . '/styles/style-' . getCurrentOption('style') . '.css';
94
+    return 'templates/' . getCurrentTemplate() . '/styles/style-' . getCurrentOption('style') . '.css';
95 95
 }
96 96
 
97 97
 function getCurrentTemplate()
98 98
 {
99
-    return getCurrentOption ('template');
99
+    return getCurrentOption('template');
100 100
 }
101 101
 
102 102
 function getUrlWithVersion($url)
@@ -160,10 +160,10 @@  discard block
 block discarded – undo
160 160
     libxml_use_internal_errors(true);
161 161
 
162 162
     $doc->loadHTML('<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body>' .
163
-                        $html  . '</body></html>'); // Load the HTML
163
+                        $html . '</body></html>'); // Load the HTML
164 164
     $output = $doc->saveXML($doc->documentElement); // Transform to an Ansi xml stream
165 165
     $output = xml2xhtml($output);
166
-    if (preg_match ('#<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></meta></head><body>(.*)</body></html>#ms', $output, $matches)) {
166
+    if (preg_match('#<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></meta></head><body>(.*)</body></html>#ms', $output, $matches)) {
167 167
         $output = $matches [1]; // Remove <html><body>
168 168
     }
169 169
     /*
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     }
176 176
     */
177 177
 
178
-    if (!are_libxml_errors_ok ()) $output = 'HTML code not valid.';
178
+    if (!are_libxml_errors_ok()) $output = 'HTML code not valid.';
179 179
 
180 180
     libxml_use_internal_errors(false);
181 181
     return $output;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     //echo var_dump($langs);
265 265
     $lang_file = NULL;
266 266
     foreach ($langs as $language => $val) {
267
-        $temp_file = dirname(__FILE__). '/lang/Localization_' . $language . '.json';
267
+        $temp_file = dirname(__FILE__) . '/lang/Localization_' . $language . '.json';
268 268
         if (file_exists($temp_file)) {
269 269
             $lang = $language;
270 270
             $lang_file = $temp_file;
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         }
273 273
     }
274 274
     if (empty ($lang_file)) {
275
-        $lang_file = dirname(__FILE__). '/lang/Localization_' . $lang . '.json';
275
+        $lang_file = dirname(__FILE__) . '/lang/Localization_' . $lang . '.json';
276 276
     }
277 277
     return array($lang, $lang_file);
278 278
 }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
  * This method is based on this page
282 282
  * http://www.mind-it.info/2010/02/22/a-simple-approach-to-localization-in-php/
283 283
  */
284
-function localize($phrase, $count=-1, $reset=false)
284
+function localize($phrase, $count = -1, $reset = false)
285 285
 {
286 286
     global $config;
287 287
     if ($count == 0)
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
         $lang_file_en = NULL;
302 302
         list ($lang, $lang_file) = getLangAndTranslationFile();
303 303
         if ($lang != 'en') {
304
-            $lang_file_en = dirname(__FILE__). '/lang/' . 'Localization_en.json';
304
+            $lang_file_en = dirname(__FILE__) . '/lang/' . 'Localization_en.json';
305 305
         }
306 306
 
307 307
         $lang_file_content = file_get_contents($lang_file);
@@ -309,18 +309,18 @@  discard block
 block discarded – undo
309 309
         $translations = json_decode($lang_file_content, true);
310 310
 
311 311
         /* Clean the array of all unfinished translations */
312
-        foreach (array_keys ($translations) as $key) {
313
-            if (preg_match ('/^##TODO##/', $key)) {
312
+        foreach (array_keys($translations) as $key) {
313
+            if (preg_match('/^##TODO##/', $key)) {
314 314
                 unset ($translations [$key]);
315 315
             }
316 316
         }
317 317
         if (!is_null($lang_file_en)) {
318 318
             $lang_file_content = file_get_contents($lang_file_en);
319 319
             $translations_en = json_decode($lang_file_content, true);
320
-            $translations = array_merge ($translations_en, $translations);
320
+            $translations = array_merge($translations_en, $translations);
321 321
         }
322 322
     }
323
-    if (array_key_exists ($phrase, $translations)) {
323
+    if (array_key_exists($phrase, $translations)) {
324 324
         return $translations[$phrase];
325 325
     }
326 326
     return $phrase;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
         $urlParams = '';
333 333
     }
334 334
     $start = '';
335
-    if (preg_match ('#^\?(.*)#', $urlParams, $matches)) {
335
+    if (preg_match('#^\?(.*)#', $urlParams, $matches)) {
336 336
         $start = '?';
337 337
         $urlParams = $matches[1];
338 338
     }
Please login to merge, or discard this patch.
lib/JSON_renderer.php 1 patch
Spacing   +95 added lines, -95 removed lines patch added patch discarded remove patch
@@ -14,53 +14,53 @@  discard block
 block discarded – undo
14 14
      * @param Book $book
15 15
      * @return array
16 16
      */
17
-    public static function getBookContentArray ($book) {
17
+    public static function getBookContentArray($book) {
18 18
         global $config;
19 19
         $i = 0;
20
-        $preferedData = array ();
20
+        $preferedData = array();
21 21
         foreach ($config['cops_prefered_format'] as $format)
22 22
         {
23 23
             if ($i == 2) { break; }
24
-            if ($data = $book->getDataFormat ($format)) {
24
+            if ($data = $book->getDataFormat($format)) {
25 25
                 $i++;
26
-                array_push ($preferedData, array ("url" => $data->getHtmlLink (),
27
-                  "viewUrl" => $data->getViewHtmlLink (), "name" => $format));
26
+                array_push($preferedData, array("url" => $data->getHtmlLink(),
27
+                  "viewUrl" => $data->getViewHtmlLink(), "name" => $format));
28 28
             }
29 29
         }
30 30
 
31 31
         $publisher = $book->getPublisher();
32
-        if (is_null ($publisher)) {
32
+        if (is_null($publisher)) {
33 33
             $pn = "";
34 34
             $pu = "";
35 35
         } else {
36 36
             $pn = $publisher->name;
37
-            $link = new LinkNavigation ($publisher->getUri ());
38
-            $pu = $link->hrefXhtml ();
37
+            $link = new LinkNavigation($publisher->getUri());
38
+            $pu = $link->hrefXhtml();
39 39
         }
40 40
 
41
-        $serie = $book->getSerie ();
42
-        if (is_null ($serie)) {
41
+        $serie = $book->getSerie();
42
+        if (is_null($serie)) {
43 43
             $sn = "";
44 44
             $scn = "";
45 45
             $su = "";
46 46
         } else {
47 47
             $sn = $serie->name;
48
-            $scn = str_format (localize ("content.series.data"), $book->seriesIndex, $serie->name);
49
-            $link = new LinkNavigation ($serie->getUri ());
50
-            $su = $link->hrefXhtml ();
48
+            $scn = str_format(localize("content.series.data"), $book->seriesIndex, $serie->name);
49
+            $link = new LinkNavigation($serie->getUri());
50
+            $su = $link->hrefXhtml();
51 51
         }
52 52
         $cc = $book->getCustomColumnValues($config['cops_calibre_custom_column_list'], true);
53 53
 
54
-        return array ("id" => $book->id,
54
+        return array("id" => $book->id,
55 55
                       "hasCover" => $book->hasCover,
56 56
                       "preferedData" => $preferedData,
57
-                      "rating" => $book->getRating (),
57
+                      "rating" => $book->getRating(),
58 58
                       "publisherName" => $pn,
59 59
                       "publisherurl" => $pu,
60
-                      "pubDate" => $book->getPubDate (),
61
-                      "languagesName" => $book->getLanguages (),
62
-                      "authorsName" => $book->getAuthorsName (),
63
-                      "tagsName" => $book->getTagsName (),
60
+                      "pubDate" => $book->getPubDate(),
61
+                      "languagesName" => $book->getLanguages(),
62
+                      "authorsName" => $book->getAuthorsName(),
63
+                      "tagsName" => $book->getTagsName(),
64 64
                       "seriesName" => $sn,
65 65
                       "seriesIndex" => $book->seriesIndex,
66 66
                       "seriesCompleteName" => $scn,
@@ -72,85 +72,85 @@  discard block
 block discarded – undo
72 72
      * @param Book $book
73 73
      * @return array
74 74
      */
75
-    public static function getFullBookContentArray ($book) {
75
+    public static function getFullBookContentArray($book) {
76 76
         global $config;
77
-        $out = self::getBookContentArray ($book);
78
-        $database = GetUrlParam (DB);
79
-
80
-        $out ["coverurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml ();
81
-        $out ["thumbnailurl"] = Data::getLink ($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml ();
82
-        $out ["content"] = $book->getComment (false);
83
-        $out ["datas"] = array ();
84
-        $dataKindle = $book->GetMostInterestingDataToSendToKindle ();
77
+        $out = self::getBookContentArray($book);
78
+        $database = GetUrlParam(DB);
79
+
80
+        $out ["coverurl"] = Data::getLink($book, "jpg", "image/jpeg", Link::OPDS_IMAGE_TYPE, "cover.jpg", NULL)->hrefXhtml();
81
+        $out ["thumbnailurl"] = Data::getLink($book, "jpg", "image/jpeg", Link::OPDS_THUMBNAIL_TYPE, "cover.jpg", NULL, NULL, $config['cops_html_thumbnail_height'] * 2)->hrefXhtml();
82
+        $out ["content"] = $book->getComment(false);
83
+        $out ["datas"] = array();
84
+        $dataKindle = $book->GetMostInterestingDataToSendToKindle();
85 85
         foreach ($book->getDatas() as $data) {
86
-            $tab = array ("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink (), "mail" => 0, "readerUrl" => "");
87
-            if (!empty ($config['cops_mail_configuration']) && !is_null ($dataKindle) && $data->id == $dataKindle->id) {
86
+            $tab = array("id" => $data->id, "format" => $data->format, "url" => $data->getHtmlLink(), "mail" => 0, "readerUrl" => "");
87
+            if (!empty ($config['cops_mail_configuration']) && !is_null($dataKindle) && $data->id == $dataKindle->id) {
88 88
                 $tab ["mail"] = 1;
89 89
             }
90 90
             if ($data->format == "EPUB") {
91 91
                 $tab ["readerUrl"] = "epubreader.php?data={$data->id}&db={$database}";
92 92
             }
93
-            array_push ($out ["datas"], $tab);
93
+            array_push($out ["datas"], $tab);
94 94
         }
95
-        $out ["authors"] = array ();
96
-        foreach ($book->getAuthors () as $author) {
97
-            $link = new LinkNavigation ($author->getUri ());
98
-            array_push ($out ["authors"], array ("name" => $author->name, "url" => $link->hrefXhtml ()));
95
+        $out ["authors"] = array();
96
+        foreach ($book->getAuthors() as $author) {
97
+            $link = new LinkNavigation($author->getUri());
98
+            array_push($out ["authors"], array("name" => $author->name, "url" => $link->hrefXhtml()));
99 99
         }
100
-        $out ["tags"] = array ();
101
-        foreach ($book->getTags () as $tag) {
102
-            $link = new LinkNavigation ($tag->getUri ());
103
-            array_push ($out ["tags"], array ("name" => $tag->name, "url" => $link->hrefXhtml ()));
100
+        $out ["tags"] = array();
101
+        foreach ($book->getTags() as $tag) {
102
+            $link = new LinkNavigation($tag->getUri());
103
+            array_push($out ["tags"], array("name" => $tag->name, "url" => $link->hrefXhtml()));
104 104
         }
105 105
         $out ["customcolumns_preview"] = $book->getCustomColumnValues($config['cops_calibre_custom_column_preview'], true);
106 106
 
107 107
         return $out;
108 108
     }
109 109
 
110
-    public static function getContentArray ($entry) {
110
+    public static function getContentArray($entry) {
111 111
         if ($entry instanceof EntryBook) {
112
-            $out = array ( "title" => $entry->title);
113
-            $out ["book"] = self::getBookContentArray ($entry->book);
112
+            $out = array("title" => $entry->title);
113
+            $out ["book"] = self::getBookContentArray($entry->book);
114 114
             return $out;
115 115
         }
116
-        return array ( "title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink (), "number" => $entry->numberOfElement );
116
+        return array("title" => $entry->title, "content" => $entry->content, "navlink" => $entry->getNavLink(), "number" => $entry->numberOfElement);
117 117
     }
118 118
 
119
-    public static function getContentArrayTypeahead ($page) {
120
-        $out = array ();
119
+    public static function getContentArrayTypeahead($page) {
120
+        $out = array();
121 121
         foreach ($page->entryArray as $entry) {
122 122
             if ($entry instanceof EntryBook) {
123
-                array_push ($out, array ("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->book->getDetailUrl ()));
123
+                array_push($out, array("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->book->getDetailUrl()));
124 124
             } else {
125
-                if (empty ($entry->className) xor Base::noDatabaseSelected ()) {
126
-                    array_push ($out, array ("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->getNavLink ()));
125
+                if (empty ($entry->className) xor Base::noDatabaseSelected()) {
126
+                    array_push($out, array("class" => $entry->className, "title" => $entry->title, "navlink" => $entry->getNavLink()));
127 127
                 } else {
128
-                    array_push ($out, array ("class" => $entry->className, "title" => $entry->content, "navlink" => $entry->getNavLink ()));
128
+                    array_push($out, array("class" => $entry->className, "title" => $entry->content, "navlink" => $entry->getNavLink()));
129 129
                 }
130 130
             }
131 131
         }
132 132
         return $out;
133 133
     }
134 134
 
135
-    public static function addCompleteArray ($in) {
135
+    public static function addCompleteArray($in) {
136 136
         global $config;
137 137
         $out = $in;
138 138
 
139
-        $out ["c"] = array ("version" => VERSION, "i18n" => array (
139
+        $out ["c"] = array("version" => VERSION, "i18n" => array(
140 140
                            "coverAlt" => localize("i18n.coversection"),
141 141
                            "authorsTitle" => localize("authors.title"),
142 142
                            "bookwordTitle" => localize("bookword.title"),
143 143
                            "tagsTitle" => localize("tags.title"),
144 144
                            "seriesTitle" => localize("series.title"),
145
-                           "customizeTitle" => localize ("customize.title"),
146
-                           "aboutTitle" => localize ("about.title"),
147
-                           "previousAlt" => localize ("paging.previous.alternate"),
148
-                           "nextAlt" => localize ("paging.next.alternate"),
149
-                           "searchAlt" => localize ("search.alternate"),
150
-                           "sortAlt" => localize ("sort.alternate"),
151
-                           "homeAlt" => localize ("home.alternate"),
152
-                           "cogAlt" => localize ("cog.alternate"),
153
-                           "permalinkAlt" => localize ("permalink.alternate"),
145
+                           "customizeTitle" => localize("customize.title"),
146
+                           "aboutTitle" => localize("about.title"),
147
+                           "previousAlt" => localize("paging.previous.alternate"),
148
+                           "nextAlt" => localize("paging.next.alternate"),
149
+                           "searchAlt" => localize("search.alternate"),
150
+                           "sortAlt" => localize("sort.alternate"),
151
+                           "homeAlt" => localize("home.alternate"),
152
+                           "cogAlt" => localize("cog.alternate"),
153
+                           "permalinkAlt" => localize("permalink.alternate"),
154 154
                            "publisherName" => localize("publisher.name"),
155 155
                            "pubdateTitle" => localize("pubdate.title"),
156 156
                            "languagesTitle" => localize("language.title"),
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
                            "sortorderAsc" => localize("search.sortorder.asc"),
159 159
                            "sortorderDesc" => localize("search.sortorder.desc"),
160 160
                            "customizeEmail" => localize("customize.email")),
161
-                       "url" => array (
161
+                       "url" => array(
162 162
                            "detailUrl" => "index.php?page=13&id={0}&db={1}",
163 163
                            "coverUrl" => "fetch.php?id={0}&db={1}",
164 164
                            "thumbnailUrl" => "fetch.php?height=" . $config['cops_html_thumbnail_height'] . "&id={0}&db={1}"),
165
-                       "config" => array (
165
+                       "config" => array(
166 166
                            "use_fancyapps" => $config ["cops_use_fancyapps"],
167 167
                            "max_item_per_page" => $config['cops_max_item_per_page'],
168 168
                            "kindleHack"        => "",
169
-                           "server_side_rendering" => useServerSideRendering (),
169
+                           "server_side_rendering" => useServerSideRendering(),
170 170
                            "html_tag_filter" => $config['cops_html_tag_filter']));
171 171
         if ($config['cops_thumbnail_handling'] == "1") {
172 172
             $out ["c"]["url"]["thumbnailUrl"] = $out ["c"]["url"]["coverUrl"];
@@ -179,32 +179,32 @@  discard block
 block discarded – undo
179 179
         return $out;
180 180
     }
181 181
 
182
-    public static function getJson ($complete = false) {
182
+    public static function getJson($complete = false) {
183 183
         global $config;
184
-        $page = getURLParam ("page", Base::PAGE_INDEX);
185
-        $query = getURLParam ("query");
186
-        $search = getURLParam ("search");
187
-        $qid = getURLParam ("id");
188
-        $n = getURLParam ("n", "1");
189
-        $database = GetUrlParam (DB);
184
+        $page = getURLParam("page", Base::PAGE_INDEX);
185
+        $query = getURLParam("query");
186
+        $search = getURLParam("search");
187
+        $qid = getURLParam("id");
188
+        $n = getURLParam("n", "1");
189
+        $database = GetUrlParam(DB);
190 190
 
191
-        $currentPage = Page::getPage ($page, $qid, $query, $n);
192
-        $currentPage->InitializeContent ();
191
+        $currentPage = Page::getPage($page, $qid, $query, $n);
192
+        $currentPage->InitializeContent();
193 193
 
194 194
         if ($search) {
195
-            return self::getContentArrayTypeahead ($currentPage);
195
+            return self::getContentArrayTypeahead($currentPage);
196 196
         }
197 197
 
198
-        $out = array ( "title" => $currentPage->title);
199
-        $entries = array ();
198
+        $out = array("title" => $currentPage->title);
199
+        $entries = array();
200 200
         foreach ($currentPage->entryArray as $entry) {
201
-            array_push ($entries, self::getContentArray ($entry));
201
+            array_push($entries, self::getContentArray($entry));
202 202
         }
203
-        if (!is_null ($currentPage->book)) {
204
-            $out ["book"] = self::getFullBookContentArray ($currentPage->book);
203
+        if (!is_null($currentPage->book)) {
204
+            $out ["book"] = self::getFullBookContentArray($currentPage->book);
205 205
         }
206
-        $out ["databaseId"] = GetUrlParam (DB, "");
207
-        $out ["databaseName"] = Base::getDbName ();
206
+        $out ["databaseId"] = GetUrlParam(DB, "");
207
+        $out ["databaseName"] = Base::getDbName();
208 208
         if ($out ["databaseId"] == "") {
209 209
             $out ["databaseName"] = "";
210 210
         }
@@ -213,42 +213,42 @@  discard block
 block discarded – undo
213 213
             $out ["fullTitle"] = $out ["databaseName"] . " > " . $out ["fullTitle"];
214 214
         }
215 215
         $out ["page"] = $page;
216
-        $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled () ? 1 : 0;
216
+        $out ["multipleDatabase"] = Base::isMultipleDatabaseEnabled()?1:0;
217 217
         $out ["entries"] = $entries;
218 218
         $out ["isPaginated"] = 0;
219
-        if ($currentPage->isPaginated ()) {
220
-            $prevLink = $currentPage->getPrevLink ();
221
-            $nextLink = $currentPage->getNextLink ();
219
+        if ($currentPage->isPaginated()) {
220
+            $prevLink = $currentPage->getPrevLink();
221
+            $nextLink = $currentPage->getNextLink();
222 222
             $out ["isPaginated"] = 1;
223 223
             $out ["prevLink"] = "";
224
-            if (!is_null ($prevLink)) {
225
-                $out ["prevLink"] = $prevLink->hrefXhtml ();
224
+            if (!is_null($prevLink)) {
225
+                $out ["prevLink"] = $prevLink->hrefXhtml();
226 226
             }
227 227
             $out ["nextLink"] = "";
228
-            if (!is_null ($nextLink)) {
229
-                $out ["nextLink"] = $nextLink->hrefXhtml ();
228
+            if (!is_null($nextLink)) {
229
+                $out ["nextLink"] = $nextLink->hrefXhtml();
230 230
             }
231
-            $out ["maxPage"] = $currentPage->getMaxPage ();
231
+            $out ["maxPage"] = $currentPage->getMaxPage();
232 232
             $out ["currentPage"] = $currentPage->n;
233 233
         }
234
-        if (!is_null (getURLParam ("complete")) || $complete) {
235
-            $out = self::addCompleteArray ($out);
234
+        if (!is_null(getURLParam("complete")) || $complete) {
235
+            $out = self::addCompleteArray($out);
236 236
        }
237 237
 
238 238
         $out ["containsBook"] = 0;
239
-        if ($currentPage->containsBook ()) {
239
+        if ($currentPage->containsBook()) {
240 240
             $out ["containsBook"] = 1;
241 241
         }
242 242
 
243
-        $out["abouturl"] = "index.php" . addURLParameter ("?page=" . Base::PAGE_ABOUT, DB, $database);
243
+        $out["abouturl"] = "index.php" . addURLParameter("?page=" . Base::PAGE_ABOUT, DB, $database);
244 244
 
245 245
         if ($page == Base::PAGE_ABOUT) {
246
-            $temp = preg_replace ("/\<h1\>About COPS\<\/h1\>/", "<h1>About COPS " . VERSION . "</h1>", file_get_contents('about.html'));
246
+            $temp = preg_replace("/\<h1\>About COPS\<\/h1\>/", "<h1>About COPS " . VERSION . "</h1>", file_get_contents('about.html'));
247 247
             $out ["fullhtml"] = $temp;
248 248
         }
249 249
 
250 250
         $out ["homeurl"] = "index.php";
251
-        if ($page != Base::PAGE_INDEX && !is_null ($database)) $out ["homeurl"] = $out ["homeurl"] .  "?" . addURLParameter ("", DB, $database);
251
+        if ($page != Base::PAGE_INDEX && !is_null($database)) $out ["homeurl"] = $out ["homeurl"] . "?" . addURLParameter("", DB, $database);
252 252
 
253 253
         return $out;
254 254
     }
Please login to merge, or discard this patch.