system_modules_confirm_form

Versions
5
system_modules_confirm_form($modules, $form_values = array())
6 – 7
system_modules_confirm_form($modules, $storage)

Display confirmation form for required modules.

Parameters

$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

Code

modules/system/system.admin.inc, line 892

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

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

  foreach ($storage['more_modules'] 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);
  }
  $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/config/modules',
      t('Would you like to continue with enabling the above?'),
      t('Continue'),
      t('Cancel'));
    return $form;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.