You are here

function masquerade_block in Masquerade 5

Same name and namespace in other branches
  1. 6 masquerade.module \masquerade_block()

Implementation of hook_block().

File

./masquerade.module, line 203
masquerade.module

Code

function masquerade_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Masquerade');
      return $blocks;
    case 'view':
      if ($GLOBALS['masquerading'] || (user_access('masquerade as user') || user_access('masquerade as admin'))) {
        switch ($delta) {
          case 0:
            $block['subject'] = t('Masquerade');
            $block['content'] = drupal_get_form('masquerade_block_1', $form);
            break;
        }
        return $block;
      }
  }
}