diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index a38a2f2..feec92e 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -477,7 +477,7 @@ function theme_system_modules_uninstall($variables) { } /** - * Prepares variables for the appearance page template. + * Prepares variables for appearance page templates. * * Default template: system-themes-page.html.twig. * @@ -519,7 +519,7 @@ function template_preprocess_system_themes_page(&$variables) { ); } else { - $current_theme['screenshot'] = '
' . t('no screenshot') . '
'; + $current_theme['screenshot'] = array(); } // Localize the theme description. @@ -531,33 +531,34 @@ function template_preprocess_system_themes_page(&$variables) { $current_theme['attributes'] = new Attribute(array('class' => $theme->classes)); $current_theme['name'] = $theme->info['name']; $current_theme['version'] = isset($theme->info['version']) ? $theme->info['version'] : ''; - $current_theme['notes'] = count($theme->notes) ? '(' . join(', ', $theme->notes) . ')' : ''; + $current_theme['notes'] = $theme->notes; // Make sure to provide feedback on compatibility. + $current_theme['incompatible'] = ''; if (!empty($theme->incompatible_core)) { - $current_theme['compatibility'] = t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => \Drupal::CORE_COMPATIBILITY)); + $current_theme['incompatible'] = t('This version is not compatible with Drupal !core_version and should be replaced.', array('!core_version' => \Drupal::CORE_COMPATIBILITY)); } elseif (!empty($theme->incompatible_php)) { if (substr_count($theme->info['php'], '.') < 2) { $theme->info['php'] .= '.*'; } - $current_theme['compatibility'] = t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())); + $current_theme['incompatible'] = t('This theme requires PHP version @php_required and is incompatible with PHP version !php_version.', array('@php_required' => $theme->info['php'], '!php_version' => phpversion())); } elseif (!empty($theme->incompatible_base)) { - $current_theme['compatibility'] = t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => $theme->info['base theme'])); + $current_theme['incompatible'] = t('This theme requires the base theme @base_theme to operate correctly.', array('@base_theme' => $theme->info['base theme'])); } elseif (!empty($theme->incompatible_engine)) { - $current_theme['compatibility'] = t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])); - } - else { - $current_theme['compatibility'] = array( - '#theme' => 'links', - '#links' => $theme->operations, - '#attributes' => array( - 'class' => array('operations', 'clearfix'), - ), - ); + $current_theme['incompatible'] = t('This theme requires the theme engine @theme_engine to operate correctly.', array('@theme_engine' => $theme->info['engine'])); } + + // Build operation links. + $current_theme['operations'] = array( + '#theme' => 'links', + '#links' => $theme->operations, + '#attributes' => array( + 'class' => array('operations', 'clearfix'), + ), + ); $theme_group['themes'][] = $current_theme; } $groups[] = $theme_group; diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 1aba032..c9250f4 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -156,7 +156,6 @@ function system_theme() { 'variables' => array( 'theme_groups' => array(), 'theme_group_titles' => array(), - 'admin_theme_options' => array(), ), 'file' => 'system.admin.inc', 'template' => 'system-themes-page', diff --git a/core/modules/system/templates/system-themes-page.html.twig b/core/modules/system/templates/system-themes-page.html.twig index 185e94e..234610e 100644 --- a/core/modules/system/templates/system-themes-page.html.twig +++ b/core/modules/system/templates/system-themes-page.html.twig @@ -4,29 +4,22 @@ * Default theme implementation for the Appearance page. * * Available variables: - * - attributes: HTML element attributes. - * - theme_groups: A list of theme groups. - * - * Each theme_groups[group] contains a list of theme groups. - * - * Each group in theme_groups[group] contains: - * - attributes: Element attributes specific to this group. - * - title: Title for the theme group. - * - state: State of the theme group. - * - themes: A list of themes within that group. - * - * Each group.themes[theme] contains a a list of themes. - * - * Each theme in group.themes[theme] contains: - * - attributes: Element attributes specific to this theme. - * - screenshot: Render of theme screenshot. - * - description: Description of the theme. - * - name: Name of theme. - * - version: Verions number of theme. - * - notes: Identifies what context this theme is being used. - * eg. (default theme, admin theme) - * - compatibility: Description of any incompatibility issues, - * if the theme is compatible, provides a list of links. + * - attributes: HTML attributes for the main container. + * - theme_groups: A list of theme groups. Each theme group contains: + * - attributes: HTML attributes specific to this theme group. + * - title: Title for the theme group. + * - state: State of the theme group, e.g. enabled or disabled. + * - themes: A list of themes within the theme group. Each theme contains: + * - attributes: HTML attributes specific to this theme. + * - screenshot: A screenshot representing the theme. + * - description: Description of the theme. + * - name: Theme name. + * - version: The theme's version number. + * - notes: Identifies what context this theme is being used in, e.g., + * default theme, admin theme. + * - incompatible: Text describing any compatibility issues. + * - operations: A list of operation links, e.g., Settings, Enable, Disable, + * etc. these links should only be displayed if the theme is compatible. * * @see template_preprocess_system_themes_page() * @@ -47,9 +40,19 @@ {% endif %}
-

{{ theme.name }} {{ theme.version }} {{ theme.notes }}

+

+ {{- theme.name }} {{ theme.version -}} + {% if theme.notes %} + ({{ theme.notes|join(', ') }}) + {%- endif -%} +

{{ theme.description }}
- {{ theme.compatibility }} + {# Display operation links if the theme is compatible. #} + {% if not theme.incompatible %} + {{ theme.operations }} + {% else %} +
{{ theme.incompatible }}
+ {% endif %}
{% endfor %}