You are here

function invite_block in Invite 5

Same name and namespace in other branches
  1. 5.2 invite.module \invite_block()
  2. 6.2 invite.module \invite_block()

Implementation of hook_block().

File

./invite.module, line 259
Allows your users to send and track invitations to join your site.

Code

function invite_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    $blocks[0] = array(
      'info' => t('Invite a friend'),
    );
    return $blocks;
  }
  else {
    if ($op == 'view') {
      switch ($delta) {
        case 0:
          if (user_access('send invitations')) {
            $block = array(
              'subject' => t('Invite a friend'),
              'content' => drupal_get_form('invite_form', 'block'),
            );
          }
          break;
      }
      return $block;
    }
  }
}