@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | if ($this->form_personal->handle($controller_personal) || $this->form_password->handle($controller_password)) { |
47 | 47 | |
48 | - Request::redirect(INSTALL_PATH . '/profile/edit?submitted'); |
|
48 | + Request::redirect(INSTALL_PATH.'/profile/edit?submitted'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | # Display success message |
@@ -50,7 +50,9 @@ |
||
50 | 50 | |
51 | 51 | # Display success message |
52 | 52 | |
53 | - if (false !== Request::get('submitted')) Messages::set('success', Language::get('USER_SUCCESS_EDIT')); |
|
53 | + if (false !== Request::get('submitted')) { |
|
54 | + Messages::set('success', Language::get('USER_SUCCESS_EDIT')); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | # ------------------------ |
56 | 58 |
@@ -24,14 +24,14 @@ |
||
24 | 24 | |
25 | 25 | if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', '); |
26 | 26 | |
27 | - $values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')'); |
|
27 | + $values[] = ('('.$this->getString(array_values($row), '$value', ', ').')'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | # Build query |
31 | 31 | |
32 | - $this->query = ('INSERT ' . ($ignore ? 'IGNORE ' : '') . |
|
32 | + $this->query = ('INSERT '.($ignore ? 'IGNORE ' : ''). |
|
33 | 33 | |
34 | - 'INTO ' . $table . ' (' . $names . ') VALUES ' . implode(', ', $values)); |
|
34 | + 'INTO '.$table.' ('.$names.') VALUES '.implode(', ', $values)); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
@@ -29,9 +29,11 @@ |
||
29 | 29 | |
30 | 30 | $names = ''; $values = []; |
31 | 31 | |
32 | - foreach ($set as $key => $row) if (is_array($row)) { |
|
32 | + foreach ($set as $key => $row) { |
|
33 | + if (is_array($row)) { |
|
33 | 34 | |
34 | 35 | if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', '); |
36 | + } |
|
35 | 37 | |
36 | 38 | $values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')'); |
37 | 39 | } |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | # Database tables |
4 | 4 | |
5 | -define('TABLE_PAGES', 'pages'); |
|
6 | -define('TABLE_PAGES_RELATIONS', 'pages_relations'); |
|
5 | +define('TABLE_PAGES', 'pages'); |
|
6 | +define('TABLE_PAGES_RELATIONS', 'pages_relations'); |
|
7 | 7 | |
8 | -define('TABLE_MENU', 'menu'); |
|
9 | -define('TABLE_MENU_RELATIONS', 'menu_relations'); |
|
8 | +define('TABLE_MENU', 'menu'); |
|
9 | +define('TABLE_MENU_RELATIONS', 'menu_relations'); |
|
10 | 10 | |
11 | -define('TABLE_VARIABLES', 'variables'); |
|
12 | -define('TABLE_WIDGETS', 'widgets'); |
|
11 | +define('TABLE_VARIABLES', 'variables'); |
|
12 | +define('TABLE_WIDGETS', 'widgets'); |
|
13 | 13 | |
14 | -define('TABLE_USERS', 'users'); |
|
15 | -define('TABLE_USERS_SECRETS', 'users_secrets'); |
|
16 | -define('TABLE_USERS_SESSIONS', 'users_sessions'); |
|
14 | +define('TABLE_USERS', 'users'); |
|
15 | +define('TABLE_USERS_SECRETS', 'users_secrets'); |
|
16 | +define('TABLE_USERS_SESSIONS', 'users_sessions'); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | if ((0 !== strcasecmp($this->entity->name(), $name)) && |
41 | 41 | |
42 | - @file_exists($this->entity->parent()->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
42 | + @file_exists($this->entity->parent()->pathFull().$name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
43 | 43 | |
44 | 44 | # Rename item |
45 | 45 |
@@ -29,19 +29,25 @@ |
||
29 | 29 | |
30 | 30 | # Validate name |
31 | 31 | |
32 | - if (false === ($name = Validate::fileName($name))) return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
32 | + if (false === ($name = Validate::fileName($name))) { |
|
33 | + return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | # Check if item exists |
35 | 37 | |
36 | 38 | if ((0 !== strcasecmp($this->entity->name(), $name)) && |
37 | 39 | |
38 | - @file_exists($this->entity->parent()->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
40 | + @file_exists($this->entity->parent()->pathFull() . $name)) { |
|
41 | + return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
42 | + } |
|
39 | 43 | |
40 | 44 | # Rename item |
41 | 45 | |
42 | - if (!$this->entity->rename($name)) return (($this->entity->type() === FILEMANAGER_TYPE_DIR) ? |
|
46 | + if (!$this->entity->rename($name)) { |
|
47 | + return (($this->entity->type() === FILEMANAGER_TYPE_DIR) ? |
|
43 | 48 | |
44 | 49 | 'FILEMANAGER_ERROR_DIR_RENAME' : 'FILEMANAGER_ERROR_FILE_RENAME'); |
50 | + } |
|
45 | 51 | |
46 | 52 | # ------------------------ |
47 | 53 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | # Check if item exists |
39 | 39 | |
40 | - if (@file_exists($this->parent->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
40 | + if (@file_exists($this->parent->pathFull().$name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
41 | 41 | |
42 | 42 | # Create item |
43 | 43 |
@@ -29,19 +29,25 @@ |
||
29 | 29 | |
30 | 30 | # Validate name |
31 | 31 | |
32 | - if (false === ($name = Validate::fileName($name))) return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
32 | + if (false === ($name = Validate::fileName($name))) { |
|
33 | + return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | # Check if item exists |
35 | 37 | |
36 | - if (@file_exists($this->parent->pathFull() . $name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
38 | + if (@file_exists($this->parent->pathFull() . $name)) { |
|
39 | + return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
40 | + } |
|
37 | 41 | |
38 | 42 | # Create item |
39 | 43 | |
40 | 44 | $entity = Filemanager::get($type, $this->parent); |
41 | 45 | |
42 | - if (!$entity->create($name)) return (($entity->type() === FILEMANAGER_TYPE_DIR) ? |
|
46 | + if (!$entity->create($name)) { |
|
47 | + return (($entity->type() === FILEMANAGER_TYPE_DIR) ? |
|
43 | 48 | |
44 | 49 | 'FILEMANAGER_ERROR_DIR_CREATE' : 'FILEMANAGER_ERROR_FILE_CREATE'); |
50 | + } |
|
45 | 51 | |
46 | 52 | # ------------------------ |
47 | 53 |
@@ -19,11 +19,15 @@ |
||
19 | 19 | |
20 | 20 | private function add(string $type, string $name, array $args) { |
21 | 21 | |
22 | - if (('' === $name) || isset($this->list[$name])) return; |
|
22 | + if (('' === $name) || isset($this->list[$name])) { |
|
23 | + return; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $this->list[$name] = new $this->types[$type](...$args); |
25 | 27 | |
26 | - if (($type !== 'textual') || $this->list[$name]->short) $this->secure[] = $name; |
|
28 | + if (($type !== 'textual') || $this->list[$name]->short) { |
|
29 | + $this->secure[] = $name; |
|
30 | + } |
|
27 | 31 | } |
28 | 32 | |
29 | 33 | # Constructor |
@@ -32,11 +32,11 @@ |
||
32 | 32 | |
33 | 33 | public function statement() { |
34 | 34 | |
35 | - return ("FOREIGN KEY (`" . $this->name . "`) REFERENCES `" . $this->table . "` (`" . $this->field . "`)") . |
|
35 | + return ("FOREIGN KEY (`".$this->name."`) REFERENCES `".$this->table."` (`".$this->field."`)"). |
|
36 | 36 | |
37 | - ((null !== $this->delete) ? (" ON DELETE " . $this->delete) : "") . |
|
37 | + ((null !== $this->delete) ? (" ON DELETE ".$this->delete) : ""). |
|
38 | 38 | |
39 | - ((null !== $this->update) ? (" ON UPDATE " . $this->update) : ""); |
|
39 | + ((null !== $this->update) ? (" ON UPDATE ".$this->update) : ""); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -23,9 +23,13 @@ |
||
23 | 23 | |
24 | 24 | $this->name = $name; $this->table = $table; $this->field = $field; |
25 | 25 | |
26 | - if (null !== $delete) $this->delete = $this->getAction($delete); |
|
26 | + if (null !== $delete) { |
|
27 | + $this->delete = $this->getAction($delete); |
|
28 | + } |
|
27 | 29 | |
28 | - if (null !== $update) $this->update = $this->getAction($delete); |
|
30 | + if (null !== $update) { |
|
31 | + $this->update = $this->getAction($delete); |
|
32 | + } |
|
29 | 33 | } |
30 | 34 | |
31 | 35 | # Get statement |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | return ((null !== $this->type) ? ($this->type . " ") : "") . |
34 | 34 | |
35 | - ("KEY `" . $this->name . "` (`" . $this->name . "`)"); |
|
35 | + ("KEY `" . $this->name . "` (`" . $this->name . "`)"); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | } |
@@ -30,9 +30,9 @@ |
||
30 | 30 | |
31 | 31 | public function statement() { |
32 | 32 | |
33 | - return ((null !== $this->type) ? ($this->type . " ") : "") . |
|
33 | + return ((null !== $this->type) ? ($this->type." ") : ""). |
|
34 | 34 | |
35 | - ("KEY `" . $this->name . "` (`" . $this->name . "`)"); |
|
35 | + ("KEY `".$this->name."` (`".$this->name."`)"); |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | } |
@@ -23,7 +23,9 @@ |
||
23 | 23 | |
24 | 24 | $this->name = $name; |
25 | 25 | |
26 | - if (null !== $type) $this->type = $this->getType($type); |
|
26 | + if (null !== $type) { |
|
27 | + $this->type = $this->getType($type); |
|
28 | + } |
|
27 | 29 | } |
28 | 30 | |
29 | 31 | # Get statement |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | public function statement() { |
21 | 21 | |
22 | - return ("`" . $this->name . "` int(10) UNSIGNED NOT NULL" . ($this->auto_increment ? " AUTO_INCREMENT" : "")); |
|
22 | + return ("`".$this->name."` int(10) UNSIGNED NOT NULL".($this->auto_increment ? " AUTO_INCREMENT" : "")); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | # Cast value |