1 node.module node_modules_disabled($modules)

Implements hook_modules_disabled().

File

core/modules/node/node.module, line 3633
The core module that allows content to be submitted to the site.

Code

function node_modules_disabled($modules) {
  // Check whether any of the disabled modules implemented hook_node_grants(),
  // in which case the node access table needs to be rebuilt.
  foreach ($modules as $module) {
    // At this point, the module is already disabled, but its code is still
    // loaded in memory. Module functions must no longer be called. We only
    // check whether a hook implementation function exists and do not invoke it.
    if (!node_access_needs_rebuild() && module_hook($module, 'node_grants')) {
      node_access_needs_rebuild(TRUE);
    }
  }

  // If there remains no more node_access module, rebuilding will be
  // straightforward, we can do it right now.
  if (node_access_needs_rebuild() && count(module_implements('node_grants')) == 0) {
    node_access_rebuild();
  }

  // Check if the disabled modules included any content types and disable the
  // ones associated with it.
  $node_types = node_type_get_types();
  foreach ($node_types as $type) {
    if (in_array($type->module, $modules)) {
      $type->disabled = TRUE;
      node_type_save($type);
    }
  }
}