Newer
Older
Angie Byron
committed
<?php
/**
* @file
Alex Pott
committed
* Hooks provided by the System module.
Angie Byron
committed
*/
use Drupal\Core\Url;
Angie Byron
committed
/**
* @addtogroup hooks
* @{
*/
Dries Buytaert
committed
/**
* Alters theme operation links.
*
* @param $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) {
Dries Buytaert
committed
foreach ($theme_groups[$state] as &$theme) {
Dries Buytaert
committed
// Add a foo link to each list of theme operations.
$theme->operations[] = [
Dries Buytaert
committed
'title' => t('Foo'),
'url' => Url::fromRoute('system.themes_page'),
'query' => ['theme' => $theme->getName()]
];
Dries Buytaert
committed
}
}
}
Angie Byron
committed
/**
* @} End of "addtogroup hooks".
*/