2 // @todo FIXME: standard file header missing.
4 * Form for blocking a user from a group
8 * @author Evan Prodromou <evan@status.net>
9 * @author Sarven Capadisli <csarven@status.net>
10 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
11 * @link http://status.net/
15 class GroupBlockForm extends Form
18 * Profile of user to block
24 * Group to block the user from
38 * @param HTMLOutputter $out output channel
39 * @param Profile $profile profile of user to block
40 * @param User_group $group group to block user from
41 * @param array $args return-to args
43 function __construct($out=null, $profile=null, $group=null, $args=null)
45 parent::__construct($out);
47 $this->profile = $profile;
48 $this->group = $group;
55 * @return int ID of the form
59 // This should be unique for the page.
60 return 'block-' . $this->profile->id;
66 * @return string class of the form
70 return 'form_group_block';
76 * @return string URL of the action
80 return common_local_url('groupblock');
90 // TRANS: Form legend for form to block user from a group.
91 $this->out->element('legend', null, _('Block user from group'));
95 * Data elements of the form
101 $this->out->hidden('blockto-' . $this->profile->id,
104 $this->out->hidden('blockgroup-' . $this->group->id,
108 foreach ($this->args as $k => $v) {
109 $this->out->hidden('returnto-' . $k, $v);
119 function formActions()
123 // TRANS: Button text for the form that will block a user from a group.
124 _m('BUTTON','Block'),
127 // TRANS: Submit button title.
128 _m('TOOLTIP', 'Block this user so that they can no longer post messages to it.'));