You are here

function janrain_capture_block_content in Janrain Registration 7

Same name and namespace in other branches
  1. 7.4 janrain_capture.module \janrain_capture_block_content()
  2. 7.2 janrain_capture.module \janrain_capture_block_content()
  3. 7.3 janrain_capture.module \janrain_capture_block_content()

Provides the content for the Janrain Capture block, and is also used to replace the user login block content if the "enforce" setting is on.

2 calls to janrain_capture_block_content()
janrain_capture_block_view_user_login_alter in ./janrain_capture.module
Implements hook_block_view_MODULE_DELTA_alter().
janrain_capture_ui_block_view in ./janrain_capture_ui.module
Implements hook_block_view().

File

./janrain_capture.module, line 393
This module implements authentication endpoints for Janrain Capture.

Code

function janrain_capture_block_content() {
  global $user;
  $items = array();

  // Provide either a "Register / Sign in" link or a "View Profile" link
  // depending on whether the user is logged in.
  $link_type = $user->uid ? 'profile' : 'signin';
  $link_func = sprintf('janrain_capture_%s_link', $link_type);
  $link = $link_func();
  $items[] = drupal_render($link);

  // Add a logout link for logged in users.
  if ($user->uid) {
    $items[] = janrain_capture_render_logout_link();
  }
  return theme('item_list', array(
    'items' => $items,
  ));
}