Update AzuraForms.

This commit is contained in:
Buster "Silver Eagle" Neece 2021-04-25 08:30:56 -05:00
parent b7a6f305a8
commit 4720e83533
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
2 changed files with 12 additions and 26 deletions

11
composer.lock generated
View File

@ -102,16 +102,17 @@
"source": {
"type": "git",
"url": "https://github.com/AzuraCast/azuraforms.git",
"reference": "ed1aaa82c684ebd2a748a6e834fd307f3618bd48"
"reference": "75916f552330b562a8d6acdebc1251939575aee4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/AzuraCast/azuraforms/zipball/ed1aaa82c684ebd2a748a6e834fd307f3618bd48",
"reference": "ed1aaa82c684ebd2a748a6e834fd307f3618bd48",
"url": "https://api.github.com/repos/AzuraCast/azuraforms/zipball/75916f552330b562a8d6acdebc1251939575aee4",
"reference": "75916f552330b562a8d6acdebc1251939575aee4",
"shasum": ""
},
"require": {
"php": ">=7.2"
"ext-json": "*",
"php": ">=7.4"
},
"require-dev": {
"overtrue/phplint": "^2.0",
@ -163,7 +164,7 @@
"type": "patreon"
}
],
"time": "2021-04-22T09:53:37+00:00"
"time": "2021-04-25T13:21:28+00:00"
},
{
"name": "azuracast/flysystem-v2-extensions",

View File

@ -24,32 +24,17 @@ class Form extends \AzuraForms\Form
);
}
public function openForm(): string
/**
* @return string[]
*/
protected function getFormAttributes(): array
{
$attrs = [
'id' => $this->name,
'method' => $this->method,
'action' => $this->action,
'class' => 'form ' . ($this->options['class'] ?? ''),
'accept-charset' => 'UTF-8',
];
foreach ($this->fields as $field) {
if ($field instanceof Field\File) {
$attrs['enctype'] = 'multipart/form-data';
break;
}
}
$attrs = parent::getFormAttributes();
if (!empty($this->options['tabs'])) {
$attrs['novalidate'] = 'novalidate';
}
$attrsAsHtml = [];
foreach ($attrs as $key => $val) {
$attrsAsHtml[] = $key . '="' . $val . '"';
}
return '<form ' . implode(' ', $attrsAsHtml) . '>';
return $attrs;
}
}