You are here

function editor_theme_registry_alter in Editor 7

Implements hook_theme_registry_alter().

File

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

Code

function editor_theme_registry_alter(&$theme_registry) {

  // Drop textarea.js in favor of CSS3 resize.
  // @see https://www.drupal.org/node/1465840
  if (isset($theme_registry['textarea'])) {
    $path = drupal_get_path('module', 'editor');
    $theme_registry['textarea']['file'] = 'editor.theme.inc';
    $theme_registry['textarea']['theme path'] = $path . '/includes';
    $theme_registry['textarea']['function'] = 'editor_textarea';
    $theme_registry['textarea']['includes'][] = $theme_registry['textarea']['theme path'] . '/' . $theme_registry['textarea']['file'];
  }

  // Add an 'editor' column to the text format overview form.
  if (isset($theme_registry['filter_admin_overview'])) {
    $path = drupal_get_path('module', 'editor');
    $theme_registry['filter_admin_overview']['file'] = 'editor.theme.inc';
    $theme_registry['filter_admin_overview']['theme path'] = $path . '/includes';
    $theme_registry['filter_admin_overview']['function'] = 'editor_admin_overview';

    // Locate the default filter.module include.
    $filter_include = array_search('modules/filter/filter.admin.inc', $theme_registry['filter_admin_overview']['includes']);

    // Replace it with the editor.module include.
    array_splice($theme_registry['filter_admin_overview']['includes'], $filter_include, 1, $theme_registry['filter_admin_overview']['theme path'] . '/' . $theme_registry['filter_admin_overview']['file']);
  }
}