Helper module for the Text Editor tests.
<?php
/**
* @file
* Helper module for the Text Editor tests.
*/
/**
* Implements hook_editor_default_settings().
*/
function editor_test_editor_default_settings($editor) {
if ($editor === 'unicorn') {
return array(
'rainbows' => TRUE,
'sparkles' => TRUE,
);
}
}
/**
* Implements hook_editor_default_settings_alter().
*/
function editor_test_editor_default_settings_alter(&$settings, $editor) {
if ($editor === 'unicorn' && isset($settings['sparkles'])) {
$settings['sparkles'] = FALSE;
}
}
/**
* Implements hook_editor_js_settings_alter().
*/
function editor_test_editor_js_settings_alter(&$settings) {
// Allow tests to enable or disable this alter hook.
if (!Drupal::state()
->get('editor_test_js_settings_alter_enabled', FALSE)) {
return;
}
if (isset($settings['full_html'])) {
$settings['full_html']['editorSettings']['ponyModeEnabled'] = FALSE;
}
}
Name | Description |
---|---|
editor_test_editor_default_settings | Implements hook_editor_default_settings(). |
editor_test_editor_default_settings_alter | Implements hook_editor_default_settings_alter(). |
editor_test_editor_js_settings_alter | Implements hook_editor_js_settings_alter(). |