Beispiel #1
0
 /**
  * Show the event form
  *
  * @return void
  */
 function showContent()
 {
     if (!empty($this->error)) {
         $this->element('p', 'error', $this->error);
     }
     $form = new RSVPForm($this->event, $this);
     $form->show();
     return;
 }
Beispiel #2
0
 /**
  * Add a new event
  *
  * @return void
  */
 function cancelRSVP()
 {
     try {
         $notice = $this->rsvp->getNotice();
         // NB: this will delete the rsvp, too
         if (!empty($notice)) {
             common_log(LOG_DEBUG, "Deleting notice...");
             $notice->delete();
         } else {
             common_log(LOG_DEBUG, "Deleting RSVP alone...");
             $this->rsvp->delete();
         }
     } catch (ClientException $ce) {
         $this->error = $ce->getMessage();
         $this->showPage();
         return;
     }
     if ($this->boolean('ajax')) {
         $this->startHTML('text/xml;charset=utf-8');
         $this->elementStart('head');
         // TRANS: Page title after sending a notice.
         $this->element('title', null, _m('Event saved'));
         $this->elementEnd('head');
         $this->elementStart('body');
         $form = new RSVPForm($this->event, $this);
         $form->show();
         $this->elementEnd('body');
         $this->endHTML();
     }
 }