template_preprocess_system_modules_uninstall(&$variables)
Prepares variables for module uninstall templates.
Default template: system-modules-uninstall.html.twig.
$variables: An associative array containing:
function template_preprocess_system_modules_uninstall(&$variables) { $form = $variables['form']; $variables['modules'] = []; // Iterate through all the modules, which are children of this element. foreach (Element::children($form['modules']) as $key) { $module = $form['modules'][$key]; $module['module_name'] = $module['#module_name']; $module['checkbox'] = $form['uninstall'][$key]; $module['checkbox_id'] = $form['uninstall'][$key]['#id']; if (!empty($module['#validation_reasons'])) { $module['validation_reasons'] = $module['#validation_reasons']; $module['reasons_count'] = count($module['validation_reasons']); } else { $module['reasons_count'] = 0; } if (!empty($module['#required_by'])) { $module['required_by'] = $module['#required_by']; $module['reasons_count'] = $module['reasons_count'] + 1; } $module['attributes'] = new Attribute($module['#attributes']); $variables['modules'][] = $module; } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!system!system.admin.inc/function/template_preprocess_system_modules_uninstall/8.1.x