You are here

function module_grants_requirements in Module Grants 7

Implements hook_requirements().

File

./module_grants.install, line 37
Install and uninstall hooks for Module Grants module

Code

function module_grants_requirements($phase) {
  $ret = array();
  if ($phase == 'runtime') {
    $ret['module_grants_hook_module_implements_alter']['title'] = t('module_implements_alter hook order check');
    $modules = module_implements('module_implements_alter');
    $last_module = end($modules);
    $ret['module_grants_hook_module_implements_alter']['value'] = $last_module;
    if ($last_module === 'module_grants') {
      $ret['module_grants_hook_module_implements_alter']['description'] = t("Module grants' hook_module_implements_alter is the last hook to be called.");
      $ret['module_grants_hook_module_implements_alter']['severity'] = REQUIREMENT_OK;
    }
    else {
      $ret['module_grants_hook_module_implements_alter']['description'] = t("Module grants' hook_module_implements_alter is not last hook to be called,\n        every changes to hook_node_access in the hook_module_implements_alter after it will be ignored. The last hook_module_implements_alter is from module @module", array(
        '@module',
        $last_module,
      ));
      $ret['module_grants_hook_module_implements_alter']['severity'] = REQUIREMENT_WARNING;
    }
  }
  return $ret;
}