function admin_toolbar_tools_installed_themes in Admin Toolbar 8
Return installed themes.
Return value
array An array of friendly theme names, keyed by the machine name.
1 call to admin_toolbar_tools_installed_themes()
- admin_toolbar_tools_menu_links_discovered_alter in admin_toolbar_tools/
admin_toolbar_tools.module - Implements hook_menu_links_discovered_alter().
File
- admin_toolbar_tools/
admin_toolbar_tools.module, line 690 - Provides extra menu links for the core drupal toolbar.
Code
function admin_toolbar_tools_installed_themes() {
$themeHandler = \Drupal::service('theme_handler');
$all_themes = $themeHandler
->listInfo();
$themes_installed = [];
foreach ($all_themes as $key_theme => $theme) {
if ($themeHandler
->hasUi($key_theme)) {
$themes_installed[$key_theme] = $themeHandler
->getName($key_theme);
}
}
return $themes_installed;
}