draft submit form #14

This commit is contained in:
ghost 2023-09-24 15:57:08 +03:00
parent 4697519663
commit 31b8a0a5fb
2 changed files with 175 additions and 7 deletions

View file

@ -2,6 +2,13 @@
class AppControllerSubmit
{
private $_validator;
public function __construct(AppModelValidator $validator)
{
$this->_validator = $validator;
}
private function _response(string $title, string $h1, string $text, int $code = 200)
{
require_once __DIR__ . '/response.php';
@ -48,6 +55,79 @@ class AppControllerSubmit
);
}
// Form
$form = (object)
[
'title' => (object)
[
'error' => [],
'attribute' => (object)
[
'value' => null,
'minlength' => $this->_validator->getPageTitleLengthMin(),
'maxlength' => $this->_validator->getPageTitleLengthMax(),
'placeholder' => sprintf(
_('Page subject (%s-%s chars)'),
number_format($this->_validator->getPageTitleLengthMin()),
number_format($this->_validator->getPageTitleLengthMax())
),
]
],
'description' => (object)
[
'error' => [],
'attribute' => (object)
[
'value' => null,
'minlength' => $this->_validator->getPageDescriptionLengthMin(),
'maxlength' => $this->_validator->getPageDescriptionLengthMax(),
'placeholder' => sprintf(
_('Page description text (%s-%s chars)'),
number_format($this->_validator->getPageDescriptionLengthMin()),
number_format($this->_validator->getPageDescriptionLengthMax())
),
]
],
'keywords' => (object)
[
'error' => [],
'attribute' => (object)
[
'value' => null,
'minlength' => $this->_validator->getPageKeywordsLengthMin(),
'maxlength' => $this->_validator->getPageKeywordsLengthMax(),
'placeholder' => sprintf(
_('Page keywords (%s-%s total / %s-%s chars per item)'),
number_format($this->_validator->getPageKeywordsQuantityMin()),
number_format($this->_validator->getPageKeywordsQuantityMax()),
number_format($this->_validator->getPageKeywordsLengthMin()),
number_format($this->_validator->getPageKeywordsLengthMax())
),
]
],
'torrent' => (object)
[
'error' => [],
'attribute' => (object)
[
'value' => null,
'placeholder' => sprintf(
_('Torrent file (use Ctrl to select multiple files)')
),
],
],
'magnet' => (object)
[
'error' => [],
'value' => null,
],
];
if (isset($_POST))
{
}
// Render
require_once __DIR__ . '/module/head.php';