@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | protected function getValue(string $value) : string { |
| 30 | 30 | |
| 31 | - return ('\'' . addslashes($value) . '\''); |
|
| 31 | + return ('\''.addslashes($value).'\''); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $parser = function($value) { if (is_scalar($value)) return $this->getValue($value); }; |
| 43 | 43 | |
| 44 | - return ('(' . implode(', ', array_filter(array_map($parser, $value))) . ')'); |
|
| 44 | + return ('('.implode(', ', array_filter(array_map($parser, $value))).')'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -23,15 +23,15 @@ |
||
| 23 | 23 | |
| 24 | 24 | $table = $this->getName($table); |
| 25 | 25 | |
| 26 | - if ($column !== '*') $column = (($distinct ? 'DISTINCT ' : '') . $this->getName($column)); |
|
| 26 | + if ($column !== '*') $column = (($distinct ? 'DISTINCT ' : '').$this->getName($column)); |
|
| 27 | 27 | |
| 28 | 28 | $condition = $this->getString($condition, '^name IN $list', ' AND '); |
| 29 | 29 | |
| 30 | 30 | # Build query |
| 31 | 31 | |
| 32 | - $this->query = ('SELECT COUNT(' . $column . ') as count ' . |
|
| 32 | + $this->query = ('SELECT COUNT('.$column.') as count '. |
|
| 33 | 33 | |
| 34 | - 'FROM ' . $table . ($condition ? (' WHERE (' . $condition . ')') : '')); |
|
| 34 | + 'FROM '.$table.($condition ? (' WHERE ('.$condition.')') : '')); |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -19,32 +19,32 @@ |
||
| 19 | 19 | |
| 20 | 20 | # Check basic types |
| 21 | 21 | |
| 22 | - if (is_string ($default)) return function (string $value) { return $value; }; |
|
| 22 | + if (is_string($default)) return function(string $value) { return $value; }; |
|
| 23 | 23 | |
| 24 | - if (is_bool ($default)) return function (bool $value) { return $value; }; |
|
| 24 | + if (is_bool($default)) return function(bool $value) { return $value; }; |
|
| 25 | 25 | |
| 26 | - if (is_int ($default)) return function (int $value) { return $value; }; |
|
| 26 | + if (is_int($default)) return function(int $value) { return $value; }; |
|
| 27 | 27 | |
| 28 | - if (is_float ($default)) return function (float $value) { return $value; }; |
|
| 28 | + if (is_float($default)) return function(float $value) { return $value; }; |
|
| 29 | 29 | |
| 30 | - if (is_array ($default)) return function (array $value) { return $value; }; |
|
| 30 | + if (is_array($default)) return function(array $value) { return $value; }; |
|
| 31 | 31 | |
| 32 | - if (is_callable ($default)) return function (callable $value) { return $value; }; |
|
| 32 | + if (is_callable($default)) return function(callable $value) { return $value; }; |
|
| 33 | 33 | |
| 34 | 34 | # Check object type |
| 35 | 35 | |
| 36 | - if (is_object($default)) return function ($value) use ($default) { |
|
| 36 | + if (is_object($default)) return function($value) use ($default) { |
|
| 37 | 37 | |
| 38 | 38 | return (is_a($value, get_class($default)) ? $value : null); |
| 39 | 39 | }; |
| 40 | 40 | |
| 41 | 41 | # Check resource type |
| 42 | 42 | |
| 43 | - if (is_resource($default)) return function ($value) { return (is_resource($value) ? $value : null); }; |
|
| 43 | + if (is_resource($default)) return function($value) { return (is_resource($value) ? $value : null); }; |
|
| 44 | 44 | |
| 45 | 45 | # ------------------------ |
| 46 | 46 | |
| 47 | - return function () { return null; }; |
|
| 47 | + return function() { return null; }; |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | |
| 68 | 68 | public static function sortby(array $array, $sub_key, bool $descending = false) : array { |
| 69 | 69 | |
| 70 | - $select_key = function ($element) use ($sub_key) { return ($element[$sub_key] ?? false); }; |
|
| 70 | + $select_key = function($element) use ($sub_key) { return ($element[$sub_key] ?? false); }; |
|
| 71 | 71 | |
| 72 | 72 | $sorted = []; $column = array_map($select_key, $array); |
| 73 | 73 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | protected static $loader_class = 'Modules\Extend\Loader\Templates', $exception_class = 'Exception\Template'; |
| 12 | 12 | |
| 13 | - protected static $root_dir = [SECTION_SITE => DIR_SYSTEM_TEMPLATES . 'Site/', SECTION_ADMIN => DIR_SYSTEM_TEMPLATES . 'Admin/']; |
|
| 13 | + protected static $root_dir = [SECTION_SITE => DIR_SYSTEM_TEMPLATES.'Site/', SECTION_ADMIN => DIR_SYSTEM_TEMPLATES.'Admin/']; |
|
| 14 | 14 | |
| 15 | 15 | protected static $schema_prototype = 'Prototype\Template', $regex_name = REGEX_TEMPLATE_NAME; |
| 16 | 16 | |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | if ($this->form->handle(new static::$controller_class, true)) { |
| 50 | 50 | |
| 51 | - Request::redirect(INSTALL_PATH . (static::$url . '?submitted')); |
|
| 51 | + Request::redirect(INSTALL_PATH.(static::$url.'?submitted')); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | # Display success message |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | if (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_URL; |
| 23 | 23 | |
| 24 | - return ((Request::isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']); |
|
| 24 | + return ((Request::isSecure() ? 'https://' : 'http://').$_SERVER['HTTP_HOST']); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | if (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_EMAIL; |
| 34 | 34 | |
| 35 | - return ('admin@' . $_SERVER['HTTP_HOST']); |
|
| 35 | + return ('admin@'.$_SERVER['HTTP_HOST']); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -43,98 +43,98 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | # Site language |
| 45 | 45 | |
| 46 | - $this->addParam('site_language', CONFIG_SITE_LANGUAGE, function (string $name) { |
|
| 46 | + $this->addParam('site_language', CONFIG_SITE_LANGUAGE, function(string $name) { |
|
| 47 | 47 | |
| 48 | 48 | return ((false !== ($name = Extend\Languages::validate($name))) ? $name : null); |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | 51 | # Site template |
| 52 | 52 | |
| 53 | - $this->addParam('site_template', CONFIG_SITE_TEMPLATE, function (string $name) { |
|
| 53 | + $this->addParam('site_template', CONFIG_SITE_TEMPLATE, function(string $name) { |
|
| 54 | 54 | |
| 55 | 55 | return ((false !== ($name = Extend\Templates::validate($name))) ? $name : null); |
| 56 | 56 | }); |
| 57 | 57 | |
| 58 | 58 | # Site title |
| 59 | 59 | |
| 60 | - $this->addParam('site_title', CONFIG_SITE_TITLE, function (string $title) { |
|
| 60 | + $this->addParam('site_title', CONFIG_SITE_TITLE, function(string $title) { |
|
| 61 | 61 | |
| 62 | 62 | return (('' !== $title) ? $title : null); |
| 63 | 63 | }); |
| 64 | 64 | |
| 65 | 65 | # Site slogan |
| 66 | 66 | |
| 67 | - $this->addParam('site_slogan', CONFIG_SITE_SLOGAN, function (string $slogan) { |
|
| 67 | + $this->addParam('site_slogan', CONFIG_SITE_SLOGAN, function(string $slogan) { |
|
| 68 | 68 | |
| 69 | 69 | return $slogan; |
| 70 | 70 | }); |
| 71 | 71 | |
| 72 | 72 | # Site status |
| 73 | 73 | |
| 74 | - $this->addParam('site_status', CONFIG_SITE_STATUS, function (int $status) { |
|
| 74 | + $this->addParam('site_status', CONFIG_SITE_STATUS, function(int $status) { |
|
| 75 | 75 | |
| 76 | 76 | return ((false !== ($status = Range\Status::validate($status))) ? $status : null); |
| 77 | 77 | }); |
| 78 | 78 | |
| 79 | 79 | # Site description |
| 80 | 80 | |
| 81 | - $this->addParam('site_description', CONFIG_SITE_DESCRIPTION, function (string $description) { |
|
| 81 | + $this->addParam('site_description', CONFIG_SITE_DESCRIPTION, function(string $description) { |
|
| 82 | 82 | |
| 83 | 83 | return $description; |
| 84 | 84 | }); |
| 85 | 85 | |
| 86 | 86 | # Site keywords |
| 87 | 87 | |
| 88 | - $this->addParam('site_keywords', CONFIG_SITE_KEYWORDS, function (string $keywords) { |
|
| 88 | + $this->addParam('site_keywords', CONFIG_SITE_KEYWORDS, function(string $keywords) { |
|
| 89 | 89 | |
| 90 | 90 | return $keywords; |
| 91 | 91 | }); |
| 92 | 92 | |
| 93 | 93 | # System url |
| 94 | 94 | |
| 95 | - $this->addParam('system_url', $this->getSystemUrl(), function (string $url) { |
|
| 95 | + $this->addParam('system_url', $this->getSystemUrl(), function(string $url) { |
|
| 96 | 96 | |
| 97 | 97 | return ((false !== ($url = Validate::url($url))) ? $url : null); |
| 98 | 98 | }); |
| 99 | 99 | |
| 100 | 100 | # System email |
| 101 | 101 | |
| 102 | - $this->addParam('system_email', $this->getSystemEmail(), function (string $email) { |
|
| 102 | + $this->addParam('system_email', $this->getSystemEmail(), function(string $email) { |
|
| 103 | 103 | |
| 104 | 104 | return ((false !== ($email = Validate::email($email))) ? $email : null); |
| 105 | 105 | }); |
| 106 | 106 | |
| 107 | 107 | # System timezone |
| 108 | 108 | |
| 109 | - $this->addParam('system_timezone', CONFIG_SYSTEM_TIMEZONE, function (string $timezone) { |
|
| 109 | + $this->addParam('system_timezone', CONFIG_SYSTEM_TIMEZONE, function(string $timezone) { |
|
| 110 | 110 | |
| 111 | 111 | return ((false !== ($timezone = Timezone::validate($timezone))) ? $timezone : null); |
| 112 | 112 | }); |
| 113 | 113 | |
| 114 | 114 | # Admin language |
| 115 | 115 | |
| 116 | - $this->addParam('admin_language', CONFIG_ADMIN_LANGUAGE, function (string $name) { |
|
| 116 | + $this->addParam('admin_language', CONFIG_ADMIN_LANGUAGE, function(string $name) { |
|
| 117 | 117 | |
| 118 | 118 | return ((false !== ($name = Extend\Languages::validate($name))) ? $name : null); |
| 119 | 119 | }); |
| 120 | 120 | |
| 121 | 121 | # Admin template |
| 122 | 122 | |
| 123 | - $this->addParam('admin_template', CONFIG_ADMIN_TEMPLATE, function (string $name) { |
|
| 123 | + $this->addParam('admin_template', CONFIG_ADMIN_TEMPLATE, function(string $name) { |
|
| 124 | 124 | |
| 125 | 125 | return ((false !== ($name = Extend\Templates::validate($name))) ? $name : null); |
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | 128 | # Admin display entities |
| 129 | 129 | |
| 130 | - $this->addParam('admin_display_entities', CONFIG_ADMIN_DISPLAY_ENTITIES, function (int $display) { |
|
| 130 | + $this->addParam('admin_display_entities', CONFIG_ADMIN_DISPLAY_ENTITIES, function(int $display) { |
|
| 131 | 131 | |
| 132 | 132 | return ((false !== ($display = Range\Display\Entities::validate($display))) ? $display : null); |
| 133 | 133 | }); |
| 134 | 134 | |
| 135 | 135 | # Admin display files |
| 136 | 136 | |
| 137 | - $this->addParam('admin_display_files', CONFIG_ADMIN_DISPLAY_FILES, function (int $display) { |
|
| 137 | + $this->addParam('admin_display_files', CONFIG_ADMIN_DISPLAY_FILES, function(int $display) { |
|
| 138 | 138 | |
| 139 | 139 | return ((false !== ($display = Range\Display\Files::validate($display))) ? $display : null); |
| 140 | 140 | }); |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | |
| 23 | 23 | # Save uploaded file |
| 24 | 24 | |
| 25 | - if (true === ($upload = (Uploader::save('upload', (DIR_UPLOADS . $target_dir))))) { |
|
| 25 | + if (true === ($upload = (Uploader::save('upload', (DIR_UPLOADS.$target_dir))))) { |
|
| 26 | 26 | |
| 27 | - $name = Uploader::baseName(); $url = (INSTALL_PATH . '/uploads/' . $target_dir . $name); |
|
| 27 | + $name = Uploader::baseName(); $url = (INSTALL_PATH.'/uploads/'.$target_dir.$name); |
|
| 28 | 28 | |
| 29 | 29 | $ajax->set('name', $name)->set('url', $url); |
| 30 | 30 | |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | public static function checkInstallFile() { |
| 26 | 26 | |
| 27 | - return Explorer::isFile(DIR_WWW . 'install.php'); |
|
| 27 | + return Explorer::isFile(DIR_WWW.'install.php'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | # Get MySQL version |