You are here

function hook_access_grant_view in Access Control Kit 7

Acts on an access grant that is being assembled before rendering.

The module may add elements to $grant->content prior to rendering. The structure of $grant->content is a renderable array as expected by drupal_render().

Parameters

object $grant: The access grant that is being assembled for rendering.

string $view_mode: The $view_mode parameter from access_grant_view().

See also

hook_entity_view()

1 function implements hook_access_grant_view()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

access_access_grant_view in ./access.access.inc
Implements hook_access_grant_view().
1 invocation of hook_access_grant_view()
access_grant_build_content in ./access.module
Builds a structured array representing the access grant in $grant->content.

File

./access.api.php, line 480
Hooks provided by the access control kit module.

Code

function hook_access_grant_view($grant, $view_mode) {

  // Display the user's email address on the grant page.
  if ($view_mode == 'full') {
    $account = user_load($grant->uid);
    $grant->content['email'] = array(
      '#markup' => t('Email address: @email', array(
        '@email' => $account->mail,
      )),
    );
  }
}