You are here

function modules_enable in Patterns 7.2

Wraps the call to drupal_form_submit to enable modules. It enables automatically all the dependencies

Parameters

string $form_id String containing the form ID. In the case of custom functions the value is empty.:

array $form_state Set of values after parsing the action.:

1 string reference to 'modules_enable'
system_patterns in patterns_components/components/system.inc
Implements hook_patterns().

File

patterns_components/components/system.inc, line 511

Code

function modules_enable($form_id, &$form_state) {
  $modules_enabled = array();
  foreach ($form_state['values'] as $module) {
    module_enable(array(
      $module['value'],
    ), TRUE);
    $modules_enabled[] = $module['value'];
  }
  $msg = count($modules_enabled) > 0 ? t('Module(s) %modules enabled.', array(
    '%modules' => implode(', ', $modules_enabled),
  )) : t('No modules have been enabled.');
  return patterns_results(PATTERN_SUCCESS, $msg);
}