X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fblockform.php;h=b6652b1f69c023f75d2b5da17d0f071b86b2349d;hb=84b5480007d30280cc9c829fe1316db0f853f64c;hp=51e43f8b599158cad389d082459a8058a6758d41;hpb=12c475c101c070cbcc4c63f7b1049f6d3282b9ee;p=quix0rs-gnu-social.git diff --git a/lib/blockform.php b/lib/blockform.php index 51e43f8b59..b6652b1f69 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 + * Action this form provides * - * @param HTMLOutputter $out output channel - * @param Profile $profile profile of user to block - * @param array $args return-to args + * @return string Name of the action, lowercased. */ - function __construct($out=null, $profile=null, $args=null) + function target() { - parent::__construct($out); - - $this->profile = $profile; - $this->args = $args; + return 'block'; } /** - * ID of the form + * Title of the form * - * @return int ID of the form + * @return string Title of the form, internationalized */ - function id() + function title() { - return 'block-' . $this->profile->id; + return _('Block'); } /** - * Action of the form + * Description of the form * - * @return string URL of the action + * @return string description of the form, internationalized */ - function action() + function description() { - return common_local_url('block'); + return _('Block this user'); } - - /** - * Data elements of the form - * - * @return void - */ - - 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() - { - $this->out->submit('submit', _('Block')); - } -} \ No newline at end of file +}