module_grants.install in Module Grants 7
Same filename and directory in other branches
Install and uninstall hooks for Module Grants module
File
module_grants.installView source
<?php
/**
* @file
* Install and uninstall hooks for Module Grants module
*/
/**
* Implementation of hook_install().
*/
function module_grants_install() {
}
/**
* Implementation of hook_uninstall().
*/
function module_grants_uninstall() {
variable_del('module_grants_lenient');
variable_del('module_grants_OR_modules');
}
/**
* Implements hook_enable()
*/
function module_grants_enable() {
db_update('system')
->fields(array(
'weight' => 10000,
))
->condition('type', 'module')
->condition('name', 'module_grants')
->execute();
}
/**
* Implements hook_requirements().
*/
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;
}
Functions
Name | Description |
---|---|
module_grants_enable | Implements hook_enable() |
module_grants_install | Implementation of hook_install(). |
module_grants_requirements | Implements hook_requirements(). |
module_grants_uninstall | Implementation of hook_uninstall(). |