chain_menu_access_test.module in Chain Menu Access API 6
Same filename and directory in other branches
Dummy module implementing menu access functions to test the Chain Menu Access API module.
File
tests/chain_menu_access_test.moduleView source
<?php
/**
* @file
* Dummy module implementing menu access functions to test the
* Chain Menu Access API module.
*/
/**
* Implements hook_menu_alter().
*/
function chain_menu_access_test_menu_alter(&$menu) {
// Allow everyone access to admin/user/user/create (#1079032).
chain_menu_access_chain($menu['admin/user/user/create'], 'chain_menu_access_test_enabled', array(
'admin/user/user/create',
), TRUE);
}
/**
* Dynamically turn this module on and off.
*/
function chain_menu_access_test_enabled($path) {
$enabled = !empty($_GET['enable_cma']);
drupal_set_message("Access to {$path} is " . ($enabled ? 'ENABLED' : 'DISABLED') . '.');
return $enabled;
}
Functions
Name | Description |
---|---|
chain_menu_access_test_enabled | Dynamically turn this module on and off. |
chain_menu_access_test_menu_alter | Implements hook_menu_alter(). |