You are here

at_tools.module in AT Tools 8

Same filename and directory in other branches
  1. 8.3 at_tools.module
  2. 8.2 at_tools.module
  3. 7 at_tools.module

Contains at_tools.module

File

at_tools.module
View source
<?php

/**
 * @file
 * Contains at_tools.module
 */
use Drupal\Component\Utility\Html;

/**
 * Prepares variables for appearance page templates.
 *
 * Default template: system-themes-page.html.twig.
 *
 * @param $variables
 *   An associative array containing:
 *   - theme_groups: An associative array containing groups of themes.
 *   - theme_group_titles: An associative array containing titles of themes.
 */
function at_tools_preprocess_system_themes_page(&$variables) {
  $variables['#attached']['library'][] = 'at_tools/appearance_settings';
  $theme_groups = $variables['theme_groups'];
  foreach ($theme_groups as $group_key => $theme_group) {
    foreach ($theme_group['themes'] as $theme_key => $theme) {
      foreach ($theme as $t => $theme_values) {

        // Add a class to each "theme-selector" wrapper.
        $variables['theme_groups'][$group_key]['themes'][$theme_key]['attributes']
          ->addClass(Html::cleanCssIdentifier(strtolower($theme['name'])));
      }
    }
  }
}

Functions

Namesort descending Description
at_tools_preprocess_system_themes_page Prepares variables for appearance page templates.