Drupal 8  8.0.2
Internal Class Reference
Inheritance diagram for Internal:

Public Member Functions

 __construct (array $configuration, $plugin_id, $plugin_definition, CacheBackendInterface $cache_backend)
 
 isInternal ()
 
 getFile ()
 
 getConfig (Editor $editor)
 
 getButtons ()
 
- Public Member Functions inherited from CKEditorPluginBase
 isInternal ()
 
 getDependencies (Editor $editor)
 
 getLibraries (Editor $editor)
 
- Public Member Functions inherited from PluginInspectionInterface
 getPluginId ()
 
 getPluginDefinition ()
 

Static Public Member Functions

static create (ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
 

Protected Member Functions

 generateFormatTagsSetting (Editor $editor)
 
 generateACFSettings (Editor $editor)
 

Protected Attributes

 $cache
 

Detailed Description

Defines the "internal" plugin (i.e. core plugins part of our CKEditor build).

( id = "internal", label = ("CKEditor core") )

Constructor & Destructor Documentation

__construct ( array  $configuration,
  $plugin_id,
  $plugin_definition,
CacheBackendInterface  $cache_backend 
)

Constructs a object.

Parameters
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin_id for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
\Drupal\Core\Cache\CacheBackendInterface$cache_backendThe cache backend.

References Drupal\cache().

Here is the call graph for this function:

Member Function Documentation

static create ( ContainerInterface  $container,
array  $configuration,
  $plugin_id,
  $plugin_definition 
)
static

Creates an instance of the plugin.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container to pull out services used in the plugin.
array$configurationA configuration array containing information about the plugin instance.
string$plugin_idThe plugin ID for the plugin instance.
mixed$plugin_definitionThe plugin implementation definition.
Returns
static Returns an instance of this plugin.

Implements ContainerFactoryPluginInterface.

generateACFSettings ( Editor  $editor)
protected

Builds the ACF part of the CKEditor JS settings.

This ensures that CKEditor obeys the HTML restrictions defined by Drupal's filter system, by enabling CKEditor's Advanced Content Filter (ACF) functionality: http://ckeditor.com/blog/CKEditor-4.1-RC-Released.

See Also
getConfig()
Parameters
\Drupal\editor\Entity\Editor$editorA configured text editor object.
Returns
array An array with two values:
  • the first value is the "allowedContent" setting: a well-formatted array or TRUE. The latter indicates that anything is allowed.
  • the second value is the "disallowedContent" setting: a well-formatted array or FALSE. The latter indicates that nothing is disallowed.

References Editor\getFilterFormat(), Editor\hasAssociatedFilterFormat(), and FilterInterface\TYPE_HTML_RESTRICTOR.

Referenced by Internal\getConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

generateFormatTagsSetting ( Editor  $editor)
protected

Builds the "format_tags" configuration part of the CKEditor JS settings.

See Also
getConfig()
Parameters
\Drupal\editor\Entity\Editor$editorA configured text editor object.
Returns
array An array containing the "format_tags" configuration.

References Drupal\cache(), Editor\getFilterFormat(), Editor\hasAssociatedFilterFormat(), Editor\id(), and Cache\PERMANENT.

Referenced by Internal\getConfig().

Here is the call graph for this function:

Here is the caller graph for this function:

getButtons ( )

{Returns the buttons that this plugin provides, along with metadata.The metadata is used by the CKEditor module to generate a visual CKEditor toolbar builder UI.

Returns
array An array of buttons that are provided by this plugin. This will only be used in the administrative section for assembling the toolbar. Each button should by keyed by its CKEditor button name, and should contain an array of button properties, including:
  • label: A human-readable, translated button name.
  • image: An image for the button to be used in the toolbar.
  • image_rtl: If the image needs to have a right-to-left version, specify an alternative file that will be used in RTL editors.
  • image_alternative: If this button does not render as an image, specify an HTML string representing the contents of this button.
  • image_alternative_rtl: Similar to image_alternative, but a right-to-left version.
  • attributes: An array of HTML attributes which should be added to this button when rendering the button in the administrative section for assembling the toolbar.
  • multiple: Boolean value indicating if this button may be added multiple times to the toolbar. This typically is only applicable for dividers and group indicators.
}

Implements CKEditorPluginButtonsInterface.

References t().

Here is the call graph for this function:

getConfig ( Editor  $editor)

{Returns the additions to CKEDITOR.config for a specific CKEditor instance.The editor's settings can be retrieved via $editor->getSettings(), but be aware that it may not yet contain plugin-specific settings, because the user may not yet have configured the form. If there are plugin-specific settings (verify with isset()), they can be found at

$settings = $editor->getSettings();
$plugin_specific_settings = $settings['plugins'][$plugin_id];
Parameters
\Drupal\editor\Entity\Editor$editorA configured text editor object.
Returns
array A keyed array, whose keys will end up as keys under CKEDITOR.config.
}

Implements CKEditorPluginInterface.

References Internal\generateACFSettings(), Internal\generateFormatTagsSetting(), Editor\getSettings(), and NestedArray\mergeDeepArray().

Here is the call graph for this function:

getFile ( )

{Returns the Drupal root-relative file path to the plugin JavaScript file.Note: this does not use a Drupal library because this uses CKEditor's API, see http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.resourceManager.html#addExternal.

Returns
string|FALSE The Drupal root-relative path to the file, FALSE if an internal plugin.
}

Implements CKEditorPluginInterface.

isInternal ( )

{Indicates if this plugin is part of the optimized CKEditor build.Plugins marked as internal are implicitly loaded as part of CKEditor.

Returns
bool
}

Implements CKEditorPluginInterface.


The documentation for this class was generated from the following file: