commit de93ac67e41c83ba44d7fda09a88faf6f2d3eda7 Author: Joel Pittet Date: Mon Oct 5 11:39:54 2015 -0700 clean-up diff --git a/core/modules/system/src/Form/ModulesListForm.php b/core/modules/system/src/Form/ModulesListForm.php index c1474de..e86ba0a 100644 --- a/core/modules/system/src/Form/ModulesListForm.php +++ b/core/modules/system/src/Form/ModulesListForm.php @@ -170,11 +170,6 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#title' => $this->t($package), '#open' => TRUE, '#theme' => 'system_modules_details', - '#header' => array( - array('data' => $this->t('Installed'), 'class' => array('checkbox', 'visually-hidden')), - array('data' => $this->t('Name'), 'class' => array('name', 'visually-hidden')), - array('data' => $this->t('Description'), 'class' => array('description', 'visually-hidden', RESPONSIVE_PRIORITY_LOW)), - ), '#attributes' => array('class' => array('package-listing')), // Ensure that the "Core" package comes first. '#weight' => $package == 'Core' ? -10 : NULL, diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 7051e1e..1472109 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -193,11 +193,6 @@ function template_preprocess_status_report(&$variables) { */ function template_preprocess_system_modules_details(&$variables) { $form = $variables['form']; - $variables['header'] = [ - 'installed' => $form['#header'][0]['data'], - 'name' => $form['#header'][1]['data'], - 'description' => $form['#header'][2]['data'], - ]; $variables['modules'] = []; // Iterate through all the modules, which are children of this element. @@ -215,11 +210,7 @@ function template_preprocess_system_modules_details(&$variables) { $id = Html::getUniqueId('module-' . $key); $module['id'] = $id; $module['enable_id'] = $module['enable']['#id']; - $module['machine_name'] = [ - '#prefix' => '', - '#plain_text' => $key, - '#suffix' => '', - ]; + $module['machine_name'] = $key; // @todo Remove early rendering and use safe_join in the Twig template once // https://www.drupal.org/node/2579091 is fixed. @@ -230,7 +221,7 @@ function template_preprocess_system_modules_details(&$variables) { '#items' => $module['#requires'], '#context' => ['list_style' => 'comma-list'], ]; - $module['requires'] = t('Requires: @module-list', array('@module-list' => $renderer->render($requires))); + $module['requires'] = $renderer->render($requires); } if (!empty($module['#required_by'])) { $required_by = [ @@ -238,16 +229,12 @@ function template_preprocess_system_modules_details(&$variables) { '#items' => $module['#required_by'], '#context' => ['list_style' => 'comma-list'], ]; - $module['required_by'] = t('Required by: @module-list', array('@module-list' => $renderer->render($required_by))); + $module['required_by'] = $renderer->render($required_by); } - $links = []; - foreach (['help', 'permissions', 'configure'] as $link_type) { - if (isset($module['links'][$link_type])) { - $links[] = $module['links'][$link_type]; - } + if (!empty($module['version'])) { + $module['version'] = $renderer->render($module['version']); } - $module['links'] = $links; $module['attributes'] = new Attribute($module['#attributes']); $variables['modules'][] = $module; diff --git a/core/modules/system/templates/system-modules-details.html.twig b/core/modules/system/templates/system-modules-details.html.twig index 8c0efe7..c91ca37 100644 --- a/core/modules/system/templates/system-modules-details.html.twig +++ b/core/modules/system/templates/system-modules-details.html.twig @@ -6,10 +6,6 @@ * Displays a list of all packages in a project. * * Available variables: - * - header: Table header containing the following cells: - * - installed: A localized string for the title of the Installed column. - * - name: A localized string for the title of the Name column. - * - description: A localized string for the title of the Description column. * - modules: Contains multiple module instances. Each module contains: * - attributes: Attributes on the row. * - checkbox: A checkbox for enabling the module. @@ -31,15 +27,9 @@ - - - + + + @@ -58,21 +48,21 @@
-
{{ 'Machine name: @machine-name'|t({'@machine-name': module.machine_name|render}) }}
+
{{ 'Machine name: @machine-name'|t({'@machine-name': module.machine_name }) }}
{% if module.version %} -
{{ 'Version: @module-version'|t({'@module-version': module.version|render}) }}
+
{{ 'Version: @module-version'|t({'@module-version': module.version }) }}
{% endif %} {% if module.requires %} -
{{ module.requires }}
+
{{ 'Requires: @module-list'|t({'@module-version': module.requires }) }}
{% endif %} {% if module.required_by %} -
{{ module.required_by }}
+
{{ 'Required by: @module-list'|t({'@module-version': module.required_by }) }}
{% endif %}
{% if module.links %} {% endif %}
- {{- header.installed -}} - - {{- header.name -}} - - {{- header.description -}} - {{ 'Installed'|t }}{{ 'Name'|t }}{{ 'Description'|t }}