You are here

function ginvite_init in Group 7

Implements hook_init().

Check for invites on every non-anonymous page load.

File

modules/ginvite/ginvite.module, line 77
Contains invite functionality for the Group module.

Code

function ginvite_init() {
  global $user;
  if ($user->uid) {
    if (GroupMembership::getByStatus($user->uid, 'invited')) {
      $message = 'You have pending group invitations. <a href="@url">Visit your profile</a> to see them.';
      $replace = array(
        '@url' => url("user/{$user->uid}/group/invite"),
      );
      drupal_set_message(t($message, $replace), 'warning', FALSE);
    }
  }
}