You are here

function tinymce_settings_form in TinyMCE 7

Editor settings callback; Provide options for TinyMCE module.

1 call to tinymce_settings_form()
tinymce_form_wysiwyg_profile_form_alter in includes/tinymce.wysiwyg.inc
Implements hook_form_FORM_ID_alter().
1 string reference to 'tinymce_settings_form'
tinymce_editor_info in ./tinymce.module
Implements hook_editor_info().

File

./tinymce.module, line 508

Code

function tinymce_settings_form(&$form, $form_state, $editor, $format) {
  $module_path = drupal_get_path('module', 'tinymce');
  $plugins = tinymce_plugins();
  $elements['toolbar'] = array(
    '#type' => 'fieldset',
    '#title' => t('Toolbar'),
    '#parents' => array(
      'editor_settings',
    ),
    '#attached' => array(
      'library' => array(
        array(
          'tinymce',
          'drupal.tinymce.admin',
        ),
      ),
      'js' => array(
        array(
          'data' => array(
            'tinymce' => array(
              'toolbarAdmin' => theme('tinymce_settings_toolbar', array(
                'editor' => $editor,
                'plugins' => $plugins,
              )),
            ),
          ),
          'type' => 'setting',
        ),
      ),
    ),
    '#attributes' => array(
      'class' => array(
        'tinymce-toolbar-configuration',
      ),
    ),
  );
  $elements['toolbar']['toolbar'] = array(
    '#type' => 'textarea',
    '#title' => t('Toolbar configuration'),
    '#default_value' => json_encode($editor->settings['toolbar']),
    '#attributes' => array(
      'class' => array(
        'tinymce-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'], 'tinymce_settings_form_submit');
  return $elements;
}