Moving form to its own file as we do nowadays

This commit is contained in:
Mikael Nordfeldth 2017-04-25 21:11:49 +02:00
parent c71600c144
commit df7ff4ef1a
2 changed files with 95 additions and 94 deletions

View File

@ -27,9 +27,7 @@
* @link http://status.net/ * @link http://status.net/
*/ */
if (!defined('STATUSNET')) { if (!defined('GNUSOCIAL')) { exit(1); }
exit(1);
}
/** /**
* Administer blacklist * Administer blacklist
@ -118,94 +116,3 @@ class BlacklistadminpanelAction extends AdminPanelAction
return true; return true;
} }
} }
/**
* Admin panel form for blacklist panel
*
* @category Admin
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @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.'));
}
}

View File

@ -0,0 +1,94 @@
<?php
if (!defined('GNUSOCIAL')) { exit(1); }
/**
* Admin panel form for blacklist panel
*
* @category Admin
* @package StatusNet
* @author Evan Prodromou <evan@status.net>
* @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.'));
}
}