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 @@ -181,10 +181,10 @@ * projects. Each project (or module) is an associative array containing the * following elements: * - name: The name of the module. + * - enable: A checkbox for enabling the module. * - description: (optional) A description of the module. * - version: (optional) The version of the module. * - links: (optional) Administration links provided by the module. - * - enable: A checkbox for enabling the module. * - #requires: (optional) A list of modules that the project requires. * - #required_by: (optional) A list of modules that require the project. */ @@ -194,7 +194,7 @@ $header = array( 'installed' => $form['#header'][0]['data'], 'name' => $form['#header'][1]['data'], - 'description' => $form['#header'][1]['data'], + 'description' => $form['#header'][2]['data'], ); $modules = array(); @@ -212,30 +212,19 @@ // Add the module label and expand/collapse functionality. $id = Html::getUniqueId('module-' . $key); - $label = [ - '#type' => 'inline_template', - '#template' => '', - '#context' => [ - 'id' => $id, - 'enable_id' => $module['enable']['#id'], - 'module_name' => $module['name'], - ], - ]; - $item['name'] = $label; + $item['id'] = $id; + $item['enable_id'] = $module['enable']['#id']; + $item['name'] = $module['name']; + + // Build out the description content for the module details. + $item['description'] = $module['description']; - $description = ''; - // Begin building out the description content for the module details. $renderer = \Drupal::service('renderer'); - $machine_name_render = [ - '#prefix' => '', - '#plain_text' => $key, - '#suffix' => '', - ]; - $description .= t('Machine name: @machine-name', array('@machine-name' => $renderer->render($machine_name_render))); + $item['machine_name'] = $renderer->render($machine_name_render); $version = !empty($module['version']['#markup']); if ($version) { - $description .= '
' . t('Version: @module-version', array('@module-version' => $renderer->render($module['version']))) . '
'; + $item['version'] = t('Version: @module-version', array('@module-version' => $renderer->render($module['version']))); } $module['#requires'] = array_filter($module['#requires']); @@ -250,7 +239,7 @@ '#items' => $module['#requires'], '#context' => ['list_style' => 'comma-list'], ]; - $description .= '
' . t('Requires: @module-list', array('@module-list' => $renderer->render($requires))) . '
'; + $item['requires'] = t('Requires: @module-list', array('@module-list' => $renderer->render($requires))); } if ($required_by) { $required_by = [ @@ -258,30 +247,16 @@ '#items' => $module['#required_by'], '#context' => ['list_style' => 'comma-list'], ]; - $description .= '
' . t('Required by: @module-list', array('@module-list' => $renderer->render($required_by))) . '
'; + $item['required_by'] = t('Required by: @module-list', array('@module-list' => $renderer->render($required_by))); } - $description .= ''; - $links = ''; + + $links = []; foreach (array('help', 'permissions', 'configure') as $link_type) { - $links .= drupal_render($module['links'][$link_type]); + $links[] = $module['links'][$link_type]; } if ($links) { - $description .= ' '; + $item['links'] = $links; } - $title = [ - '#type' => 'inline_template', - '#template' => '{{ module_description }}', - '#context' => ['module_description' => $module['description']], - ]; - $details = array( - '#type' => 'details', - '#title' => $title, - '#attributes' => array('id' => $module['enable']['#id'] . '-description'), - '#description' => $description, - ); - $item['details'] = $details; $item['attributes'] = new Attribute($module['#attributes']); $modules[] = $item; diff -u b/core/modules/system/templates/system-modules-details.html.twig b/core/modules/system/templates/system-modules-details.html.twig --- b/core/modules/system/templates/system-modules-details.html.twig +++ b/core/modules/system/templates/system-modules-details.html.twig @@ -13,8 +13,15 @@ * - modules: Contains multiple module instances. Each module contains: * - attributes: Attributes on the row. * - checkbox: A checkbox for enabling the module. - * - name: The name of the module. - * - details: Other details about the module. + * - name: The human-readable name of the module. + * - id: A unqiue id for interacting with the details element. + * - enable_id: A unique id for interacting with the checkbox element. + * - description: The description of the module. + * - machine_name: The module's machine name. + * - version: (optional) Information about the module version. + * - requires: (optional) A list of modules that this module requires. + * - required_by: (optional) A list of modules that require this module. + * - links: (optional) A list of administration links provided by the module. * * @see template_preprocess_system_modules_details() * @@ -46,9 +53,32 @@ - {{- module.name -}} + - {{ module.details }} +
+ + {{ module.description }} + +
+
+
Machine name: {{ module.machine_name }}
+
{{ module.version }}
+ {% if module.requires %} +
{{ module.requires }}
+ {% endif %} + {% if module.required_by %} +
{{ module.required_by }}
+ {% endif %} + {% if module.links %} + + {% endif %} +
+
+
{% endfor %} - \ No newline at end of file +