1. 8.3.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  2. 8.0.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  3. 8.1.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  4. 8.2.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
  5. 8.4.x core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module

Support module for testing theme suggestions.

File

core/modules/system/tests/modules/theme_suggestions_test/theme_suggestions_test.module
View source
  1. <?php
  2. /**
  3. * @file
  4. * Support module for testing theme suggestions.
  5. */
  6. /**
  7. * Implements hook_theme().
  8. */
  9. function theme_suggestions_test_theme() {
  10. $items['theme_suggestions_test_include'] = array(
  11. 'file' => 'theme_suggestions_test.inc',
  12. 'variables' => array(),
  13. 'function' => 'theme_theme_suggestions_test_include',
  14. );
  15. return $items;
  16. }
  17. /**
  18. * Implements hook_theme_suggestions_alter().
  19. */
  20. function theme_suggestions_test_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
  21. drupal_set_message(__FUNCTION__ . '() executed.');
  22. if ($hook == 'theme_test_general_suggestions') {
  23. $suggestions[] = $hook . '__module_override';
  24. }
  25. }
  26. /**
  27. * Implements hook_theme_suggestions_HOOK_alter().
  28. */
  29. function theme_suggestions_test_theme_suggestions_theme_test_suggestions_alter(array &$suggestions, array $variables) {
  30. drupal_set_message(__FUNCTION__ . '() executed.');
  31. $suggestions[] = 'theme_test_suggestions__' . 'module_override';
  32. }
  33. /**
  34. * Implements hook_theme_suggestions_HOOK_alter().
  35. */
  36. function theme_suggestions_test_theme_suggestions_theme_test_function_suggestions_alter(array &$suggestions, array $variables) {
  37. $suggestions[] = 'theme_test_function_suggestions__' . 'module_override';
  38. }
  39. /**
  40. * Implements hook_theme_suggestions_HOOK_alter().
  41. */
  42. function theme_suggestions_test_theme_suggestions_theme_test_specific_suggestions_alter(array &$suggestions, array $variables) {
  43. $suggestions[] = 'theme_test_specific_suggestions__' . 'variant__foo';
  44. }
  45. /**
  46. * Implements hook_theme_suggestions_HOOK_alter().
  47. */
  48. function theme_suggestions_test_theme_suggestions_theme_test_suggestions_include_alter(array &$suggestions, array $variables, $hook) {
  49. $suggestions[] = 'theme_suggestions_test_include';
  50. }

Functions