function _fe_block_get_block_roles in Features Extra 7
Helper function to get the block roles visibility settings.
Parameters
array $block: the block definition array
Return value
array associated role settings for the block
- key: role name
- value: role id
1 call to _fe_block_get_block_roles()
- fe_block_settings_features_export_render in fe_block/
fe_block.module - Implements hook_features_export_render().
File
- fe_block/
fe_block.module, line 1156 - Provide features components for exporting core blocks and settings.
Code
function _fe_block_get_block_roles($block) {
$query = db_select('block_role', 'br')
->condition('br.module', $block['module'])
->condition('br.delta', $block['delta']);
$query
->innerJoin('role', 'r', 'r.rid = br.rid');
$query
->fields('r', array(
'name',
'rid',
))
->orderBy('r.name', 'ASC');
$roles = $query
->execute()
->fetchAllKeyed(0, 1);
return $roles;
}