You are here

function hook_access_scheme_views_data_alter in Access Control Kit 7

Alters the realm fields' views table data.

This hook is invoked from access_views_data_alter() for each access scheme.

Parameters

array &$data: The array of Views table data for a scheme's realm field table. This is in the same format as a table in the return value of hook_views_data().

string $field_value_name: The name of the table column that contains the realm field value.

string $field_name: The name of the realm field.

string $scheme_type: The access scheme type (e.g., 'list_integer').

See also

access_views_data_alter()

1 function implements hook_access_scheme_views_data_alter()

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

access_access_scheme_views_data_alter in ./access.access.inc
Implements hook_access_scheme_views_data_alter().
1 invocation of hook_access_scheme_views_data_alter()
access_views_data_alter in ./access.views.inc
Implements hook_views_data_alter().

File

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

Code

function hook_access_scheme_views_data_alter(&$data, $field_value_name, $field_name, $scheme_type) {

  // Add a relationship to the referenced taxonomy term.
  if ($scheme_type == 'taxonomy_term') {
    $data[$field_value_name]['relationship'] = array(
      'handler' => 'views_handler_relationship',
      'base' => 'taxonomy_term_data',
      'base field' => 'tid',
      'label' => t('term from !field_name', array(
        '!field_name' => $field_name,
      )),
    );
  }
}