class CkeditorEditor implements EditorInterface (View source)

Properties

protected Liaison $config

The configuration repository.

protected PluginManager $pluginManager

The plugin manager instance.

protected ResponseAssetGroup $assets
protected string|null $identifier

The custom editor identifier.

protected string|null $token

The CSRF token.

protected bool $allowFileManager

Can the editor offer the "browse files" feature?

protected bool $allowSitemap

Can the editor offer the "browse sitemap" feature?

protected array $styles
protected Application $app
private Service $site

Methods

__construct(Liaison $config, Service $site, PluginManager $pluginManager, array $styles, Application $app)

Initialize the instance.

array
getOptions($dynamicOptions = [])

No description

string
getEditorInitJSFunction(array $dynamicOptions = [])

Generate the Javascript code that initialize the plugin.

string
outputInlineEditorInitJSFunction()

Generate the Javascript code that initialize the plugin when it will be used inline.

string
outputPageInlineEditor(string $key, string|null $content = null)

Generate the HTML to be placed in a page to display the inline editor.

outputSimpleEditor($key, $content = null)

Outputs a simple, sanitized editor.

string
outputStandardEditor(string $key, string|null $content = null)

Generate the HTML to be placed in a page to display the editor.

string
outputEditorWithOptions(string $key, array $options = [], string|null $content = null)

Generate the HTML to be placed in a page to display the editor.

string
outputStandardEditorInitJSFunction()

Generate the standard Javascript code that initialize the plugin.

saveOptionsForm(Request $request)

Save the plugin options.

requireEditorAssets()

Build the list of required assets.

string
getStylesJson()

Returns a JSON Encoded string of styles.

string
outputPageComposerEditor(string $key, string $content)

Generate the HTML to be placed in a page to display the editor in composer views.

string
outputBlockEditModeEditor(string $key, string $content)

Generate the HTML to be placed in a page to display the editor when the page is in edito mode.

bool
allowFileManager()

Can the editor offer the "browse files" feature?

bool
allowSitemap()

Can the editor offer the "browse sitemap" feature?

setAllowFileManager(bool $allow)

Set if the editor can offer the "browse files" feature.

setAllowSitemap(bool $allow)

Set if the editor can offer the "browse sitemap" feature.

getPluginManager()

Get the plugin manager instance.

setToken(string $token)

Set the CSRF token.

setIdentifier(string $identifier)

Set the custom editor identifier.

string
getIdentifier(bool $autogenerate = true)

Get the editor identifier.

string
getEditorScript(string $identifier, array $options = [])

Get the HTML code to be used to initialize the editor.

string|null
getLanguageOption()

Get the CKEditor language configuration.

getEditorSnippetsAndClasses()

Build an object containing the CKEditor preconfigured snippets and classes.

Details

__construct(Liaison $config, Service $site, PluginManager $pluginManager, array $styles, Application $app)

Initialize the instance.

Parameters

Liaison $config
Service $site
PluginManager $pluginManager
array $styles
Application $app

array getOptions($dynamicOptions = [])

No description

Parameters

$dynamicOptions

Return Value

array

string getEditorInitJSFunction(array $dynamicOptions = [])

Generate the Javascript code that initialize the plugin.

Parameters

array $dynamicOptions

a list of custom options that override the default ones

Return Value

string

string outputInlineEditorInitJSFunction()

Generate the Javascript code that initialize the plugin when it will be used inline.

Return Value

string

string outputPageInlineEditor(string $key, string|null $content = null)

Generate the HTML to be placed in a page to display the inline editor.

Parameters

string $key

the name of the field to be used to POST the editor content

string|null $content

The initial value of the editor content

Return Value

string

See also

EditorInterface::outputPageInlineEditor

outputSimpleEditor($key, $content = null)

Outputs a simple, sanitized editor.

Parameters

$key
$content

string outputStandardEditor(string $key, string|null $content = null)

Generate the HTML to be placed in a page to display the editor.

Parameters

string $key

the name of the field to be used to POST the editor content

string|null $content

The initial value of the editor content

Return Value

string

See also

EditorInterface::outputStandardEditor

string outputEditorWithOptions(string $key, array $options = [], string|null $content = null)

Generate the HTML to be placed in a page to display the editor.

Parameters

string $key

the name of the field to be used to POST the editor content

array $options

custom options

string|null $content

The initial value of the editor content

Return Value

string

string outputStandardEditorInitJSFunction()

Generate the standard Javascript code that initialize the plugin.

Return Value

string

saveOptionsForm(Request $request)

Save the plugin options.

Parameters

Request $request

See also

EditorInterface::saveOptionsForm

requireEditorAssets()

Build the list of required assets.

string getStylesJson()

Returns a JSON Encoded string of styles.

Return Value

string

string outputPageComposerEditor(string $key, string $content)

Generate the HTML to be placed in a page to display the editor in composer views.

Parameters

string $key

the name of the field to be used to POST the editor content

string $content

The initial value of the editor content

Return Value

string

See also

EditorInterface::outputPageComposerEditor

string outputBlockEditModeEditor(string $key, string $content)

Generate the HTML to be placed in a page to display the editor when the page is in edito mode.

Parameters

string $key

the name of the field to be used to POST the editor content

string $content

The initial value of the editor content

Return Value

string

See also

EditorInterface::outputBlockEditModeEditor

bool allowFileManager()

Can the editor offer the "browse files" feature?

Return Value

bool

bool allowSitemap()

Can the editor offer the "browse sitemap" feature?

Return Value

bool

setAllowFileManager(bool $allow)

Set if the editor can offer the "browse files" feature.

Parameters

bool $allow

See also

EditorInterface::setAllowFileManager

setAllowSitemap(bool $allow)

Set if the editor can offer the "browse sitemap" feature.

Parameters

bool $allow

See also

EditorInterface::setAllowSitemap

PluginManager getPluginManager()

Get the plugin manager instance.

setToken(string $token)

Set the CSRF token.

Parameters

string $token

setIdentifier(string $identifier)

Set the custom editor identifier.

Parameters

string $identifier

string getIdentifier(bool $autogenerate = true)

Get the editor identifier.

Parameters

bool $autogenerate

When true, will generate a new identifier, when false will use the object's set identifier

Return Value

string

protected string getEditorScript(string $identifier, array $options = [])

Get the HTML code to be used to initialize the editor.

Parameters

string $identifier

the editor identifier

array $options

a list of custom options that override the default one

Return Value

string

protected string|null getLanguageOption()

Get the CKEditor language configuration.

Return Value

string|null

private stdClass getEditorSnippetsAndClasses()

Build an object containing the CKEditor preconfigured snippets and classes.

Return Value

stdClass