@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | $data = $book->component($component); |
15 | 15 | |
16 | - $callback = function ($m) use ($book, $component, $add) { |
|
16 | + $callback = function($m) use ($book, $component, $add) { |
|
17 | 17 | $method = $m[1]; |
18 | 18 | $path = $m[2]; |
19 | 19 | $end = ''; |
@@ -72,10 +72,10 @@ discard block |
||
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'); |
|
77 | + header('Cache-Control: maxage=' . $expires); |
|
78 | + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $expires) . ' GMT'); |
|
79 | 79 | header('Content-Type: ' . $book->componentContentType($component)); |
80 | 80 | echo $data; |
81 | 81 | } catch (Exception $e) { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | public const ALL_RATING_ID = "cops:rating"; |
12 | 12 | |
13 | 13 | public const RATING_COLUMNS = "ratings.id as id, ratings.rating as rating, count(*) as count"; |
14 | - public 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 | + public 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"; |
|
15 | 15 | public $id; |
16 | 16 | public $name; |
17 | 17 | |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | |
24 | 24 | public function getUri() |
25 | 25 | { |
26 | - return "?page=".parent::PAGE_RATING_DETAIL."&id=$this->id"; |
|
26 | + return "?page=" . parent::PAGE_RATING_DETAIL . "&id=$this->id"; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function getEntryId() |
30 | 30 | { |
31 | - return self::ALL_RATING_ID.":".$this->id; |
|
31 | + return self::ALL_RATING_ID . ":" . $this->id; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public static function getCount() |
@@ -48,14 +48,14 @@ discard block |
||
48 | 48 | $entryArray = []; |
49 | 49 | while ($post = $result->fetchObject()) { |
50 | 50 | $ratingObj = new Rating($post->id, $post->rating); |
51 | - $rating=$post->rating/2; |
|
51 | + $rating = $post->rating / 2; |
|
52 | 52 | $rating = str_format(localize("ratingword", $rating), $rating); |
53 | 53 | array_push($entryArray, new Entry( |
54 | 54 | $rating, |
55 | 55 | $ratingObj->getEntryId(), |
56 | 56 | str_format(localize("bookword", $post->count), $post->count), |
57 | 57 | "text", |
58 | - [ new LinkNavigation($ratingObj->getUri())], |
|
58 | + [new LinkNavigation($ratingObj->getUri())], |
|
59 | 59 | "", |
60 | 60 | $post->count |
61 | 61 | )); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | $rating = Rating::getRatingById($this->idGet); |
14 | 14 | $this->idPage = $rating->getEntryId(); |
15 | - $this->title =str_format(localize("ratingword", $rating->name/2), $rating->name/2); |
|
15 | + $this->title = str_format(localize("ratingword", $rating->name / 2), $rating->name / 2); |
|
16 | 16 | [$this->entryArray, $this->totalNumber] = Book::getBooksByRating($this->idGet, $this->n); |
17 | 17 | } |
18 | 18 | } |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | |
29 | 29 | public function getUri() |
30 | 30 | { |
31 | - return "?page=".parent::PAGE_AUTHOR_DETAIL."&id=$this->id"; |
|
31 | + return "?page=" . parent::PAGE_AUTHOR_DETAIL . "&id=$this->id"; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function getEntryId() |
35 | 35 | { |
36 | - return self::ALL_AUTHORS_ID.":".$this->id; |
|
36 | + return self::ALL_AUTHORS_ID . ":" . $this->id; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | public static function getEntryIdByLetter($startingLetter) |
40 | 40 | { |
41 | - return self::ALL_AUTHORS_ID.":letter:".$startingLetter; |
|
41 | + return self::ALL_AUTHORS_ID . ":letter:" . $startingLetter; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public static function getCount() |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | Author::getEntryIdByLetter($post->title), |
61 | 61 | str_format(localize("authorword", $post->count), $post->count), |
62 | 62 | "text", |
63 | - [ new LinkNavigation("?page=".parent::PAGE_AUTHORS_FIRST_LETTER."&id=". rawurlencode($post->title))], |
|
63 | + [new LinkNavigation("?page=" . parent::PAGE_AUTHORS_FIRST_LETTER . "&id=" . rawurlencode($post->title))], |
|
64 | 64 | "", |
65 | 65 | $post->count |
66 | 66 | )); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | DB . ":query:{$d}", |
79 | 79 | " ", |
80 | 80 | "text", |
81 | - [ new LinkNavigation("?" . DB . "={$d}")], |
|
81 | + [new LinkNavigation("?" . DB . "={$d}")], |
|
82 | 82 | "tt-header" |
83 | 83 | )); |
84 | 84 | Base::getDb($d); |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | DB . ":query:{$d}:{$key}", |
113 | 113 | str_format(localize("{$key}word", $total), $total), |
114 | 114 | "text", |
115 | - [ new LinkNavigation("?page={$pagequery}&query={$query}&db={$d}&scope={$key}")], |
|
116 | - Base::noDatabaseSelected() ? "" : "tt-header", |
|
115 | + [new LinkNavigation("?page={$pagequery}&query={$query}&db={$d}&scope={$key}")], |
|
116 | + Base::noDatabaseSelected()?"":"tt-header", |
|
117 | 117 | $total |
118 | 118 | )); |
119 | 119 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | DB . ":query:{$i}", |
164 | 164 | str_format(localize("bookword", $totalNumber), $totalNumber), |
165 | 165 | "text", |
166 | - [ new LinkNavigation("?" . DB . "={$i}&page=9&query=" . $this->query)], |
|
166 | + [new LinkNavigation("?" . DB . "={$i}&page=9&query=" . $this->query)], |
|
167 | 167 | "", |
168 | 168 | $totalNumber |
169 | 169 | )); |
@@ -228,7 +228,7 @@ |
||
228 | 228 | return new Link("fetch.php?" . $urlParam, $mime, $rel, $title); |
229 | 229 | } |
230 | 230 | } else { |
231 | - return new Link(str_replace('%2F', '/', rawurlencode($book->path."/".$filename)), $mime, $rel, $title); |
|
231 | + return new Link(str_replace('%2F', '/', rawurlencode($book->path . "/" . $filename)), $mime, $rel, $title); |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | } |
@@ -11,18 +11,18 @@ discard block |
||
11 | 11 | */ |
12 | 12 | abstract class CustomColumnType extends Base |
13 | 13 | { |
14 | - public const ALL_CUSTOMS_ID = "cops:custom"; |
|
14 | + public const ALL_CUSTOMS_ID = "cops:custom"; |
|
15 | 15 | |
16 | - public const CUSTOM_TYPE_TEXT = "text"; // type 1 + 2 |
|
17 | - public const CUSTOM_TYPE_COMMENT = "comments"; // type 3 |
|
18 | - public const CUSTOM_TYPE_SERIES = "series"; // type 4 |
|
16 | + public const CUSTOM_TYPE_TEXT = "text"; // type 1 + 2 |
|
17 | + public const CUSTOM_TYPE_COMMENT = "comments"; // type 3 |
|
18 | + public const CUSTOM_TYPE_SERIES = "series"; // type 4 |
|
19 | 19 | public const CUSTOM_TYPE_ENUM = "enumeration"; // type 5 |
20 | - public const CUSTOM_TYPE_DATE = "datetime"; // type 6 |
|
21 | - public const CUSTOM_TYPE_FLOAT = "float"; // type 7 |
|
22 | - public const CUSTOM_TYPE_INT = "int"; // type 8 |
|
23 | - public const CUSTOM_TYPE_RATING = "rating"; // type 9 |
|
24 | - public const CUSTOM_TYPE_BOOL = "bool"; // type 10 |
|
25 | - public const CUSTOM_TYPE_COMPOSITE = "composite"; // type 11 + 12 |
|
20 | + public const CUSTOM_TYPE_DATE = "datetime"; // type 6 |
|
21 | + public const CUSTOM_TYPE_FLOAT = "float"; // type 7 |
|
22 | + public const CUSTOM_TYPE_INT = "int"; // type 8 |
|
23 | + public const CUSTOM_TYPE_RATING = "rating"; // type 9 |
|
24 | + public const CUSTOM_TYPE_BOOL = "bool"; // type 10 |
|
25 | + public const CUSTOM_TYPE_COMPOSITE = "composite"; // type 11 + 12 |
|
26 | 26 | |
27 | 27 | /** @var array[integer]CustomColumnType */ |
28 | 28 | private static $customColumnCacheID = []; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $result->execute([$this->customId]); |
111 | 111 | if ($post = $result->fetchObject()) { |
112 | 112 | $json = json_decode($post->display); |
113 | - return (isset($json->description) && !empty($json->description)) ? $json->description : null; |
|
113 | + return (isset($json->description) && !empty($json->description))?$json->description:null; |
|
114 | 114 | } |
115 | 115 | return null; |
116 | 116 | } |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | |
24 | 24 | public function getUri() |
25 | 25 | { |
26 | - return "?page=".parent::PAGE_TAG_DETAIL."&id=$this->id"; |
|
26 | + return "?page=" . parent::PAGE_TAG_DETAIL . "&id=$this->id"; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function getEntryId() |
30 | 30 | { |
31 | - return self::ALL_TAGS_ID.":".$this->id; |
|
31 | + return self::ALL_TAGS_ID . ":" . $this->id; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public static function getCount() |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | public static function getAllTagsByQuery($query, $n, $database = null, $numberPerPage = null) |
56 | 56 | { |
57 | - $columns = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count"; |
|
57 | + $columns = "tags.id as id, tags.name as name, (select count(*) from books_tags_link where tags.id = tag) as count"; |
|
58 | 58 | $sql = 'select {0} from tags where upper (tags.name) like ? {1} order by tags.name'; |
59 | 59 | [$totalNumber, $result] = parent::executeQuery($sql, $columns, "", ['%' . $query . '%'], $n, $database, $numberPerPage); |
60 | 60 | $entryArray = []; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $tag->getEntryId(), |
66 | 66 | str_format(localize("bookword", $post->count), $post->count), |
67 | 67 | "text", |
68 | - [ new LinkNavigation($tag->getUri())] |
|
68 | + [new LinkNavigation($tag->getUri())] |
|
69 | 69 | )); |
70 | 70 | } |
71 | 71 | return [$entryArray, $totalNumber]; |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | $this->query = $pquery; |
87 | 87 | $this->n = $pn; |
88 | 88 | $this->favicon = $config['cops_icon']; |
89 | - $this->authorName = $config['cops_author_name'] ?: 'Sébastien Lucas'; |
|
90 | - $this->authorUri = $config['cops_author_uri'] ?: 'http://blog.slucas.fr'; |
|
91 | - $this->authorEmail = $config['cops_author_email'] ?: '[email protected]'; |
|
89 | + $this->authorName = $config['cops_author_name']?:'Sébastien Lucas'; |
|
90 | + $this->authorUri = $config['cops_author_uri']?:'http://blog.slucas.fr'; |
|
91 | + $this->authorEmail = $config['cops_author_email']?:'[email protected]'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | public function InitializeContent() |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | "cops:{$i}:catalog", |
106 | 106 | str_format(localize("bookword", $nBooks), $nBooks), |
107 | 107 | "text", |
108 | - [ new LinkNavigation("?" . DB . "={$i}")], |
|
108 | + [new LinkNavigation("?" . DB . "={$i}")], |
|
109 | 109 | "", |
110 | 110 | $nBooks |
111 | 111 | )); |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $this->entryArray = array_merge($this->entryArray, Book::getCount()); |
156 | 156 | |
157 | 157 | if (Base::isMultipleDatabaseEnabled()) { |
158 | - $this->title = Base::getDbName(); |
|
158 | + $this->title = Base::getDbName(); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | } |