You are here

function composer_manager_system_modules_submit in Composer Manager 6

Same name and namespace in other branches
  1. 6.2 composer_manager.module \composer_manager_system_modules_submit()

Form submission handler for system_modules().

Determines what modules have been enabled or disabled and rewrites the consolidated composer.json file if one of the modules has dependencies.

See also

composer_manager_write_if_changed()

1 string reference to 'composer_manager_system_modules_submit'
composer_manager_form_system_modules_alter in ./composer_manager.module
Implements hook_form_FORM_ID_alter() for system_modules().

File

./composer_manager.module, line 72
Provides consolidated management of third-party Composer-compatible packages required by contributed modules.

Code

function composer_manager_system_modules_submit($form, &$form_state) {
  $module_list = module_list();

  // Get list of modules that have been enabled or disabled.
  $enabled = array_diff_key($module_list, $form['#module_list']);
  $disabled = array_diff_key($form['#module_list'], $module_list);
  $modules = array_merge($enabled, $disabled);
  composer_manager_write_if_changed($modules);
}