commit 6244bc4b82357239fbe88bf711ae4bed8eb3a3f0 Author: Joel Pittet Date: Mon Oct 21 22:00:26 2013 -0700 a bit better diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php index b72354d..fcec672 100644 --- a/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php +++ b/core/modules/system/lib/Drupal/system/Form/ModulesListForm.php @@ -111,26 +111,27 @@ public function buildForm(array $form, array &$form_state) { foreach ($modules as $filename => $module) { if (empty($module->info['hidden'])) { $package = $module->info['package']; - $form['modules'][$package]['_package_table'][$filename] = $this->buildRow($modules, $module, $distribution); + $form['modules'][$package][$filename] = $this->buildRow($modules, $module, $distribution); } } // Add a wrapper around every package. foreach (element_children($form['modules']) as $package) { - $form['modules'][$package] += array( - '#type' => 'details', - '#title' => $this->t($package), - // Ensure that the "Core" package comes first. - '#weight' => $package == 'Core' ? -10 : NULL, - '#attributes' => array('class' => array('package-listing')), - ); - $form['modules'][$package]['_package_table'] += array( + $table = array( '#type' => 'table', '#header' => array( array('data' => '' . $this->t('Installed') . '', 'class' => array('checkbox')), array('data' => $this->t('Name'), 'class' => array('name')), array('data' => $this->t('Description'), 'class' => array('description', RESPONSIVE_PRIORITY_LOW)), ), + ) + $form['modules'][$package]; + $form['modules'][$package] = array( + '#type' => 'details', + '#title' => $this->t($package), + // Ensure that the "Core" package comes first. + '#weight' => $package == 'Core' ? -10 : NULL, + '#attributes' => array('class' => array('package-listing')), + 'table' => $table, ); } @@ -308,7 +309,7 @@ protected function buildRow(array $modules, $module, $distribution) { } // Set id for checkbox here so module label can reference it. - $id = drupal_html_class('edit-modules-' . $module->info['package'] . '-package-table-' . $module->name . '-enable'); + $id = drupal_html_class('edit-modules-' . $module->info['package'] . '-' . $module->name . '-enable'); $row['name']['#markup'] = $module->info['name']; @@ -317,12 +318,12 @@ protected function buildRow(array $modules, $module, $distribution) { 'class' => array('checkbox'), ), '#id' => $id, + '#parents' => array('modules', $module->info['package'], $module->name, 'enable'), ); // Add the module label and expand/collapse functionalty. $row['name'] = array( - // TODO: Should be module id. - '#prefix' => '