@@ -23,11 +23,15 @@ discard block |
||
23 | 23 | |
24 | 24 | $name = Settings::get(self::$param[$this->section]); $primary = self::$default[$this->section]; |
25 | 25 | |
26 | - if (self::valid($name) && isset($items[$name])) $active = $name; |
|
27 | - |
|
28 | - else if (self::valid($primary) && isset($items[$primary])) $active = $primary; |
|
26 | + if (self::valid($name) && isset($items[$name])) { |
|
27 | + $active = $name; |
|
28 | + } else if (self::valid($primary) && isset($items[$primary])) { |
|
29 | + $active = $primary; |
|
30 | + } |
|
29 | 31 | |
30 | - foreach (array_keys($items) as $name) $items[$name]['active'] = ($name === $active); |
|
32 | + foreach (array_keys($items) as $name) { |
|
33 | + $items[$name]['active'] = ($name === $active); |
|
34 | + } |
|
31 | 35 | |
32 | 36 | # ------------------------ |
33 | 37 | |
@@ -73,12 +77,16 @@ discard block |
||
73 | 77 | |
74 | 78 | $items->add($item = View::get(self::$view_item)); |
75 | 79 | |
76 | - foreach (self::$data as $name) $item->$name = $extension[$name]; |
|
80 | + foreach (self::$data as $name) { |
|
81 | + $item->$name = $extension[$name]; |
|
82 | + } |
|
77 | 83 | |
78 | 84 | $item->class = ($extension['active'] ? 'positive' : 'grey'); |
79 | 85 | } |
80 | 86 | |
81 | - if ($items->count()) $contents->block('items', $items); |
|
87 | + if ($items->count()) { |
|
88 | + $contents->block('items', $items); |
|
89 | + } |
|
82 | 90 | |
83 | 91 | # ------------------------ |
84 | 92 | |
@@ -93,15 +101,21 @@ discard block |
||
93 | 101 | |
94 | 102 | # Check for demo mode |
95 | 103 | |
96 | - if (Informer::isDemoMode()) return $ajax->error(Language::get('DEMO_MODE_RESTRICTION')); |
|
104 | + if (Informer::isDemoMode()) { |
|
105 | + return $ajax->error(Language::get('DEMO_MODE_RESTRICTION')); |
|
106 | + } |
|
97 | 107 | |
98 | 108 | # Save configuration |
99 | 109 | |
100 | 110 | $param = self::$param[$this->section]; $name = Request::post('name'); |
101 | 111 | |
102 | - if (false === Settings::set($param, $name)) return $ajax->error(Language::get(self::$error_name)); |
|
112 | + if (false === Settings::set($param, $name)) { |
|
113 | + return $ajax->error(Language::get(self::$error_name)); |
|
114 | + } |
|
103 | 115 | |
104 | - if (false === Settings::save()) return $ajax->error(Language::get(self::$error_save)); |
|
116 | + if (false === Settings::save()) { |
|
117 | + return $ajax->error(Language::get(self::$error_save)); |
|
118 | + } |
|
105 | 119 | |
106 | 120 | # ------------------------ |
107 | 121 | |
@@ -116,7 +130,9 @@ discard block |
||
116 | 130 | |
117 | 131 | $this->items = $this->getHandlerItems(); |
118 | 132 | |
119 | - if (Request::isAjax()) return $this->handleAjax(); |
|
133 | + if (Request::isAjax()) { |
|
134 | + return $this->handleAjax(); |
|
135 | + } |
|
120 | 136 | |
121 | 137 | # ------------------------ |
122 | 138 |
@@ -32,10 +32,12 @@ discard block |
||
32 | 32 | |
33 | 33 | $languages = [Extend\Languages::pathPrimary(), Extend\Languages::path()]; |
34 | 34 | |
35 | - foreach (array_unique($languages) as $path) foreach (static::PHRASES as $name) { |
|
35 | + foreach (array_unique($languages) as $path) { |
|
36 | + foreach (static::PHRASES as $name) { |
|
36 | 37 | |
37 | 38 | Language::load($path . 'Phrases/' . $name . '.php'); |
38 | 39 | } |
40 | + } |
|
39 | 41 | |
40 | 42 | # Set template globals |
41 | 43 | |
@@ -57,7 +59,9 @@ discard block |
||
57 | 59 | |
58 | 60 | # Set timezone |
59 | 61 | |
60 | - if (Auth::check() && ('' !== ($timezone = Auth::user()->timezone))) date_default_timezone_set($timezone); |
|
62 | + if (Auth::check() && ('' !== ($timezone = Auth::user()->timezone))) { |
|
63 | + date_default_timezone_set($timezone); |
|
64 | + } |
|
61 | 65 | |
62 | 66 | # ------------------------ |
63 | 67 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | foreach (array_unique($languages) as $path) foreach (static::PHRASES as $name) { |
36 | 36 | |
37 | - Language::load($path . 'Phrases/' . $name . '.php'); |
|
37 | + Language::load($path.'Phrases/'.$name.'.php'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | # Set template globals |
@@ -147,20 +147,29 @@ discard block |
||
147 | 147 | |
148 | 148 | if ($this instanceof Component\Install) { |
149 | 149 | |
150 | - if (Template::isBlock($result = $this->handle())) return $this->displayForm($result, STATUS_CODE_200); |
|
150 | + if (Template::isBlock($result = $this->handle())) { |
|
151 | + return $this->displayForm($result, STATUS_CODE_200); |
|
152 | + } |
|
151 | 153 | } |
152 | 154 | |
153 | 155 | # Handle auth component request |
154 | 156 | |
155 | 157 | else if ($this instanceof Component\Auth) { |
156 | 158 | |
157 | - if (Auth::check()) Request::redirect(INSTALL_PATH . '/admin'); |
|
158 | - |
|
159 | - if ($this instanceof Component\Auth\Initial) { if (!Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/login'); } |
|
159 | + if (Auth::check()) { |
|
160 | + Request::redirect(INSTALL_PATH . '/admin'); |
|
161 | + } |
|
160 | 162 | |
161 | - else if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
163 | + if ($this instanceof Component\Auth\Initial) { if (!Auth::initial()) { |
|
164 | + Request::redirect(INSTALL_PATH . '/admin/login'); |
|
165 | + } |
|
166 | + } else if (Auth::initial()) { |
|
167 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
168 | + } |
|
162 | 169 | |
163 | - if (Template::isBlock($result = $this->handle())) return $this->displayForm($result, STATUS_CODE_401); |
|
170 | + if (Template::isBlock($result = $this->handle())) { |
|
171 | + return $this->displayForm($result, STATUS_CODE_401); |
|
172 | + } |
|
164 | 173 | } |
165 | 174 | |
166 | 175 | # Handle panel component request |
@@ -172,9 +181,13 @@ discard block |
||
172 | 181 | Request::redirect(INSTALL_PATH . '/admin/login'); |
173 | 182 | } |
174 | 183 | |
175 | - if (Template::isBlock($result = $this->handle())) return $this->displayPage($result); |
|
184 | + if (Template::isBlock($result = $this->handle())) { |
|
185 | + return $this->displayPage($result); |
|
186 | + } |
|
176 | 187 | |
177 | - if (Ajax::isResponse($result)) return Ajax::output($result); |
|
188 | + if (Ajax::isResponse($result)) { |
|
189 | + return Ajax::output($result); |
|
190 | + } |
|
178 | 191 | } |
179 | 192 | } |
180 | 193 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | # Set title |
33 | 33 | |
34 | - $form->title = ((('' !== $this->title) ? ($this->title . ' | ') : '') . CADMIUM_NAME); |
|
34 | + $form->title = ((('' !== $this->title) ? ($this->title.' | ') : '').CADMIUM_NAME); |
|
35 | 35 | |
36 | 36 | # Create layout |
37 | 37 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | # Set title |
74 | 74 | |
75 | - $page->title = ((('' !== $this->title) ? ($this->title . ' | ') : '') . CADMIUM_NAME); |
|
75 | + $page->title = ((('' !== $this->title) ? ($this->title.' | ') : '').CADMIUM_NAME); |
|
76 | 76 | |
77 | 77 | # Create layout |
78 | 78 | |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | |
154 | 154 | else if ($this instanceof Component\Auth) { |
155 | 155 | |
156 | - if (Auth::check()) Request::redirect(INSTALL_PATH . '/admin'); |
|
156 | + if (Auth::check()) Request::redirect(INSTALL_PATH.'/admin'); |
|
157 | 157 | |
158 | - if ($this instanceof Component\Auth\Initial) { if (!Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/login'); } |
|
158 | + if ($this instanceof Component\Auth\Initial) { if (!Auth::initial()) Request::redirect(INSTALL_PATH.'/admin/login'); } |
|
159 | 159 | |
160 | - else if (Auth::initial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
160 | + else if (Auth::initial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
161 | 161 | |
162 | 162 | if (Template::isBlock($result = $this->handle())) return $this->displayForm($result, STATUS_CODE_401); |
163 | 163 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | if (!Auth::check() || ((false !== Request::get('logout')) && Auth::logout())) { |
170 | 170 | |
171 | - Request::redirect(INSTALL_PATH . '/admin/login'); |
|
171 | + Request::redirect(INSTALL_PATH.'/admin/login'); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | if (Template::isBlock($result = $this->handle())) return $this->displayPage($result); |
@@ -40,7 +40,9 @@ discard block |
||
40 | 40 | |
41 | 41 | if (Settings::get('users_registration')) { |
42 | 42 | |
43 | - if (!Auth::check()) $layout->block('auth')->enable(); else { |
|
43 | + if (!Auth::check()) { |
|
44 | + $layout->block('auth')->enable(); |
|
45 | + } else { |
|
44 | 46 | |
45 | 47 | $layout->block('user')->enable(); |
46 | 48 | |
@@ -48,7 +50,9 @@ discard block |
||
48 | 50 | |
49 | 51 | $layout->block('user')->name = Auth::user()->name; |
50 | 52 | |
51 | - if (Auth::user()->rank === RANK_ADMINISTRATOR) $layout->block('user')->block('admin')->enable(); |
|
53 | + if (Auth::user()->rank === RANK_ADMINISTRATOR) { |
|
54 | + $layout->block('user')->block('admin')->enable(); |
|
55 | + } |
|
52 | 56 | } |
53 | 57 | } |
54 | 58 | |
@@ -109,9 +113,11 @@ discard block |
||
109 | 113 | |
110 | 114 | # Set canonical |
111 | 115 | |
112 | - if ('' === $this->canonical) $page->block('canonical')->disable(); |
|
113 | - |
|
114 | - else $page->block('canonical')->link = $this->canonical; |
|
116 | + if ('' === $this->canonical) { |
|
117 | + $page->block('canonical')->disable(); |
|
118 | + } else { |
|
119 | + $page->block('canonical')->link = $this->canonical; |
|
120 | + } |
|
115 | 121 | |
116 | 122 | # Set layout |
117 | 123 | |
@@ -128,19 +134,27 @@ discard block |
||
128 | 134 | |
129 | 135 | # Check site status |
130 | 136 | |
131 | - if (Settings::get('site_status') === STATUS_MAINTENANCE) return Status::maintenance(); |
|
137 | + if (Settings::get('site_status') === STATUS_MAINTENANCE) { |
|
138 | + return Status::maintenance(); |
|
139 | + } |
|
132 | 140 | |
133 | - if (Settings::get('site_status') === STATUS_UPDATE) return Status::update(); |
|
141 | + if (Settings::get('site_status') === STATUS_UPDATE) { |
|
142 | + return Status::update(); |
|
143 | + } |
|
134 | 144 | |
135 | 145 | # Check access rights |
136 | 146 | |
137 | 147 | if ($this instanceof Component\Profile) { |
138 | 148 | |
139 | - if (!Settings::get('users_registration')) return Status::error404(); |
|
149 | + if (!Settings::get('users_registration')) { |
|
150 | + return Status::error404(); |
|
151 | + } |
|
140 | 152 | |
141 | 153 | if (($this instanceof Component\Profile\Auth)) { |
142 | 154 | |
143 | - if (Auth::check()) Request::redirect(INSTALL_PATH . '/profile'); |
|
155 | + if (Auth::check()) { |
|
156 | + Request::redirect(INSTALL_PATH . '/profile'); |
|
157 | + } |
|
144 | 158 | |
145 | 159 | } else if (!Auth::check() || ((false !== Request::get('logout')) && Auth::logout())) { |
146 | 160 | |
@@ -156,9 +170,13 @@ discard block |
||
156 | 170 | |
157 | 171 | $variables = new Variables(); $widgets = new Widgets(); |
158 | 172 | |
159 | - foreach ($variables->items() as $name => $value) Template::global($name, $value); |
|
173 | + foreach ($variables->items() as $name => $value) { |
|
174 | + Template::global($name, $value); |
|
175 | + } |
|
160 | 176 | |
161 | - foreach ($widgets->items() as $name => $block) Template::widget($name, $block); |
|
177 | + foreach ($widgets->items() as $name => $block) { |
|
178 | + Template::widget($name, $block); |
|
179 | + } |
|
162 | 180 | |
163 | 181 | # Display page |
164 | 182 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | private function getLayout(Template\Asset\Block $contents) { |
27 | 27 | |
28 | - $layout = View::get('Layouts\\' . $this->layout); |
|
28 | + $layout = View::get('Layouts\\'.$this->layout); |
|
29 | 29 | |
30 | 30 | # Create layout components |
31 | 31 | |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | |
101 | 101 | $page->keywords = ('' !== $this->keywords) ? $this->keywords : Settings::get('site_keywords'); |
102 | 102 | |
103 | - $page->robots = (($this->robots_index ? 'INDEX' : 'NOINDEX') . ',' . ($this->robots_follow ? 'FOLLOW' : 'NOFOLLOW')); |
|
103 | + $page->robots = (($this->robots_index ? 'INDEX' : 'NOINDEX').','.($this->robots_follow ? 'FOLLOW' : 'NOFOLLOW')); |
|
104 | 104 | |
105 | 105 | # Set title |
106 | 106 | |
107 | - $page->title = ((('' !== $this->title) ? ($this->title . ' | ') : '') . Settings::get('site_title')); |
|
107 | + $page->title = ((('' !== $this->title) ? ($this->title.' | ') : '').Settings::get('site_title')); |
|
108 | 108 | |
109 | 109 | # Set canonical |
110 | 110 | |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | |
140 | 140 | if (($this instanceof Component\Profile\Auth)) { |
141 | 141 | |
142 | - if (Auth::check()) Request::redirect(INSTALL_PATH . '/profile'); |
|
142 | + if (Auth::check()) Request::redirect(INSTALL_PATH.'/profile'); |
|
143 | 143 | |
144 | 144 | } else if (!Auth::check() || ((false !== Request::get('logout')) && Auth::logout())) { |
145 | 145 | |
146 | - Request::redirect(INSTALL_PATH . '/profile/login'); |
|
146 | + Request::redirect(INSTALL_PATH.'/profile/login'); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 |
@@ -14,7 +14,9 @@ discard block |
||
14 | 14 | |
15 | 15 | for ($index = ($active - 2); $index <= ($active + 2); $index++) { |
16 | 16 | |
17 | - if (!($index > 0 && $index <= $count)) continue; |
|
17 | + if (!($index > 0 && $index <= $count)) { |
|
18 | + continue; |
|
19 | + } |
|
18 | 20 | |
19 | 21 | $class = (($index === $active) ? 'active item' : 'item'); |
20 | 22 | |
@@ -41,7 +43,9 @@ discard block |
||
41 | 43 | |
42 | 44 | $block->link = $url->set('index', $index)->get(); $block->index = $index; |
43 | 45 | |
44 | - if ($closest) $block->block('ellipsis')->disable(); |
|
46 | + if ($closest) { |
|
47 | + $block->block('ellipsis')->disable(); |
|
48 | + } |
|
45 | 49 | } |
46 | 50 | } |
47 | 51 | |
@@ -58,9 +62,9 @@ discard block |
||
58 | 62 | |
59 | 63 | list ($extremum, $index) = $data; $block = $pagination->block($class); |
60 | 64 | |
61 | - if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); } |
|
62 | - |
|
63 | - else $block->link = $url->set('index', $index)->get(); |
|
65 | + if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); } else { |
|
66 | + $block->link = $url->set('index', $index)->get(); |
|
67 | + } |
|
64 | 68 | } |
65 | 69 | } |
66 | 70 | |
@@ -68,9 +72,13 @@ discard block |
||
68 | 72 | |
69 | 73 | public static function block(int $index, int $display, int $total, Url $url) { |
70 | 74 | |
71 | - if (($index <= 0) || ($display <= 0) || ($total <= 0)) return false; |
|
75 | + if (($index <= 0) || ($display <= 0) || ($total <= 0)) { |
|
76 | + return false; |
|
77 | + } |
|
72 | 78 | |
73 | - if (($display >= $total) || ($index > ($count = ceil($total / $display)))) return false; |
|
79 | + if (($display >= $total) || ($index > ($count = ceil($total / $display)))) { |
|
80 | + return false; |
|
81 | + } |
|
74 | 82 | |
75 | 83 | # Create block |
76 | 84 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | |
59 | 59 | list ($extremum, $index) = $data; $block = $pagination->block($class); |
60 | 60 | |
61 | - if ($active === $extremum) { $block->disable(); $pagination->block($class . '_disabled')->enable(); } |
|
61 | + if ($active === $extremum) { $block->disable(); $pagination->block($class.'_disabled')->enable(); } |
|
62 | 62 | |
63 | 63 | else $block->link = $url->set('index', $index)->get(); |
64 | 64 | } |
@@ -12,11 +12,15 @@ discard block |
||
12 | 12 | |
13 | 13 | private static function setMessage(string $type, string $text, string $header = null) { |
14 | 14 | |
15 | - if (('' === $text) || isset(self::$messages[$type])) return; |
|
15 | + if (('' === $text) || isset(self::$messages[$type])) { |
|
16 | + return; |
|
17 | + } |
|
16 | 18 | |
17 | 19 | self::$messages[$type] = ['text' => $text, 'header' => null]; |
18 | 20 | |
19 | - if ((null !== $header) && ('' !== $header)) self::$messages[$type]['header'] = $header; |
|
21 | + if ((null !== $header) && ('' !== $header)) { |
|
22 | + self::$messages[$type]['header'] = $header; |
|
23 | + } |
|
20 | 24 | } |
21 | 25 | |
22 | 26 | # Init messages |
@@ -30,7 +34,9 @@ discard block |
||
30 | 34 | |
31 | 35 | public static function info(string $text = null, string $header = null) { |
32 | 36 | |
33 | - if (null === $text) return (self::$messages['info'] ?? false); |
|
37 | + if (null === $text) { |
|
38 | + return (self::$messages['info'] ?? false); |
|
39 | + } |
|
34 | 40 | |
35 | 41 | self::setMessage('info', $text, $header); |
36 | 42 | } |
@@ -39,7 +45,9 @@ discard block |
||
39 | 45 | |
40 | 46 | public static function warning(string $text = null, string $header = null) { |
41 | 47 | |
42 | - if (null === $text) return (self::$messages['warning'] ?? false); |
|
48 | + if (null === $text) { |
|
49 | + return (self::$messages['warning'] ?? false); |
|
50 | + } |
|
43 | 51 | |
44 | 52 | self::setMessage('warning', $text, $header); |
45 | 53 | } |
@@ -48,7 +56,9 @@ discard block |
||
48 | 56 | |
49 | 57 | public static function error(string $text = null, string $header = null) { |
50 | 58 | |
51 | - if (null === $text) return (self::$messages['error'] ?? false); |
|
59 | + if (null === $text) { |
|
60 | + return (self::$messages['error'] ?? false); |
|
61 | + } |
|
52 | 62 | |
53 | 63 | self::setMessage('error', $text, $header); |
54 | 64 | } |
@@ -57,7 +67,9 @@ discard block |
||
57 | 67 | |
58 | 68 | public static function success(string $text = null, string $header = null) { |
59 | 69 | |
60 | - if (null === $text) return (self::$messages['success'] ?? false); |
|
70 | + if (null === $text) { |
|
71 | + return (self::$messages['success'] ?? false); |
|
72 | + } |
|
61 | 73 | |
62 | 74 | self::setMessage('success', $text, $header); |
63 | 75 | } |
@@ -74,7 +86,11 @@ discard block |
||
74 | 86 | |
75 | 87 | $block->type = $type; $block->text = Template::block($message['text']); $header = $block->block('header'); |
76 | 88 | |
77 | - if (isset($message['header'])) $header->text = $message['header']; else $header->disable(); |
|
89 | + if (isset($message['header'])) { |
|
90 | + $header->text = $message['header']; |
|
91 | + } else { |
|
92 | + $header->disable(); |
|
93 | + } |
|
78 | 94 | } |
79 | 95 | |
80 | 96 | # ------------------------ |
@@ -20,7 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | $item->children = ($children = Template::group()); |
22 | 22 | |
23 | - foreach ($this->items[$id]['children'] as $child) $children->add($this->parseItem($child)); |
|
23 | + foreach ($this->items[$id]['children'] as $child) { |
|
24 | + $children->add($this->parseItem($child)); |
|
25 | + } |
|
24 | 26 | |
25 | 27 | } else { |
26 | 28 | |
@@ -46,7 +48,9 @@ discard block |
||
46 | 48 | |
47 | 49 | ("FROM " . TABLE_MENU . " men ORDER BY men.parent_id ASC, men.position ASC, men.id ASC"); |
48 | 50 | |
49 | - if (!(DB::send($query) && DB::last()->status)) return; |
|
51 | + if (!(DB::send($query) && DB::last()->status)) { |
|
52 | + return; |
|
53 | + } |
|
50 | 54 | |
51 | 55 | # Process results |
52 | 56 | |
@@ -57,9 +61,13 @@ discard block |
||
57 | 61 | $this->items[$entity->id()] = $entity->data(); |
58 | 62 | } |
59 | 63 | |
60 | - foreach ($this->items as $id => $item) if (0 === $item['parent_id']) $this->menu[] = $id; |
|
64 | + foreach ($this->items as $id => $item) { |
|
65 | + if (0 === $item['parent_id']) $this->menu[] = $id; |
|
66 | + } |
|
61 | 67 | |
62 | - else if (isset($this->items[$item['parent_id']])) $this->items[$item['parent_id']]['children'][] = $id; |
|
68 | + else if (isset($this->items[$item['parent_id']])) { |
|
69 | + $this->items[$item['parent_id']]['children'][] = $id; |
|
70 | + } |
|
63 | 71 | } |
64 | 72 | |
65 | 73 | # Get block |
@@ -68,7 +76,9 @@ discard block |
||
68 | 76 | |
69 | 77 | $menu = Template::group(); |
70 | 78 | |
71 | - foreach ($this->menu as $id) $menu->add($this->parseItem($id)); |
|
79 | + foreach ($this->menu as $id) { |
|
80 | + $menu->add($this->parseItem($id)); |
|
81 | + } |
|
72 | 82 | |
73 | 83 | # ------------------------ |
74 | 84 |
@@ -42,9 +42,9 @@ |
||
42 | 42 | |
43 | 43 | # Process selection |
44 | 44 | |
45 | - $query = ("SELECT men.id, men.parent_id, men.slug, men.text, men.target ") . |
|
45 | + $query = ("SELECT men.id, men.parent_id, men.slug, men.text, men.target "). |
|
46 | 46 | |
47 | - ("FROM " . TABLE_MENU . " men ORDER BY men.parent_id ASC, men.position ASC, men.id ASC"); |
|
47 | + ("FROM ".TABLE_MENU." men ORDER BY men.parent_id ASC, men.position ASC, men.id ASC"); |
|
48 | 48 | |
49 | 49 | if (!(DB::send($query) && DB::last()->status)) return; |
50 | 50 |
@@ -10,7 +10,9 @@ |
||
10 | 10 | |
11 | 11 | public function handle(callable $callback) { |
12 | 12 | |
13 | - if (false === ($post = $this->post())) return false; |
|
13 | + if (false === ($post = $this->post())) { |
|
14 | + return false; |
|
15 | + } |
|
14 | 16 | |
15 | 17 | # Check form for errors |
16 | 18 |
@@ -19,13 +19,17 @@ |
||
19 | 19 | |
20 | 20 | public static function get(string $name) { |
21 | 21 | |
22 | - if ('' === self::$section) throw new Exception\View(); |
|
22 | + if ('' === self::$section) { |
|
23 | + throw new Exception\View(); |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $class_name = ('System\Views\\' . self::$section . '\\' . $name); |
25 | 27 | |
26 | - if (isset(self::$cache[$class_name])) $view = clone self::$cache[$class_name]; |
|
27 | - |
|
28 | - else $view = (self::$cache[$class_name] = new $class_name()); |
|
28 | + if (isset(self::$cache[$class_name])) { |
|
29 | + $view = clone self::$cache[$class_name]; |
|
30 | + } else { |
|
31 | + $view = (self::$cache[$class_name] = new $class_name()); |
|
32 | + } |
|
29 | 33 | |
30 | 34 | # ------------------------ |
31 | 35 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | if ('' === self::$section) throw new Exception\View(); |
23 | 23 | |
24 | - $class_name = ('Views\\' . self::$section . '\\' . $name); |
|
24 | + $class_name = ('Views\\'.self::$section.'\\'.$name); |
|
25 | 25 | |
26 | 26 | if (isset(self::$cache[$class_name])) $view = clone self::$cache[$class_name]; |
27 | 27 |