You are here

function modules_disable in Patterns 7.2

Wraps the call to drupal_form_submit to disable modules. It disables 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_disable'
system_patterns in patterns_components/components/system.inc
Implements hook_patterns().

File

patterns_components/components/system.inc, line 529

Code

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