You are here

function ckeditor_settings_form in CKEditor for WYSIWYG Module 7

Editor settings callback; Provide options for CKEditor module.

1 call to ckeditor_settings_form()
ckeditor_form_wysiwyg_profile_form_alter in includes/ckeditor.wysiwyg.inc
Implements hook_form_FORM_ID_alter().
1 string reference to 'ckeditor_settings_form'
ckeditor_editor_info in ./ckeditor.module
Implements hook_editor_info().

File

includes/ckeditor.admin.inc, line 9

Code

function ckeditor_settings_form(&$form, $form_state, $editor, $format) {
  form_load_include($form_state, 'inc', 'ckeditor', 'includes/ckeditor.admin');
  $plugins = ckeditor_plugins();
  $elements['toolbar'] = array(
    '#type' => 'fieldset',
    '#title' => t('Toolbar'),
    '#parents' => array(
      'editor_settings',
    ),
    '#attached' => array(
      'library' => array(
        array(
          'ckeditor',
          'drupal.ckeditor.admin',
        ),
      ),
      'js' => array(
        array(
          'data' => array(
            'ckeditor' => array(
              'toolbarAdmin' => theme('ckeditor_settings_toolbar', array(
                'editor' => $editor,
                'plugins' => $plugins,
              )),
            ),
          ),
          'type' => 'setting',
        ),
      ),
    ),
    '#attributes' => array(
      'class' => array(
        'ckeditor-toolbar-configuration',
      ),
    ),
  );
  $elements['toolbar']['toolbar'] = array(
    '#type' => 'textarea',
    '#title' => t('Toolbar configuration'),
    '#default_value' => json_encode($editor->settings['toolbar']),
    '#attributes' => array(
      'class' => array(
        'ckeditor-toolbar-textarea',
      ),
    ),
  );
  $elements['toolbar']['format_list'] = array(
    '#type' => 'textfield',
    '#title' => t('Format list'),
    '#default_value' => implode(', ', $editor->settings['format_list']),
    '#description' => t('A list of tags that will be provided in the "Format" dropdown, separated by commas.'),
  );
  $elements['toolbar']['style_list'] = array(
    '#type' => 'textarea',
    '#title' => t('Style list'),
    '#rows' => 4,
    '#default_value' => implode("\n", $editor->settings['style_list']),
    '#description' => t('A list of classes that will be provided in the "Styles" dropdown, each on a separate line. These styles should be available in your theme\'s editor.css as well as in your theme\'s main CSS file.'),
  );
  array_unshift($form['#submit'], 'ckeditor_settings_form_submit');
  return $elements;
}