1.20.x system.admin.inc system_modules_confirm_form($modules, $storage)

Display confirmation form for required modules.


$modules: Array of module file objects as returned from system_rebuild_module_data().

$storage: The contents of $form_state['storage']; an array with two elements: the list of required modules and the list of status form field values from the previous screen.

Related topics


modules/system/system.admin.inc, line 870
Admin page callbacks for the System module.


function system_modules_confirm_form($modules, $storage) {
  $items = array();

  $form['validation_modules'] = array('#type' => 'value', '#value' => $modules);
  $form['status']['#tree'] = TRUE;

  foreach ($storage['more_required'] as $info) {
    $t_argument = array(
      '@module' => $info['name'],
      '@required' => implode(', ', $info['requires']),
    $items[] = format_plural(count($info['requires']), 'You must enable the @required module to install @module.', 'You must enable the @required modules to install @module.', $t_argument);

  foreach ($storage['missing_modules'] as $name => $info) {
    $t_argument = array(
      '@module' => $name,
      '@depends' => implode(', ', $info['depends']),
    $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument);

  $form['text'] = array('#markup' => theme('item_list', array('items' => $items)));

  if ($form) {
    // Set some default form values
    $form = confirm_form(
    t('Some required modules must be enabled'), 
    t('Would you like to continue with the above?'), 
    // Removing the button-danger class so that button-primary will be added automatically for us.
    return $form;