diff --git a/CHANGELOG.md b/CHANGELOG.md index fb0837ee..441615cc 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,39 @@ +## [0.9.1] - 2019-06-XX +### Added +- Flextype Admin Panel: new setting `route` added to customize admin base route. #154 +- Flextype Core: GlobalVarsTwigExtension - new global constant `PATH_FIELDSETS` added. #154 +- Flextype Core: Entries API - public property `$entry` added. #154 +- Flextype Core: Entries API - public property `$entries` added. #154 +- Flextype Core: Entries API - new event `onEntryAfterInitialized` added. #154 +- Flextype Core: Entries API - new event `onEntriesAfterInitialized` added. #154 +- Flextype Core: Shortcodes - `EntriesShortcode` added. #154 +- Flextype Core: Shortcodes - `BaseUrlShortcode` added. #154 +- Flextype Core: Snippets - SnippetsTwigExtension: `snippets_exec()` added. #154 +- Flextype Core: Snippets - `[snppets_fetch]` shortcode added. #154 +- Flextype Core: Snippets - `_exec_snippet()` method added. #154 +- Flextype Core: Snippets - `exec()` method added. #154 +- Flextype Core: Snippets - added ability to access $flextype and $app inside snippets. #154 +- Flextype Core: GlobalVarsTwigExtension `FLEXTYPE_VERSION` added. #154 +- Flextype Site Plugin: public property `$entry` added. #154 +- Flextype Site Plugin: new event `onSiteEntryAfterInitialized` added. #154 + +### Fixed +- Flextype Core: Entries API - `fetchALL()` issue with fetching entries recursively fixed. #154 #161 + +### Changed +- Flextype Site: code refactoring. #154 +- Flextype Admin Panel: code refactoring. #154 +- Flextype Core: Snippets - from now we will set prefix `bind_` for all variables. #154 + +### Removed +- Flextype Core: Entries API - remove unused Shortcodes code from method `fetch()` #162 +- Flextype Core: Shortcodes - `SiteUrlShortcode` removed. #154 +- Flextype Core: Snippets - `SnippetsTwigExtension`: snippet removed. #154 +- Flextype Core: Snippets - `[snippets]` shortcode removed. #154 +- Flextype Core: Snippets - `_display_snippet()` method removed. #154 +- Flextype Core: Snippets - `- display()` method removed. #154 +- Flextype Core: GlobalVarsTwigExtension `flextype_version` removed. #154 + ## [0.9.0] - 2019-06-14 ### Added - Flextype Core: Slim Framework Integration! @@ -48,7 +84,6 @@ - Flextype Core: Flextype Error Handler Component removed. - Flextype Core: Flextype Event Component removed. - ## [0.8.3] - 2019-01-16 ### Added - Admin Panel: New Gorgeous Light Theme for Admin panel! diff --git a/flextype/bootstrap.php b/flextype/bootstrap.php index 589c6ced..557dffb1 100755 --- a/flextype/bootstrap.php +++ b/flextype/bootstrap.php @@ -21,7 +21,7 @@ use Flextype\Component\Filesystem\Filesystem; * * @var string */ -define('FLEXTYPE_VERSION', '0.9.0'); +define('FLEXTYPE_VERSION', '0.9.1'); // Start the session Session::start(); @@ -29,10 +29,10 @@ Session::start(); // Configure application $config = [ 'settings' => [ - 'debug' => false, + 'debug' => true, 'whoops.editor' => 'atom', 'whoops.page_title' => 'Error!', - 'displayErrorDetails' => false, + 'displayErrorDetails' => true, 'addContentLengthHeader' => true, 'addContentLengthHeader' => false, 'routerCacheFile' => false, diff --git a/flextype/core/Entries.php b/flextype/core/Entries.php index 6c0610b8..5171c9ff 100755 --- a/flextype/core/Entries.php +++ b/flextype/core/Entries.php @@ -17,8 +17,26 @@ use Flextype\Component\Filesystem\Filesystem; class Entries { + /** + * Current entry data array + * + * @var array + * @access public + */ + public $entry = []; + + /** + * Current entries data array + * + * @var array + * @access public + */ + public $entries = []; + /** * Flextype Dependency Container + * + * @access private */ private $flextype; @@ -44,17 +62,13 @@ class Entries $entry_file = $this->_file_location($id); if (Filesystem::has($entry_file)) { + + // Create unique entry cache_id $cache_id = md5('entry' . $entry_file . ((Filesystem::getTimestamp($entry_file) === false) ? '' : Filesystem::getTimestamp($entry_file))); // Try to get the entry from cache if ($this->flextype['cache']->contains($cache_id)) { if ($entry_decoded = $this->flextype['cache']->fetch($cache_id)) { - - // Apply Shortcodes for each entry fields - foreach ($entry_decoded as $key => $_entry_decoded) { - $entry_decoded[$key] = $_entry_decoded;//$this->flextype['shortcodes']->process($_entry_decoded); - } - return $entry_decoded; } else { return false; @@ -67,15 +81,17 @@ class Entries $entry_decoded['date'] = $entry_decoded['date'] ?? date($this->flextype['registry']->get('settings.date_format'), Filesystem::getTimestamp($entry_file)); $entry_decoded['slug'] = $entry_decoded['slug'] ?? ltrim(rtrim($id, '/'), '/'); - // Save to cache + // Save decoded entry content into the cache $this->flextype['cache']->save($cache_id, $entry_decoded); - // Apply Shortcodes for each entry fields - foreach ($entry_decoded as $key => $_entry_decoded) { - $entry_decoded[$key] = $_entry_decoded;//$this->flextype['shortcodes']->process($_entry_decoded); - } + // Set entry + $this->entry = $entry_decoded; - return $entry_decoded; + // Run event onEntryAfterInitialized + $this->flextype['emitter']->emit('onEntryAfterInitialized'); + + // Return entry + return $this->entry; } else { return false; } @@ -97,23 +113,24 @@ class Entries * @param string $order_type Order type: DESC or ASC * @param int $offset Offset * @param int $length Length + * @param bool $recursive Whether to list recursively. * @return array The entries */ - public function fetchAll(string $id, string $order_by = 'date', string $order_type = 'DESC', int $offset = null, int $length = null) : array + public function fetchAll(string $id, string $order_by = 'date', string $order_type = 'DESC', int $offset = null, int $length = null, bool $recursive = false) : array { - // Entries array where founded entries will stored + // Set empty entries array where founded entries will stored $entries = []; - // Сache id + // Set empty cache id for the entries $cache_id = ''; - // Entries path + // Get entries path $entries_path = $this->_dir_location($id); // Get entries list - $entries_list = Filesystem::listContents($entries_path); + $entries_list = Filesystem::listContents($entries_path, $recursive); - // Create entries cached id + // Create unique entries cache_id foreach ($entries_list as $current_entry) { if (strpos($current_entry['path'], $id . '/entry.json') !== false) { // ignore ... @@ -124,6 +141,8 @@ class Entries } } + // If the entries exist at a specific cache_id, + // then we take them from the cache otherwise we look for them. if ($this->flextype['cache']->contains($cache_id)) { $entries = $this->flextype['cache']->fetch($cache_id); } else { @@ -133,25 +152,45 @@ class Entries if (strpos($current_entry['path'], $id . '/entry.json') !== false) { // ignore ... } else { + // We are checking... + // Whether the requested entry is a director and whether the file entry.json is in this directory. if ($current_entry['type'] == 'dir' && Filesystem::has($current_entry['path'] . '/entry.json')) { - $entries[$current_entry['dirname']] = $this->fetch($id . '/' . $current_entry['dirname']); + + // Get entry uid + // 1. Remove entries path + // 2. Remove left and right slashes + $uid = ltrim(rtrim(str_replace(PATH['entries'], '', $current_entry['path']), '/'), '/'); + + // For each founded entry we should create $entries array. + $entries[$uid] = $this->fetch($uid); } } } + // Save entries into the cache $this->flextype['cache']->save($cache_id, $entries); } - // Sort and Slice entries if $raw === false + // If count of the entries more then 0 then sort and slice them. if (count($entries) > 0) { + + // Sort entries $entries = Arr::sort($entries, $order_by, $order_type); + // Slice entries if ($offset !== null && $length !== null) { $entries = array_slice($entries, $offset, $length); } } - return $entries; + // Set entries + $this->entries = $entries; + + // Run event onEntriesAfterInitialized + $this->flextype['emitter']->emit('onEntriesAfterInitialized'); + + // Return entries + return $this->entries; } /** @@ -171,7 +210,7 @@ class Entries * Update entry * * @access public - * @param string $id Entry + * @param string $id Entry * @param array $data Data * @return bool */ @@ -190,7 +229,7 @@ class Entries * Create entry * * @access public - * @param string $id Entry id + * @param string $id Entry id * @param array $data Data * @return bool */ @@ -203,6 +242,8 @@ class Entries // Try to create directory for new entry if (Filesystem::createDir($entry_dir)) { + + // Entry file path $entry_file = $entry_dir . '/entry.json'; // Check if new entry file exists diff --git a/flextype/core/Snippets.php b/flextype/core/Snippets.php index ad53c7fe..de98b067 100644 --- a/flextype/core/Snippets.php +++ b/flextype/core/Snippets.php @@ -21,27 +21,33 @@ class Snippets */ private $flextype; + /** + * Flextype Application + */ + private $app; + /** * Constructor * * @access public */ - public function __construct($flextype) + public function __construct($flextype, $app) { $this->flextype = $flextype; + $this->app = $app; } /** - * Get snippet + * Exec snippet * * @access public * @param string $id Snippet id * @return string|bool Returns the contents of the output buffer and end output buffering. * If output buffering isn't active then FALSE is returned. */ - public function display(string $id) + public function exec(string $id) { - return $this->_display_snippet(['fetch' => $id]); + return $this->_exec_snippet(['id' => $id]); } /** @@ -93,7 +99,7 @@ class Snippets } /** - * Rename snippet. + * Rename snippet * * @access public * @param string $id Snippet id @@ -182,23 +188,23 @@ class Snippets } /** - * Helper private method _display_snippet + * Helper private method _exec_snippet * * @access private * @param array $vars Vars * @return string|bool Returns the contents of the output buffer and end output buffering. * If output buffering isn't active then FALSE is returned. */ - private function _display_snippet(array $vars) + private function _exec_snippet(array $vars) { - // Extracst attributes - extract($vars); + // Extracts vars and set prefix bind_ for all of them + extract($vars, EXTR_PREFIX_ALL, 'bind'); - // Get snippet name - $name = (isset($fetch)) ? (string) $fetch : ''; + // Get snippet id + $snippet_id = (string) $bind_id ?? ''; - // Define snippet path - $snippet_file = $this->_file_location($name); + // Define snippet file path + $snippet_file = $this->_file_location($snippet_id); // Process snippet if (Filesystem::has($snippet_file)) { @@ -206,13 +212,19 @@ class Snippets // Turn on output buffering ob_start(); - // Include view file + // Re-init $flextype for snippets + $flextype = $this->flextype; + + // Re-init $app for snippets + $app = $this->app; + + // Include snippet file include $snippet_file; // Output... return ob_get_clean(); } else { - throw new \RuntimeException("Snippet {$name} does not exist."); + throw new \RuntimeException("Snippet {$snippet_id} does not exist."); } } diff --git a/flextype/dependencies.php b/flextype/dependencies.php index 478b167b..492c7183 100644 --- a/flextype/dependencies.php +++ b/flextype/dependencies.php @@ -140,8 +140,8 @@ $flextype['fieldsets'] = function ($container) use ($flextype) { /** * Add snippets service to Flextype container */ -$flextype['snippets'] = function ($container) use ($flextype) { - return new Snippets($flextype); +$flextype['snippets'] = function ($container) use ($flextype, $app) { + return new Snippets($flextype, $app); }; /** diff --git a/flextype/routes/web.php b/flextype/routes/web.php index b8db77d9..112bd494 100644 --- a/flextype/routes/web.php +++ b/flextype/routes/web.php @@ -1,5 +1,15 @@ + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Flextype; use Psr\Http\Message\ResponseInterface as Response; diff --git a/flextype/shortcodes/SiteUrlShortcode.php b/flextype/shortcodes/BaseUrlShortcode.php similarity index 84% rename from flextype/shortcodes/SiteUrlShortcode.php rename to flextype/shortcodes/BaseUrlShortcode.php index 974b8e3b..d3dcb99e 100644 --- a/flextype/shortcodes/SiteUrlShortcode.php +++ b/flextype/shortcodes/BaseUrlShortcode.php @@ -15,7 +15,7 @@ namespace Flextype; use Thunder\Shortcode\ShortcodeFacade; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -// Shortcode: [site_url] -$flextype['shortcodes']->addHandler('site_url', function () { +// Shortcode: [base_url] +$flextype['shortcodes']->addHandler('base_url', function () { return \Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER))->getBaseUrl(); }); diff --git a/flextype/shortcodes/EntriesShortcode.php b/flextype/shortcodes/EntriesShortcode.php new file mode 100644 index 00000000..0df8022e --- /dev/null +++ b/flextype/shortcodes/EntriesShortcode.php @@ -0,0 +1,22 @@ + + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flextype; + +use Thunder\Shortcode\ShortcodeFacade; +use Thunder\Shortcode\Shortcode\ShortcodeInterface; +use Flextype\Component\Arr\Arr; + +// Shortcode: [entries_fetch id="entry-id" field="field-name" default="default-value"] +$flextype['shortcodes']->addHandler('entries_fetch', function (ShortcodeInterface $s) use ($flextype) { + return Arr::get($flextype['entries']->fetch($s->getParameter('id')), $s->getParameter('field'), $s->getParameter('default')); +}); diff --git a/flextype/shortcodes/SnippetsShortcode.php b/flextype/shortcodes/SnippetsShortcode.php index f4754fa0..2cf14b86 100644 --- a/flextype/shortcodes/SnippetsShortcode.php +++ b/flextype/shortcodes/SnippetsShortcode.php @@ -15,7 +15,7 @@ namespace Flextype; use Thunder\Shortcode\ShortcodeFacade; use Thunder\Shortcode\Shortcode\ShortcodeInterface; -// Shortcode: [snippets fetch=snippet-name] -$flextype['shortcodes']->addHandler('snippets', function (ShortcodeInterface $s) use ($flextype) { - return $flextype['snippets']->display($s->getParameter('fetch')); +// Shortcode: [snippets_fetch id="snippet-name"] +$flextype['shortcodes']->addHandler('snippets_fetch', function (ShortcodeInterface $s) use ($flextype) { + return $flextype['snippets']->exec($s->getParameter('id')); }); diff --git a/flextype/twig/EntriesTwigExtension.php b/flextype/twig/EntriesTwigExtension.php index 4a265b62..821e41cc 100644 --- a/flextype/twig/EntriesTwigExtension.php +++ b/flextype/twig/EntriesTwigExtension.php @@ -45,8 +45,8 @@ class EntriesTwigExtension extends \Twig_Extension return $this->flextype['entries']->fetch($entry); } - public function fetchAll(string $entry, string $order_by = 'date', string $order_type = 'DESC', int $offset = null, int $length = null) : array + public function fetchAll(string $entry, string $order_by = 'date', string $order_type = 'DESC', int $offset = null, int $length = null, bool $recursive = false) : array { - return $this->flextype['entries']->fetchAll($entry, $order_by, $order_type, $offset, $length); + return $this->flextype['entries']->fetchAll($entry, $order_by, $order_type, $offset, $length, $recursive); } } diff --git a/flextype/twig/GlobalVarsTwigExtension.php b/flextype/twig/GlobalVarsTwigExtension.php index 9d7ba101..76c6a067 100644 --- a/flextype/twig/GlobalVarsTwigExtension.php +++ b/flextype/twig/GlobalVarsTwigExtension.php @@ -12,8 +12,6 @@ namespace Flextype; -use Flextype\Component\Session\Session; - class GlobalVarsTwigExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface { /** @@ -37,10 +35,11 @@ class GlobalVarsTwigExtension extends \Twig_Extension implements \Twig_Extension 'PATH_THEMES' => PATH['themes'], 'PATH_ENTRIES' => PATH['entries'], 'PATH_SNIPPETS' => PATH['snippets'], + 'PATH_FIELDSETS' => PATH['fieldsets'], 'PATH_CONFIG_DEFAULT' => PATH['config']['default'], 'PATH_CONFIG_SITE' => PATH['config']['site'], 'PATH_CACHE' => PATH['cache'], - 'flextype_version' => FLEXTYPE_VERSION, + 'FLEXTYPE_VERSION' => FLEXTYPE_VERSION, 'registry' => $this->flextype['registry']->dump() ]; } diff --git a/flextype/twig/SnippetsTwigExtension.php b/flextype/twig/SnippetsTwigExtension.php index 88dc21f5..4ef42fa1 100644 --- a/flextype/twig/SnippetsTwigExtension.php +++ b/flextype/twig/SnippetsTwigExtension.php @@ -35,12 +35,12 @@ class SnippetsTwigExtension extends \Twig_Extension public function getFunctions() { return [ - new \Twig_SimpleFunction('snippet', [$this, 'snippet']) + new \Twig_SimpleFunction('snippets_exec', [$this, 'exec']) ]; } - public function snippet(string $id) + public function exec(string $id) { - return $this->flextype['snippets']->display($id); + return $this->flextype['snippets']->exec($id); } } diff --git a/site/plugins/admin/bootstrap.php b/site/plugins/admin/bootstrap.php index d985f021..077be02b 100755 --- a/site/plugins/admin/bootstrap.php +++ b/site/plugins/admin/bootstrap.php @@ -1,7 +1,5 @@ getPath()); +/** + * Set base admin route + */ +$admin_route = $flextype->registry->get('plugins.admin.route'); -// Set base admin route -$admin_route = 'admin'; +/** + * Ensure vendor libraries exist + */ +!is_file($admin_autoload = __DIR__ . '/vendor/autoload.php') and exit("Please run: composer install"); -// Ensure vendor libraries exist -!is_file($autoload = __DIR__ . '/vendor/autoload.php') and exit("Please run: composer install"); +/** + * Register The Auto Loader + * + * Composer provides a convenient, automatically generated class loader for + * our application. We just need to utilize it! We'll simply require it + * into the script here so that we don't have to worry about manual + * loading any of our classes later on. It feels nice to relax. + * Register The Auto Loader + */ +$admin_loader = require_once $admin_autoload; -// Register The Auto Loader -$loader = require_once $autoload; - -// Include routes +/** + * Include web routes + */ include_once 'routes/web.php'; -// Set Default Admin locale -I18n::$locale = $flextype->registry->get('settings.locale'); - -// Add Admin Navigation -$flextype->registry->set('admin_navigation.content.entries', ['title' => '' . __('admin_entries'), 'link' => $flextype->router->pathFor('admin.entries.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.extends.fieldsets', ['title' => '' . __('admin_fieldsets'), 'link' => $flextype->router->pathFor('admin.fieldsets.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.extends.templates', ['title' => '' . __('admin_templates'), 'link' => $flextype->router->pathFor('admin.templates.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.extends.snippets', ['title' => '' . __('admin_snippets'), 'link' => $flextype->router->pathFor('admin.snippets.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.extends.plugins', ['title' => '' . __('admin_plugins'), 'link' => $flextype->router->pathFor('admin.plugins.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.settings.settings', ['title' => '' . __('admin_settings'), 'link' => $flextype->router->pathFor('admin.settings.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.settings.infomation', ['title' => '' . __('admin_information'), 'link' => $flextype->router->pathFor('admin.information.index'), 'attributes' => ['class' => 'nav-link']]); -$flextype->registry->set('admin_navigation.help.docs', ['title' => '' . __('admin_documentation'), 'link' => 'http://flextype.org/en/documentation', 'attributes' => ['class' => 'nav-link', 'target' => '_blank']]); - -// Add Global Vars Admin Twig Extension -$flextype->view->addExtension(new GlobalVarsAdminTwigExtension($flextype)); - -$flextype['DashboardController'] = function ($container) { - return new DashboardController($container); -}; - -$flextype['SettingsController'] = function ($container) { - return new SettingsController($container); -}; - -$flextype['InformationController'] = function ($container) { - return new InformationController($container); -}; - -$flextype['PluginsController'] = function ($container) { - return new PluginsController($container); -}; - -$flextype['EntriesController'] = function ($container) { - return new EntriesController($container); -}; - -$flextype['FieldsetsController'] = function ($container) { - return new FieldsetsController($container); -}; - -$flextype['SnippetsController'] = function ($container) { - return new SnippetsController($container); -}; - -$flextype['TemplatesController'] = function ($container) { - return new TemplatesController($container); -}; - -$flextype['UsersController'] = function ($container) { - return new UsersController($container); -}; +/** + * Include dependencies + */ +include_once 'dependencies.php'; diff --git a/site/plugins/admin/dependencies.php b/site/plugins/admin/dependencies.php new file mode 100644 index 00000000..b432a577 --- /dev/null +++ b/site/plugins/admin/dependencies.php @@ -0,0 +1,69 @@ + + * @link http://romanenko.digital + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flextype; + +use Flextype\Component\Arr\Arr; +use Flextype\Component\I18n\I18n; +use function Flextype\Component\I18n\__; + +// Set Default Admin locale +I18n::$locale = $flextype->registry->get('settings.locale'); + +// Add Admin Navigation +$flextype->registry->set('admin_navigation.content.entries', ['title' => '' . __('admin_entries'), 'link' => $flextype->router->pathFor('admin.entries.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.extends.fieldsets', ['title' => '' . __('admin_fieldsets'), 'link' => $flextype->router->pathFor('admin.fieldsets.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.extends.templates', ['title' => '' . __('admin_templates'), 'link' => $flextype->router->pathFor('admin.templates.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.extends.snippets', ['title' => '' . __('admin_snippets'), 'link' => $flextype->router->pathFor('admin.snippets.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.extends.plugins', ['title' => '' . __('admin_plugins'), 'link' => $flextype->router->pathFor('admin.plugins.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.settings.settings', ['title' => '' . __('admin_settings'), 'link' => $flextype->router->pathFor('admin.settings.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.settings.infomation', ['title' => '' . __('admin_information'), 'link' => $flextype->router->pathFor('admin.information.index'), 'attributes' => ['class' => 'nav-link']]); +$flextype->registry->set('admin_navigation.help.docs', ['title' => '' . __('admin_documentation'), 'link' => 'http://flextype.org/en/documentation', 'attributes' => ['class' => 'nav-link', 'target' => '_blank']]); + +// Add Global Vars Admin Twig Extension +$flextype->view->addExtension(new GlobalVarsAdminTwigExtension($flextype)); + +$flextype['DashboardController'] = function ($container) { + return new DashboardController($container); +}; + +$flextype['SettingsController'] = function ($container) { + return new SettingsController($container); +}; + +$flextype['InformationController'] = function ($container) { + return new InformationController($container); +}; + +$flextype['PluginsController'] = function ($container) { + return new PluginsController($container); +}; + +$flextype['EntriesController'] = function ($container) { + return new EntriesController($container); +}; + +$flextype['FieldsetsController'] = function ($container) { + return new FieldsetsController($container); +}; + +$flextype['SnippetsController'] = function ($container) { + return new SnippetsController($container); +}; + +$flextype['TemplatesController'] = function ($container) { + return new TemplatesController($container); +}; + +$flextype['UsersController'] = function ($container) { + return new UsersController($container); +}; diff --git a/site/plugins/admin/settings.json b/site/plugins/admin/settings.json index 60e7e096..db7e2d83 100644 --- a/site/plugins/admin/settings.json +++ b/site/plugins/admin/settings.json @@ -1,3 +1,4 @@ { - "enabled": true + "enabled": true, + "route": "admin" } diff --git a/site/plugins/admin/views/templates/extends/snippets/index.html b/site/plugins/admin/views/templates/extends/snippets/index.html index cb78f88f..76833215 100644 --- a/site/plugins/admin/views/templates/extends/snippets/index.html +++ b/site/plugins/admin/views/templates/extends/snippets/index.html @@ -64,7 +64,7 @@