You are here

function editor_get_editors in Editor 7

Returns a list of text editors that are used with 'text_format' elements.

Return value

array An associative array of editors keyed by the internal name of the editor. Each editor may contain the following elements (all are optional except as noted):

  • title: (required) A human readable name for the editor.
  • settings callback: The name of a function that returns configuration form elements for the editor. See hook_editor_EDITOR_settings() for details.
  • default settings: An associative array containing default settings for the editor, to be applied when the editor has not been configured yet.
  • js settings callback: The name of a function that returns configuration options that should be added to the page via JavaScript for use on the client side. See hook_editor_EDITOR_js_settings() for details.

See also

filter_example.module

hook_filter_info()

hook_filter_info_alter()

5 calls to editor_get_editors()
editor_admin_format_editor_submit in includes/editor.admin.inc
Element submission handler for configuring an editor.
editor_form_filter_admin_format_form_alter in includes/editor.admin.inc
Implements hook_form_FORM_ID_alter().
editor_form_filter_admin_overview_alter in includes/editor.filter.inc
Implements hook_form_FORM_ID_alter().
editor_get_js_settings in ./editor.module
Retrieve JavaScript settings that should be added by each filter.
editor_load in ./editor.module
Loads an individual editor's information.

File

./editor.module, line 678
Allows rich text fields to be edited using WYSIWYG client-side editors.

Code

function editor_get_editors() {
  $editors =& drupal_static(__FUNCTION__, NULL);
  if (!isset($editors)) {
    $editors = array();
    $modules = module_implements('editor_info');
    foreach ($modules as $module) {
      $module_editors = module_invoke($module, 'editor_info');
      foreach ($module_editors as $editor_name => $editor) {
        $editor['module'] = $module;
        $editors[$editor_name] = $editor;
      }
    }
    drupal_alter('editor_info', $editors);
  }
  return $editors;
}