123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319 |
- <?php
- if (!defined('STATUSNET') && !defined('LACONICA')) {
- exit(1);
- }
- require_once INSTALLDIR.'/lib/form.php';
- class SearchProfileForm extends Form
- {
- var $peopletag;
- function __construct($out, Profile_list $peopletag)
- {
- parent::__construct($out);
- $this->peopletag = $peopletag;
- }
-
- function id()
- {
- return 'form_peopletag-add-' . $this->peopletag->id;
- }
-
- function formClass()
- {
- return 'form_peopletag_edit_user_search';
- }
-
- function action()
- {
- return common_local_url('profilecompletion');
- }
-
- function formLegend()
- {
-
- $this->out->element('legend', null, sprintf(_('Search and list people')));
- }
-
- function formData()
- {
-
- $fields = array('fulltext' => _('Everything'),
-
- 'nickname' => _('Nickname'),
-
- 'fullname' => _('Fullname'),
-
- 'description' => _('Description'),
-
- 'location' => _('Location'),
-
- 'uri' => _('URI (Remote users)'));
- $this->out->hidden('peopletag_id', $this->peopletag->id);
- $this->out->input('q', null);
-
- $this->out->dropdown('field', _m('LABEL','Search in'), $fields,
-
- _('Choose a field to search.'), false, 'fulltext');
- }
-
- function formActions()
- {
-
- $this->out->submit('submit', _m('BUTTON','Search'));
- }
- }
- class UntagButton extends Form
- {
- var $profile;
- var $peopletag;
- function __construct($out, Profile $profile, Profile_list $peopletag)
- {
- parent::__construct($out);
- $this->profile = $profile;
- $this->peopletag = $peopletag;
- }
-
- function id()
- {
- return 'form_peopletag-' . $this->peopletag->id . '-remove-' . $this->profile->id;
- }
-
- function formClass()
- {
- return 'form_user_remove_peopletag';
- }
-
- function action()
- {
- return common_local_url('removepeopletag');
- }
-
- function formLegend()
- {
-
-
- $this->out->element('legend', null, sprintf(_('Remove %1$s from list %2$s'),
- $this->profile->nickname, $this->peopletag->tag));
- }
-
- function formData()
- {
- $this->out->hidden('peopletag_id', $this->peopletag->id);
- $this->out->hidden('tagged', $this->profile->id);
- }
-
- function formActions()
- {
-
- $this->out->submit('submit', _m('BUTTON','Remove'));
- }
- }
- class TagButton extends Form
- {
- var $profile;
- var $peopletag;
- function __construct($out, Profile $profile, Profile_list $peopletag)
- {
- parent::__construct($out);
- $this->profile = $profile;
- $this->peopletag = $peopletag;
- }
-
- function id()
- {
- return 'form_peopletag-' . $this->peopletag->id . '-add-' . $this->profile->id;
- }
-
- function formClass()
- {
- return 'form_user_add_peopletag';
- }
-
- function action()
- {
- return common_local_url('addpeopletag');
- }
-
- function formLegend()
- {
-
-
- $this->out->element('legend', null, sprintf(_('Add %1$s to list %2$s'),
- $this->profile->nickname, $this->peopletag->tag));
- }
-
- function formData()
- {
- UntagButton::formData();
- }
-
- function formActions()
- {
-
- $this->out->submit('submit', _m('BUTTON','Add'));
- }
- }
- class TaggedProfileItem extends Widget
- {
- var $profile=null;
- function __construct($out=null, $profile)
- {
- parent::__construct($out);
- $this->profile = $profile;
- }
- function show()
- {
- $this->out->elementStart('a', array('class' => 'url',
- 'href' => $this->profile->profileurl,
- 'title' => $this->profile->getBestName()));
- $avatarUrl = $this->profile->avatarUrl(AVATAR_MINI_SIZE);
- $this->out->element('img', array('src' => $avatarUrl,
- 'width' => AVATAR_MINI_SIZE,
- 'height' => AVATAR_MINI_SIZE,
- 'class' => 'avatar photo',
- 'alt' => $this->profile->getBestName()));
- $this->out->element('span', 'fn nickname', $this->profile->nickname);
- $this->out->elementEnd('a');
- }
- }
|