You are here

function _simplified_modules_set_expected_status in Simplified Modules 7

Sets the expected status of a module in all relevant arrays.

Parameters

$module: The module whose status will be set.

$status: The status to set (TRUE for enabled, FALSE for disabled).

$submitted_module_status: An array mapping module names to their submitted status (TRUE for enabled, FALSE for disabled) before the system_modules_submit() function will process them. This will be modified in place to add the new module status.

$module_values: An array of submitted form values representing the modules, corresponding to the $form_state['values']['modules'] array that system_modules_submit() will eventually receive. This will be modified in place to add the new module status.

$module_dependencies: Module dependencies returned by _simplified_modules_module_build_dependencies().

Return value

An array with the same format as $submitted_module_status, representing the expected status of each module after system_modules_submit() has finished processing it, and taking into account the new module status that was set by this function.

See also

_simplified_modules_expected_final_module_status()

1 call to _simplified_modules_set_expected_status()
simplified_modules_system_modules_submit in ./simplified_modules.module
Custom submit handler for the system_modules() admin page.

File

./simplified_modules.module, line 275
Simplifies the modules page by allowing related modules to be grouped under a single checkbox.

Code

function _simplified_modules_set_expected_status($module, $status, &$submitted_module_status, &$module_values, $module_dependencies) {
  $group = $module_dependencies[$module]->info['package'];
  $module_values[$group][$module]['enable'] = $status;
  $submitted_module_status[$module] = $status;
  return _simplified_modules_expected_final_module_status($submitted_module_status, $module_dependencies);
}