Skip to content

Instantly share code, notes, and snippets.

@psynaptic
Created January 12, 2012 16:57
Show Gist options
  • Save psynaptic/1601647 to your computer and use it in GitHub Desktop.
Save psynaptic/1601647 to your computer and use it in GitHub Desktop.
/**
* Implements hook_block_view_alter().
*/
function ex_user_block_view_alter(&$data, $block) {
if ($block->delta == 'masquerade' && !variable_get('ex_user_show_masquerade_block', 1)) {
$data = array();
}
// Change the masquerade block title to reflect the masquerading state.
if ($block->delta == 'masquerade' && isset($_SESSION['masquerading'])) {
$data['subject'] = t('Masquerading');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment