/** * Bootstrap the application events. * * @return void */ public function boot() { $this->app['xe.pluginRegister']->add(Textarea::class); AbstractEditor::setImageResolver(function (array $ids) { $dimension = $this->app['request']->isMobile() ? 'M' : 'L'; $fileClass = $this->app['xe.storage']->getModel(); $files = $fileClass::whereIn('id', $ids)->get(); $imgClass = $this->app['xe.media']->getHandler(Media::TYPE_IMAGE)->getModel(); $images = []; foreach ($files as $file) { $images[] = $imgClass::getThumbnail($this->app['xe.media']->make($file), EditorHandler::THUMBNAIL_TYPE, $dimension); } return $images; }); $this->app['events']->listen('xe.editor.option.building', function ($editor) { $key = $this->app['xe.editor']->getPermKey($editor->getInstanceId()); if (!$this->app['xe.permission']->get($key)) { $this->app['xe.permission']->register($key, new Grant()); } }); $this->app['events']->listen('xe.editor.render', function ($editor) { $this->app['xe.frontend']->js('assets/core/common/js/xe.editor.core.js')->load(); }); }
/** * Get the evaluated contents of the object. * * @return string */ public function render() { $this->initAssets(); $this->arguments['content'] = str_replace(['<', '>'], ['&lt;', '&gt;'], $this->arguments['content']); return $this->renderPlugins(parent::render(), $this->scriptOnly); }