@@ -5,14 +5,14 @@ |
||
5 | 5 | namespace Flextype; |
6 | 6 | |
7 | 7 | // UsersController |
8 | -$app->group('/' . $admin_route, function () use ($app) : void { |
|
8 | +$app->group('/' . $admin_route, function() use ($app) : void { |
|
9 | 9 | $app->get('/installation', 'UsersController:installation')->setName('admin.users.installation'); |
10 | 10 | $app->post('/installation', 'UsersController:installationProcess')->setName('admin.users.installationProcess'); |
11 | 11 | $app->get('/login', 'UsersController:login')->setName('admin.users.login'); |
12 | 12 | $app->post('/login', 'UsersController:loginProcess')->setName('admin.users.loginProcess'); |
13 | 13 | }); |
14 | 14 | |
15 | -$app->group('/' . $admin_route, function () use ($app) : void { |
|
15 | +$app->group('/' . $admin_route, function() use ($app) : void { |
|
16 | 16 | // Dashboard |
17 | 17 | $app->get('', 'DashboardController:index')->setName('admin.dashboard.index'); |
18 | 18 |
@@ -37,13 +37,13 @@ |
||
37 | 37 | $_admin_js = ($flextype['registry']->has('assets.admin.js')) ? $flextype['registry']->get('assets.admin.js') : []; |
38 | 38 | |
39 | 39 | $flextype['registry']->set('assets.admin.css', |
40 | - array_merge($_admin_css, |
|
41 | - ['site/plugins/admin/assets/dist/css/admin-vendor-build.min.css', |
|
40 | + array_merge($_admin_css, |
|
41 | + ['site/plugins/admin/assets/dist/css/admin-vendor-build.min.css', |
|
42 | 42 | 'site/plugins/admin/assets/dist/css/admin-build.min.css'])); |
43 | 43 | |
44 | 44 | $flextype['registry']->set('assets.admin.js', |
45 | - array_merge($_admin_js, |
|
46 | - ['site/plugins/admin/assets/dist/js/admin-vendor-build.min.js'])); |
|
45 | + array_merge($_admin_js, |
|
46 | + ['site/plugins/admin/assets/dist/js/admin-vendor-build.min.js'])); |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * Add flash service to Flextype container |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | |
21 | 21 | // Add Admin Navigation |
22 | 22 | $flextype->registry->set('plugins.admin.settings.navigation.content.entries', ['title' => __('admin_entries'), 'icon' => 'fas fa-database', 'link' => $flextype->router->pathFor('admin.entries.index')]); |
23 | -$flextype->registry->set('plugins.admin.settings.navigation.extends.plugins', ['title' => __('admin_plugins'),'icon' => 'fas fa-plug', 'link' => $flextype->router->pathFor('admin.plugins.index')]); |
|
24 | -$flextype->registry->set('plugins.admin.settings.navigation.system.tools', ['title' => __('admin_tools'),'icon' => 'fas fa-toolbox', 'link' => $flextype->router->pathFor('admin.tools.index')]); |
|
25 | -$flextype->registry->set('plugins.admin.settings.navigation.system.api', ['title' => __('admin_api'),'icon' => 'fas fa-network-wired', 'link' => $flextype->router->pathFor('admin.api.index')]); |
|
23 | +$flextype->registry->set('plugins.admin.settings.navigation.extends.plugins', ['title' => __('admin_plugins'), 'icon' => 'fas fa-plug', 'link' => $flextype->router->pathFor('admin.plugins.index')]); |
|
24 | +$flextype->registry->set('plugins.admin.settings.navigation.system.tools', ['title' => __('admin_tools'), 'icon' => 'fas fa-toolbox', 'link' => $flextype->router->pathFor('admin.tools.index')]); |
|
25 | +$flextype->registry->set('plugins.admin.settings.navigation.system.api', ['title' => __('admin_api'), 'icon' => 'fas fa-network-wired', 'link' => $flextype->router->pathFor('admin.api.index')]); |
|
26 | 26 | |
27 | 27 | // Add Global Vars Admin Twig Extension |
28 | 28 | $flextype->twig->addExtension(new GlobalVarsAdminTwigExtension($flextype)); |
@@ -48,50 +48,50 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Add flash service to Flextype container |
50 | 50 | */ |
51 | -$flextype['flash'] = static function () { |
|
51 | +$flextype['flash'] = static function() { |
|
52 | 52 | return new Messages(); |
53 | 53 | }; |
54 | 54 | |
55 | -$flextype['DashboardController'] = static function ($container) { |
|
55 | +$flextype['DashboardController'] = static function($container) { |
|
56 | 56 | return new DashboardController($container); |
57 | 57 | }; |
58 | 58 | |
59 | -$flextype['SettingsController'] = static function ($container) { |
|
59 | +$flextype['SettingsController'] = static function($container) { |
|
60 | 60 | return new SettingsController($container); |
61 | 61 | }; |
62 | 62 | |
63 | -$flextype['PluginsController'] = static function ($container) { |
|
63 | +$flextype['PluginsController'] = static function($container) { |
|
64 | 64 | return new PluginsController($container); |
65 | 65 | }; |
66 | 66 | |
67 | -$flextype['EntriesController'] = static function ($container) { |
|
67 | +$flextype['EntriesController'] = static function($container) { |
|
68 | 68 | return new EntriesController($container); |
69 | 69 | }; |
70 | 70 | |
71 | -$flextype['UsersController'] = static function ($container) { |
|
71 | +$flextype['UsersController'] = static function($container) { |
|
72 | 72 | return new UsersController($container); |
73 | 73 | }; |
74 | 74 | |
75 | -$flextype['ToolsController'] = static function ($container) { |
|
75 | +$flextype['ToolsController'] = static function($container) { |
|
76 | 76 | return new ToolsController($container); |
77 | 77 | }; |
78 | 78 | |
79 | -$flextype['ApiController'] = static function ($container) { |
|
79 | +$flextype['ApiController'] = static function($container) { |
|
80 | 80 | return new ApiController($container); |
81 | 81 | }; |
82 | 82 | |
83 | -$flextype['ApiDeliveryController'] = static function ($container) { |
|
83 | +$flextype['ApiDeliveryController'] = static function($container) { |
|
84 | 84 | return new ApiDeliveryController($container); |
85 | 85 | }; |
86 | 86 | |
87 | -$flextype['ApiDeliveryEntriesController'] = static function ($container) { |
|
87 | +$flextype['ApiDeliveryEntriesController'] = static function($container) { |
|
88 | 88 | return new ApiDeliveryEntriesController($container); |
89 | 89 | }; |
90 | 90 | |
91 | -$flextype['ApiDeliveryImagesController'] = static function ($container) { |
|
91 | +$flextype['ApiDeliveryImagesController'] = static function($container) { |
|
92 | 92 | return new ApiDeliveryImagesController($container); |
93 | 93 | }; |
94 | 94 | |
95 | -$flextype['ApiDeliveryRegistryController'] = static function ($container) { |
|
95 | +$flextype['ApiDeliveryRegistryController'] = static function($container) { |
|
96 | 96 | return new ApiDeliveryRegistryController($container); |
97 | 97 | }; |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $results = []; |
195 | 195 | |
196 | 196 | foreach ($array as $key => $value) { |
197 | - if (is_array($value) && ! empty($value)) { |
|
197 | + if (is_array($value) && !empty($value)) { |
|
198 | 198 | $results = array_merge($results, $this->dotArray($value, $prepend . $key . '.')); |
199 | 199 | } else { |
200 | 200 | $results[$prepend . $key] = $value; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | { |
212 | 212 | $bytestotal = 0; |
213 | 213 | $path = realpath($path); |
214 | - if ($path!==false && $path!=='' && file_exists($path)) { |
|
214 | + if ($path !== false && $path !== '' && file_exists($path)) { |
|
215 | 215 | foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS)) as $object) { |
216 | 216 | $bytestotal += $object->getSize(); |
217 | 217 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | 'create' => [ |
122 | 122 | 'link' => 'javascript:;', |
123 | 123 | 'title' => __('admin_create_new_entry'), |
124 | - 'onclick' => 'event.preventDefault(); selectEntryType("'.$this->getEntryID($query).'", 0);' |
|
124 | + 'onclick' => 'event.preventDefault(); selectEntryType("' . $this->getEntryID($query) . '", 0);' |
|
125 | 125 | ] |
126 | 126 | ] |
127 | 127 | ] |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $parts = [0 => '']; |
149 | 149 | } |
150 | 150 | |
151 | - $type = isset($query['type']) ? $query['type']: ''; |
|
151 | + $type = isset($query['type']) ? $query['type'] : ''; |
|
152 | 152 | |
153 | 153 | return $this->twig->render( |
154 | 154 | $response, |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | |
283 | 283 | if ($this->entries->create($id, $data_result)) { |
284 | 284 | |
285 | - if (! Filesystem::has(PATH['site'] . '/uploads' . '/entries/' . $id)) { |
|
285 | + if (!Filesystem::has(PATH['site'] . '/uploads' . '/entries/' . $id)) { |
|
286 | 286 | Filesystem::createDir(PATH['site'] . '/uploads' . '/entries/' . $id); |
287 | 287 | } |
288 | 288 | |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | |
717 | 717 | ], |
718 | 718 | 'edit_entry' => [ |
719 | - 'link' => $this->router->pathFor('admin.entries.edit') . '?id=' . $this->getEntryID($query). '&type=editor', |
|
719 | + 'link' => $this->router->pathFor('admin.entries.edit') . '?id=' . $this->getEntryID($query) . '&type=editor', |
|
720 | 720 | 'title' => __('admin_editor'), |
721 | 721 | |
722 | 722 | ], |
@@ -891,7 +891,7 @@ discard block |
||
891 | 891 | |
892 | 892 | if (isset($data['routable'])) { |
893 | 893 | $data['routable'] = (bool) $data['routable']; |
894 | - } elseif(isset($entry['routable'])) { |
|
894 | + } elseif (isset($entry['routable'])) { |
|
895 | 895 | $data['routable'] = (bool) $entry['routable']; |
896 | 896 | } else { |
897 | 897 | $data['routable'] = true; |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | // Get POST data |
116 | 116 | $data = $request->getParsedBody(); |
117 | 117 | |
118 | - if (! Filesystem::has($_user_file = PATH['site'] . '/accounts/' . $this->slugify->slugify($data['username']) . '/profile.yaml')) { |
|
118 | + if (!Filesystem::has($_user_file = PATH['site'] . '/accounts/' . $this->slugify->slugify($data['username']) . '/profile.yaml')) { |
|
119 | 119 | // Generate UUID |
120 | 120 | $uuid = Uuid::uuid4()->toString(); |
121 | 121 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $api_delivery_entries_token_dir_path = PATH['site'] . '/tokens' . '/delivery/entries/' . $api_delivery_entries_token; |
147 | 147 | $api_delivery_entries_token_file_path = $api_delivery_entries_token_dir_path . '/token.yaml'; |
148 | 148 | |
149 | - if (! Filesystem::has($api_delivery_entries_token_dir_path)) Filesystem::createDir($api_delivery_entries_token_dir_path); |
|
149 | + if (!Filesystem::has($api_delivery_entries_token_dir_path)) Filesystem::createDir($api_delivery_entries_token_dir_path); |
|
150 | 150 | |
151 | 151 | Filesystem::write( |
152 | 152 | $api_delivery_entries_token_file_path, |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $api_delivery_images_token_dir_path = PATH['site'] . '/tokens' . '/delivery/images/' . $api_delivery_images_token; |
170 | 170 | $api_delivery_images_token_file_path = $api_delivery_images_token_dir_path . '/token.yaml'; |
171 | 171 | |
172 | - if (! Filesystem::has($api_delivery_images_token_dir_path)) Filesystem::createDir($api_delivery_images_token_dir_path); |
|
172 | + if (!Filesystem::has($api_delivery_images_token_dir_path)) Filesystem::createDir($api_delivery_images_token_dir_path); |
|
173 | 173 | |
174 | 174 | Filesystem::write( |
175 | 175 | $api_delivery_images_token_file_path, |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $api_delivery_registry_token_dir_path = PATH['site'] . '/tokens' . '/delivery/registry/' . $api_delivery_registry_token; |
193 | 193 | $api_delivery_registry_token_file_path = $api_delivery_registry_token_dir_path . '/token.yaml'; |
194 | 194 | |
195 | - if (! Filesystem::has($api_delivery_registry_token_dir_path)) Filesystem::createDir($api_delivery_registry_token_dir_path); |
|
195 | + if (!Filesystem::has($api_delivery_registry_token_dir_path)) Filesystem::createDir($api_delivery_registry_token_dir_path); |
|
196 | 196 | |
197 | 197 | Filesystem::write( |
198 | 198 | $api_delivery_registry_token_file_path, |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | Filesystem::write($custom_flextype_settings_file_path, $this->parser->encode($custom_flextype_settings_file_data, 'yaml')); |
222 | 222 | |
223 | 223 | // Create uploads dir for default entries |
224 | - if (! Filesystem::has(PATH['site'] . '/uploads/entries/home/')) { |
|
224 | + if (!Filesystem::has(PATH['site'] . '/uploads/entries/home/')) { |
|
225 | 225 | Filesystem::createDir(PATH['site'] . '/uploads/entries/home/'); |
226 | 226 | } |
227 | 227 |
@@ -146,7 +146,9 @@ discard block |
||
146 | 146 | $api_delivery_entries_token_dir_path = PATH['site'] . '/tokens' . '/delivery/entries/' . $api_delivery_entries_token; |
147 | 147 | $api_delivery_entries_token_file_path = $api_delivery_entries_token_dir_path . '/token.yaml'; |
148 | 148 | |
149 | - if (! Filesystem::has($api_delivery_entries_token_dir_path)) Filesystem::createDir($api_delivery_entries_token_dir_path); |
|
149 | + if (! Filesystem::has($api_delivery_entries_token_dir_path)) { |
|
150 | + Filesystem::createDir($api_delivery_entries_token_dir_path); |
|
151 | + } |
|
150 | 152 | |
151 | 153 | Filesystem::write( |
152 | 154 | $api_delivery_entries_token_file_path, |
@@ -169,7 +171,9 @@ discard block |
||
169 | 171 | $api_delivery_images_token_dir_path = PATH['site'] . '/tokens' . '/delivery/images/' . $api_delivery_images_token; |
170 | 172 | $api_delivery_images_token_file_path = $api_delivery_images_token_dir_path . '/token.yaml'; |
171 | 173 | |
172 | - if (! Filesystem::has($api_delivery_images_token_dir_path)) Filesystem::createDir($api_delivery_images_token_dir_path); |
|
174 | + if (! Filesystem::has($api_delivery_images_token_dir_path)) { |
|
175 | + Filesystem::createDir($api_delivery_images_token_dir_path); |
|
176 | + } |
|
173 | 177 | |
174 | 178 | Filesystem::write( |
175 | 179 | $api_delivery_images_token_file_path, |
@@ -192,7 +196,9 @@ discard block |
||
192 | 196 | $api_delivery_registry_token_dir_path = PATH['site'] . '/tokens' . '/delivery/registry/' . $api_delivery_registry_token; |
193 | 197 | $api_delivery_registry_token_file_path = $api_delivery_registry_token_dir_path . '/token.yaml'; |
194 | 198 | |
195 | - if (! Filesystem::has($api_delivery_registry_token_dir_path)) Filesystem::createDir($api_delivery_registry_token_dir_path); |
|
199 | + if (! Filesystem::has($api_delivery_registry_token_dir_path)) { |
|
200 | + Filesystem::createDir($api_delivery_registry_token_dir_path); |
|
201 | + } |
|
196 | 202 | |
197 | 203 | Filesystem::write( |
198 | 204 | $api_delivery_registry_token_file_path, |
@@ -120,7 +120,7 @@ |
||
120 | 120 | $api_token_dir_path = PATH['site'] . '/tokens' . '/delivery/entries/' . $api_token; |
121 | 121 | $api_token_file_path = $api_token_dir_path . '/token.yaml'; |
122 | 122 | |
123 | - if (! Filesystem::has($api_token_file_path)) { |
|
123 | + if (!Filesystem::has($api_token_file_path)) { |
|
124 | 124 | |
125 | 125 | Filesystem::createDir($api_token_dir_path); |
126 | 126 |
@@ -120,7 +120,7 @@ |
||
120 | 120 | $api_token_dir_path = PATH['site'] . '/tokens' . '/delivery/images/' . $api_token; |
121 | 121 | $api_token_file_path = $api_token_dir_path . '/token.yaml'; |
122 | 122 | |
123 | - if (! Filesystem::has($api_token_file_path)) { |
|
123 | + if (!Filesystem::has($api_token_file_path)) { |
|
124 | 124 | |
125 | 125 | Filesystem::createDir($api_token_dir_path); |
126 | 126 |
@@ -120,7 +120,7 @@ |
||
120 | 120 | $api_token_dir_path = PATH['site'] . '/tokens' . '/delivery/registry/' . $api_token; |
121 | 121 | $api_token_file_path = $api_token_dir_path . '/token.yaml'; |
122 | 122 | |
123 | - if (! Filesystem::has($api_token_file_path)) { |
|
123 | + if (!Filesystem::has($api_token_file_path)) { |
|
124 | 124 | |
125 | 125 | Filesystem::createDir($api_token_dir_path); |
126 | 126 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | /** |
24 | 24 | * Ensure vendor libraries exist |
25 | 25 | */ |
26 | -! is_file($admin_autoload = __DIR__ . '/vendor/autoload.php') and exit('Please run: <i>composer install</i> admin plugin'); |
|
26 | +!is_file($admin_autoload = __DIR__ . '/vendor/autoload.php') and exit('Please run: <i>composer install</i> admin plugin'); |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Register The Auto Loader |