Exemplo n.º 1
0
 public function testListSideMenuItems()
 {
     $manager = NavigationManager::instance();
     $items = $manager->listSideMenuItems();
     $this->assertEmpty($items);
     $manager->setContext('October.Tester', 'blog');
     $items = $manager->listSideMenuItems();
     $this->assertArrayHasKey('posts', $items);
     $this->assertArrayHasKey('categories', $items);
 }
 /**
  * Register singletons
  */
 protected function registerSingletons()
 {
     App::singleton('backend.helper', function () {
         return new \Backend\Helpers\Backend();
     });
     App::singleton('backend.menu', function () {
         return \Backend\Classes\NavigationManager::instance();
     });
     App::singleton('backend.auth', function () {
         return \Backend\Classes\AuthManager::instance();
     });
 }
 public function testAddSideMenuItems()
 {
     $manager = NavigationManager::instance();
     $manager->addSideMenuItems('October.Tester', 'blog', ['foo' => ['label' => 'Bar', 'icon' => 'icon-derp', 'url' => 'http://google.com', 'permissions' => ['october.tester.access_foo', 'october.tester.access_bar']]]);
     $manager->setContext('October.Tester', 'blog');
     $items = $manager->listSideMenuItems();
     $this->assertInternalType('array', $items);
     $this->assertArrayHasKey('foo', $items);
     $this->assertInternalType('object', $items['foo']);
     $this->assertObjectHasAttribute('code', $items['foo']);
     $this->assertObjectHasAttribute('owner', $items['foo']);
     $this->assertObjectHasAttribute('order', $items['foo']);
     $this->assertEquals(-1, $items['foo']->order);
     $this->assertEquals('foo', $items['foo']->code);
     $this->assertEquals('October.Tester', $items['foo']->owner);
     $this->assertObjectHasAttribute('permissions', $items['foo']);
     $this->assertInternalType('array', $items['foo']->permissions);
     $this->assertCount(2, $items['foo']->permissions);
     $this->assertContains('october.tester.access_foo', $items['foo']->permissions);
     $this->assertContains('october.tester.access_bar', $items['foo']->permissions);
 }
 public function testRemoveSideMenuItem()
 {
     $manager = NavigationManager::instance();
     $manager->addSideMenuItems('October.Tester', 'blog', ['bar' => ['label' => 'Bar', 'icon' => 'icon-bars', 'url' => 'http://yahoo.com']]);
     $manager->setContext('October.Tester', 'blog');
     $items = $manager->listSideMenuItems();
     $this->assertArrayHasKey('bar', $items);
     $manager->removeSideMenuItem('October.Tester', 'blog', 'bar');
     $items = $manager->listSideMenuItems();
     $this->assertArrayNotHasKey('bar', $items);
 }
Exemplo n.º 5
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     /*
      * Register self
      */
     parent::register('system');
     /*
      * Register core providers
      */
     App::register('October\\Rain\\Config\\ConfigServiceProvider');
     App::register('October\\Rain\\Translation\\TranslationServiceProvider');
     /*
      * Define path constants
      */
     if (!defined('PATH_APP')) {
         define('PATH_APP', app_path());
     }
     if (!defined('PATH_BASE')) {
         define('PATH_BASE', base_path());
     }
     if (!defined('PATH_PUBLIC')) {
         define('PATH_PUBLIC', public_path());
     }
     if (!defined('PATH_STORAGE')) {
         define('PATH_STORAGE', storage_path());
     }
     if (!defined('PATH_PLUGINS')) {
         define('PATH_PLUGINS', base_path() . Config::get('cms.pluginsDir'));
     }
     /*
      * Register singletons
      */
     App::singleton('string', function () {
         return new \October\Rain\Support\Str();
     });
     App::singleton('backend.helper', function () {
         return new \Backend\Classes\BackendHelper();
     });
     App::singleton('backend.menu', function () {
         return \Backend\Classes\NavigationManager::instance();
     });
     App::singleton('backend.auth', function () {
         return \Backend\Classes\AuthManager::instance();
     });
     /*
      * Register all plugins
      */
     $pluginManager = PluginManager::instance();
     $pluginManager->registerAll();
     /*
      * Error handling for uncaught Exceptions
      */
     App::error(function (\Exception $exception, $httpCode) {
         $handler = new ErrorHandler();
         $isConsole = App::runningInConsole();
         return $handler->handleException($exception, $httpCode, $isConsole);
     });
     /*
      * Write all log events to the database
      */
     Event::listen('illuminate.log', function ($level, $message, $context) {
         if (!DbDongle::hasDatabase()) {
             return;
         }
         EventLog::add($message, $level);
     });
     /*
      * Register basic Twig
      */
     App::bindShared('twig', function ($app) {
         $twig = new Twig_Environment(new TwigLoader(), ['auto_reload' => true]);
         $twig->addExtension(new TwigExtension());
         return $twig;
     });
     /*
      * Register .htm extension for Twig views
      */
     App::make('view')->addExtension('htm', 'twig', function () {
         return new TwigEngine(App::make('twig'));
     });
     /*
      * Register Twig that will parse strings
      */
     App::bindShared('twig.string', function ($app) {
         $twig = $app['twig'];
         $twig->setLoader(new Twig_Loader_String());
         return $twig;
     });
     /*
      * Override system mailer with mail settings
      */
     Event::listen('mailer.beforeRegister', function () {
         if (MailSettings::isConfigured()) {
             MailSettings::applyConfigValues();
         }
     });
     /*
      * Override standard Mailer content with template
      */
     Event::listen('mailer.beforeAddContent', function ($mailer, $message, $view, $plain, $data) {
         if (MailTemplate::addContentToMailer($message, $view, $data)) {
             return false;
         }
     });
     /*
      * Register other module providers
      */
     foreach (Config::get('cms.loadModules', []) as $module) {
         if (strtolower(trim($module)) == 'system') {
             continue;
         }
         App::register('\\' . $module . '\\ServiceProvider');
     }
     /*
      * Register navigation
      */
     BackendMenu::registerCallback(function ($manager) {
         $manager->registerMenuItems('October.System', ['system' => ['label' => 'system::lang.system.menu_label', 'icon' => 'icon-cog', 'url' => Backend::url('system/settings'), 'permissions' => ['backend.manage_users', 'system.*'], 'order' => 1000]]);
     });
     /*
      * Register report widgets
      */
     WidgetManager::instance()->registerReportWidgets(function ($manager) {
         $manager->registerReportWidget('System\\ReportWidgets\\Status', ['label' => 'backend::lang.dashboard.status.widget_title_default', 'context' => 'dashboard']);
     });
     /*
      * Register permissions
      */
     BackendAuth::registerCallback(function ($manager) {
         $manager->registerPermissions('October.System', ['system.manage_settings' => ['label' => 'system::lang.permissions.manage_system_settings', 'tab' => 'System'], 'system.manage_updates' => ['label' => 'system::lang.permissions.manage_software_updates', 'tab' => 'System'], 'system.manage_mail_templates' => ['label' => 'system::lang.permissions.manage_mail_templates', 'tab' => 'System']]);
     });
     /*
      * Register markup tags
      */
     MarkupManager::instance()->registerCallback(function ($manager) {
         $manager->registerFunctions(['post' => 'post', 'link_to' => 'link_to', 'link_to_asset' => 'link_to_asset', 'link_to_route' => 'link_to_route', 'link_to_action' => 'link_to_action', 'asset' => 'asset', 'action' => 'action', 'url' => 'url', 'route' => 'route', 'secure_url' => 'secure_url', 'secure_asset' => 'secure_asset', 'str_*' => ['Str', '*'], 'url_*' => ['URL', '*'], 'html_*' => ['HTML', '*'], 'form_*' => ['Form', '*'], 'form_macro' => ['Form', '__call']]);
         $manager->registerFilters(['slug' => ['Str', 'slug'], 'plural' => ['Str', 'plural'], 'singular' => ['Str', 'singular'], 'finish' => ['Str', 'finish'], 'snake' => ['Str', 'snake'], 'camel' => ['Str', 'camel'], 'studly' => ['Str', 'studly'], 'md' => ['October\\Rain\\Support\\Markdown', 'parse']]);
     });
     /*
      * Register settings
      */
     SettingsManager::instance()->registerCallback(function ($manager) {
         $manager->registerSettingItems('October.System', ['administrators' => ['label' => 'backend::lang.user.menu_label', 'description' => 'backend::lang.user.menu_description', 'category' => SettingsManager::CATEGORY_SYSTEM, 'icon' => 'icon-users', 'url' => Backend::url('backend/users'), 'permissions' => ['backend.manage_users'], 'order' => 600], 'updates' => ['label' => 'system::lang.updates.menu_label', 'description' => 'system::lang.updates.menu_description', 'category' => SettingsManager::CATEGORY_SYSTEM, 'icon' => 'icon-cloud-download', 'url' => Backend::url('system/updates'), 'permissions' => ['system.manage_updates'], 'order' => 700], 'event_logs' => ['label' => 'system::lang.event_log.menu_label', 'description' => 'system::lang.event_log.menu_description', 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-exclamation-triangle', 'url' => Backend::url('system/eventlogs'), 'permissions' => ['system.access_event_logs'], 'order' => 800], 'request_logs' => ['label' => 'system::lang.request_log.menu_label', 'description' => 'system::lang.request_log.menu_description', 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-file-o', 'url' => Backend::url('system/requestlogs'), 'permissions' => ['system.access_request_logs'], 'order' => 800], 'mail_settings' => ['label' => 'system::lang.mail.menu_label', 'description' => 'system::lang.mail.menu_description', 'category' => SettingsManager::CATEGORY_MAIL, 'icon' => 'icon-envelope', 'class' => 'System\\Models\\MailSettings', 'order' => 400], 'mail_templates' => ['label' => 'system::lang.mail_templates.menu_label', 'description' => 'system::lang.mail_templates.menu_description', 'category' => SettingsManager::CATEGORY_MAIL, 'icon' => 'icon-envelope-square', 'url' => Backend::url('system/mailtemplates'), 'order' => 500]]);
     });
     /*
      * Register console commands
      */
     $this->registerConsoleCommand('october.up', 'System\\Console\\OctoberUp');
     $this->registerConsoleCommand('october.down', 'System\\Console\\OctoberDown');
     $this->registerConsoleCommand('october.update', 'System\\Console\\OctoberUpdate');
     $this->registerConsoleCommand('october.util', 'System\\Console\\OctoberUtil');
     $this->registerConsoleCommand('plugin.install', 'System\\Console\\PluginInstall');
     $this->registerConsoleCommand('plugin.remove', 'System\\Console\\PluginRemove');
     $this->registerConsoleCommand('plugin.refresh', 'System\\Console\\PluginRefresh');
     /*
      * Override clear cache command
      */
     App::bindShared('command.cache.clear', function ($app) {
         return new \System\Console\CacheClear($app['cache'], $app['files']);
     });
     /*
      * Register the sidebar for the System main menu
      */
     BackendMenu::registerContextSidenavPartial('October.System', 'system', '@/modules/system/partials/_system_sidebar.htm');
 }
Exemplo n.º 6
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     /*
      * Register self
      */
     parent::register('system');
     /*
      * Register core providers
      */
     App::register('October\\Rain\\Config\\ConfigServiceProvider');
     App::register('October\\Rain\\Translation\\TranslationServiceProvider');
     /*
      * Define path constants
      */
     if (!defined('PATH_APP')) {
         define('PATH_APP', app_path());
     }
     if (!defined('PATH_BASE')) {
         define('PATH_BASE', base_path());
     }
     if (!defined('PATH_PUBLIC')) {
         define('PATH_PUBLIC', public_path());
     }
     if (!defined('PATH_STORAGE')) {
         define('PATH_STORAGE', storage_path());
     }
     if (!defined('PATH_PLUGINS')) {
         define('PATH_PLUGINS', base_path() . Config::get('cms.pluginsDir'));
     }
     /*
      * Register singletons
      */
     App::singleton('string', function () {
         return new \October\Rain\Support\Str();
     });
     App::singleton('backend.helper', function () {
         return new \Backend\Classes\BackendHelper();
     });
     App::singleton('backend.menu', function () {
         return \Backend\Classes\NavigationManager::instance();
     });
     App::singleton('backend.auth', function () {
         return \Backend\Classes\AuthManager::instance();
     });
     /*
      * Register all plugins
      */
     $pluginManager = PluginManager::instance();
     $pluginManager->registerAll();
     /*
      * Error handling for uncaught Exceptions
      */
     App::error(function (\Exception $exception, $httpCode, $isConsole) {
         $handler = new ErrorHandler();
         return $handler->handleException($exception, $httpCode, $isConsole);
     });
     /*
      * Register basic twig
      */
     App::bindShared('twig', function ($app) {
         return new Twig_Environment(new TwigLoader(), ['auto_reload' => true]);
     });
     /*
      * Register .htm extension for Twig views
      */
     App::make('view')->addExtension('htm', 'twig', function () {
         return new TwigEngine(App::make('twig'));
     });
     /*
      * Override system email with email settings
      */
     Event::listen('mailer.beforeRegister', function () {
         if (EmailSettings::isConfigured()) {
             EmailSettings::applyConfigValues();
         }
     });
     /*
      * Override standard Mailer content with template
      */
     Event::listen('mailer.register', function () {
         App::make('mailer')->bindEvent('content.beforeAdd', function ($message, $view, $plain, $data) {
             if (EmailTemplate::addContentToMailer($message, $view, $data)) {
                 return false;
             }
         });
     });
     /*
      * Register other module providers
      */
     foreach (Config::get('cms.loadModules', []) as $module) {
         if (strtolower(trim($module)) == 'system') {
             continue;
         }
         App::register('\\' . $module . '\\ServiceProvider');
     }
     /*
      * Register navigation
      */
     BackendMenu::registerCallback(function ($manager) {
         $manager->registerMenuItems('October.System', ['system' => ['label' => 'system::lang.system.menu_label', 'icon' => 'icon-cog', 'url' => Backend::url('system/settings'), 'permissions' => ['backend.*', 'system.*'], 'order' => 1000, 'sideMenu' => ['settings' => ['label' => 'system::lang.settings.menu_label', 'icon' => 'icon-cogs', 'url' => Backend::url('system/settings'), 'permissions' => ['system.manage_settings']], 'users' => ['label' => 'backend::lang.user.menu_label', 'icon' => 'icon-user', 'url' => Backend::url('backend/users'), 'permissions' => ['backend.manage_users']], 'updates' => ['label' => 'system::lang.updates.menu_label', 'icon' => 'icon-cloud-download', 'url' => Backend::url('system/updates'), 'permissions' => ['system.manage_updates']]]]]);
     });
     /*
      * Register report widgets
      */
     WidgetManager::instance()->registerReportWidgets(function ($manager) {
         $manager->registerReportWidget('System\\ReportWidgets\\Status', ['label' => 'System status', 'context' => 'dashboard']);
     });
     /*
      * Register permissions
      */
     BackendAuth::registerCallback(function ($manager) {
         $manager->registerPermissions('October.System', ['system.manage_settings' => ['label' => 'Manage system settings', 'tab' => 'System'], 'system.manage_updates' => ['label' => 'Manage software updates', 'tab' => 'System'], 'system.manage_email_templates' => ['label' => 'Manage email templates', 'tab' => 'System']]);
     });
     /*
      * Register settings
      */
     SettingsManager::instance()->registerCallback(function ($manager) {
         $manager->registerSettingItems('October.System', ['email_settings' => ['label' => 'system::lang.email.menu_label', 'description' => 'system::lang.email.menu_description', 'category' => 'System', 'icon' => 'icon-envelope', 'class' => 'System\\Models\\EmailSettings', 'sort' => 100], 'email_templates' => ['label' => 'system::lang.email_templates.menu_label', 'description' => 'system::lang.email_templates.menu_description', 'category' => 'System', 'icon' => 'icon-envelope-square', 'url' => Backend::url('system/emailtemplates'), 'sort' => 100]]);
     });
     /*
      * Register console commands
      */
     $this->registerConsoleCommand('october.up', 'System\\Console\\OctoberUp');
     $this->registerConsoleCommand('october.down', 'System\\Console\\OctoberDown');
     $this->registerConsoleCommand('october.update', 'System\\Console\\OctoberUpdate');
     $this->registerConsoleCommand('plugin.install', 'System\\Console\\PluginInstall');
     $this->registerConsoleCommand('plugin.remove', 'System\\Console\\PluginRemove');
     $this->registerConsoleCommand('plugin.refresh', 'System\\Console\\PluginRefresh');
     /*
      * Override clear cache command
      */
     App::bindShared('command.cache.clear', function ($app) {
         return new \System\Console\CacheClear($app['cache'], $app['files']);
     });
 }
Exemplo n.º 7
0
 /**
  * Create a new instance of this singleton.
  *
  * @static 
  */
 public static function instance()
 {
     return \Backend\Classes\NavigationManager::instance();
 }
Exemplo n.º 8
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     /*
      * Register self
      */
     parent::register('system');
     /*
      * Register singletons
      */
     App::singleton('backend.helper', function () {
         return new \Backend\Helpers\Backend();
     });
     App::singleton('backend.menu', function () {
         return \Backend\Classes\NavigationManager::instance();
     });
     App::singleton('backend.auth', function () {
         return \Backend\Classes\AuthManager::instance();
     });
     /*
      * Check for CLI or system/updates route and disable any plugin initialization
      * @todo This should be moved to middleware
      */
     $requestPath = \October\Rain\Router\Helper::normalizeUrl(\Request::path());
     $systemPath = \October\Rain\Router\Helper::normalizeUrl(Config::get('cms.backendUri') . '/system/updates');
     if (stripos($requestPath, $systemPath) === 0) {
         PluginManager::$noInit = true;
     }
     $updateCommands = ['october:up', 'october:update'];
     if (App::runningInConsole() && count(array_intersect($updateCommands, Request::server('argv'))) > 0) {
         PluginManager::$noInit = true;
     }
     /*
      * Register all plugins
      */
     $pluginManager = PluginManager::instance();
     $pluginManager->registerAll();
     /*
      * Allow plugins to use the scheduler
      */
     Event::listen('console.schedule', function ($schedule) use($pluginManager) {
         foreach ($pluginManager->getPlugins() as $plugin) {
             if (method_exists($plugin, 'registerSchedule')) {
                 $plugin->registerSchedule($schedule);
             }
         }
     });
     /*
      * Error handling for uncaught Exceptions
      */
     Event::listen('exception.beforeRender', function ($exception, $httpCode, $request) {
         $handler = new ErrorHandler();
         return $handler->handleException($exception);
     });
     /*
      * Write all log events to the database
      */
     Event::listen('illuminate.log', function ($level, $message, $context) {
         if (DbDongle::hasDatabase() && !defined('OCTOBER_NO_EVENT_LOGGING')) {
             EventLog::add($message, $level);
         }
     });
     /*
      * Register basic Twig
      */
     App::singleton('twig', function ($app) {
         $twig = new Twig_Environment(new TwigLoader(), ['auto_reload' => true]);
         $twig->addExtension(new TwigExtension());
         return $twig;
     });
     /*
      * Register .htm extension for Twig views
      */
     App::make('view')->addExtension('htm', 'twig', function () {
         return new TwigEngine(App::make('twig'));
     });
     /*
      * Register Twig that will parse strings
      */
     App::singleton('twig.string', function ($app) {
         $twig = $app['twig'];
         $twig->setLoader(new Twig_Loader_String());
         return $twig;
     });
     /*
      * Override system mailer with mail settings
      */
     Event::listen('mailer.beforeRegister', function () {
         if (MailSettings::isConfigured()) {
             MailSettings::applyConfigValues();
         }
     });
     /*
      * Override standard Mailer content with template
      */
     Event::listen('mailer.beforeAddContent', function ($mailer, $message, $view, $data) {
         if (MailTemplate::addContentToMailer($message, $view, $data)) {
             return false;
         }
     });
     /*
      * Register other module providers
      */
     foreach (Config::get('cms.loadModules', []) as $module) {
         if (strtolower(trim($module)) == 'system') {
             continue;
         }
         App::register('\\' . $module . '\\ServiceProvider');
     }
     /*
      * Register navigation
      */
     BackendMenu::registerCallback(function ($manager) {
         $manager->registerMenuItems('October.System', ['system' => ['label' => 'system::lang.settings.menu_label', 'icon' => 'icon-cog', 'url' => Backend::url('system/settings'), 'permissions' => ['backend.manage_users', 'system.*'], 'order' => 1000]]);
     });
     /*
      * Register report widgets
      */
     WidgetManager::instance()->registerReportWidgets(function ($manager) {
         $manager->registerReportWidget('System\\ReportWidgets\\Status', ['label' => 'backend::lang.dashboard.status.widget_title_default', 'context' => 'dashboard']);
     });
     /*
      * Register permissions
      */
     BackendAuth::registerCallback(function ($manager) {
         $manager->registerPermissions('October.System', ['system.manage_updates' => ['label' => 'system::lang.permissions.manage_software_updates', 'tab' => 'system::lang.permissions.name'], 'system.manage_mail_settings' => ['label' => 'system::lang.permissions.manage_mail_settings', 'tab' => 'system::lang.permissions.name'], 'system.manage_mail_templates' => ['label' => 'system::lang.permissions.manage_mail_templates', 'tab' => 'system::lang.permissions.name']]);
     });
     /*
      * Register markup tags
      */
     MarkupManager::instance()->registerCallback(function ($manager) {
         $manager->registerFunctions(['input' => 'input', 'post' => 'post', 'get' => 'get', 'link_to' => 'link_to', 'link_to_asset' => 'link_to_asset', 'link_to_route' => 'link_to_route', 'link_to_action' => 'link_to_action', 'asset' => 'asset', 'action' => 'action', 'url' => 'url', 'route' => 'route', 'secure_url' => 'secure_url', 'secure_asset' => 'secure_asset', 'str_*' => ['Str', '*'], 'url_*' => ['URL', '*'], 'html_*' => ['HTML', '*'], 'form_*' => ['Form', '*'], 'form_macro' => ['Form', '__call']]);
         $manager->registerFilters(['slug' => ['Str', 'slug'], 'plural' => ['Str', 'plural'], 'singular' => ['Str', 'singular'], 'finish' => ['Str', 'finish'], 'snake' => ['Str', 'snake'], 'camel' => ['Str', 'camel'], 'studly' => ['Str', 'studly'], 'trans' => ['Lang', 'get'], 'transchoice' => ['Lang', 'choice'], 'md' => ['Markdown', 'parse']]);
     });
     /*
      * Register settings
      */
     SettingsManager::instance()->registerCallback(function ($manager) {
         $manager->registerSettingItems('October.System', ['administrators' => ['label' => 'backend::lang.user.menu_label', 'description' => 'backend::lang.user.menu_description', 'category' => SettingsManager::CATEGORY_SYSTEM, 'icon' => 'icon-users', 'url' => Backend::url('backend/users'), 'permissions' => ['backend.manage_users'], 'order' => 600], 'updates' => ['label' => 'system::lang.updates.menu_label', 'description' => 'system::lang.updates.menu_description', 'category' => SettingsManager::CATEGORY_SYSTEM, 'icon' => 'icon-cloud-download', 'url' => Backend::url('system/updates'), 'permissions' => ['system.manage_updates'], 'order' => 700], 'event_logs' => ['label' => 'system::lang.event_log.menu_label', 'description' => 'system::lang.event_log.menu_description', 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-exclamation-triangle', 'url' => Backend::url('system/eventlogs'), 'permissions' => ['system.access_event_logs'], 'order' => 800], 'request_logs' => ['label' => 'system::lang.request_log.menu_label', 'description' => 'system::lang.request_log.menu_description', 'category' => SettingsManager::CATEGORY_LOGS, 'icon' => 'icon-file-o', 'url' => Backend::url('system/requestlogs'), 'permissions' => ['system.access_request_logs'], 'order' => 800], 'mail_settings' => ['label' => 'system::lang.mail.menu_label', 'description' => 'system::lang.mail.menu_description', 'category' => SettingsManager::CATEGORY_MAIL, 'icon' => 'icon-envelope', 'class' => 'System\\Models\\MailSettings', 'permissions' => ['system.manage_mail_settings'], 'order' => 400], 'mail_templates' => ['label' => 'system::lang.mail_templates.menu_label', 'description' => 'system::lang.mail_templates.menu_description', 'category' => SettingsManager::CATEGORY_MAIL, 'icon' => 'icon-envelope-square', 'url' => Backend::url('system/mailtemplates'), 'permissions' => ['system.manage_mail_templates'], 'order' => 500]]);
     });
     /*
      * Add CMS based cache clearing to native command
      */
     Event::listen('cache:cleared', function () {
         \System\Helpers\Cache::clear();
     });
     /*
      * Register console commands
      */
     $this->registerConsoleCommand('october.up', 'System\\Console\\OctoberUp');
     $this->registerConsoleCommand('october.down', 'System\\Console\\OctoberDown');
     $this->registerConsoleCommand('october.update', 'System\\Console\\OctoberUpdate');
     $this->registerConsoleCommand('october.util', 'System\\Console\\OctoberUtil');
     $this->registerConsoleCommand('plugin.install', 'System\\Console\\PluginInstall');
     $this->registerConsoleCommand('plugin.remove', 'System\\Console\\PluginRemove');
     $this->registerConsoleCommand('plugin.refresh', 'System\\Console\\PluginRefresh');
     /*
      * Register the sidebar for the System main menu
      */
     BackendMenu::registerContextSidenavPartial('October.System', 'system', '~/modules/system/partials/_system_sidebar.htm');
 }