media_test_ckeditor.module
Helper module for the Media Embed CKEditor plugin tests.
File
-
core/
modules/ media/ tests/ modules/ media_test_ckeditor/ media_test_ckeditor.module
View source
<?php
/**
* @file
* Helper module for the Media Embed CKEditor plugin tests.
*/
use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
use Drupal\Core\Entity\EntityInterface;
/**
* Implements hook_entity_view_alter().
*/
function media_test_ckeditor_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
// @see \Drupal\Tests\media\FunctionalJavascript\CKEditorIntegrationTest::testPreviewUsesDefaultThemeAndIsClientCacheable()
$build['#attributes']['data-media-embed-test-active-theme'] = \Drupal::theme()->getActiveTheme()
->getName();
}
/**
* Implements hook_preprocess_HOOK().
*/
function media_test_ckeditor_preprocess_media_embed_error(&$variables) {
$variables['attributes']['class'][] = 'this-error-message-is-themeable';
}
Functions
Title | Deprecated | Summary |
---|---|---|
media_test_ckeditor_entity_view_alter | Implements hook_entity_view_alter(). | |
media_test_ckeditor_preprocess_media_embed_error | Implements hook_preprocess_HOOK(). |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.