@@ -16,9 +16,11 @@ discard block |
||
16 | 16 | |
17 | 17 | # Set breadcrumbs |
18 | 18 | |
19 | - if (count($this->path) <= 1) $contents->block('breadcrumbs')->disable(); |
|
20 | - |
|
21 | - else $contents->block('breadcrumbs')->path = $this->path; |
|
19 | + if (count($this->path) <= 1) { |
|
20 | + $contents->block('breadcrumbs')->disable(); |
|
21 | + } else { |
|
22 | + $contents->block('breadcrumbs')->path = $this->path; |
|
23 | + } |
|
22 | 24 | |
23 | 25 | # Set contents |
24 | 26 | |
@@ -41,19 +43,31 @@ discard block |
||
41 | 43 | |
42 | 44 | $slug = implode('/', $this->url->path()); |
43 | 45 | |
44 | - if ('' !== $slug) $this->page->initBySlug($slug); else $this->page->init(1); |
|
46 | + if ('' !== $slug) { |
|
47 | + $this->page->initBySlug($slug); |
|
48 | + } else { |
|
49 | + $this->page->init(1); |
|
50 | + } |
|
45 | 51 | |
46 | 52 | # Display error if not found |
47 | 53 | |
48 | - if (0 === $this->page->id) return false; |
|
54 | + if (0 === $this->page->id) { |
|
55 | + return false; |
|
56 | + } |
|
49 | 57 | |
50 | 58 | # Get path |
51 | 59 | |
52 | - if (false !== ($path = $this->page->path())) $this->path = $path; |
|
60 | + if (false !== ($path = $this->page->path())) { |
|
61 | + $this->path = $path; |
|
62 | + } |
|
53 | 63 | |
54 | 64 | # Set data |
55 | 65 | |
56 | - if ($this->page->id !== 1) $this->title = $this->page->title; else $this->layout = 'Index'; |
|
66 | + if ($this->page->id !== 1) { |
|
67 | + $this->title = $this->page->title; |
|
68 | + } else { |
|
69 | + $this->layout = 'Index'; |
|
70 | + } |
|
57 | 71 | |
58 | 72 | $this->description = $this->page->description; |
59 | 73 | $this->keywords = $this->page->keywords; |
@@ -12,7 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | $selection = 'MAX(time_modified) as last_modified'; |
14 | 14 | |
15 | - if (!(DB::select(TABLE_PAGES, $selection) && (DB::last()->rows === 1))) return 0; |
|
15 | + if (!(DB::select(TABLE_PAGES, $selection) && (DB::last()->rows === 1))) { |
|
16 | + return 0; |
|
17 | + } |
|
16 | 18 | |
17 | 19 | # ------------------------ |
18 | 20 | |
@@ -27,11 +29,15 @@ discard block |
||
27 | 29 | |
28 | 30 | $condition = ['visibility' => VISIBILITY_PUBLISHED, 'access' => ACCESS_PUBLIC, 'locked' => 0]; |
29 | 31 | |
30 | - if (!(DB::select(TABLE_PAGES, $selection, $condition, 'slug') && DB::last()->status)) return; |
|
32 | + if (!(DB::select(TABLE_PAGES, $selection, $condition, 'slug') && DB::last()->status)) { |
|
33 | + return; |
|
34 | + } |
|
31 | 35 | |
32 | 36 | # ------------------------ |
33 | 37 | |
34 | - while (null !== ($page = DB::last()->row())) yield Entitizer::create(TABLE_PAGES, $page); |
|
38 | + while (null !== ($page = DB::last()->row())) { |
|
39 | + yield Entitizer::create(TABLE_PAGES, $page); |
|
40 | + } |
|
35 | 41 | } |
36 | 42 | |
37 | 43 | # Handle request |
@@ -44,7 +50,9 @@ discard block |
||
44 | 50 | |
45 | 51 | # Get last modification time |
46 | 52 | |
47 | - if ($sitemap->load($this->getLastModified())) return $sitemap; |
|
53 | + if ($sitemap->load($this->getLastModified())) { |
|
54 | + return $sitemap; |
|
55 | + } |
|
48 | 56 | |
49 | 57 | # Fill sitemap |
50 | 58 |