Ejemplo n.º 1
0
 /**
  * Data elements
  *
  * @return void
  */
 function formData()
 {
     if (Event::handle('StartShowTagProfileFormData', array($this))) {
         $this->hidden('token', common_session_token());
         $this->hidden('id', $this->target->id);
         $this->elementStart('ul', 'form_data');
         $this->elementStart('li');
         $tags = Profile_tag::getTagsArray($this->out->getScoped()->id, $this->target->id, $this->out->getScoped()->id);
         // TRANS: Field label on list form.
         $this->input('tags', _m('LABEL', 'Lists'), $this->arg('tags') ? $this->arg('tags') : implode(' ', $tags), _('Lists for this user (letters, numbers, -, ., and _), comma- or space- separated.'));
         $this->elementEnd('li');
         $this->elementEnd('ul');
         Event::handle('EndShowTagProfileFormData', array($this));
     }
 }
Ejemplo n.º 2
0
 function getSelfTags()
 {
     return Profile_tag::getTagsArray($this->id, $this->id, $this->id);
 }
Ejemplo n.º 3
0
 function showContent()
 {
     if (Event::handle('StartShowTagProfileForm', array($this, $this->profile)) && $this->profile) {
         $this->elementStart('div', 'entity_profile vcard author');
         // TRANS: Header in list form.
         $this->element('h2', null, _('User profile'));
         $avatar = $this->profile->getAvatar(AVATAR_PROFILE_SIZE);
         $this->element('img', array('src' => $avatar ? $avatar->displayUrl() : Avatar::defaultImage(AVATAR_PROFILE_SIZE), 'class' => 'photo avatar entity_depiction', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, 'alt' => $this->profile->fullname ? $this->profile->fullname : $this->profile->nickname));
         $this->element('a', array('href' => $this->profile->profileurl, 'class' => 'entity_nickname nickname'), $this->profile->nickname);
         if ($this->profile->fullname) {
             $this->element('div', 'fn entity_fn', $this->profile->fullname);
         }
         if ($this->profile->location) {
             $this->element('div', 'label entity_location', $this->profile->location);
         }
         if ($this->profile->homepage) {
             $this->element('a', array('href' => $this->profile->homepage, 'rel' => 'me', 'class' => 'url entity_url'), $this->profile->homepage);
         }
         if ($this->profile->bio) {
             $this->element('div', 'note entity_note', $this->profile->bio);
         }
         $this->elementEnd('div');
         $this->elementStart('form', array('method' => 'post', 'id' => 'form_tag_user', 'class' => 'form_settings', 'name' => 'tagprofile', 'action' => common_local_url('tagprofile', array('id' => $this->profile->id))));
         $this->elementStart('fieldset');
         // TRANS: Fieldset legend for list form.
         $this->element('legend', null, _('List user'));
         $this->hidden('token', common_session_token());
         $this->hidden('id', $this->profile->id);
         $user = common_current_user();
         $this->elementStart('ul', 'form_data');
         $this->elementStart('li');
         $tags = Profile_tag::getTagsArray($user->id, $this->profile->id, $user->id);
         // TRANS: Field label on list form.
         $this->input('tags', _m('LABEL', 'Lists'), $this->arg('tags') ? $this->arg('tags') : implode(' ', $tags), _('Lists for this user (letters, numbers, -, ., and _), comma- or space- separated.'));
         $this->elementEnd('li');
         $this->elementEnd('ul');
         // TRANS: Button text to save lists.
         $this->submit('save', _m('BUTTON', 'Save'));
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
         Event::handle('EndShowTagProfileForm', array($this, $this->profile));
     }
 }