function CKEditor::settingsFormSubmit in CKEditor for WYSIWYG Module 8
Implements \Drupal\editor\Plugin\EditorInterface::settingsFormSubmit().
File
- lib/
Drupal/ ckeditor/ Plugin/ editor/ editor/ CKEditor.php, line 90 - Definition of \Drupal\ckeditor\Plugin\editor\editor\CKEditor.
Class
- CKEditor
- Defines a CKEditor-based text editor for Drupal.
Namespace
Drupal\ckeditor\Plugin\editor\editorCode
function settingsFormSubmit(array $form, array &$form_state) {
// Modify the toolbar settings by reference. The values in
// $form_state['values']['editor_settings'] will be saved directly by
// editor_form_filter_admin_format_submit().
$toolbar_settings =& $form_state['values']['editor_settings']['toolbar'];
$toolbar_settings['buttons'] = json_decode($toolbar_settings['buttons'], FALSE);
$format_list = array();
foreach (explode(',', $toolbar_settings['format_list']) as $format) {
$format_list[] = trim($format);
}
$toolbar_settings['format_list'] = $format_list;
$style_list = array();
foreach (explode(',', $toolbar_settings['style_list']) as $style) {
$style_list[] = trim($style);
}
$toolbar_settings['style_list'] = $style_list;
}