@@ -23,19 +23,19 @@ |
||
| 23 | 23 | |
| 24 | 24 | # Add params |
| 25 | 25 | |
| 26 | - $this->params->addTextual ('code', true, 40, true, ''); |
|
| 27 | - $this->params->addTextual ('ip', true, 255, false, ''); |
|
| 28 | - $this->params->addInteger ('time', false, 10, true, 0); |
|
| 26 | + $this->params->addTextual('code', true, 40, true, ''); |
|
| 27 | + $this->params->addTextual('ip', true, 255, false, ''); |
|
| 28 | + $this->params->addInteger('time', false, 10, true, 0); |
|
| 29 | 29 | |
| 30 | 30 | # Add indexes |
| 31 | 31 | |
| 32 | - $this->indexes->add ('code', 'UNIQUE'); |
|
| 33 | - $this->indexes->add ('ip'); |
|
| 34 | - $this->indexes->add ('time'); |
|
| 32 | + $this->indexes->add('code', 'UNIQUE'); |
|
| 33 | + $this->indexes->add('ip'); |
|
| 34 | + $this->indexes->add('time'); |
|
| 35 | 35 | |
| 36 | 36 | # Add foreign keys |
| 37 | 37 | |
| 38 | - $this->foreigns->add ('id', TABLE_USERS, 'id', 'CASCADE', 'RESTRICT'); |
|
| 38 | + $this->foreigns->add('id', TABLE_USERS, 'id', 'CASCADE', 'RESTRICT'); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | /** |
| 184 | 184 | * Get the entity creation time |
| 185 | 185 | * |
| 186 | - * @return int|false : the time or false on failure |
|
| 186 | + * @return null|integer : the time or false on failure |
|
| 187 | 187 | */ |
| 188 | 188 | |
| 189 | 189 | public function getCreated() { |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | /** |
| 210 | 210 | * Get the entity modification time |
| 211 | 211 | * |
| 212 | - * @return int|false : the time or false on failure |
|
| 212 | + * @return null|integer : the time or false on failure |
|
| 213 | 213 | */ |
| 214 | 214 | |
| 215 | 215 | public function getModified() { |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | /** |
| 236 | 236 | * Get the entity size |
| 237 | 237 | * |
| 238 | - * @return int|false : the size or false on failure |
|
| 238 | + * @return integer : the size or false on failure |
|
| 239 | 239 | */ |
| 240 | 240 | |
| 241 | 241 | public function getSize() { |
@@ -27,9 +27,9 @@ |
||
| 27 | 27 | |
| 28 | 28 | if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) return false; |
| 29 | 29 | |
| 30 | - $path = (($this->parent->getPath() ? ($this->parent->getPath() . '/') : '') . $name); |
|
| 30 | + $path = (($this->parent->getPath() ? ($this->parent->getPath().'/') : '').$name); |
|
| 31 | 31 | |
| 32 | - $path_full = ($this->parent->getPathFull() . $name); |
|
| 32 | + $path_full = ($this->parent->getPathFull().$name); |
|
| 33 | 33 | |
| 34 | 34 | # ------------------------ |
| 35 | 35 | |
@@ -23,9 +23,13 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | private function getPrototype(string $name) { |
| 25 | 25 | |
| 26 | - if (('' === $name) || preg_match('/[\/\\\\]/', $name)) return false; |
|
| 26 | + if (('' === $name) || preg_match('/[\/\\\\]/', $name)) { |
|
| 27 | + return false; |
|
| 28 | + } |
|
| 27 | 29 | |
| 28 | - if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) return false; |
|
| 30 | + if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) { |
|
| 31 | + return false; |
|
| 32 | + } |
|
| 29 | 33 | |
| 30 | 34 | $path = (($this->parent->getPath() ? ($this->parent->getPath() . '/') : '') . $name); |
| 31 | 35 | |
@@ -53,17 +57,23 @@ discard block |
||
| 53 | 57 | |
| 54 | 58 | public function init(string $name) : bool { |
| 55 | 59 | |
| 56 | - if (false === ($prototype = $this->getPrototype($name))) return false; |
|
| 60 | + if (false === ($prototype = $this->getPrototype($name))) { |
|
| 61 | + return false; |
|
| 62 | + } |
|
| 57 | 63 | |
| 58 | 64 | # Check type |
| 59 | 65 | |
| 60 | 66 | $type = Explorer::getType($prototype['path_full']); |
| 61 | 67 | |
| 62 | - if (!in_array($type, ['dir', 'file'], true)) return false; |
|
| 68 | + if (!in_array($type, ['dir', 'file'], true)) { |
|
| 69 | + return false; |
|
| 70 | + } |
|
| 63 | 71 | |
| 64 | 72 | # Set data |
| 65 | 73 | |
| 66 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
| 74 | + foreach ($prototype as $var => $value) { |
|
| 75 | + $this->$var = $value; |
|
| 76 | + } |
|
| 67 | 77 | |
| 68 | 78 | $this->type = $type; |
| 69 | 79 | |
@@ -81,9 +91,13 @@ discard block |
||
| 81 | 91 | |
| 82 | 92 | public function check(string $name) : bool { |
| 83 | 93 | |
| 84 | - if (false === ($prototype = $this->getPrototype($name))) return false; |
|
| 94 | + if (false === ($prototype = $this->getPrototype($name))) { |
|
| 95 | + return false; |
|
| 96 | + } |
|
| 85 | 97 | |
| 86 | - if (($name !== $this->name) && Explorer::exists($prototype['path_full'])) return false; |
|
| 98 | + if (($name !== $this->name) && Explorer::exists($prototype['path_full'])) { |
|
| 99 | + return false; |
|
| 100 | + } |
|
| 87 | 101 | |
| 88 | 102 | # ------------------------ |
| 89 | 103 | |
@@ -98,19 +112,27 @@ discard block |
||
| 98 | 112 | |
| 99 | 113 | public function create(string $name, string $type) : bool { |
| 100 | 114 | |
| 101 | - if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false; |
|
| 115 | + if (('' !== $this->name) || (false === ($prototype = $this->getPrototype($name)))) { |
|
| 116 | + return false; |
|
| 117 | + } |
|
| 102 | 118 | |
| 103 | - if (!in_array($type, ['dir', 'file'], true)) return false; |
|
| 119 | + if (!in_array($type, ['dir', 'file'], true)) { |
|
| 120 | + return false; |
|
| 121 | + } |
|
| 104 | 122 | |
| 105 | 123 | # Create entity |
| 106 | 124 | |
| 107 | 125 | $create = (($type === 'dir') ? 'createDir' : 'createFile'); |
| 108 | 126 | |
| 109 | - if (!Explorer::$create($prototype['path_full'])) return false; |
|
| 127 | + if (!Explorer::$create($prototype['path_full'])) { |
|
| 128 | + return false; |
|
| 129 | + } |
|
| 110 | 130 | |
| 111 | 131 | # Set data |
| 112 | 132 | |
| 113 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
| 133 | + foreach ($prototype as $var => $value) { |
|
| 134 | + $this->$var = $value; |
|
| 135 | + } |
|
| 114 | 136 | |
| 115 | 137 | $this->type = $type; |
| 116 | 138 | |
@@ -127,15 +149,21 @@ discard block |
||
| 127 | 149 | |
| 128 | 150 | public function rename(string $name) : bool { |
| 129 | 151 | |
| 130 | - if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) return false; |
|
| 152 | + if (('' === $this->name) || (false === ($prototype = $this->getPrototype($name)))) { |
|
| 153 | + return false; |
|
| 154 | + } |
|
| 131 | 155 | |
| 132 | 156 | # Rename entity |
| 133 | 157 | |
| 134 | - if (!Explorer::rename($this->path_full, $prototype['path_full'])) return false; |
|
| 158 | + if (!Explorer::rename($this->path_full, $prototype['path_full'])) { |
|
| 159 | + return false; |
|
| 160 | + } |
|
| 135 | 161 | |
| 136 | 162 | # Set data |
| 137 | 163 | |
| 138 | - foreach ($prototype as $var => $value) $this->$var = $value; |
|
| 164 | + foreach ($prototype as $var => $value) { |
|
| 165 | + $this->$var = $value; |
|
| 166 | + } |
|
| 139 | 167 | |
| 140 | 168 | # ------------------------ |
| 141 | 169 | |
@@ -150,13 +178,17 @@ discard block |
||
| 150 | 178 | |
| 151 | 179 | public function remove() : bool { |
| 152 | 180 | |
| 153 | - if ('' === $this->name) return false; |
|
| 181 | + if ('' === $this->name) { |
|
| 182 | + return false; |
|
| 183 | + } |
|
| 154 | 184 | |
| 155 | 185 | # Remove entity |
| 156 | 186 | |
| 157 | 187 | $remove = (($this->type === 'dir') ? 'removeDir' : 'removeFile'); |
| 158 | 188 | |
| 159 | - if (!Explorer::$remove($this->path_full, true)) return false; |
|
| 189 | + if (!Explorer::$remove($this->path_full, true)) { |
|
| 190 | + return false; |
|
| 191 | + } |
|
| 160 | 192 | |
| 161 | 193 | # Reset data |
| 162 | 194 | |
@@ -175,7 +207,9 @@ discard block |
||
| 175 | 207 | |
| 176 | 208 | public function getExtension() { |
| 177 | 209 | |
| 178 | - if ('' === $this->name) return false; |
|
| 210 | + if ('' === $this->name) { |
|
| 211 | + return false; |
|
| 212 | + } |
|
| 179 | 213 | |
| 180 | 214 | return strtolower(Explorer::getExtension($this->name, false)); |
| 181 | 215 | } |
@@ -188,7 +222,9 @@ discard block |
||
| 188 | 222 | |
| 189 | 223 | public function getCreated() { |
| 190 | 224 | |
| 191 | - if ('' === $this->name) return false; |
|
| 225 | + if ('' === $this->name) { |
|
| 226 | + return false; |
|
| 227 | + } |
|
| 192 | 228 | |
| 193 | 229 | return Explorer::getCreated($this->path_full); |
| 194 | 230 | } |
@@ -201,7 +237,9 @@ discard block |
||
| 201 | 237 | |
| 202 | 238 | public function getAccessed() { |
| 203 | 239 | |
| 204 | - if ('' === $this->name) return false; |
|
| 240 | + if ('' === $this->name) { |
|
| 241 | + return false; |
|
| 242 | + } |
|
| 205 | 243 | |
| 206 | 244 | return Explorer::getAccessed($this->path_full); |
| 207 | 245 | } |
@@ -214,7 +252,9 @@ discard block |
||
| 214 | 252 | |
| 215 | 253 | public function getModified() { |
| 216 | 254 | |
| 217 | - if ('' === $this->name) return false; |
|
| 255 | + if ('' === $this->name) { |
|
| 256 | + return false; |
|
| 257 | + } |
|
| 218 | 258 | |
| 219 | 259 | return Explorer::getModified($this->path_full); |
| 220 | 260 | } |
@@ -227,7 +267,9 @@ discard block |
||
| 227 | 267 | |
| 228 | 268 | public function getPermissions() { |
| 229 | 269 | |
| 230 | - if ('' === $this->name) return false; |
|
| 270 | + if ('' === $this->name) { |
|
| 271 | + return false; |
|
| 272 | + } |
|
| 231 | 273 | |
| 232 | 274 | return Explorer::getPermissions($this->path_full); |
| 233 | 275 | } |
@@ -240,7 +282,9 @@ discard block |
||
| 240 | 282 | |
| 241 | 283 | public function getSize() { |
| 242 | 284 | |
| 243 | - if ('' === $this->name) return false; |
|
| 285 | + if ('' === $this->name) { |
|
| 286 | + return false; |
|
| 287 | + } |
|
| 244 | 288 | |
| 245 | 289 | return Explorer::getSize($this->path_full); |
| 246 | 290 | } |
@@ -253,7 +297,9 @@ discard block |
||
| 253 | 297 | |
| 254 | 298 | public function getContents() { |
| 255 | 299 | |
| 256 | - if ('' === $this->name) return false; |
|
| 300 | + if ('' === $this->name) { |
|
| 301 | + return false; |
|
| 302 | + } |
|
| 257 | 303 | |
| 258 | 304 | return Explorer::getContents($this->path_full); |
| 259 | 305 | } |
@@ -266,7 +312,9 @@ discard block |
||
| 266 | 312 | |
| 267 | 313 | public function putContents(string $contents) { |
| 268 | 314 | |
| 269 | - if ('' === $this->name) return false; |
|
| 315 | + if ('' === $this->name) { |
|
| 316 | + return false; |
|
| 317 | + } |
|
| 270 | 318 | |
| 271 | 319 | return Explorer::putContents($this->path_full, $contents); |
| 272 | 320 | } |
@@ -9,64 +9,64 @@ |
||
| 9 | 9 | |
| 10 | 10 | # Cadmium |
| 11 | 11 | |
| 12 | -define('CADMIUM_NAME', 'Cadmium CMS'); |
|
| 13 | -define('CADMIUM_HOME', 'http://cadmium-cms.com'); |
|
| 12 | +define('CADMIUM_NAME', 'Cadmium CMS'); |
|
| 13 | +define('CADMIUM_HOME', 'http://cadmium-cms.com'); |
|
| 14 | 14 | |
| 15 | -define('CADMIUM_VERSION', '0.4.6'); |
|
| 16 | -define('CADMIUM_COPY', '2017'); |
|
| 15 | +define('CADMIUM_VERSION', '0.4.6'); |
|
| 16 | +define('CADMIUM_COPY', '2017'); |
|
| 17 | 17 | |
| 18 | 18 | # Third-party |
| 19 | 19 | |
| 20 | -define('JQUERY_VERSION', '3.2.1'); |
|
| 21 | -define('SEMANTIC_UI_VERSION', '2.2.10'); |
|
| 22 | -define('CKEDITOR_VERSION', '4.6.2'); |
|
| 23 | -define('ACE_VERSION', '1.2.6'); |
|
| 20 | +define('JQUERY_VERSION', '3.2.1'); |
|
| 21 | +define('SEMANTIC_UI_VERSION', '2.2.10'); |
|
| 22 | +define('CKEDITOR_VERSION', '4.6.2'); |
|
| 23 | +define('ACE_VERSION', '1.2.6'); |
|
| 24 | 24 | |
| 25 | 25 | # Sections |
| 26 | 26 | |
| 27 | -define('SECTION_SITE', 'site'); |
|
| 28 | -define('SECTION_ADMIN', 'admin'); |
|
| 27 | +define('SECTION_SITE', 'site'); |
|
| 28 | +define('SECTION_ADMIN', 'admin'); |
|
| 29 | 29 | |
| 30 | 30 | # Access |
| 31 | 31 | |
| 32 | -define('ACCESS_PUBLIC', 0); |
|
| 33 | -define('ACCESS_REGISTERED', 1); |
|
| 34 | -define('ACCESS_ADMINISTRATOR', 2); |
|
| 32 | +define('ACCESS_PUBLIC', 0); |
|
| 33 | +define('ACCESS_REGISTERED', 1); |
|
| 34 | +define('ACCESS_ADMINISTRATOR', 2); |
|
| 35 | 35 | |
| 36 | 36 | # Frequency |
| 37 | 37 | |
| 38 | -define('FREQUENCY_ALWAYS', 'always'); |
|
| 39 | -define('FREQUENCY_HOURLY', 'hourly'); |
|
| 40 | -define('FREQUENCY_DAILY', 'daily'); |
|
| 41 | -define('FREQUENCY_WEEKLY', 'weekly'); |
|
| 42 | -define('FREQUENCY_MONTHLY', 'monthly'); |
|
| 43 | -define('FREQUENCY_YEARLY', 'yearly'); |
|
| 44 | -define('FREQUENCY_NEVER', 'never'); |
|
| 38 | +define('FREQUENCY_ALWAYS', 'always'); |
|
| 39 | +define('FREQUENCY_HOURLY', 'hourly'); |
|
| 40 | +define('FREQUENCY_DAILY', 'daily'); |
|
| 41 | +define('FREQUENCY_WEEKLY', 'weekly'); |
|
| 42 | +define('FREQUENCY_MONTHLY', 'monthly'); |
|
| 43 | +define('FREQUENCY_YEARLY', 'yearly'); |
|
| 44 | +define('FREQUENCY_NEVER', 'never'); |
|
| 45 | 45 | |
| 46 | 46 | # Rank |
| 47 | 47 | |
| 48 | -define('RANK_GUEST', 0); |
|
| 49 | -define('RANK_USER', 1); |
|
| 50 | -define('RANK_ADMINISTRATOR', 2); |
|
| 48 | +define('RANK_GUEST', 0); |
|
| 49 | +define('RANK_USER', 1); |
|
| 50 | +define('RANK_ADMINISTRATOR', 2); |
|
| 51 | 51 | |
| 52 | 52 | # Sex |
| 53 | 53 | |
| 54 | -define('SEX_NOT_SELECTED', 0); |
|
| 55 | -define('SEX_MALE', 1); |
|
| 56 | -define('SEX_FEMALE', 2); |
|
| 54 | +define('SEX_NOT_SELECTED', 0); |
|
| 55 | +define('SEX_MALE', 1); |
|
| 56 | +define('SEX_FEMALE', 2); |
|
| 57 | 57 | |
| 58 | 58 | # Status |
| 59 | 59 | |
| 60 | -define('STATUS_ONLINE', 0); |
|
| 61 | -define('STATUS_MAINTENANCE', 1); |
|
| 62 | -define('STATUS_UPDATE', 2); |
|
| 60 | +define('STATUS_ONLINE', 0); |
|
| 61 | +define('STATUS_MAINTENANCE', 1); |
|
| 62 | +define('STATUS_UPDATE', 2); |
|
| 63 | 63 | |
| 64 | 64 | # Target |
| 65 | 65 | |
| 66 | -define('TARGET_SELF', 0); |
|
| 67 | -define('TARGET_BLANK', 1); |
|
| 66 | +define('TARGET_SELF', 0); |
|
| 67 | +define('TARGET_BLANK', 1); |
|
| 68 | 68 | |
| 69 | 69 | # Visibility |
| 70 | 70 | |
| 71 | -define('VISIBILITY_DRAFT', 0); |
|
| 72 | -define('VISIBILITY_PUBLISHED', 1); |
|
| 71 | +define('VISIBILITY_DRAFT', 0); |
|
| 72 | +define('VISIBILITY_PUBLISHED', 1); |
|
@@ -44,19 +44,27 @@ |
||
| 44 | 44 | |
| 45 | 45 | # Validate name |
| 46 | 46 | |
| 47 | - if (false === ($name = Validate::fileName($name))) return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
| 47 | + if (false === ($name = Validate::fileName($name))) { |
|
| 48 | + return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
| 49 | + } |
|
| 48 | 50 | |
| 49 | - if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) return ['name', 'FILEMANAGER_ERROR_HIDDEN']; |
|
| 51 | + if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) { |
|
| 52 | + return ['name', 'FILEMANAGER_ERROR_HIDDEN']; |
|
| 53 | + } |
|
| 50 | 54 | |
| 51 | 55 | # Check if name is used |
| 52 | 56 | |
| 53 | - if (!$this->entity->check($name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
| 57 | + if (!$this->entity->check($name)) { |
|
| 58 | + return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
| 59 | + } |
|
| 54 | 60 | |
| 55 | 61 | # Rename entity |
| 56 | 62 | |
| 57 | - if (!$this->entity->rename($name)) return (($this->entity->getType() === 'dir') ? |
|
| 63 | + if (!$this->entity->rename($name)) { |
|
| 64 | + return (($this->entity->getType() === 'dir') ? |
|
| 58 | 65 | |
| 59 | 66 | 'FILEMANAGER_ERROR_DIR_RENAME' : 'FILEMANAGER_ERROR_FILE_RENAME'); |
| 67 | + } |
|
| 60 | 68 | |
| 61 | 69 | # ------------------------ |
| 62 | 70 | |
@@ -44,7 +44,9 @@ |
||
| 44 | 44 | |
| 45 | 45 | # Rename item |
| 46 | 46 | |
| 47 | - if (false === $this->entity->putContents($contents)) return 'FILEMANAGER_ERROR_FILE_EDIT'; |
|
| 47 | + if (false === $this->entity->putContents($contents)) { |
|
| 48 | + return 'FILEMANAGER_ERROR_FILE_EDIT'; |
|
| 49 | + } |
|
| 48 | 50 | |
| 49 | 51 | # ------------------------ |
| 50 | 52 | |
@@ -44,9 +44,13 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | # Validate name |
| 46 | 46 | |
| 47 | - if (false === ($name = Validate::fileName($name))) return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
| 47 | + if (false === ($name = Validate::fileName($name))) { |
|
| 48 | + return ['name', 'FILEMANAGER_ERROR_NAME_INVALID']; |
|
| 49 | + } |
|
| 48 | 50 | |
| 49 | - if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) return ['name', 'FILEMANAGER_ERROR_HIDDEN']; |
|
| 51 | + if ($this->parent->isIgnoreHidden() && preg_match('/^\./', $name)) { |
|
| 52 | + return ['name', 'FILEMANAGER_ERROR_HIDDEN']; |
|
| 53 | + } |
|
| 50 | 54 | |
| 51 | 55 | # Get entity |
| 52 | 56 | |
@@ -54,11 +58,15 @@ discard block |
||
| 54 | 58 | |
| 55 | 59 | # Check if name is used |
| 56 | 60 | |
| 57 | - if (!$entity->check($name)) return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
| 61 | + if (!$entity->check($name)) { |
|
| 62 | + return ['name', 'FILEMANAGER_ERROR_EXISTS']; |
|
| 63 | + } |
|
| 58 | 64 | |
| 59 | 65 | # Create entity |
| 60 | 66 | |
| 61 | - if (!$entity->create($name, 'dir')) return 'FILEMANAGER_ERROR_DIR_CREATE'; |
|
| 67 | + if (!$entity->create($name, 'dir')) { |
|
| 68 | + return 'FILEMANAGER_ERROR_DIR_CREATE'; |
|
| 69 | + } |
|
| 62 | 70 | |
| 63 | 71 | # ------------------------ |
| 64 | 72 | |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | use Filemanager\Common\Addons; |
| 17 | 17 | |
| 18 | - protected $path_full = (DIR_SYSTEM_CLASSES . 'Addons/'); |
|
| 18 | + protected $path_full = (DIR_SYSTEM_CLASSES.'Addons/'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -15,6 +15,6 @@ |
||
| 15 | 15 | |
| 16 | 16 | use Filemanager\Common\Templates; |
| 17 | 17 | |
| 18 | - protected $path_full = (DIR_SYSTEM_TEMPLATES . SECTION_SITE . '/'); |
|
| 18 | + protected $path_full = (DIR_SYSTEM_TEMPLATES.SECTION_SITE.'/'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | # Set link |
| 30 | 30 | |
| 31 | - $query = (('' !== $this->parent->getPath()) ? ('?parent=' . $this->parent->getPath()) : ''); |
|
| 31 | + $query = (('' !== $this->parent->getPath()) ? ('?parent='.$this->parent->getPath()) : ''); |
|
| 32 | 32 | |
| 33 | - $bar->link = (INSTALL_PATH . '/admin/content/filemanager' . $query); |
|
| 33 | + $bar->link = (INSTALL_PATH.'/admin/content/filemanager'.$query); |
|
| 34 | 34 | |
| 35 | 35 | # Implement form |
| 36 | 36 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | private function getPaginationBlock() { |
| 47 | 47 | |
| 48 | - $query = (('' !== $this->parent->getPath()) ? ('?parent=' . $this->parent->getPath()) : ''); |
|
| 48 | + $query = (('' !== $this->parent->getPath()) ? ('?parent='.$this->parent->getPath()) : ''); |
|
| 49 | 49 | |
| 50 | - $url = new Url(INSTALL_PATH . '/admin/content/filemanager' . $query); |
|
| 50 | + $url = new Url(INSTALL_PATH.'/admin/content/filemanager'.$query); |
|
| 51 | 51 | |
| 52 | 52 | # ------------------------ |
| 53 | 53 | |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | if (isset($submitted)) { |
| 150 | 150 | |
| 151 | - Request::redirect(INSTALL_PATH . '/admin/content/filemanager/' . static::$origin . '?' . (('' !== |
|
| 151 | + Request::redirect(INSTALL_PATH.'/admin/content/filemanager/'.static::$origin.'?'.(('' !== |
|
| 152 | 152 | |
| 153 | - ($parent = $this->parent->getPath())) ? ('parent=' . $parent . '&') : '') . 'submitted=' . $submitted); |
|
| 153 | + ($parent = $this->parent->getPath())) ? ('parent='.$parent.'&') : '').'submitted='.$submitted); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | # Display success message |
@@ -64,7 +64,9 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | # Set parent |
| 66 | 66 | |
| 67 | - if (!$ajax) $contents->parent = $this->parent->getPath(); |
|
| 67 | + if (!$ajax) { |
|
| 68 | + $contents->parent = $this->parent->getPath(); |
|
| 69 | + } |
|
| 68 | 70 | |
| 69 | 71 | # Set origin and title |
| 70 | 72 | |
@@ -76,7 +78,9 @@ discard block |
||
| 76 | 78 | |
| 77 | 79 | # Process bar |
| 78 | 80 | |
| 79 | - if (!$ajax) $this->processBar($contents->getBlock('bar')); |
|
| 81 | + if (!$ajax) { |
|
| 82 | + $this->processBar($contents->getBlock('bar')); |
|
| 83 | + } |
|
| 80 | 84 | |
| 81 | 85 | # Set items |
| 82 | 86 | |
@@ -84,14 +88,18 @@ discard block |
||
| 84 | 88 | |
| 85 | 89 | foreach ($this->loader->getItems() as $entity) { |
| 86 | 90 | |
| 87 | - if ($entity->isDir()) $items->addItem(Lister\Dir::getBlock($entity, $ajax)); |
|
| 88 | - |
|
| 89 | - else $items->addItem(Lister\File::getBlock($entity, $ajax)); |
|
| 91 | + if ($entity->isDir()) { |
|
| 92 | + $items->addItem(Lister\Dir::getBlock($entity, $ajax)); |
|
| 93 | + } else { |
|
| 94 | + $items->addItem(Lister\File::getBlock($entity, $ajax)); |
|
| 95 | + } |
|
| 90 | 96 | } |
| 91 | 97 | |
| 92 | 98 | # Set pagination |
| 93 | 99 | |
| 94 | - if (!$ajax) $contents->pagination = $this->getPaginationBlock(); |
|
| 100 | + if (!$ajax) { |
|
| 101 | + $contents->pagination = $this->getPaginationBlock(); |
|
| 102 | + } |
|
| 95 | 103 | |
| 96 | 104 | # ------------------------ |
| 97 | 105 | |
@@ -127,7 +135,9 @@ discard block |
||
| 127 | 135 | |
| 128 | 136 | protected function handle(bool $ajax = false) { |
| 129 | 137 | |
| 130 | - if ($ajax) return $this->handleAjax(); |
|
| 138 | + if ($ajax) { |
|
| 139 | + return $this->handleAjax(); |
|
| 140 | + } |
|
| 131 | 141 | |
| 132 | 142 | # Create parent |
| 133 | 143 | |
@@ -141,9 +151,11 @@ discard block |
||
| 141 | 151 | |
| 142 | 152 | if (static::$permissions['manage']) { |
| 143 | 153 | |
| 144 | - if (Uploader::submit('upload', $this->parent->getPathFull())) $submitted = 'upload'; |
|
| 145 | - |
|
| 146 | - else if ($this->form->handle(new Filemanager\Controller\Create($this->parent), true)) $submitted = 'create'; |
|
| 154 | + if (Uploader::submit('upload', $this->parent->getPathFull())) { |
|
| 155 | + $submitted = 'upload'; |
|
| 156 | + } else if ($this->form->handle(new Filemanager\Controller\Create($this->parent), true)) { |
|
| 157 | + $submitted = 'create'; |
|
| 158 | + } |
|
| 147 | 159 | } |
| 148 | 160 | |
| 149 | 161 | if (isset($submitted)) { |
@@ -155,9 +167,11 @@ discard block |
||
| 155 | 167 | |
| 156 | 168 | # Display success message |
| 157 | 169 | |
| 158 | - if (Request::get('submitted') === 'upload') Popup::set('positive', Language::get('FILEMANAGER_SUCCESS_UPLOAD')); |
|
| 159 | - |
|
| 160 | - else if (Request::get('submitted') === 'create') Popup::set('positive', Language::get('FILEMANAGER_SUCCESS_DIR_CREATE')); |
|
| 170 | + if (Request::get('submitted') === 'upload') { |
|
| 171 | + Popup::set('positive', Language::get('FILEMANAGER_SUCCESS_UPLOAD')); |
|
| 172 | + } else if (Request::get('submitted') === 'create') { |
|
| 173 | + Popup::set('positive', Language::get('FILEMANAGER_SUCCESS_DIR_CREATE')); |
|
| 174 | + } |
|
| 161 | 175 | |
| 162 | 176 | # Load items |
| 163 | 177 | |