Ejemplo n.º 1
0
 function showProfileItem($profile)
 {
     $this->elementStart('li', 'entity_removable_profile');
     $item = new TaggedProfileItem($this, $profile);
     $item->show();
     $this->elementStart('span', 'entity_actions');
     if ($profile->isTagged($this->peopletag)) {
         $untag = new UntagButton($this, $profile, $this->peopletag);
         $untag->show();
     } else {
         $tag = new TagButton($this, $profile, $this->peopletag);
         $tag->show();
     }
     $this->elementEnd('span');
     $this->elementEnd('li');
 }
Ejemplo n.º 2
0
 /**
  * Handle request
  *
  * Does the subscription and returns results.
  *
  * @param Array $args unused.
  *
  * @return void
  */
 function handle($args)
 {
     // Throws exception on error
     $ptag = Profile_tag::unTag($this->user->id, $this->tagged->id, $this->peopletag->tag);
     if (!$ptag) {
         $user = User::staticGet('id', $this->tagged->id);
         if ($user) {
             $this->clientError(sprintf(_('There was an unexpected error while delisting %s.'), $user->nickname));
         } else {
             // TRANS: Client error displayed when an unknown error occurs while listing a user.
             // TRANS: %s is a profile URL.
             $this->clientError(sprintf(_('There was a problem listing %s. ' . 'The remote server is probably not responding correctly, ' . 'please try retrying later.'), $this->profile->profileurl));
         }
         return false;
     }
     if ($this->boolean('ajax')) {
         $this->startHTML('text/xml;charset=utf-8');
         $this->elementStart('head');
         // TRANS: Title after removing a user from a list.
         $this->element('title', null, _('Unlisted'));
         $this->elementEnd('head');
         $this->elementStart('body');
         $unsubscribe = new TagButton($this, $this->tagged, $this->peopletag);
         $unsubscribe->show();
         $this->elementEnd('body');
         $this->elementEnd('html');
     } else {
         $url = common_local_url('subscriptions', array('nickname' => $this->user->nickname));
         common_redirect($url, 303);
     }
 }