function system_modules_confirm_form

7.x 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

1 call to system_modules_confirm_form()
system_modules in drupal/modules/system/
Menu callback; provides module enable/disable interface.


drupal/modules/system/, line 1054
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($form, t('Some required modules must be enabled'), 'admin/modules', t('Would you like to continue with the above?'), t('Continue'), t('Cancel'));
    return $form;