summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/system/system.api.php
blob: 7f259f27d5ec33f89cd5142e711fbd64a785249c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

/**
 * @file
 * Hooks provided by the System module.
 */

use Drupal\Core\Url;

/**
 * @addtogroup hooks
 * @{
 */

/**
 * Alters theme operation links.
 *
 * @param array $theme_groups
 *   An associative array containing groups of themes.
 *
 * @see system_themes_page()
 */
function hook_system_themes_page_alter(&$theme_groups) {
  foreach ($theme_groups as $state => &$group) {
    foreach ($theme_groups[$state] as &$theme) {
      // Add a foo link to each list of theme operations.
      $theme->operations[] = [
        'title' => t('Foo'),
        'url' => Url::fromRoute('system.themes_page'),
        'query' => ['theme' => $theme->getName()],
      ];
    }
  }
}

/**
 * @} End of "addtogroup hooks".
 */