public function CKEditor::buildToolbarJSSetting in Drupal 9
Same name and namespace in other branches
- 8 core/modules/ckeditor/src/Plugin/Editor/CKEditor.php \Drupal\ckeditor\Plugin\Editor\CKEditor::buildToolbarJSSetting()
- 10 core/modules/ckeditor/src/Plugin/Editor/CKEditor.php \Drupal\ckeditor\Plugin\Editor\CKEditor::buildToolbarJSSetting()
Builds the "toolbar" configuration part of the CKEditor JS settings.
Parameters
\Drupal\editor\Entity\Editor $editor: A configured text editor object.
Return value
array An array containing the "toolbar" configuration.
See also
getJSSettings()
1 call to CKEditor::buildToolbarJSSetting()
- CKEditor::getJSSettings in core/
modules/ ckeditor/ src/ Plugin/ Editor/ CKEditor.php - Returns JavaScript settings to be attached.
File
- core/
modules/ ckeditor/ src/ Plugin/ Editor/ CKEditor.php, line 435
Class
- CKEditor
- Defines a CKEditor-based text editor for Drupal.
Namespace
Drupal\ckeditor\Plugin\EditorCode
public function buildToolbarJSSetting(Editor $editor) {
$toolbar = [];
$settings = $editor
->getSettings();
foreach ($settings['toolbar']['rows'] as $row) {
foreach ($row as $group) {
$toolbar[] = $group;
}
$toolbar[] = '/';
}
return $toolbar;
}