function hook_access_grant_view_alter in Access Control Kit 7
Alters the results of access_grant_view().
This hook is called after the grant has been assembled in a structured array and may be used for doing processing which requires that the complete grant content structure be built first.
If the module wishes to act on the rendered HTML of the grant rather than the structured array, it may use this hook to add a #post_render callback. Alternatively, it could also implement hook_preprocess_access_grant(). See drupal_render() and theme() documentation respectively for details.
Parameters
array $build: A renderable array representing the access grant.
See also
1 invocation of hook_access_grant_view_alter()
- access_grant_view in ./
access.module - Generates a renderable array for an access grant.
File
- ./
access.api.php, line 508 - Hooks provided by the access control kit module.
Code
function hook_access_grant_view_alter(&$build) {
// Move the email field to the top.
if ($build['#view_mode'] == 'full' && isset($build['email'])) {
$build['email']['#weight'] = -10;
}
// Add a #post_render callback to act on the rendered HTML of the grant.
$build['#post_render'][] = 'my_module_access_grant_post_render';
}