You are here

function invite_help in Invite 5

Same name and namespace in other branches
  1. 8 invite.module \invite_help()
  2. 5.2 invite.module \invite_help()
  3. 6.2 invite.module \invite_help()
  4. 7.2 invite.module \invite_help()

Implementation of hook_help().

Returns appropriate help text for all three invite status pages.

File

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

Code

function invite_help($section) {

  // Show module help
  if ($section == 'admin/help#invite') {
    $file = drupal_get_path('module', 'invite') . '/README.txt';
    if (file_exists($file)) {
      return _filter_autop(file_get_contents($file));
    }
    return;
  }

  // Show introductory text on overview pages
  switch ($section) {
    case 'invite/list':
    case 'invite/list/accepted':
      $output = '<p>' . t("The invitations shown on this page have been used to join the site. Clicking on an e-mail address takes you to the user's profile page.");
      break;
    case 'invite/list/pending':
      $output = '<p>' . t("The invitations shown on this page haven't been accepted yet.");
      break;
    case 'invite/list/expired':
      $output = '<p>' . t('The invitations shown on this page have not been used to register on the site within the expiration period of @count days.', array(
        '@count' => variable_get('invite_expiry', 30),
      ));
      break;
    default:
      return;
  }
  $output .= ' ' . t('The status <em>deleted</em> means the user account has been terminated.') . '</p>';
  if (!user_access('withdraw accepted invitations')) {
    $output .= '<p>' . t("At any time, you may withdraw either pending or expired invitations. Accepted invitations can't be withdrawn and count permanently toward your invitation allotment.") . '</p>';
  }
  return $output;
}