@@ -12,19 +12,33 @@ |
||
12 | 12 | |
13 | 13 | $extension = strtolower(Explorer::extension($file_name, false)); |
14 | 14 | |
15 | - if (self::isImage($extension)) return 'image'; |
|
15 | + if (self::isImage($extension)) { |
|
16 | + return 'image'; |
|
17 | + } |
|
16 | 18 | |
17 | - if (self::isAudio($extension)) return 'audio'; |
|
19 | + if (self::isAudio($extension)) { |
|
20 | + return 'audio'; |
|
21 | + } |
|
18 | 22 | |
19 | - if (self::isVideo($extension)) return 'video'; |
|
23 | + if (self::isVideo($extension)) { |
|
24 | + return 'video'; |
|
25 | + } |
|
20 | 26 | |
21 | - if (in_array($extension, ['doc', 'docx'], true)) return 'word'; |
|
27 | + if (in_array($extension, ['doc', 'docx'], true)) { |
|
28 | + return 'word'; |
|
29 | + } |
|
22 | 30 | |
23 | - if (in_array($extension, ['xls', 'xlsx'], true)) return 'excel'; |
|
31 | + if (in_array($extension, ['xls', 'xlsx'], true)) { |
|
32 | + return 'excel'; |
|
33 | + } |
|
24 | 34 | |
25 | - if (in_array($extension, ['ppt', 'pptx'], true)) return 'powerpoint'; |
|
35 | + if (in_array($extension, ['ppt', 'pptx'], true)) { |
|
36 | + return 'powerpoint'; |
|
37 | + } |
|
26 | 38 | |
27 | - if ($extension === 'pdf') return 'pdf'; |
|
39 | + if ($extension === 'pdf') { |
|
40 | + return 'pdf'; |
|
41 | + } |
|
28 | 42 | |
29 | 43 | # ------------------------ |
30 | 44 |
@@ -49,7 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | if (Request::post('action') === 'remove') { |
51 | 51 | |
52 | - if (!$this->entity->remove()) return $ajax->error(Language::get(static::$message_error_remove)); |
|
52 | + if (!$this->entity->remove()) { |
|
53 | + return $ajax->error(Language::get(static::$message_error_remove)); |
|
54 | + } |
|
53 | 55 | } |
54 | 56 | |
55 | 57 | # ------------------------ |
@@ -80,7 +82,9 @@ discard block |
||
80 | 82 | |
81 | 83 | # Handle ajax request |
82 | 84 | |
83 | - if (Request::isAjax()) return $this->handleAjax(); |
|
85 | + if (Request::isAjax()) { |
|
86 | + return $this->handleAjax(); |
|
87 | + } |
|
84 | 88 | |
85 | 89 | # Create form |
86 | 90 | |
@@ -97,7 +101,9 @@ discard block |
||
97 | 101 | |
98 | 102 | # Display success message |
99 | 103 | |
100 | - if (false !== Request::get('submitted')) Messages::success(Language::get(static::$message_success_rename)); |
|
104 | + if (false !== Request::get('submitted')) { |
|
105 | + Messages::success(Language::get(static::$message_success_rename)); |
|
106 | + } |
|
101 | 107 | |
102 | 108 | # ------------------------ |
103 | 109 |
@@ -35,11 +35,15 @@ |
||
35 | 35 | |
36 | 36 | # Check if install file exists |
37 | 37 | |
38 | - if (Informer::checkInstallFile()) Messages::error(Language::get('DASHBOARD_MESSAGE_INSTALL_FILE')); |
|
38 | + if (Informer::checkInstallFile()) { |
|
39 | + Messages::error(Language::get('DASHBOARD_MESSAGE_INSTALL_FILE')); |
|
40 | + } |
|
39 | 41 | |
40 | 42 | # Check if configuration file is loaded |
41 | 43 | |
42 | - if (!Settings::loaded()) Messages::warning(Language::get('DASHBOARD_MESSAGE_CONFIG_FILE')); |
|
44 | + if (!Settings::loaded()) { |
|
45 | + Messages::warning(Language::get('DASHBOARD_MESSAGE_CONFIG_FILE')); |
|
46 | + } |
|
43 | 47 | |
44 | 48 | # ------------------------ |
45 | 49 |
@@ -45,7 +45,9 @@ |
||
45 | 45 | |
46 | 46 | public static function mysqlVersion() { |
47 | 47 | |
48 | - if (!(DB::send("SELECT VERSION() as version") && DB::last()->status)) return false; |
|
48 | + if (!(DB::send("SELECT VERSION() as version") && DB::last()->status)) { |
|
49 | + return false; |
|
50 | + } |
|
49 | 51 | |
50 | 52 | return strval(DB::last()->row()['version']); |
51 | 53 | } |
@@ -29,9 +29,13 @@ discard block |
||
29 | 29 | |
30 | 30 | # Check name exists |
31 | 31 | |
32 | - if (false === ($check_name = $this->variable->check('name', $name))) return 'VARIABLE_ERROR_MODIFY'; |
|
32 | + if (false === ($check_name = $this->variable->check('name', $name))) { |
|
33 | + return 'VARIABLE_ERROR_MODIFY'; |
|
34 | + } |
|
33 | 35 | |
34 | - if ($check_name === 1) return 'VARIABLE_ERROR_NAME_DUPLICATE'; |
|
36 | + if ($check_name === 1) { |
|
37 | + return 'VARIABLE_ERROR_NAME_DUPLICATE'; |
|
38 | + } |
|
35 | 39 | |
36 | 40 | # Modify variable |
37 | 41 | |
@@ -43,7 +47,9 @@ discard block |
||
43 | 47 | |
44 | 48 | $modifier = ((0 === $this->variable->id) ? 'create' : 'edit'); |
45 | 49 | |
46 | - if (!$this->variable->$modifier($data)) return 'VARIABLE_ERROR_MODIFY'; |
|
50 | + if (!$this->variable->$modifier($data)) { |
|
51 | + return 'VARIABLE_ERROR_MODIFY'; |
|
52 | + } |
|
47 | 53 | |
48 | 54 | # ------------------------ |
49 | 55 |
@@ -39,7 +39,9 @@ |
||
39 | 39 | |
40 | 40 | $modifier = ((0 === $this->menuitem->id) ? 'create' : 'edit'); |
41 | 41 | |
42 | - if (!$this->menuitem->$modifier($data)) return 'MENUITEM_ERROR_MODIFY'; |
|
42 | + if (!$this->menuitem->$modifier($data)) { |
|
43 | + return 'MENUITEM_ERROR_MODIFY'; |
|
44 | + } |
|
43 | 45 | |
44 | 46 | # ------------------------ |
45 | 47 |
@@ -29,9 +29,13 @@ discard block |
||
29 | 29 | |
30 | 30 | # Check name exists |
31 | 31 | |
32 | - if (false === ($check_name = $this->widget->check('name', $name))) return 'WIDGET_ERROR_MODIFY'; |
|
32 | + if (false === ($check_name = $this->widget->check('name', $name))) { |
|
33 | + return 'WIDGET_ERROR_MODIFY'; |
|
34 | + } |
|
33 | 35 | |
34 | - if ($check_name === 1) return 'WIDGET_ERROR_NAME_DUPLICATE'; |
|
36 | + if ($check_name === 1) { |
|
37 | + return 'WIDGET_ERROR_NAME_DUPLICATE'; |
|
38 | + } |
|
35 | 39 | |
36 | 40 | # Modify widget |
37 | 41 | |
@@ -44,7 +48,9 @@ discard block |
||
44 | 48 | |
45 | 49 | $modifier = ((0 === $this->widget->id) ? 'create' : 'edit'); |
46 | 50 | |
47 | - if (!$this->widget->$modifier($data)) return 'WIDGET_ERROR_MODIFY'; |
|
51 | + if (!$this->widget->$modifier($data)) { |
|
52 | + return 'WIDGET_ERROR_MODIFY'; |
|
53 | + } |
|
48 | 54 | |
49 | 55 | # ------------------------ |
50 | 56 |
@@ -32,7 +32,9 @@ |
||
32 | 32 | |
33 | 33 | $contents->block('parent')->block('browse')->disable(); |
34 | 34 | |
35 | - } else $contents->block('parent')->block('browse')->link = $this->parent->link; |
|
35 | + } else { |
|
36 | + $contents->block('parent')->block('browse')->link = $this->parent->link; |
|
37 | + } |
|
36 | 38 | } |
37 | 39 | } |
38 | 40 | } |
@@ -32,7 +32,9 @@ |
||
32 | 32 | |
33 | 33 | $contents->block('parent')->block('browse')->disable(); |
34 | 34 | |
35 | - } else $contents->block('parent')->block('browse')->link = $this->parent->link; |
|
35 | + } else { |
|
36 | + $contents->block('parent')->block('browse')->link = $this->parent->link; |
|
37 | + } |
|
36 | 38 | } |
37 | 39 | } |
38 | 40 | } |