@@ -14,7 +14,9 @@ |
||
| 14 | 14 | |
| 15 | 15 | DB::select(TABLE_VARIABLES, ['name', 'value'], null, ['name' => 'ASC']); |
| 16 | 16 | |
| 17 | - if (!(DB::getLast() && DB::getLast()->status)) return; |
|
| 17 | + if (!(DB::getLast() && DB::getLast()->status)) { |
|
| 18 | + return; |
|
| 19 | + } |
|
| 18 | 20 | |
| 19 | 21 | # Process results |
| 20 | 22 | |
@@ -12,11 +12,15 @@ |
||
| 12 | 12 | |
| 13 | 13 | # Process selection |
| 14 | 14 | |
| 15 | - if (0 === count($name = array_keys(Template::getWidgets()))) return; |
|
| 15 | + if (0 === count($name = array_keys(Template::getWidgets()))) { |
|
| 16 | + return; |
|
| 17 | + } |
|
| 16 | 18 | |
| 17 | 19 | DB::select(TABLE_WIDGETS, ['name', 'contents'], ['active' => 1, 'name' => $name], ['name' => 'ASC']); |
| 18 | 20 | |
| 19 | - if (!(DB::getLast() && DB::getLast()->status)) return; |
|
| 21 | + if (!(DB::getLast() && DB::getLast()->status)) { |
|
| 22 | + return; |
|
| 23 | + } |
|
| 20 | 24 | |
| 21 | 25 | # Process results |
| 22 | 26 | |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | public static function robots() { |
| 73 | 73 | |
| 74 | - return ((self::robotsIndex() ? 'INDEX' : 'NOINDEX') . ',' . (self::robotsFollow() ? 'FOLLOW' : 'NOFOLLOW')); |
|
| 74 | + return ((self::robotsIndex() ? 'INDEX' : 'NOINDEX').','.(self::robotsFollow() ? 'FOLLOW' : 'NOFOLLOW')); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public static function title(string $value = null) { |
| 19 | 19 | |
| 20 | - if (null === $value) return (self::$data['title'] ?? false); |
|
| 20 | + if (null === $value) { |
|
| 21 | + return (self::$data['title'] ?? false); |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | self::$data['title'] = $value; |
| 23 | 25 | } |
@@ -26,7 +28,9 @@ discard block |
||
| 26 | 28 | |
| 27 | 29 | public static function description(string $value = null) { |
| 28 | 30 | |
| 29 | - if (null === $value) return (self::$data['description'] ?? false); |
|
| 31 | + if (null === $value) { |
|
| 32 | + return (self::$data['description'] ?? false); |
|
| 33 | + } |
|
| 30 | 34 | |
| 31 | 35 | self::$data['description'] = $value; |
| 32 | 36 | } |
@@ -35,7 +39,9 @@ discard block |
||
| 35 | 39 | |
| 36 | 40 | public static function keywords(string $value = null) { |
| 37 | 41 | |
| 38 | - if (null === $value) return (self::$data['keywords'] ?? false); |
|
| 42 | + if (null === $value) { |
|
| 43 | + return (self::$data['keywords'] ?? false); |
|
| 44 | + } |
|
| 39 | 45 | |
| 40 | 46 | self::$data['keywords'] = $value; |
| 41 | 47 | } |
@@ -44,7 +50,9 @@ discard block |
||
| 44 | 50 | |
| 45 | 51 | public static function robotsIndex(bool $value = null) { |
| 46 | 52 | |
| 47 | - if (null === $value) return (self::$data['robots_index'] ?? false); |
|
| 53 | + if (null === $value) { |
|
| 54 | + return (self::$data['robots_index'] ?? false); |
|
| 55 | + } |
|
| 48 | 56 | |
| 49 | 57 | self::$data['robots_index'] = $value; |
| 50 | 58 | } |
@@ -53,7 +61,9 @@ discard block |
||
| 53 | 61 | |
| 54 | 62 | public static function robotsFollow(bool $value = null) { |
| 55 | 63 | |
| 56 | - if (null === $value) return (self::$data['robots_follow'] ?? false); |
|
| 64 | + if (null === $value) { |
|
| 65 | + return (self::$data['robots_follow'] ?? false); |
|
| 66 | + } |
|
| 57 | 67 | |
| 58 | 68 | self::$data['robots_follow'] = $value; |
| 59 | 69 | } |
@@ -62,7 +72,9 @@ discard block |
||
| 62 | 72 | |
| 63 | 73 | public static function canonical(string $value = null) { |
| 64 | 74 | |
| 65 | - if (null === $value) return (self::$data['canonical'] ?? false); |
|
| 75 | + if (null === $value) { |
|
| 76 | + return (self::$data['canonical'] ?? false); |
|
| 77 | + } |
|
| 66 | 78 | |
| 67 | 79 | self::$data['canonical'] = $value; |
| 68 | 80 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | # Check auth |
| 35 | 35 | |
| 36 | - if (($this instanceof Area\Auth) && Auth::check()) Request::redirect(INSTALL_PATH . '/admin'); |
|
| 36 | + if (($this instanceof Area\Auth) && Auth::check()) Request::redirect(INSTALL_PATH.'/admin'); |
|
| 37 | 37 | |
| 38 | 38 | # Handle request |
| 39 | 39 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | if (!Auth::check() || ((false !== Request::get('logout')) && Auth::logout())) { |
| 56 | 56 | |
| 57 | - Request::redirect(INSTALL_PATH . '/admin/login'); |
|
| 57 | + Request::redirect(INSTALL_PATH.'/admin/login'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | # Handle request |
@@ -33,11 +33,15 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | # Check auth |
| 35 | 35 | |
| 36 | - if (($this instanceof Area\Auth) && Auth::check()) Request::redirect(INSTALL_PATH . '/admin'); |
|
| 36 | + if (($this instanceof Area\Auth) && Auth::check()) { |
|
| 37 | + Request::redirect(INSTALL_PATH . '/admin'); |
|
| 38 | + } |
|
| 37 | 39 | |
| 38 | 40 | # Handle request |
| 39 | 41 | |
| 40 | - if (Template::isBlock($result = $this->handle())) return (new View\Form($this->_title))->display($result); |
|
| 42 | + if (Template::isBlock($result = $this->handle())) { |
|
| 43 | + return (new View\Form($this->_title))->display($result); |
|
| 44 | + } |
|
| 41 | 45 | |
| 42 | 46 | # ------------------------ |
| 43 | 47 | |
@@ -63,9 +67,13 @@ discard block |
||
| 63 | 67 | |
| 64 | 68 | $result = $this->handle(Request::isAjax() && ($request === 'display')); |
| 65 | 69 | |
| 66 | - if (Template::isBlock($result)) return (new View\Panel($this->_title))->$request($result); |
|
| 70 | + if (Template::isBlock($result)) { |
|
| 71 | + return (new View\Panel($this->_title))->$request($result); |
|
| 72 | + } |
|
| 67 | 73 | |
| 68 | - if (Ajax::isResponse($result)) return Ajax::output($result); |
|
| 74 | + if (Ajax::isResponse($result)) { |
|
| 75 | + return Ajax::output($result); |
|
| 76 | + } |
|
| 69 | 77 | |
| 70 | 78 | # ------------------------ |
| 71 | 79 | |
@@ -84,14 +92,20 @@ discard block |
||
| 84 | 92 | |
| 85 | 93 | $ips = preg_split('/ +/', CONFIG_ADMIN_IP, -1, PREG_SPLIT_NO_EMPTY); |
| 86 | 94 | |
| 87 | - if (!in_array(REQUEST_CLIENT_IP, $ips, true)) return Status::displayError404(); |
|
| 95 | + if (!in_array(REQUEST_CLIENT_IP, $ips, true)) { |
|
| 96 | + return Status::displayError404(); |
|
| 97 | + } |
|
| 88 | 98 | } |
| 89 | 99 | |
| 90 | 100 | # Handle request |
| 91 | 101 | |
| 92 | - if (($this instanceof Area\Auth) || ($this instanceof Area\Install)) return $this->handleFormArea(); |
|
| 102 | + if (($this instanceof Area\Auth) || ($this instanceof Area\Install)) { |
|
| 103 | + return $this->handleFormArea(); |
|
| 104 | + } |
|
| 93 | 105 | |
| 94 | - if ($this instanceof Area\Panel) return $this->handlePanelArea(); |
|
| 106 | + if ($this instanceof Area\Panel) { |
|
| 107 | + return $this->handlePanelArea(); |
|
| 108 | + } |
|
| 95 | 109 | |
| 96 | 110 | # ------------------------ |
| 97 | 111 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | private function getTitle() : string { |
| 23 | 23 | |
| 24 | - return ((('' !== $this->title) ? (Language::get($this->title) . ' | ') : '') . CADMIUM_NAME); |
|
| 24 | + return ((('' !== $this->title) ? (Language::get($this->title).' | ') : '').CADMIUM_NAME); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | protected function _display(Template\Block $layout) { |
| 32 | 32 | |
| 33 | - $view = View::get('Main/' . $this->view); |
|
| 33 | + $view = View::get('Main/'.$this->view); |
|
| 34 | 34 | |
| 35 | 35 | # Set language |
| 36 | 36 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | # Check auth |
| 35 | 35 | |
| 36 | - if (Auth::check()) Request::redirect(INSTALL_PATH . '/profile'); |
|
| 36 | + if (Auth::check()) Request::redirect(INSTALL_PATH.'/profile'); |
|
| 37 | 37 | |
| 38 | 38 | # ------------------------ |
| 39 | 39 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | if (!Auth::check() || ((false !== Request::get('logout')) && Auth::logout())) { |
| 52 | 52 | |
| 53 | - Request::redirect(INSTALL_PATH . '/profile/login'); |
|
| 53 | + Request::redirect(INSTALL_PATH.'/profile/login'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | # ------------------------ |
@@ -33,7 +33,9 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | # Check auth |
| 35 | 35 | |
| 36 | - if (Auth::check()) Request::redirect(INSTALL_PATH . '/profile'); |
|
| 36 | + if (Auth::check()) { |
|
| 37 | + Request::redirect(INSTALL_PATH . '/profile'); |
|
| 38 | + } |
|
| 37 | 39 | |
| 38 | 40 | # ------------------------ |
| 39 | 41 | |
@@ -68,9 +70,13 @@ discard block |
||
| 68 | 70 | |
| 69 | 71 | $result = $this->handle(Request::isAjax()); |
| 70 | 72 | |
| 71 | - if (Template::isBlock($result)) return (new View($this->_title, $this->_layout))->display($result); |
|
| 73 | + if (Template::isBlock($result)) { |
|
| 74 | + return (new View($this->_title, $this->_layout))->display($result); |
|
| 75 | + } |
|
| 72 | 76 | |
| 73 | - if (Ajax::isResponse($result)) return Ajax::output($result); |
|
| 77 | + if (Ajax::isResponse($result)) { |
|
| 78 | + return Ajax::output($result); |
|
| 79 | + } |
|
| 74 | 80 | |
| 75 | 81 | # ------------------------ |
| 76 | 82 | |
@@ -85,17 +91,27 @@ discard block |
||
| 85 | 91 | |
| 86 | 92 | # Check site status |
| 87 | 93 | |
| 88 | - if (Settings::get('site_status') === STATUS_MAINTENANCE) return Status::displayMaintenance(); |
|
| 94 | + if (Settings::get('site_status') === STATUS_MAINTENANCE) { |
|
| 95 | + return Status::displayMaintenance(); |
|
| 96 | + } |
|
| 89 | 97 | |
| 90 | - if (Settings::get('site_status') === STATUS_UPDATE) return Status::displayUpdate(); |
|
| 98 | + if (Settings::get('site_status') === STATUS_UPDATE) { |
|
| 99 | + return Status::displayUpdate(); |
|
| 100 | + } |
|
| 91 | 101 | |
| 92 | 102 | # Handle request |
| 93 | 103 | |
| 94 | - if ($this instanceof Area\Auth) return $this->handleAuthArea(); |
|
| 104 | + if ($this instanceof Area\Auth) { |
|
| 105 | + return $this->handleAuthArea(); |
|
| 106 | + } |
|
| 95 | 107 | |
| 96 | - if ($this instanceof Area\Authorized) return $this->handleAuthorizedArea(); |
|
| 108 | + if ($this instanceof Area\Authorized) { |
|
| 109 | + return $this->handleAuthorizedArea(); |
|
| 110 | + } |
|
| 97 | 111 | |
| 98 | - if ($this instanceof Area\Common) return $this->handleCommonArea(); |
|
| 112 | + if ($this instanceof Area\Common) { |
|
| 113 | + return $this->handleCommonArea(); |
|
| 114 | + } |
|
| 99 | 115 | |
| 100 | 116 | # ------------------------ |
| 101 | 117 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | private function getLayout(Template\Block $contents) : Template\Block { |
| 24 | 24 | |
| 25 | - $layout = View::get('Layouts/' . $this->layout); |
|
| 25 | + $layout = View::get('Layouts/'.$this->layout); |
|
| 26 | 26 | |
| 27 | 27 | # Set menu |
| 28 | 28 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $title = (SEO::title() ?: Language::get($this->title) ?: ''); |
| 80 | 80 | |
| 81 | - $page->title = ((('' !== $title) ? ($title . ' | ') : '') . Settings::get('site_title')); |
|
| 81 | + $page->title = ((('' !== $title) ? ($title.' | ') : '').Settings::get('site_title')); |
|
| 82 | 82 | |
| 83 | 83 | # Set canonical |
| 84 | 84 | |
@@ -38,7 +38,9 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $layout->getBlock('user')->name = Auth::user()->name; |
| 40 | 40 | |
| 41 | - if (Auth::user()->rank === RANK_ADMINISTRATOR) $layout->getBlock('admin')->enable(); |
|
| 41 | + if (Auth::user()->rank === RANK_ADMINISTRATOR) { |
|
| 42 | + $layout->getBlock('admin')->enable(); |
|
| 43 | + } |
|
| 42 | 44 | } |
| 43 | 45 | |
| 44 | 46 | # Set title |
@@ -82,7 +84,9 @@ discard block |
||
| 82 | 84 | |
| 83 | 85 | # Set canonical |
| 84 | 86 | |
| 85 | - if (false !== SEO::canonical()) $page->getBlock('canonical')->enable()->link = SEO::canonical(); |
|
| 87 | + if (false !== SEO::canonical()) { |
|
| 88 | + $page->getBlock('canonical')->enable()->link = SEO::canonical(); |
|
| 89 | + } |
|
| 86 | 90 | |
| 87 | 91 | # Set layout |
| 88 | 92 | |
@@ -90,9 +94,13 @@ discard block |
||
| 90 | 94 | |
| 91 | 95 | # Set global components |
| 92 | 96 | |
| 93 | - foreach (Variables::generate() as $name => $value) Template::setGlobal($name, $value); |
|
| 97 | + foreach (Variables::generate() as $name => $value) { |
|
| 98 | + Template::setGlobal($name, $value); |
|
| 99 | + } |
|
| 94 | 100 | |
| 95 | - foreach (Widgets::generate() as $name => $block) Template::setWidget($name, $block); |
|
| 101 | + foreach (Widgets::generate() as $name => $block) { |
|
| 102 | + Template::setWidget($name, $block); |
|
| 103 | + } |
|
| 96 | 104 | |
| 97 | 105 | # ------------------------ |
| 98 | 106 | |
@@ -78,11 +78,11 @@ |
||
| 78 | 78 | 'DASHBOARD_LINK_INFORMATION' => 'Больше информации', |
| 79 | 79 | |
| 80 | 80 | 'DASHBOARD_MESSAGE_INSTALL_REQUIREMENTS' => 'Некоторые возможности могут быть недоступны из-за неверной конфигурации сервера. Подробнее на ' . |
| 81 | - '<a href="$install_path$/admin/system/information#diagnostics">странице диагностики</a>.', |
|
| 81 | + '<a href="$install_path$/admin/system/information#diagnostics">странице диагностики</a>.', |
|
| 82 | 82 | 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Установочный файл <b>install.php</b> по-прежнему находится в корневой директории сайта. ' . |
| 83 | - 'Рекомендуется удалить его.', |
|
| 83 | + 'Рекомендуется удалить его.', |
|
| 84 | 84 | 'DASHBOARD_MESSAGE_SETTINGS_FILE' => 'Похоже, Вы пока не редактировали настройки сайта. '. |
| 85 | - 'Перейдите на <a href="$install_path$/admin/system/settings">страницу настроек</a> для ввода актуальных данных.', |
|
| 85 | + 'Перейдите на <a href="$install_path$/admin/system/settings">страницу настроек</a> для ввода актуальных данных.', |
|
| 86 | 86 | |
| 87 | 87 | # Pages |
| 88 | 88 | |
@@ -77,9 +77,9 @@ |
||
| 77 | 77 | 'DASHBOARD_LINK_SETTINGS' => 'Редактировать настройки', |
| 78 | 78 | 'DASHBOARD_LINK_INFORMATION' => 'Больше информации', |
| 79 | 79 | |
| 80 | - 'DASHBOARD_MESSAGE_INSTALL_REQUIREMENTS' => 'Некоторые возможности могут быть недоступны из-за неверной конфигурации сервера. Подробнее на ' . |
|
| 80 | + 'DASHBOARD_MESSAGE_INSTALL_REQUIREMENTS' => 'Некоторые возможности могут быть недоступны из-за неверной конфигурации сервера. Подробнее на '. |
|
| 81 | 81 | '<a href="$install_path$/admin/system/information#diagnostics">странице диагностики</a>.', |
| 82 | - 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Установочный файл <b>install.php</b> по-прежнему находится в корневой директории сайта. ' . |
|
| 82 | + 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Установочный файл <b>install.php</b> по-прежнему находится в корневой директории сайта. '. |
|
| 83 | 83 | 'Рекомендуется удалить его.', |
| 84 | 84 | 'DASHBOARD_MESSAGE_SETTINGS_FILE' => 'Похоже, Вы пока не редактировали настройки сайта. '. |
| 85 | 85 | 'Перейдите на <a href="$install_path$/admin/system/settings">страницу настроек</a> для ввода актуальных данных.', |
@@ -78,11 +78,11 @@ |
||
| 78 | 78 | 'DASHBOARD_LINK_INFORMATION' => 'Більше інформації', |
| 79 | 79 | |
| 80 | 80 | 'DASHBOARD_MESSAGE_INSTALL_REQUIREMENTS' => 'Деякі можливості можуть бути недоступні через невірну конфігурацію сервера. Детальніше на ' . |
| 81 | - '<a href="$install_path$/admin/system/information#diagnostics">сторінці діагностики</a>.', |
|
| 81 | + '<a href="$install_path$/admin/system/information#diagnostics">сторінці діагностики</a>.', |
|
| 82 | 82 | 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Інсталяційний файл <b>install.php</b> досі знаходиться в кореневій директорії сайта. '. |
| 83 | - 'Рекомендовано видалити його.', |
|
| 83 | + 'Рекомендовано видалити його.', |
|
| 84 | 84 | 'DASHBOARD_MESSAGE_SETTINGS_FILE' => 'Схоже, Ви поки не редагували налаштування сайта. '. |
| 85 | - 'Перейдіть на <a href="$install_path$/admin/system/settings">сторінку налаштувань</a> для введення актуальних даних.', |
|
| 85 | + 'Перейдіть на <a href="$install_path$/admin/system/settings">сторінку налаштувань</a> для введення актуальних даних.', |
|
| 86 | 86 | |
| 87 | 87 | # Pages |
| 88 | 88 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | 'DASHBOARD_LINK_SETTINGS' => 'Редагувати налаштування', |
| 78 | 78 | 'DASHBOARD_LINK_INFORMATION' => 'Більше інформації', |
| 79 | 79 | |
| 80 | - 'DASHBOARD_MESSAGE_INSTALL_REQUIREMENTS' => 'Деякі можливості можуть бути недоступні через невірну конфігурацію сервера. Детальніше на ' . |
|
| 80 | + 'DASHBOARD_MESSAGE_INSTALL_REQUIREMENTS' => 'Деякі можливості можуть бути недоступні через невірну конфігурацію сервера. Детальніше на '. |
|
| 81 | 81 | '<a href="$install_path$/admin/system/information#diagnostics">сторінці діагностики</a>.', |
| 82 | 82 | 'DASHBOARD_MESSAGE_INSTALL_FILE' => 'Інсталяційний файл <b>install.php</b> досі знаходиться в кореневій директорії сайта. '. |
| 83 | 83 | 'Рекомендовано видалити його.', |