Drupal investigation

system.api.php 719B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Hooks provided by the System module.
  5. */
  6. use Drupal\Core\Url;
  7. /**
  8. * @addtogroup hooks
  9. * @{
  10. */
  11. /**
  12. * Alters theme operation links.
  13. *
  14. * @param $theme_groups
  15. * An associative array containing groups of themes.
  16. *
  17. * @see system_themes_page()
  18. */
  19. function hook_system_themes_page_alter(&$theme_groups) {
  20. foreach ($theme_groups as $state => &$group) {
  21. foreach ($theme_groups[$state] as &$theme) {
  22. // Add a foo link to each list of theme operations.
  23. $theme->operations[] = [
  24. 'title' => t('Foo'),
  25. 'url' => Url::fromRoute('system.themes_page'),
  26. 'query' => ['theme' => $theme->getName()]
  27. ];
  28. }
  29. }
  30. }
  31. /**
  32. * @} End of "addtogroup hooks".
  33. */