1
|
<?php
|
2
|
/**
|
3
|
* @file
|
4
|
* Module for testing hook_flag_access.
|
5
|
*/
|
6
|
|
7
|
/**
|
8
|
* Implements hook_flag_access.
|
9
|
*/
|
10
|
function flagaccesstest_flag_access($flag, $entity_id, $action, $account) {
|
11
|
$mode = variable_get('FlagHookFlagAccessTestCaseMode', 'ignore');
|
12
|
|
13
|
switch ($mode) {
|
14
|
case 'ignore':
|
15
|
drupal_set_message('hook_flag_access: ignore');
|
16
|
return NULL;
|
17
|
|
18
|
case 'allow':
|
19
|
drupal_set_message('hook_flag_access: allow');
|
20
|
return TRUE;
|
21
|
|
22
|
case 'deny':
|
23
|
drupal_set_message('hook_flag_access: deny');
|
24
|
return FALSE;
|
25
|
}
|
26
|
}
|