@@ -23,7 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * Ensure vendor libraries exist |
| 25 | 25 | */ |
| 26 | -! is_file($themes_admin_autoload = __DIR__ . '/vendor/autoload.php') and exit('Please run: <i>composer install</i> themes admin plugin'); |
|
| 26 | +!is_file($themes_admin_autoload = __DIR__ . '/vendor/autoload.php') and exit('Please run: <i>composer install</i> themes admin plugin'); |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Register The Auto Loader |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | $themes_list = $this->getThemes(); |
| 48 | 48 | |
| 49 | 49 | // If Themes List isnt empty then continue |
| 50 | - if (! is_array($themes_list) || count($themes_list) <= 0) { |
|
| 50 | + if (!is_array($themes_list) || count($themes_list) <= 0) { |
|
| 51 | 51 | return; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -79,10 +79,10 @@ discard block |
||
| 79 | 79 | $custom_theme_settings_file = PATH['site'] . '/config/themes/' . $theme['dirname'] . '/settings.yaml'; |
| 80 | 80 | |
| 81 | 81 | // Create custom theme settings directory |
| 82 | - ! Filesystem::has($custom_theme_settings_dir) and Filesystem::createDir($custom_theme_settings_dir); |
|
| 82 | + !Filesystem::has($custom_theme_settings_dir) and Filesystem::createDir($custom_theme_settings_dir); |
|
| 83 | 83 | |
| 84 | 84 | // Check if default theme settings file exists |
| 85 | - if (! Filesystem::has($default_theme_settings_file)) { |
|
| 85 | + if (!Filesystem::has($default_theme_settings_file)) { |
|
| 86 | 86 | throw new RuntimeException('Load ' . $theme['dirname'] . ' theme settings - failed!'); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | // Create custom theme settings file |
| 98 | - ! Filesystem::has($custom_theme_settings_file) and Filesystem::write($custom_theme_settings_file, $default_theme_settings_file_content); |
|
| 98 | + !Filesystem::has($custom_theme_settings_file) and Filesystem::write($custom_theme_settings_file, $default_theme_settings_file_content); |
|
| 99 | 99 | |
| 100 | 100 | // Get custom theme settings content |
| 101 | 101 | $custom_theme_settings_file_content = Filesystem::read($custom_theme_settings_file); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // Check if default theme manifest file exists |
| 109 | - if (! Filesystem::has($default_theme_manifest_file)) { |
|
| 109 | + if (!Filesystem::has($default_theme_manifest_file)) { |
|
| 110 | 110 | RuntimeException('Load ' . $theme['dirname'] . ' theme manifest - failed!'); |
| 111 | 111 | } |
| 112 | 112 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | // Go through founded themes |
| 184 | 184 | foreach ($_themes_list as $theme) { |
| 185 | - if ($theme['type'] !== 'dir' || ! Filesystem::has($theme['path'] . '/' . 'theme.yaml')) { |
|
| 185 | + if ($theme['type'] !== 'dir' || !Filesystem::has($theme['path'] . '/' . 'theme.yaml')) { |
|
| 186 | 186 | continue; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $file = PATH['site'] . '/themes/' . $theme . '/' . $this->_type_location($type) . $this->slugify->slugify($id) . '.html'; |
| 119 | 119 | |
| 120 | - if (! Filesystem::has($file)) { |
|
| 120 | + if (!Filesystem::has($file)) { |
|
| 121 | 121 | if (Filesystem::write( |
| 122 | 122 | $file, |
| 123 | 123 | '' |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $theme = $request->getParsedBody()['theme']; |
| 262 | 262 | $type = $request->getParsedBody()['type_current']; |
| 263 | 263 | |
| 264 | - if (! Filesystem::has(PATH['site'] . '/themes/' . $this->registry->get('plugins.site.settings.theme') . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html')) { |
|
| 264 | + if (!Filesystem::has(PATH['site'] . '/themes/' . $this->registry->get('plugins.site.settings.theme') . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html')) { |
|
| 265 | 265 | if (Filesystem::rename( |
| 266 | 266 | PATH['site'] . '/themes/' . $theme . '/' . $this->_type_location($type) . $request->getParsedBody()['id_current'] . '.html', |
| 267 | 267 | PATH['site'] . '/themes/' . $theme . '/' . $this->_type_location($type) . $request->getParsedBody()['id'] . '.html' |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Flextype; |
| 6 | 6 | |
| 7 | -$app->group('/' . $admin_route, function () use ($app) : void { |
|
| 7 | +$app->group('/' . $admin_route, function() use ($app) : void { |
|
| 8 | 8 | |
| 9 | 9 | // ThemesController |
| 10 | 10 | $app->get('/themes', 'ThemesController:index')->setName('admin.themes.index'); |
@@ -43,5 +43,5 @@ |
||
| 43 | 43 | $_flextype_menu = ($flextype['registry']->has('plugins.admin.settings.flextype_menu')) ? $flextype['registry']->get('plugins.admin.settings.flextype_menu') : []; |
| 44 | 44 | |
| 45 | 45 | $flextype['registry']->set('plugins.admin.settings.flextype_menu', |
| 46 | - array_merge($_flextype_menu, |
|
| 46 | + array_merge($_flextype_menu, |
|
| 47 | 47 | [0 => ['link' => ['url' => '../../', 'title' => __('themes_admin_view_site'), 'is_external' => true, 'icon' => 'fas fa-globe']]])); |
@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | use function Flextype\Component\I18n\__; |
| 17 | 17 | |
| 18 | 18 | // Add Admin Navigation |
| 19 | -$flextype->registry->set('plugins.admin.settings.navigation.extends.themes', ['title' => __('themes_admin_themes'),'icon' => 'fas fa-palette', 'link' => $flextype->router->pathFor('admin.themes.index')]); |
|
| 19 | +$flextype->registry->set('plugins.admin.settings.navigation.extends.themes', ['title' => __('themes_admin_themes'), 'icon' => 'fas fa-palette', 'link' => $flextype->router->pathFor('admin.themes.index')]); |
|
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Add themes service to Flextype container |
| 23 | 23 | */ |
| 24 | -$flextype['themes'] = static function ($container) use ($flextype, $app) { |
|
| 24 | +$flextype['themes'] = static function($container) use ($flextype, $app) { |
|
| 25 | 25 | return new Themes($flextype, $app); |
| 26 | 26 | }; |
| 27 | 27 | |
@@ -31,12 +31,12 @@ discard block |
||
| 31 | 31 | $flextype['themes']->init($flextype, $app); |
| 32 | 32 | |
| 33 | 33 | // Add ThemesController |
| 34 | -$flextype['ThemesController'] = static function ($container) { |
|
| 34 | +$flextype['ThemesController'] = static function($container) { |
|
| 35 | 35 | return new ThemesController($container); |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | // Add TemplatesController |
| 39 | -$flextype['TemplatesController'] = static function ($container) { |
|
| 39 | +$flextype['TemplatesController'] = static function($container) { |
|
| 40 | 40 | return new TemplatesController($container); |
| 41 | 41 | }; |
| 42 | 42 | |