Exemplo n.º 1
0
 function showSubscribeForm()
 {
     $this->out->elementStart('li');
     if (Event::handle('StartSubscribePeopletagForm', array($this->out, $this->peopletag))) {
         if ($this->current) {
             if ($this->peopletag->hasSubscriber($this->current->id)) {
                 $form = new UnsubscribePeopletagForm($this->out, $this->peopletag);
                 $form->show();
             } else {
                 $form = new SubscribePeopletagForm($this->out, $this->peopletag);
                 $form->show();
             }
         }
         Event::handle('EndSubscribePeopletagForm', array($this->out, $this->peopletag));
     }
     $this->out->elementEnd('li');
 }
Exemplo n.º 2
0
 /**
  * Handle the request
  *
  * On POST, add the current user to the group
  *
  * @param array $args unused
  *
  * @return void
  */
 function handle($args)
 {
     parent::handle($args);
     $cur = common_current_user();
     Profile_tag_subscription::remove($this->peopletag, $cur);
     if ($this->boolean('ajax')) {
         $this->startHTML('text/xml;charset=utf-8');
         $this->elementStart('head');
         // TRANS: Page title for form that allows unsubscribing from a list.
         // TRANS: %1$s is a nickname, %2$s is a list, %3$s is a tagger nickname.
         $this->element('title', null, sprintf(_('%1$s unsubscribed from list %2$s by %3$s'), $cur->nickname, $this->peopletag->tag, $this->tagger->nickname));
         $this->elementEnd('head');
         $this->elementStart('body');
         $lf = new SubscribePeopletagForm($this, $this->peopletag);
         $lf->show();
         $this->elementEnd('body');
         $this->elementEnd('html');
     } else {
         if (common_get_returnto()) {
             common_redirect(common_get_returnto(), 303);
             return true;
         }
         common_redirect(common_local_url('peopletagsbyuser', array('nickname' => $this->tagger->nickname)), 303);
     }
 }