@@ -20,15 +20,15 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * Flextype Application |
| 22 | 22 | */ |
| 23 | - protected $flextype; |
|
| 23 | + protected $flextype; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * __construct |
| 27 | 27 | */ |
| 28 | - public function __construct($flextype) |
|
| 29 | - { |
|
| 30 | - $this->flextype = $flextype; |
|
| 31 | - } |
|
| 28 | + public function __construct($flextype) |
|
| 29 | + { |
|
| 30 | + $this->flextype = $flextype; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Index page |
@@ -15,15 +15,15 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * Flextype Application |
| 17 | 17 | */ |
| 18 | - protected $flextype; |
|
| 18 | + protected $flextype; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * __construct |
| 22 | 22 | */ |
| 23 | - public function __construct($flextype) |
|
| 24 | - { |
|
| 25 | - $this->flextype = $flextype; |
|
| 26 | - } |
|
| 23 | + public function __construct($flextype) |
|
| 24 | + { |
|
| 25 | + $this->flextype = $flextype; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Index page |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | $file = PATH['project'] . '/themes/' . $theme . '/' . $this->_type_location($type) . $this->flextype->container('slugify')->slugify($id) . '.html'; |
| 124 | 124 | |
| 125 | - if (! Filesystem::has($file)) { |
|
| 125 | + if (!Filesystem::has($file)) { |
|
| 126 | 126 | if (Filesystem::write( |
| 127 | 127 | $file, |
| 128 | 128 | '' |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $theme = $request->getParsedBody()['theme']; |
| 267 | 267 | $type = $request->getParsedBody()['type_current']; |
| 268 | 268 | |
| 269 | - if (! Filesystem::has(PATH['project'] . '/themes/' . $this->flextype->container('registry')->get('plugins.site.settings.theme') . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html')) { |
|
| 269 | + if (!Filesystem::has(PATH['project'] . '/themes/' . $this->flextype->container('registry')->get('plugins.site.settings.theme') . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html')) { |
|
| 270 | 270 | if (Filesystem::rename( |
| 271 | 271 | PATH['project'] . '/themes/' . $theme . '/' . $this->_type_location($type) . $request->getParsedBody()['id_current'] . '.html', |
| 272 | 272 | PATH['project'] . '/themes/' . $theme . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html' |
@@ -26,6 +26,6 @@ |
||
| 26 | 26 | $flextype->post('/templates/delete', 'TemplatesController:deleteProcess')->setName('admin.templates.deleteProcess'); |
| 27 | 27 | |
| 28 | 28 | })->add(new AclIsUserLoggedInMiddleware($flextype, ['redirect' => 'admin.accounts.login'])) |
| 29 | - ->add(new AclIsUserLoggedInRolesInMiddleware($flextype, ['redirect' => ($flextype->container('acl')->isUserLoggedIn() ? 'admin.accounts.no-access' : 'admin.accounts.login'), |
|
| 30 | - 'roles' => 'admin'])) |
|
| 31 | - ->add('csrf'); |
|
| 29 | + ->add(new AclIsUserLoggedInRolesInMiddleware($flextype, ['redirect' => ($flextype->container('acl')->isUserLoggedIn() ? 'admin.accounts.no-access' : 'admin.accounts.login'), |
|
| 30 | + 'roles' => 'admin'])) |
|
| 31 | + ->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 () use ($flextype) : void { |
|
| 8 | +$flextype->group('/' . $admin_route, function() use ($flextype) : void { |
|
| 9 | 9 | |
| 10 | 10 | // ThemesController |
| 11 | 11 | $flextype->get('/themes', 'ThemesController:index')->setName('admin.themes.index'); |
@@ -42,5 +42,5 @@ |
||
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $flextype->container('registry')->set('plugins.admin.settings.flextype_menu', |
| 45 | - array_merge($_flextype_menu, |
|
| 45 | + array_merge($_flextype_menu, |
|
| 46 | 46 | [0 => ['link' => ['url' => $site_url, 'title' => __('themes_admin_view_site'), 'is_external' => true, 'icon' => 'fas fa-globe']]])); |
@@ -21,15 +21,15 @@ |
||
| 21 | 21 | use function Flextype\Component\I18n\__; |
| 22 | 22 | |
| 23 | 23 | // Add Admin Navigation |
| 24 | -$flextype->container('registry')->set('plugins.admin.settings.navigation.extends.themes', ['title' => __('themes_admin_themes'),'icon' => 'fas fa-palette', 'link' => $flextype->container('router')->pathFor('admin.themes.index')]); |
|
| 24 | +$flextype->container('registry')->set('plugins.admin.settings.navigation.extends.themes', ['title' => __('themes_admin_themes'), 'icon' => 'fas fa-palette', 'link' => $flextype->container('router')->pathFor('admin.themes.index')]); |
|
| 25 | 25 | |
| 26 | 26 | // Add ThemesController |
| 27 | -$flextype->container()['ThemesController'] = static function () use ($flextype) { |
|
| 27 | +$flextype->container()['ThemesController'] = static function() use ($flextype) { |
|
| 28 | 28 | return new ThemesController($flextype); |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | // Add TemplatesController |
| 32 | -$flextype->container()['TemplatesController'] = static function () use ($flextype) { |
|
| 32 | +$flextype->container()['TemplatesController'] = static function() use ($flextype) { |
|
| 33 | 33 | return new TemplatesController($flextype); |
| 34 | 34 | }; |
| 35 | 35 | |