From df7ff4ef1abb91b33615b5552292dc0f8e46ca7b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Tue, 25 Apr 2017 21:11:49 +0200 Subject: [PATCH] Moving form to its own file as we do nowadays --- .../Blacklist/actions/blacklistadminpanel.php | 95 +------------------ .../Blacklist/forms/blacklistadminpanel.php | 94 ++++++++++++++++++ 2 files changed, 95 insertions(+), 94 deletions(-) create mode 100644 plugins/Blacklist/forms/blacklistadminpanel.php diff --git a/plugins/Blacklist/actions/blacklistadminpanel.php b/plugins/Blacklist/actions/blacklistadminpanel.php index ee1c2138b8..43cba3e2ce 100644 --- a/plugins/Blacklist/actions/blacklistadminpanel.php +++ b/plugins/Blacklist/actions/blacklistadminpanel.php @@ -27,9 +27,7 @@ * @link http://status.net/ */ -if (!defined('STATUSNET')) { - exit(1); -} +if (!defined('GNUSOCIAL')) { exit(1); } /** * Administer blacklist @@ -118,94 +116,3 @@ class BlacklistadminpanelAction extends AdminPanelAction return true; } } - -/** - * Admin panel form for blacklist panel - * - * @category Admin - * @package StatusNet - * @author Evan Prodromou - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 - * @link http://status.net/ - */ -class BlacklistAdminPanelForm extends Form -{ - /** - * ID of the form - * - * @return string ID - */ - function id() - { - return 'blacklistadminpanel'; - } - - /** - * Class of the form - * - * @return string class - */ - function formClass() - { - return 'form_settings'; - } - - /** - * Action we post to - * - * @return string action URL - */ - function action() - { - return common_local_url('blacklistadminpanel'); - } - - /** - * Show the form controls - * - * @return void - */ - function formData() - { - $this->out->elementStart('ul', 'form_data'); - - $this->out->elementStart('li'); - - $nickPatterns = Nickname_blacklist::getPatterns(); - - // TRANS: Field label in blacklist plugin administration panel. - $this->out->textarea('blacklist-nicknames', _m('Nicknames'), - implode("\r\n", $nickPatterns), - // TRANS: Field title in blacklist plugin administration panel. - _m('Patterns of nicknames to block, one per line.')); - $this->out->elementEnd('li'); - - $urlPatterns = Homepage_blacklist::getPatterns(); - - $this->out->elementStart('li'); - // TRANS: Field label in blacklist plugin administration panel. - $this->out->textarea('blacklist-urls', _m('URLs'), - implode("\r\n", $urlPatterns), - // TRANS: Field title in blacklist plugin administration panel. - _m('Patterns of URLs to block, one per line.')); - $this->out->elementEnd('li'); - - $this->out->elementEnd('ul'); - } - - /** - * Buttons for submitting - * - * @return void - */ - function formActions() - { - $this->out->submit('submit', - // TRANS: Button text in blacklist plugin administration panel to save settings. - _m('BUTTON','Save'), - 'submit', - null, - // TRANS: Button title in blacklist plugin administration panel to save settings. - _m('Save site settings.')); - } -} diff --git a/plugins/Blacklist/forms/blacklistadminpanel.php b/plugins/Blacklist/forms/blacklistadminpanel.php new file mode 100644 index 0000000000..3153ddbeea --- /dev/null +++ b/plugins/Blacklist/forms/blacklistadminpanel.php @@ -0,0 +1,94 @@ + + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3 + * @link http://status.net/ + */ +class BlacklistAdminPanelForm extends Form +{ + /** + * ID of the form + * + * @return string ID + */ + function id() + { + return 'blacklistadminpanel'; + } + + /** + * Class of the form + * + * @return string class + */ + function formClass() + { + return 'form_settings'; + } + + /** + * Action we post to + * + * @return string action URL + */ + function action() + { + return common_local_url('blacklistadminpanel'); + } + + /** + * Show the form controls + * + * @return void + */ + function formData() + { + $this->out->elementStart('ul', 'form_data'); + + $this->out->elementStart('li'); + + $nickPatterns = Nickname_blacklist::getPatterns(); + + // TRANS: Field label in blacklist plugin administration panel. + $this->out->textarea('blacklist-nicknames', _m('Nicknames'), + implode("\r\n", $nickPatterns), + // TRANS: Field title in blacklist plugin administration panel. + _m('Patterns of nicknames to block, one per line.')); + $this->out->elementEnd('li'); + + $urlPatterns = Homepage_blacklist::getPatterns(); + + $this->out->elementStart('li'); + // TRANS: Field label in blacklist plugin administration panel. + $this->out->textarea('blacklist-urls', _m('URLs'), + implode("\r\n", $urlPatterns), + // TRANS: Field title in blacklist plugin administration panel. + _m('Patterns of URLs to block, one per line.')); + $this->out->elementEnd('li'); + + $this->out->elementEnd('ul'); + } + + /** + * Buttons for submitting + * + * @return void + */ + function formActions() + { + $this->out->submit('submit', + // TRANS: Button text in blacklist plugin administration panel to save settings. + _m('BUTTON','Save'), + 'submit', + null, + // TRANS: Button title in blacklist plugin administration panel to save settings. + _m('Save site settings.')); + } +} -- 2.39.5