X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fblockform.php;h=1af5e8cfd0e400c4a3ea9b3ce9078087f8401941;hb=2c5460eb0e140655c30639c5bc909ddb80732a91;hp=403ac59feea1a4913260777071047108ff2271ff;hpb=ae883ceb9b4689f6c1dd3aecdc4a844eda7d179a;p=quix0rs-gnu-social.git diff --git a/lib/blockform.php b/lib/blockform.php index 403ac59fee..1af5e8cfd0 100644 --- a/lib/blockform.php +++ b/lib/blockform.php @@ -28,12 +28,10 @@ * @link http://status.net/ */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/form.php'; - /** * Form for blocking a user * @@ -46,110 +44,38 @@ require_once INSTALLDIR.'/lib/form.php'; * * @see UnblockForm */ - -class BlockForm extends Form +class BlockForm extends ProfileActionForm { /** - * Profile of user to block - */ - - var $profile = null; - - /** - * Return-to args - */ - - var $args = null; - - /** - * Constructor - * - * @param HTMLOutputter $out output channel - * @param Profile $profile profile of user to block - * @param array $args return-to args - */ - - function __construct($out=null, $profile=null, $args=null) - { - parent::__construct($out); - - $this->profile = $profile; - $this->args = $args; - } - - /** - * ID of the form - * - * @return int ID of the form - */ - - function id() - { - return 'block-' . $this->profile->id; - } - - - /** - * class of the form - * - * @return string class of the form - */ - - function formClass() - { - return 'form_user_block'; - } - - - /** - * Action of the form + * Action this form provides * - * @return string URL of the action + * @return string Name of the action, lowercased. */ - function action() + function target() { - return common_local_url('block'); + return 'block'; } - /** - * Legend of the Form + * Title of the form * - * @return void + * @return string Title of the form, internationalized */ - function formLegend() + function title() { - $this->out->element('legend', null, _('Block this user')); + // TRANS: Title for the form to block a user. + return _('Block'); } - /** - * Data elements of the form + * Description of the form * - * @return void + * @return string description of the form, internationalized */ - - function formData() - { - $this->out->hidden('blockto-' . $this->profile->id, - $this->profile->id, - 'blockto'); - if ($this->args) { - foreach ($this->args as $k => $v) { - $this->out->hidden('returnto-' . $k, $v); - } - } - } - - /** - * Action elements - * - * @return void - */ - - function formActions() + function description() { - $this->out->submit('submit', _('Block'), 'submit', null, _('Block this user')); + // TRANS: Description of the form to block a user. + return _('Block this user'); } }