rsvp_view_invites

Definition

rsvp_view_invites()
rsvp/rsvp.module, line 367

Description

  • Handles the rsvp invites requests.
*
  • *

Return value

themed rsvp invites list view response.

Related topics

Namesort iconDescription
core functions for rsvp.

Code

<?php
function rsvp_view_invites() {
  global $user;

  $content = '';
  $invites = _rsvp_get_invites();

  $list = array();
  while ($invite = db_fetch_object($invites)) {
    $list[$invite->nid][] = l($invite->name, "rsvp/email/". $invite->hash, array('title' => t('View invite')));
  }

  foreach ($list as $nid => $links) {
    $node = node_load($nid);
    if ($node->nid) {
      $content .= theme('item_list', $links, t('For: ') . l($node->title, 'node/'. $node->nid, array('title' => t('View this event'))) .' - '. format_date($node->event_start, 'small', '', $node->start_offset));
    }
    else {
      // node has been deleted
      $content .= theme('item_list', $links, t('Deleted event(s):'));
    }
  }
  if (count($list) == 0) {
    $content .= '<p>'. t('You have not been invited to any events yet.') .'</p>';
  }

  return $content;
}
?>