You are here

function editor_settings_profiles in Editor 5

Profile settings form.

1 string reference to 'editor_settings_profiles'
editor_menu in ./editor.module
Implementation of hook_menu().

File

./editor.module, line 633
Extendable WYSIWYG editor @author Tj Holowaychuk <tj@vision-media.ca> @link http://vision-media.ca @package Editor

Code

function editor_settings_profiles() {
  $form = array();
  $profile_options = array();
  $profiles = editor_invoke_profiles();
  $plugins = editor_invoke_plugins();
  $plugin_help = theme('editor_plugin_help', $plugins);
  foreach ((array) $profiles as $profile) {
    $profile_options[$profile->prid] = $profile->name;
  }

  // Default profile
  $form['editor_default_profile'] = array(
    '#type' => 'select',
    '#title' => t('Default Profile'),
    '#default_value' => variable_get('editor_default_profile', 'small'),
    '#options' => $profile_options,
  );

  // Profile settings
  foreach ((array) $profiles as $i => $profile) {
    $form[$profile->prid] = array(
      '#type' => 'fieldset',
      '#title' => $profile->name,
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => $profile->description,
    );
    $form[$profile->prid][$profile->prid . '_profile_string'] = array(
      '#type' => 'textarea',
      '#title' => t('Profile Plugins'),
      '#default_value' => $profile->profile_string,
      '#description' => t('Simply add the plugins \'token\' to this string to place it in the editor toolbar. The | character is transformed into a seperator and is simply for organization.'),
    );
    $form[$profile->prid]['tokens'] = array(
      '#type' => 'fieldset',
      '#title' => t('Plugin Tokens'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $form[$profile->prid]['tokens']['help'] = array(
      '#type' => 'markup',
      '#value' => $plugin_help,
    );
  }
  return system_settings_form($form);
}