@@ -9,126 +9,126 @@ |
||
| 9 | 9 | |
| 10 | 10 | # Admin ip |
| 11 | 11 | |
| 12 | -define('CONFIG_ADMIN_IP', ''); |
|
| 12 | +define('CONFIG_ADMIN_IP', ''); |
|
| 13 | 13 | |
| 14 | 14 | # Session |
| 15 | 15 | |
| 16 | -define('CONFIG_SESSION_NAME', '_sessid'); |
|
| 17 | -define('CONFIG_SESSION_LIFETIME', 2592000); # 30 days |
|
| 16 | +define('CONFIG_SESSION_NAME', '_sessid'); |
|
| 17 | +define('CONFIG_SESSION_LIFETIME', 2592000); # 30 days |
|
| 18 | 18 | |
| 19 | 19 | # Default settings |
| 20 | 20 | |
| 21 | -define('CONFIG_SITE_LANGUAGE', 'en-US'); |
|
| 22 | -define('CONFIG_SITE_TEMPLATE', 'Default'); |
|
| 21 | +define('CONFIG_SITE_LANGUAGE', 'en-US'); |
|
| 22 | +define('CONFIG_SITE_TEMPLATE', 'Default'); |
|
| 23 | 23 | |
| 24 | -define('CONFIG_SITE_TITLE', 'Demo Site'); |
|
| 25 | -define('CONFIG_SITE_SLOGAN', 'A place for site slogan'); |
|
| 26 | -define('CONFIG_SITE_STATUS', STATUS_ONLINE); |
|
| 27 | -define('CONFIG_SITE_DESCRIPTION', ''); |
|
| 28 | -define('CONFIG_SITE_KEYWORDS', ''); |
|
| 24 | +define('CONFIG_SITE_TITLE', 'Demo Site'); |
|
| 25 | +define('CONFIG_SITE_SLOGAN', 'A place for site slogan'); |
|
| 26 | +define('CONFIG_SITE_STATUS', STATUS_ONLINE); |
|
| 27 | +define('CONFIG_SITE_DESCRIPTION', ''); |
|
| 28 | +define('CONFIG_SITE_KEYWORDS', ''); |
|
| 29 | 29 | |
| 30 | -define('CONFIG_SYSTEM_URL', 'http://example.com'); |
|
| 31 | -define('CONFIG_SYSTEM_EMAIL', '[email protected]'); |
|
| 32 | -define('CONFIG_SYSTEM_TIMEZONE', 'UTC'); |
|
| 30 | +define('CONFIG_SYSTEM_URL', 'http://example.com'); |
|
| 31 | +define('CONFIG_SYSTEM_EMAIL', '[email protected]'); |
|
| 32 | +define('CONFIG_SYSTEM_TIMEZONE', 'UTC'); |
|
| 33 | 33 | |
| 34 | -define('CONFIG_ADMIN_LANGUAGE', 'en-US'); |
|
| 35 | -define('CONFIG_ADMIN_TEMPLATE', 'Default'); |
|
| 34 | +define('CONFIG_ADMIN_LANGUAGE', 'en-US'); |
|
| 35 | +define('CONFIG_ADMIN_TEMPLATE', 'Default'); |
|
| 36 | 36 | |
| 37 | -define('CONFIG_ADMIN_DISPLAY_ENTITIES', 50); |
|
| 38 | -define('CONFIG_ADMIN_DISPLAY_FILES', 40); |
|
| 37 | +define('CONFIG_ADMIN_DISPLAY_ENTITIES', 50); |
|
| 38 | +define('CONFIG_ADMIN_DISPLAY_FILES', 40); |
|
| 39 | 39 | |
| 40 | 40 | # Language |
| 41 | 41 | |
| 42 | -define('CONFIG_LANGUAGE_COOKIE_EXPIRES', 30758400); # 356 days |
|
| 42 | +define('CONFIG_LANGUAGE_COOKIE_EXPIRES', 30758400); # 356 days |
|
| 43 | 43 | |
| 44 | 44 | # Template |
| 45 | 45 | |
| 46 | -define('CONFIG_TEMPLATE_COOKIE_EXPIRES', 30758400); # 356 days |
|
| 46 | +define('CONFIG_TEMPLATE_COOKIE_EXPIRES', 30758400); # 356 days |
|
| 47 | 47 | |
| 48 | 48 | # Auth |
| 49 | 49 | |
| 50 | -define('CONFIG_USER_SESSION_LIFETIME', 604800); # 7 days |
|
| 51 | -define('CONFIG_USER_SECRET_LIFETIME', 86400); # 1 day |
|
| 50 | +define('CONFIG_USER_SESSION_LIFETIME', 604800); # 7 days |
|
| 51 | +define('CONFIG_USER_SECRET_LIFETIME', 86400); # 1 day |
|
| 52 | 52 | |
| 53 | 53 | # Entitizer |
| 54 | 54 | |
| 55 | -define('CONFIG_ENTITIZER_MAX_DEPTH', 6); |
|
| 55 | +define('CONFIG_ENTITIZER_MAX_DEPTH', 6); |
|
| 56 | 56 | |
| 57 | 57 | # Database fields |
| 58 | 58 | |
| 59 | -define('CONFIG_DATABASE_SERVER_MAX_LENGTH', 128); |
|
| 60 | -define('CONFIG_DATABASE_USER_MAX_LENGTH', 64); |
|
| 61 | -define('CONFIG_DATABASE_PASSWORD_MAX_LENGTH', 64); |
|
| 62 | -define('CONFIG_DATABASE_NAME_MAX_LENGTH', 64); |
|
| 59 | +define('CONFIG_DATABASE_SERVER_MAX_LENGTH', 128); |
|
| 60 | +define('CONFIG_DATABASE_USER_MAX_LENGTH', 64); |
|
| 61 | +define('CONFIG_DATABASE_PASSWORD_MAX_LENGTH', 64); |
|
| 62 | +define('CONFIG_DATABASE_NAME_MAX_LENGTH', 64); |
|
| 63 | 63 | |
| 64 | 64 | # Page fields |
| 65 | 65 | |
| 66 | -define('CONFIG_PAGE_TITLE_MAX_LENGTH', 255); |
|
| 67 | -define('CONFIG_PAGE_NAME_MAX_LENGTH', 40); |
|
| 68 | -define('CONFIG_PAGE_DESCRIPTION_MAX_LENGTH', 512); |
|
| 69 | -define('CONFIG_PAGE_KEYWORDS_MAX_LENGTH', 512); |
|
| 66 | +define('CONFIG_PAGE_TITLE_MAX_LENGTH', 255); |
|
| 67 | +define('CONFIG_PAGE_NAME_MAX_LENGTH', 40); |
|
| 68 | +define('CONFIG_PAGE_DESCRIPTION_MAX_LENGTH', 512); |
|
| 69 | +define('CONFIG_PAGE_KEYWORDS_MAX_LENGTH', 512); |
|
| 70 | 70 | |
| 71 | 71 | # Menuitem fields |
| 72 | 72 | |
| 73 | -define('CONFIG_MENUITEM_TEXT_MAX_LENGTH', 255); |
|
| 74 | -define('CONFIG_MENUITEM_SLUG_MAX_LENGTH', 255); |
|
| 75 | -define('CONFIG_MENUITEM_POSITION_MAX_LENGTH', 2); |
|
| 73 | +define('CONFIG_MENUITEM_TEXT_MAX_LENGTH', 255); |
|
| 74 | +define('CONFIG_MENUITEM_SLUG_MAX_LENGTH', 255); |
|
| 75 | +define('CONFIG_MENUITEM_POSITION_MAX_LENGTH', 2); |
|
| 76 | 76 | |
| 77 | 77 | # Variable fields |
| 78 | 78 | |
| 79 | -define('CONFIG_VARIABLE_TITLE_MAX_LENGTH', 64); |
|
| 80 | -define('CONFIG_VARIABLE_NAME_MAX_LENGTH', 32); |
|
| 81 | -define('CONFIG_VARIABLE_VALUE_MAX_LENGTH', 255); |
|
| 79 | +define('CONFIG_VARIABLE_TITLE_MAX_LENGTH', 64); |
|
| 80 | +define('CONFIG_VARIABLE_NAME_MAX_LENGTH', 32); |
|
| 81 | +define('CONFIG_VARIABLE_VALUE_MAX_LENGTH', 255); |
|
| 82 | 82 | |
| 83 | 83 | # Widget fields |
| 84 | 84 | |
| 85 | -define('CONFIG_WIDGET_TITLE_MAX_LENGTH', 64); |
|
| 86 | -define('CONFIG_WIDGET_NAME_MAX_LENGTH', 32); |
|
| 85 | +define('CONFIG_WIDGET_TITLE_MAX_LENGTH', 64); |
|
| 86 | +define('CONFIG_WIDGET_NAME_MAX_LENGTH', 32); |
|
| 87 | 87 | |
| 88 | 88 | # Filemanager fields |
| 89 | 89 | |
| 90 | -define('CONFIG_FILEMANAGER_NAME_MAX_LENGTH', 128); |
|
| 90 | +define('CONFIG_FILEMANAGER_NAME_MAX_LENGTH', 128); |
|
| 91 | 91 | |
| 92 | 92 | # User fields |
| 93 | 93 | |
| 94 | -define('CONFIG_USER_NAME_MIN_LENGTH', 4); |
|
| 95 | -define('CONFIG_USER_NAME_MAX_LENGTH', 16); |
|
| 94 | +define('CONFIG_USER_NAME_MIN_LENGTH', 4); |
|
| 95 | +define('CONFIG_USER_NAME_MAX_LENGTH', 16); |
|
| 96 | 96 | |
| 97 | -define('CONFIG_USER_PASSWORD_MIN_LENGTH', 4); |
|
| 98 | -define('CONFIG_USER_PASSWORD_MAX_LENGTH', 32); |
|
| 97 | +define('CONFIG_USER_PASSWORD_MIN_LENGTH', 4); |
|
| 98 | +define('CONFIG_USER_PASSWORD_MAX_LENGTH', 32); |
|
| 99 | 99 | |
| 100 | -define('CONFIG_USER_EMAIL_MAX_LENGTH', 128); |
|
| 100 | +define('CONFIG_USER_EMAIL_MAX_LENGTH', 128); |
|
| 101 | 101 | |
| 102 | -define('CONFIG_USER_FIRST_NAME_MAX_LENGTH', 32); |
|
| 103 | -define('CONFIG_USER_LAST_NAME_MAX_LENGTH', 32); |
|
| 102 | +define('CONFIG_USER_FIRST_NAME_MAX_LENGTH', 32); |
|
| 103 | +define('CONFIG_USER_LAST_NAME_MAX_LENGTH', 32); |
|
| 104 | 104 | |
| 105 | -define('CONFIG_USER_CITY_MAX_LENGTH', 32); |
|
| 105 | +define('CONFIG_USER_CITY_MAX_LENGTH', 32); |
|
| 106 | 106 | |
| 107 | -define('CONFIG_USER_CAPTCHA_MAX_LENGTH', 16); |
|
| 107 | +define('CONFIG_USER_CAPTCHA_MAX_LENGTH', 16); |
|
| 108 | 108 | |
| 109 | 109 | # Settings fields |
| 110 | 110 | |
| 111 | -define('CONFIG_SITE_TITLE_MAX_LENGTH', 128); |
|
| 112 | -define('CONFIG_SITE_SLOGAN_MAX_LENGTH', 255); |
|
| 113 | -define('CONFIG_SITE_DESCRIPTION_MAX_LENGTH', 512); |
|
| 114 | -define('CONFIG_SITE_KEYWORDS_MAX_LENGTH', 512); |
|
| 111 | +define('CONFIG_SITE_TITLE_MAX_LENGTH', 128); |
|
| 112 | +define('CONFIG_SITE_SLOGAN_MAX_LENGTH', 255); |
|
| 113 | +define('CONFIG_SITE_DESCRIPTION_MAX_LENGTH', 512); |
|
| 114 | +define('CONFIG_SITE_KEYWORDS_MAX_LENGTH', 512); |
|
| 115 | 115 | |
| 116 | -define('CONFIG_SYSTEM_URL_MAX_LENGTH', 128); |
|
| 117 | -define('CONFIG_SYSTEM_EMAIL_MAX_LENGTH', 128); |
|
| 116 | +define('CONFIG_SYSTEM_URL_MAX_LENGTH', 128); |
|
| 117 | +define('CONFIG_SYSTEM_EMAIL_MAX_LENGTH', 128); |
|
| 118 | 118 | |
| 119 | 119 | # Captcha |
| 120 | 120 | |
| 121 | -define('CONFIG_CAPTCHA_LENGTH', 5); |
|
| 121 | +define('CONFIG_CAPTCHA_LENGTH', 5); |
|
| 122 | 122 | |
| 123 | -define('CONFIG_CAPTCHA_WIDTH', 150); |
|
| 124 | -define('CONFIG_CAPTCHA_HEIGHT', 40); |
|
| 123 | +define('CONFIG_CAPTCHA_WIDTH', 150); |
|
| 124 | +define('CONFIG_CAPTCHA_HEIGHT', 40); |
|
| 125 | 125 | |
| 126 | -define('CONFIG_CAPTCHA_FONT', 'Fonts/airstrip.ttf'); |
|
| 127 | -define('CONFIG_CAPTCHA_FONT_SIZE', 20); |
|
| 126 | +define('CONFIG_CAPTCHA_FONT', 'Fonts/airstrip.ttf'); |
|
| 127 | +define('CONFIG_CAPTCHA_FONT_SIZE', 20); |
|
| 128 | 128 | |
| 129 | -define('CONFIG_CAPTCHA_TEXT_INDENT', 15); |
|
| 130 | -define('CONFIG_CAPTCHA_TEXT_STEP', 25); |
|
| 129 | +define('CONFIG_CAPTCHA_TEXT_INDENT', 15); |
|
| 130 | +define('CONFIG_CAPTCHA_TEXT_STEP', 25); |
|
| 131 | 131 | |
| 132 | 132 | # Uploads |
| 133 | 133 | |
| 134 | -define('CONFIG_UPLOADS_MAX_SIZE', 104857600); # 100 MB |
|
| 134 | +define('CONFIG_UPLOADS_MAX_SIZE', 104857600); # 100 MB |
|
@@ -21,13 +21,13 @@ |
||
| 21 | 21 | |
| 22 | 22 | # Check installation |
| 23 | 23 | |
| 24 | - if (null !== ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/index.php'); |
|
| 24 | + if (null !== ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH.'/index.php'); |
|
| 25 | 25 | |
| 26 | 26 | # Get handler class |
| 27 | 27 | |
| 28 | 28 | $checked = (Install::checkRequirements() && Validate::boolean(Request::get('checked'))); |
| 29 | 29 | |
| 30 | - $class = ('Modules\Install\Handler\\' . (!$checked ? 'Check' : 'Database')); |
|
| 30 | + $class = ('Modules\Install\Handler\\'.(!$checked ? 'Check' : 'Database')); |
|
| 31 | 31 | |
| 32 | 32 | # ------------------------ |
| 33 | 33 | |
@@ -21,7 +21,9 @@ |
||
| 21 | 21 | |
| 22 | 22 | # Check installation |
| 23 | 23 | |
| 24 | - if (null !== ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/index.php'); |
|
| 24 | + if (null !== ($data = Schema::get('System')->load())) { |
|
| 25 | + Request::redirect(INSTALL_PATH . '/index.php'); |
|
| 26 | + } |
|
| 25 | 27 | |
| 26 | 28 | # Get handler class |
| 27 | 29 | |
@@ -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 | } |