function _rolereference_names in Role Reference 6
Helper function for formatters.
Store role names collected in the current request.
1 call to _rolereference_names()
- theme_rolereference_formatter_default in ./
rolereference.module - Theme function for 'default' rolereference field formatter.
File
- ./
rolereference.module, line 264 - Defines a field type for referencing a role. Based almost entirely on nodereference and userreference modules.
Code
function _rolereference_names($rid) {
static $names = array();
if (!isset($names[$rid])) {
$name = db_result(db_query("SELECT name FROM {role} WHERE rid = %d", $rid));
$names[$rid] = $name ? $name : '';
}
return $names[$rid];
}