function _workbench_access_get_user_section_names in Workbench Access 7
Fetch an array of a user's access sections for use with tokens.
Return value
array An array of access section names keyed by access ID.
1 call to _workbench_access_get_user_section_names()
- workbench_access_tokens in ./
workbench_access.tokens.inc - Implements hook_tokens().
2 string references to '_workbench_access_get_user_section_names'
- workbench_access_user_section_delete in ./
workbench_access.module - Deletes an access rule from the {workbench_access_user} table.
- workbench_access_user_section_save in ./
workbench_access.module - Save a user access record and notify other modules.
File
- ./
workbench_access.tokens.inc, line 198 - Token integration for the workbench_access module.
Code
function _workbench_access_get_user_section_names($account) {
$sections =& drupal_static(__FUNCTION__, array());
if (!isset($sections[$account->uid])) {
$sections[$account->uid] = array();
if (!empty($account->workbench_access)) {
$access_type = variable_get('workbench_access');
foreach (array_keys($account->workbench_access) as $access_id) {
$info = workbench_access_load($access_type, $access_id);
$sections[$account->uid][$access_id] = $info['name'];
}
}
}
return $sections[$account->uid];
}