123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class TagProfileForm extends Form
- {
- protected $target = null;
-
- function __construct(Action $action, Profile $target)
- {
- parent::__construct($action);
- $this->target = $target;
- }
-
- function id()
- {
- return 'form_tagprofile_'.$target->id;
- }
-
- function formClass()
- {
- return 'form_tagprofile form_settings';
- }
-
- function action()
- {
- return common_local_url('tagprofile', array('id' => $this->target->id));
- }
-
- function formLegend()
- {
-
- $this->out->element('legend', null, sprintf(_m('ADDTOLIST', 'List %s'), $this->target->getNickname()));
- }
-
- 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);
-
- $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));
- }
- }
- function formActions()
- {
-
- $this->out->submit('save', _m('BUTTON', 'Save'));
- }
- }
|