You are here

function follow_block_view in Follow 7.2

Same name and namespace in other branches
  1. 5 follow.module \follow_block_view()
  2. 6 follow.module \follow_block_view()
  3. 7 follow.module \follow_block_view()

Implements hook_block_view().

File

./follow.module, line 286

Code

function follow_block_view($delta = '') {
  $type = $delta;
  switch ($delta) {
    case 'site':
      if (($content = _follow_block_content($type)) && (variable_get('follow_site_block_user', TRUE) || !(arg(0) == 'user' && is_numeric(arg(1))))) {
        return array(
          'subject' => _follow_block_subject(),
          'content' => $content,
        );
      }
      break;
    case 'user':
      $uid = arg(1);
      if (arg(0) == 'user' && is_numeric($uid) && ($content = _follow_block_content($type, $uid))) {
        return array(
          'subject' => _follow_block_subject($uid),
          'content' => $content,
        );
      }
      break;
  }
}