X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fblockform.php;h=1af5e8cfd0e400c4a3ea9b3ce9078087f8401941;hb=857e35c17566cf05d670b3dd27128842ba97eaf7;hp=af766b8237fbf7127a9f965b21589f81a175d2e5;hpb=a2a2dd88b5a580715a1b8256a5d8b7743675711c;p=quix0rs-gnu-social.git diff --git a/lib/blockform.php b/lib/blockform.php index af766b8237..1af5e8cfd0 100644 --- a/lib/blockform.php +++ b/lib/blockform.php @@ -1,6 +1,6 @@ . * * @category Form - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli - * @copyright 2009 Control Yourself, Inc. + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli + * @copyright 2009 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @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 * * @category Form - * @package Laconica - * @author Evan Prodromou - * @author Sarven Capadisli + * @package StatusNet + * @author Evan Prodromou + * @author Sarven Capadisli * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://laconi.ca/ + * @link http://status.net/ * * @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'); } }