@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | # Check installation |
23 | 23 | |
24 | - if (null === ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/install.php'); |
|
24 | + if (null === ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH.'/install.php'); |
|
25 | 25 | |
26 | 26 | # Connect to database |
27 | 27 |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | # Check installation |
23 | 23 | |
24 | - if (null === ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/install.php'); |
|
24 | + if (null === ($data = Schema::get('System')->load())) { |
|
25 | + Request::redirect(INSTALL_PATH . '/install.php'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | # Connect to database |
27 | 29 |
@@ -68,11 +68,11 @@ |
||
68 | 68 | |
69 | 69 | if ($this->page->id !== 1) SEO::title($this->page->title); else $this->_layout = 'Index'; |
70 | 70 | |
71 | - SEO::description ($this->page->description); |
|
72 | - SEO::keywords ($this->page->keywords); |
|
73 | - SEO::robotsIndex ($this->page->robots_index); |
|
74 | - SEO::robotsFollow ($this->page->robots_follow); |
|
75 | - SEO::canonical ($this->page->canonical); |
|
71 | + SEO::description($this->page->description); |
|
72 | + SEO::keywords($this->page->keywords); |
|
73 | + SEO::robotsIndex($this->page->robots_index); |
|
74 | + SEO::robotsFollow($this->page->robots_follow); |
|
75 | + SEO::canonical($this->page->canonical); |
|
76 | 76 | |
77 | 77 | # ------------------------ |
78 | 78 |
@@ -25,9 +25,11 @@ discard block |
||
25 | 25 | |
26 | 26 | # Set breadcrumbs |
27 | 27 | |
28 | - if (count($this->path) <= 1) $contents->getBlock('breadcrumbs')->disable(); |
|
29 | - |
|
30 | - else $contents->getBlock('breadcrumbs')->path = $this->path; |
|
28 | + if (count($this->path) <= 1) { |
|
29 | + $contents->getBlock('breadcrumbs')->disable(); |
|
30 | + } else { |
|
31 | + $contents->getBlock('breadcrumbs')->path = $this->path; |
|
32 | + } |
|
31 | 33 | |
32 | 34 | # Set contents |
33 | 35 | |
@@ -54,19 +56,31 @@ discard block |
||
54 | 56 | |
55 | 57 | $slug = $this->_url->getSlug(); |
56 | 58 | |
57 | - if ('' !== $slug) $this->page->initBySlug($slug); else $this->page->init(1); |
|
59 | + if ('' !== $slug) { |
|
60 | + $this->page->initBySlug($slug); |
|
61 | + } else { |
|
62 | + $this->page->init(1); |
|
63 | + } |
|
58 | 64 | |
59 | 65 | # Display error if not found |
60 | 66 | |
61 | - if (0 === $this->page->id) return false; |
|
67 | + if (0 === $this->page->id) { |
|
68 | + return false; |
|
69 | + } |
|
62 | 70 | |
63 | 71 | # Get path |
64 | 72 | |
65 | - if (false !== ($path = $this->page->getPath())) $this->path = $path; |
|
73 | + if (false !== ($path = $this->page->getPath())) { |
|
74 | + $this->path = $path; |
|
75 | + } |
|
66 | 76 | |
67 | 77 | # Set data |
68 | 78 | |
69 | - if ($this->page->id !== 1) SEO::title($this->page->title); else $this->_layout = 'Index'; |
|
79 | + if ($this->page->id !== 1) { |
|
80 | + SEO::title($this->page->title); |
|
81 | + } else { |
|
82 | + $this->_layout = 'Index'; |
|
83 | + } |
|
70 | 84 | |
71 | 85 | SEO::description ($this->page->description); |
72 | 86 | SEO::keywords ($this->page->keywords); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | if ($this->form->handle(new Install\Controller\Database)) { |
50 | 50 | |
51 | - Request::redirect(INSTALL_PATH . '/admin/register'); |
|
51 | + Request::redirect(INSTALL_PATH.'/admin/register'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | # ------------------------ |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | |
94 | 94 | for ($id = 2; $id <= 4; $id++) $pages[] = ['id' => $id, 'visibility' => VISIBILITY_PUBLISHED, |
95 | 95 | |
96 | - 'locked' => false, 'slug' => ('page-' . ($id - 1)), 'name' => ('page-' . ($id - 1)), |
|
96 | + 'locked' => false, 'slug' => ('page-'.($id - 1)), 'name' => ('page-'.($id - 1)), |
|
97 | 97 | |
98 | - 'title' => (Language::get('INSTALL_PAGE_DEMO_TITLE') . ' ' . ($id - 1)), |
|
98 | + 'title' => (Language::get('INSTALL_PAGE_DEMO_TITLE').' '.($id - 1)), |
|
99 | 99 | |
100 | 100 | 'contents' => Template::createBlock(Language::get('INSTALL_PAGE_DEMO_CONTENTS'))->getContents(), |
101 | 101 | |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | |
133 | 133 | for ($id = 1; $id <= 3; $id++) $menu[] = [ |
134 | 134 | |
135 | - 'id' => $id, 'active' => true, 'position' => ($id - 1), 'slug' => ('page-' . $id), |
|
135 | + 'id' => $id, 'active' => true, 'position' => ($id - 1), 'slug' => ('page-'.$id), |
|
136 | 136 | |
137 | - 'text' => (Language::get('INSTALL_PAGE_DEMO_TITLE') . ' ' . $id)]; |
|
137 | + 'text' => (Language::get('INSTALL_PAGE_DEMO_TITLE').' '.$id)]; |
|
138 | 138 | |
139 | 139 | # Process insertion |
140 | 140 |
@@ -77,7 +77,11 @@ discard block |
||
77 | 77 | |
78 | 78 | $count = DB::count(TABLE_PAGES); |
79 | 79 | |
80 | - if (false === $count) return false; else if ($count > 0) return true; |
|
80 | + if (false === $count) { |
|
81 | + return false; |
|
82 | + } else if ($count > 0) { |
|
83 | + return true; |
|
84 | + } |
|
81 | 85 | |
82 | 86 | # Process dataset |
83 | 87 | |
@@ -91,7 +95,8 @@ discard block |
||
91 | 95 | |
92 | 96 | 'time_created' => REQUEST_TIME, 'time_modified' => REQUEST_TIME]]; |
93 | 97 | |
94 | - for ($id = 2; $id <= 4; $id++) $pages[] = ['id' => $id, 'visibility' => VISIBILITY_PUBLISHED, |
|
98 | + for ($id = 2; $id <= 4; $id++) { |
|
99 | + $pages[] = ['id' => $id, 'visibility' => VISIBILITY_PUBLISHED, |
|
95 | 100 | |
96 | 101 | 'locked' => false, 'slug' => ('page-' . ($id - 1)), 'name' => ('page-' . ($id - 1)), |
97 | 102 | |
@@ -100,10 +105,13 @@ discard block |
||
100 | 105 | 'contents' => Template::createBlock(Language::get('INSTALL_PAGE_DEMO_CONTENTS'))->getContents(), |
101 | 106 | |
102 | 107 | 'time_created' => REQUEST_TIME, 'time_modified' => REQUEST_TIME]; |
108 | + } |
|
103 | 109 | |
104 | 110 | # Process insertion |
105 | 111 | |
106 | - if (!(DB::insert(TABLE_PAGES, $pages, true) && DB::getLast()->status)) return false; |
|
112 | + if (!(DB::insert(TABLE_PAGES, $pages, true) && DB::getLast()->status)) { |
|
113 | + return false; |
|
114 | + } |
|
107 | 115 | |
108 | 116 | self::fillRelationsTable(TABLE_PAGES_RELATIONS, count($pages)); |
109 | 117 | |
@@ -124,21 +132,29 @@ discard block |
||
124 | 132 | |
125 | 133 | $count = DB::count(TABLE_MENU); |
126 | 134 | |
127 | - if (false === $count) return false; else if ($count > 0) return true; |
|
135 | + if (false === $count) { |
|
136 | + return false; |
|
137 | + } else if ($count > 0) { |
|
138 | + return true; |
|
139 | + } |
|
128 | 140 | |
129 | 141 | # Process dataset |
130 | 142 | |
131 | 143 | $menu = []; |
132 | 144 | |
133 | - for ($id = 1; $id <= 3; $id++) $menu[] = [ |
|
145 | + for ($id = 1; $id <= 3; $id++) { |
|
146 | + $menu[] = [ |
|
134 | 147 | |
135 | 148 | 'id' => $id, 'active' => true, 'position' => ($id - 1), 'slug' => ('page-' . $id), |
136 | 149 | |
137 | 150 | 'text' => (Language::get('INSTALL_PAGE_DEMO_TITLE') . ' ' . $id)]; |
151 | + } |
|
138 | 152 | |
139 | 153 | # Process insertion |
140 | 154 | |
141 | - if (!(DB::insert(TABLE_MENU, $menu, true) && DB::getLast()->status)) return false; |
|
155 | + if (!(DB::insert(TABLE_MENU, $menu, true) && DB::getLast()->status)) { |
|
156 | + return false; |
|
157 | + } |
|
142 | 158 | |
143 | 159 | self::fillRelationsTable(TABLE_MENU_RELATIONS, count($menu)); |
144 | 160 | |
@@ -157,7 +173,9 @@ discard block |
||
157 | 173 | |
158 | 174 | $definitions = self::getDefinitions(false); |
159 | 175 | |
160 | - foreach ($definitions as $definition) if (!$definition->createTables()) return false; |
|
176 | + foreach ($definitions as $definition) { |
|
177 | + if (!$definition->createTables()) return false; |
|
178 | + } |
|
161 | 179 | |
162 | 180 | # ------------------------ |
163 | 181 | |
@@ -174,7 +192,9 @@ discard block |
||
174 | 192 | |
175 | 193 | $definitions = self::getDefinitions(true); |
176 | 194 | |
177 | - foreach ($definitions as $definition) if (!$definition->removeTables()) return false; |
|
195 | + foreach ($definitions as $definition) { |
|
196 | + if (!$definition->removeTables()) return false; |
|
197 | + } |
|
178 | 198 | |
179 | 199 | # ------------------------ |
180 | 200 |
@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | public static function checkFile() : bool { |
94 | 94 | |
95 | - return Explorer::isFile(DIR_WWW . 'install.php'); |
|
95 | + return Explorer::isFile(DIR_WWW.'install.php'); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 | } |
@@ -21,7 +21,9 @@ discard block |
||
21 | 21 | |
22 | 22 | public static function __autoload() { |
23 | 23 | |
24 | - if (null === self::$settings) self::$settings = new Settings\Utils\Dataset; |
|
24 | + if (null === self::$settings) { |
|
25 | + self::$settings = new Settings\Utils\Dataset; |
|
26 | + } |
|
25 | 27 | } |
26 | 28 | |
27 | 29 | /** |
@@ -32,7 +34,9 @@ discard block |
||
32 | 34 | |
33 | 35 | public static function load() : bool { |
34 | 36 | |
35 | - if (null === ($data = Schema::get('Settings')->load())) return false; |
|
37 | + if (null === ($data = Schema::get('Settings')->load())) { |
|
38 | + return false; |
|
39 | + } |
|
36 | 40 | |
37 | 41 | self::$settings->setArray($data); self::$loaded = true; |
38 | 42 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Recover)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Recover)->handle(); |
27 | 29 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Reset)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Reset)->handle(); |
27 | 29 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Login)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Login)->handle(); |
27 | 29 | } |