2008-11-25 02:37:33 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
2015-04-15 09:02:19 +00:00
|
|
|
* Hooks provided by the System module.
|
2008-11-25 02:37:33 +00:00
|
|
|
*/
|
|
|
|
|
2014-09-29 13:41:29 +00:00
|
|
|
use Drupal\Core\Url;
|
2012-05-12 03:10:23 +00:00
|
|
|
|
2008-11-25 02:37:33 +00:00
|
|
|
/**
|
|
|
|
* @addtogroup hooks
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2009-12-01 00:39:35 +00:00
|
|
|
/**
|
|
|
|
* 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) {
|
2010-09-28 02:30:32 +00:00
|
|
|
foreach ($theme_groups[$state] as &$theme) {
|
2009-12-01 00:39:35 +00:00
|
|
|
// Add a foo link to each list of theme operations.
|
2017-03-04 01:20:24 +00:00
|
|
|
$theme->operations[] = [
|
2011-05-28 13:27:33 +00:00
|
|
|
'title' => t('Foo'),
|
2014-10-09 06:39:37 +00:00
|
|
|
'url' => Url::fromRoute('system.themes_page'),
|
2018-05-11 09:40:33 +00:00
|
|
|
'query' => ['theme' => $theme->getName()],
|
2017-03-04 01:20:24 +00:00
|
|
|
];
|
2009-12-01 00:39:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-25 02:37:33 +00:00
|
|
|
/**
|
|
|
|
* @} End of "addtogroup hooks".
|
|
|
|
*/
|