class ListStylePlugin in CKEditor List Style 8
Defines the "List Style" plugin.
Plugin annotation
@CKEditorPlugin(
id = "liststyle",
label = @Translation("List Style")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\ckeditor_liststyle\Plugin\CKEditorPlugin\ListStylePlugin implements CKEditorPluginContextualInterface, CKEditorPluginInterface
Expanded class hierarchy of ListStylePlugin
File
- src/
Plugin/ CKEditorPlugin/ ListStylePlugin.php, line 18
Namespace
Drupal\ckeditor_liststyle\Plugin\CKEditorPluginView source
class ListStylePlugin extends PluginBase implements CKEditorPluginInterface, CKEditorPluginContextualInterface {
/**
* {@inheritdoc}
*/
public function getButtons() {
return [];
}
/**
* {@inheritdoc}
*/
public function isEnabled(Editor $editor) {
$enabled = FALSE;
$settings = $editor
->getSettings();
foreach ($settings['toolbar']['rows'] as $row) {
foreach ($row as $group) {
foreach ($group['items'] as $button) {
if ($button === 'BulletedList' || $button === 'NumberedList') {
$enabled = TRUE;
}
}
}
}
return $enabled;
}
/**
* {@inheritdoc}
*/
public function isInternal() {
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getDependencies(Editor $editor) {
return [];
}
/**
* {@inheritdoc}
*/
public function getLibraries(Editor $editor) {
return [];
}
/**
* {@inheritdoc}
*/
public function getFile() {
$plugin_paths = [
'libraries/liststyle/plugin.js',
'libraries/ckeditor/plugins/liststyle/plugin.js',
'libraries/ckeditor_liststyle/plugin.js',
];
$plugin = FALSE;
foreach ($plugin_paths as $plugin_path) {
if (file_exists(DRUPAL_ROOT . '/' . $plugin_path)) {
$plugin = $plugin_path;
break;
}
}
return $plugin;
}
/**
* {@inheritdoc}
*/
public function getConfig(Editor $editor) {
return [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ListStylePlugin:: |
public | function | ||
ListStylePlugin:: |
public | function |
Returns the additions to CKEDITOR.config for a specific CKEditor instance. Overrides CKEditorPluginInterface:: |
|
ListStylePlugin:: |
public | function |
Returns a list of plugins this plugin requires. Overrides CKEditorPluginInterface:: |
|
ListStylePlugin:: |
public | function |
Returns the Drupal root-relative file path to the plugin JavaScript file. Overrides CKEditorPluginInterface:: |
|
ListStylePlugin:: |
public | function |
Returns a list of libraries this plugin requires. Overrides CKEditorPluginInterface:: |
|
ListStylePlugin:: |
public | function |
Checks if this plugin should be enabled based on the editor configuration. Overrides CKEditorPluginContextualInterface:: |
|
ListStylePlugin:: |
public | function |
Indicates if this plugin is part of the optimized CKEditor build. Overrides CKEditorPluginInterface:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 92 |