public function register() { $this->app->singleton('editor', function ($app) { $config = $app->make('site')->getSite()->getConfigRepository(); $styles = $config->get('editor.ckeditor4.styles', array()); $pluginManager = new PluginManager(); $pluginManager->selectMultiple($config->get('editor.ckeditor4.plugins.selected', array())); $this->registerCkeditorPlugins($pluginManager); $this->registerCorePlugins($pluginManager); $editor = new CkeditorEditor($config, $pluginManager, $styles); $editor->setToken($app->make('token')->generate('editor')); $filePermission = FilePermissions::getGlobal(); $taskPermission = new TaskPermission(); $editor->setAllowFileManager($filePermission->canAccessFileManager() && $config->get('editor.concrete.enable_filemanager')); $editor->setAllowSitemap($taskPermission->canAccessSitemap() && $config->get('editor.concrete.enable_sitemap')); return $editor; }); }
public function __construct() { $fp = FilePermissions::getGlobal(); $tp = new TaskPermission(); $this->assets = ResponseAssetGroup::get(); $this->token = Core::make("token")->generate('editor'); $this->allowFileManager = \Config::get('concrete.editor.concrete.enable_filemanager') && $fp->canAccessFileManager(); $this->allowSitemap = \Config::get('concrete.editor.concrete.enable_sitemap') && $tp->canAccessSitemap(); $this->pluginManager = new PluginManager(); $this->pluginManager->register('undoredo', t('Undo/Redo')); $this->pluginManager->register('underline', t('Underline')); $this->pluginManager->register('concrete5lightbox', t('Lightbox')); $this->pluginManager->register('specialcharacters', t('Special Characters Palette')); $this->pluginManager->register('table', t('Table')); $this->pluginManager->register('fontfamily', t('Font Family')); $this->pluginManager->register('fontsize', t('Font Size')); $this->pluginManager->register('fontcolor', t('Font Color')); $this->pluginManager->selectMultiple(\Config::get('concrete.editor.plugins.selected')); }