@@ -112,7 +112,7 @@ |
||
112 | 112 | $api_token_dir_path = PATH['project'] . '/tokens' . '/access/' . $api_token; |
113 | 113 | $api_token_file_path = $api_token_dir_path . '/token.yaml'; |
114 | 114 | |
115 | - if (! Filesystem::has($api_token_file_path)) { |
|
115 | + if (!Filesystem::has($api_token_file_path)) { |
|
116 | 116 | |
117 | 117 | Filesystem::createDir($api_token_dir_path); |
118 | 118 |
@@ -22,10 +22,10 @@ |
||
22 | 22 | /** |
23 | 23 | * __construct |
24 | 24 | */ |
25 | - public function __construct() |
|
26 | - { |
|
25 | + public function __construct() |
|
26 | + { |
|
27 | 27 | |
28 | - } |
|
28 | + } |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Access Index page |
@@ -93,6 +93,6 @@ |
||
93 | 93 | flextype()->post('/api/access/delete', 'ApiAccessController:deleteProcess')->setName('admin.api_access.deleteProcess'); |
94 | 94 | |
95 | 95 | })->add(new AclIsUserLoggedInMiddleware(['redirect' => 'admin.accounts.login'])) |
96 | - ->add(new AclIsUserLoggedInRolesInMiddleware(['redirect' => (flextype()->getContainer()->acl->isUserLoggedIn() ? 'admin.accounts.no-access' : 'admin.accounts.login'), |
|
97 | - 'roles' => 'admin'])) |
|
98 | - ->add('csrf'); |
|
96 | + ->add(new AclIsUserLoggedInRolesInMiddleware(['redirect' => (flextype()->getContainer()->acl->isUserLoggedIn() ? 'admin.accounts.no-access' : 'admin.accounts.login'), |
|
97 | + 'roles' => 'admin'])) |
|
98 | + ->add('csrf'); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flextype\Plugin\Acl\Middlewares\AclIsUserLoggedInMiddleware; |
6 | 6 | use Flextype\Plugin\Acl\Middlewares\AclIsUserLoggedInRolesInMiddleware; |
7 | 7 | |
8 | -flextype()->group('/' . $admin_route, function () : void { |
|
8 | +flextype()->group('/' . $admin_route, function() : void { |
|
9 | 9 | // Dashboard |
10 | 10 | flextype()->get('', 'DashboardController:index')->setName('admin.dashboard.index'); |
11 | 11 |
@@ -42,13 +42,13 @@ |
||
42 | 42 | $_admin_js = (flextype('registry')->has('assets.admin.js')) ? flextype('registry')->get('assets.admin.js') : []; |
43 | 43 | |
44 | 44 | flextype('registry')->set('assets.admin.css', |
45 | - array_merge($_admin_css, |
|
46 | - ['project/plugins/admin/assets/dist/css/admin-vendor-build.min.css', |
|
45 | + array_merge($_admin_css, |
|
46 | + ['project/plugins/admin/assets/dist/css/admin-vendor-build.min.css', |
|
47 | 47 | 'project/plugins/admin/assets/dist/css/admin-build.min.css'])); |
48 | 48 | |
49 | 49 | flextype('registry')->set('assets.admin.js', |
50 | - array_merge($_admin_js, |
|
51 | - ['project/plugins/admin/assets/dist/js/admin-vendor-build.min.js'])); |
|
50 | + array_merge($_admin_js, |
|
51 | + ['project/plugins/admin/assets/dist/js/admin-vendor-build.min.js'])); |
|
52 | 52 | |
53 | 53 | flextype()->container()['DashboardController'] = static function () { |
54 | 54 | return new DashboardController(); |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | |
32 | 32 | // Add Admin Navigation |
33 | 33 | flextype('registry')->set('plugins.admin.settings.navigation.content.entries', ['title' => __('admin_entries'), 'icon' => 'fas fa-database', 'link' => flextype('router')->pathFor('admin.entries.index')]); |
34 | -flextype('registry')->set('plugins.admin.settings.navigation.extends.plugins', ['title' => __('admin_plugins'),'icon' => 'fas fa-plug', 'link' => flextype('router')->pathFor('admin.plugins.index')]); |
|
35 | -flextype('registry')->set('plugins.admin.settings.navigation.system.tools', ['title' => __('admin_tools'),'icon' => 'fas fa-toolbox', 'link' => flextype('router')->pathFor('admin.tools.index')]); |
|
36 | -flextype('registry')->set('plugins.admin.settings.navigation.system.api', ['title' => __('admin_api'),'icon' => 'fas fa-network-wired', 'link' => flextype('router')->pathFor('admin.api.index')]); |
|
34 | +flextype('registry')->set('plugins.admin.settings.navigation.extends.plugins', ['title' => __('admin_plugins'), 'icon' => 'fas fa-plug', 'link' => flextype('router')->pathFor('admin.plugins.index')]); |
|
35 | +flextype('registry')->set('plugins.admin.settings.navigation.system.tools', ['title' => __('admin_tools'), 'icon' => 'fas fa-toolbox', 'link' => flextype('router')->pathFor('admin.tools.index')]); |
|
36 | +flextype('registry')->set('plugins.admin.settings.navigation.system.api', ['title' => __('admin_api'), 'icon' => 'fas fa-network-wired', 'link' => flextype('router')->pathFor('admin.api.index')]); |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Add Assets |
@@ -50,50 +50,50 @@ discard block |
||
50 | 50 | array_merge($_admin_js, |
51 | 51 | ['project/plugins/admin/assets/dist/js/admin-vendor-build.min.js'])); |
52 | 52 | |
53 | -flextype()->container()['DashboardController'] = static function () { |
|
53 | +flextype()->container()['DashboardController'] = static function() { |
|
54 | 54 | return new DashboardController(); |
55 | 55 | }; |
56 | 56 | |
57 | -flextype()->container()['SettingsController'] = static function () { |
|
57 | +flextype()->container()['SettingsController'] = static function() { |
|
58 | 58 | return new SettingsController(); |
59 | 59 | }; |
60 | 60 | |
61 | -flextype()->container()['PluginsController'] = static function () { |
|
61 | +flextype()->container()['PluginsController'] = static function() { |
|
62 | 62 | return new PluginsController(); |
63 | 63 | }; |
64 | 64 | |
65 | -flextype()->container()['EntriesController'] = static function () { |
|
65 | +flextype()->container()['EntriesController'] = static function() { |
|
66 | 66 | return new EntriesController(); |
67 | 67 | }; |
68 | 68 | |
69 | -flextype()->container()['ToolsController'] = static function () { |
|
69 | +flextype()->container()['ToolsController'] = static function() { |
|
70 | 70 | return new ToolsController(); |
71 | 71 | }; |
72 | 72 | |
73 | -flextype()->container()['ApiController'] = static function () { |
|
73 | +flextype()->container()['ApiController'] = static function() { |
|
74 | 74 | return new ApiController(); |
75 | 75 | }; |
76 | 76 | |
77 | -flextype()->container()['ApiEntriesController'] = static function () { |
|
77 | +flextype()->container()['ApiEntriesController'] = static function() { |
|
78 | 78 | return new ApiEntriesController(); |
79 | 79 | }; |
80 | 80 | |
81 | -flextype()->container()['ApiFilesController'] = static function () { |
|
81 | +flextype()->container()['ApiFilesController'] = static function() { |
|
82 | 82 | return new ApiFilesController(); |
83 | 83 | }; |
84 | 84 | |
85 | -flextype()->container()['ApiFoldersController'] = static function () { |
|
85 | +flextype()->container()['ApiFoldersController'] = static function() { |
|
86 | 86 | return new ApiFoldersController(); |
87 | 87 | }; |
88 | 88 | |
89 | -flextype()->container()['ApiImagesController'] = static function () { |
|
89 | +flextype()->container()['ApiImagesController'] = static function() { |
|
90 | 90 | return new ApiImagesController(); |
91 | 91 | }; |
92 | 92 | |
93 | -flextype()->container()['ApiAccessController'] = static function () { |
|
93 | +flextype()->container()['ApiAccessController'] = static function() { |
|
94 | 94 | return new ApiAccessController(); |
95 | 95 | }; |
96 | 96 | |
97 | -flextype()->container()['ApiRegistryController'] = static function () { |
|
97 | +flextype()->container()['ApiRegistryController'] = static function() { |
|
98 | 98 | return new ApiRegistryController(); |
99 | 99 | }; |
@@ -20,10 +20,10 @@ |
||
20 | 20 | /** |
21 | 21 | * __construct |
22 | 22 | */ |
23 | - public function __construct() |
|
24 | - { |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | 25 | |
26 | - } |
|
26 | + } |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Registry Index page |
@@ -12,10 +12,10 @@ |
||
12 | 12 | /** |
13 | 13 | * __construct |
14 | 14 | */ |
15 | - public function __construct() |
|
16 | - { |
|
15 | + public function __construct() |
|
16 | + { |
|
17 | 17 | |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Index page |
@@ -21,10 +21,10 @@ discard block |
||
21 | 21 | /** |
22 | 22 | * __construct |
23 | 23 | */ |
24 | - public function __construct() |
|
25 | - { |
|
24 | + public function __construct() |
|
25 | + { |
|
26 | 26 | |
27 | - } |
|
27 | + } |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Index page for API's |
@@ -41,30 +41,30 @@ discard block |
||
41 | 41 | 'menu_item' => 'api', |
42 | 42 | 'api_list' => [ |
43 | 43 | 'entries' => [ |
44 | - 'title' => __('admin_entries'), |
|
45 | - 'icon' => 'fas fa-database' |
|
44 | + 'title' => __('admin_entries'), |
|
45 | + 'icon' => 'fas fa-database' |
|
46 | 46 | ], |
47 | 47 | 'registry' => [ |
48 | - 'title' => __('admin_registry'), |
|
49 | - 'icon' => 'fas fa-archive' |
|
48 | + 'title' => __('admin_registry'), |
|
49 | + 'icon' => 'fas fa-archive' |
|
50 | 50 | ], |
51 | 51 | 'images' => [ |
52 | - 'title' => __('admin_images'), |
|
53 | - 'icon' => 'far fa-images' |
|
52 | + 'title' => __('admin_images'), |
|
53 | + 'icon' => 'far fa-images' |
|
54 | 54 | ], |
55 | 55 | 'files' => [ |
56 | - 'title' => __('admin_files'), |
|
57 | - 'icon' => 'fas fa-file' |
|
56 | + 'title' => __('admin_files'), |
|
57 | + 'icon' => 'fas fa-file' |
|
58 | 58 | ], |
59 | 59 | 'folders' => [ |
60 | - 'title' => __('admin_folders'), |
|
61 | - 'icon' => 'fas fa-folder' |
|
60 | + 'title' => __('admin_folders'), |
|
61 | + 'icon' => 'fas fa-folder' |
|
62 | 62 | ], |
63 | 63 | 'access' => [ |
64 | - 'title' => __('admin_access'), |
|
65 | - 'icon' => 'fas fa-user-shield' |
|
64 | + 'title' => __('admin_access'), |
|
65 | + 'icon' => 'fas fa-user-shield' |
|
66 | + ], |
|
66 | 67 | ], |
67 | - ], |
|
68 | 68 | 'links' => [ |
69 | 69 | 'api' => [ |
70 | 70 | 'link' => flextype('router')->pathFor('admin.api.index'), |
@@ -20,10 +20,10 @@ |
||
20 | 20 | /** |
21 | 21 | * __construct |
22 | 22 | */ |
23 | - public function __construct() |
|
24 | - { |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | 25 | |
26 | - } |
|
26 | + } |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Images Index page |
@@ -17,10 +17,10 @@ |
||
17 | 17 | /** |
18 | 18 | * __construct |
19 | 19 | */ |
20 | - public function __construct() |
|
21 | - { |
|
20 | + public function __construct() |
|
21 | + { |
|
22 | 22 | |
23 | - } |
|
23 | + } |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * Get Entry ID |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | 'create' => [ |
126 | 126 | 'link' => 'javascript:;', |
127 | 127 | 'title' => __('admin_create_new_entry'), |
128 | - 'onclick' => 'event.preventDefault(); selectEntryType("'.$this->getEntryID($query).'", 0);' |
|
128 | + 'onclick' => 'event.preventDefault(); selectEntryType("' . $this->getEntryID($query) . '", 0);' |
|
129 | 129 | ] |
130 | 130 | ] |
131 | 131 | ] |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $parts = [0 => '']; |
153 | 153 | } |
154 | 154 | |
155 | - $type = isset($query['type']) ? $query['type']: ''; |
|
155 | + $type = isset($query['type']) ? $query['type'] : ''; |
|
156 | 156 | |
157 | 157 | return flextype('twig')->render( |
158 | 158 | $response, |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | if (flextype('registry')->has('plugins.site')) { |
254 | 254 | $template_path = PATH['project'] . '/themes/' . flextype('registry')->get('plugins.site.settings.theme') . '/templates/' . $data['fieldset'] . '.html'; |
255 | 255 | $template = (Filesystem::has($template_path)) ? $data['fieldset'] : 'default'; |
256 | - $data_from_post['template'] = $template; |
|
256 | + $data_from_post['template'] = $template; |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | //foreach ($fieldset['sections'] as $section_name => $section_body) { |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | |
731 | 731 | ], |
732 | 732 | 'edit_entry' => [ |
733 | - 'link' => flextype('router')->pathFor('admin.entries.edit') . '?id=' . $this->getEntryID($query). '&type=editor', |
|
733 | + 'link' => flextype('router')->pathFor('admin.entries.edit') . '?id=' . $this->getEntryID($query) . '&type=editor', |
|
734 | 734 | 'title' => __('admin_editor'), |
735 | 735 | |
736 | 736 | ], |
@@ -883,15 +883,15 @@ discard block |
||
883 | 883 | $data = $request->getParsedBody(); |
884 | 884 | |
885 | 885 | // Delete system fields |
886 | - isset($data['slug']) and Arrays::delete($data, 'slug'); |
|
887 | - isset($data['id']) and Arrays::delete($data, 'id'); |
|
888 | - isset($data['csrf_value']) and Arrays::delete($data, 'csrf_value'); |
|
889 | - isset($data['csrf_name']) and Arrays::delete($data, 'csrf_name'); |
|
890 | - isset($data['form-save-action']) and Arrays::delete($data, 'form-save-action'); |
|
891 | - isset($data['trumbowyg-icons-path']) and Arrays::delete($data, 'trumbowyg-icons-path'); |
|
892 | - isset($data['trumbowyg-locale']) and Arrays::delete($data, 'trumbowyg-locale'); |
|
886 | + isset($data['slug']) and Arrays::delete($data, 'slug'); |
|
887 | + isset($data['id']) and Arrays::delete($data, 'id'); |
|
888 | + isset($data['csrf_value']) and Arrays::delete($data, 'csrf_value'); |
|
889 | + isset($data['csrf_name']) and Arrays::delete($data, 'csrf_name'); |
|
890 | + isset($data['form-save-action']) and Arrays::delete($data, 'form-save-action'); |
|
891 | + isset($data['trumbowyg-icons-path']) and Arrays::delete($data, 'trumbowyg-icons-path'); |
|
892 | + isset($data['trumbowyg-locale']) and Arrays::delete($data, 'trumbowyg-locale'); |
|
893 | 893 | isset($data['flatpickr-date-format']) and Arrays::delete($data, 'flatpickr-date-format'); |
894 | - isset($data['flatpickr-locale']) and Arrays::delete($data, 'flatpickr-locale'); |
|
894 | + isset($data['flatpickr-locale']) and Arrays::delete($data, 'flatpickr-locale'); |
|
895 | 895 | |
896 | 896 | |
897 | 897 | $data['published_by'] = Session::get('uuid'); |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | |
917 | 917 | if (isset($data['routable'])) { |
918 | 918 | $data['routable'] = (bool) $data['routable']; |
919 | - } elseif(isset($entry['routable'])) { |
|
919 | + } elseif (isset($entry['routable'])) { |
|
920 | 920 | $data['routable'] = (bool) $entry['routable']; |
921 | 921 | } else { |
922 | 922 | $data['routable'] = true; |
@@ -20,10 +20,10 @@ |
||
20 | 20 | /** |
21 | 21 | * __construct |
22 | 22 | */ |
23 | - public function __construct() |
|
24 | - { |
|
23 | + public function __construct() |
|
24 | + { |
|
25 | 25 | |
26 | - } |
|
26 | + } |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * folders Index page |