1 ckeditor.admin.inc | ckeditor_settings_form_validate($form, &$form_state) |
Additional validate handler for filter_admin_format_form().
File
- core/
modules/ ckeditor/ ckeditor.admin.inc, line 81 - Admin page callbacks for the CKEditor 4 module.
Code
function ckeditor_settings_form_validate($form, &$form_state) {
$settings = $form_state['values']['editor_settings'];
$toolbar_string = $settings['toolbar'];
$result = json_decode($toolbar_string, TRUE);
if (empty($result)) {
form_error($form['editor_settings']['toolbar'], t('The CKEditor 4 toolbar configuration could not be saved.'));
}
$styles = _ckeditor_settings_parse_style_list($settings['plugins']['style']['style_list']);
foreach ($styles as $style) {
if (empty($style['name']) || empty($style['element']) || empty($style['attributes']['class'])) {
form_error($form['editor_settings']['plugins']['style']['style_list'], t('The CKEditor 4 list of styles is not formatted properly. Be sure to include one style per line, with the format "element.class|Label".'));
}
}
}