diff -u b/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php
--- b/core/modules/system/src/Form/ModulesListForm.php
+++ b/core/modules/system/src/Form/ModulesListForm.php
@@ -235,7 +235,7 @@
// Lastly, sort all packages by title.
uasort($form['modules'], array('\Drupal\Component\Utility\SortArray', 'sortByTitleProperty'));
- $form['#attributes']['class'] = array('system-modules', 'system-projects');
+ $form['#attributes']['class'] = ['system-modules', 'system-projects'];
$form['#attached']['library'][] = 'system/drupal.system.modules';
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
diff -u b/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
--- b/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -371,7 +371,7 @@
$groups = array();
$theme_groups = $variables['theme_groups'];
$variables['attributes']['id'] = 'system-themes-page';
- $variables['attributes']['class'] = array('system-themes', 'system-projects');
+ $variables['attributes']['class'] = ['system-themes', 'system-projects'];
$theme_infos = array();
// Build a list of theme names for all known themes
@@ -417,28 +417,24 @@
}
$version = isset($theme->info['version']) ? $theme->info['version'] : '';
- // Add the description, along with any theme it requires.
- $description = '';
- $description .= '
';
- $description .= '
' . t('Machine name: !machine-name', array('!machine-name' => '' . $theme->getName() . '')) . '
';
- if ($version) {
- $description .= '
' . t('Version: !module-version', array('!module-version' => $version)) . '
';
- }
- if (!empty($theme->requires)) {
- $names = array();
- foreach (array_keys($theme->requires) as $key) {
- $names[] = isset($theme_infos[$key]) ? $theme_infos[$key] : $key;
- }
- $description .= '
' . t('Requires: !module-list', array('!module-list' => implode(', ', $names))) . '
';
+
+ $requires = [];
+ foreach (array_keys($theme->requires) as $key) {
+ $requires[$key] = isset($theme_infos[$key]) ? $theme_infos[$key] : $key;
}
- if (!empty($theme->required_by)) {
- $names = array();
- foreach (array_keys($theme->required_by) as $key) {
- $names[] = isset($theme_infos[$key]) ? $theme_infos[$key] : $key;
- }
- $description .= '
' . t('Required by: !module-list', array('!module-list' => implode(', ', $names))) . '
';
+
+ $required_by = [];
+ foreach (array_keys($theme->required_by) as $key) {
+ $required_by[$key] = isset($theme_infos[$key]) ? $theme_infos[$key] : $key;
}
- $description .= '
';
+
+ $description = [
+ '#theme' => 'system_project_details__theme',
+ '#machine_name' => $theme->getName(),
+ '#version' => $version,
+ '#requires' => $requires,
+ '#required_by' => $required_by,
+ ];
// Localize the theme description.
$current_theme['description'] = array(
@@ -492 +487,0 @@
-
only in patch2:
unchanged:
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -217,6 +217,14 @@ function system_theme() {
'variables' => array('menu_items' => NULL),
'file' => 'system.admin.inc',
),
+ 'system_project_details' => [
+ 'variables' => [
+ 'machine_name' => [],
+ 'version' => '',
+ 'requires' => [],
+ 'required_by' => [],
+ ],
+ ],
));
}
only in patch2:
unchanged:
--- /dev/null
+++ b/core/modules/system/templates/system-project-details.html.twig
@@ -0,0 +1,22 @@
+
+{#
+/**
+ * @file
+ * Default theme implementation for the Project details.
+ *
+ * Available variables:
+ * - attributes: HTML attributes for the main container.
+ * - machine_name: The machine name of the project.
+ * - requires: The names of projects required by this project.
+ * - required_by: The projects that are requires this project.
+ *
+ * @ingroup themeable
+ */
+#}
+
+
{{ machine_name }}
+
{{ version }}
+
{{ 'Requires: @extensions'|t({'@extensions': requires|join(', ')}) }}
+
{{ 'Required by: @extensions'|t({'@extensions': required_by|join(', ')}) }}
+
+
only in patch2:
unchanged:
--- /dev/null
+++ b/core/themes/classy/templates/misc/system-project-details.html.twig
@@ -0,0 +1,22 @@
+
+{#
+/**
+ * @file
+ * Theme override for the Project details.
+ *
+ * Available variables:
+ * - attributes: HTML attributes for the main container.
+ * - machine_name: The machine name of the project.
+ * - requires: The names of projects required by this project.
+ * - required_by: The projects that are requires this project.
+ *
+ * @ingroup themeable
+ */
+#}
+
+
{{ machine_name }}
+
{{ version }}
+
{{ 'Requires: @extensions'|t({'@extensions': requires|join(', ')}) }}
+
{{ 'Required by: @extensions'|t({'@extensions': required_by|join(', ')}) }}
+
+