DirectorDatafieldForm: no more _POST :)
This commit is contained in:
parent
d52549acd7
commit
05a63e45d4
|
@ -33,9 +33,7 @@ class DirectorDatafieldForm extends DirectorObjectForm
|
||||||
'class' => 'autosubmit'
|
'class' => 'autosubmit'
|
||||||
));
|
));
|
||||||
|
|
||||||
// TODO: Form needs to provide a better way for doing this
|
if ($class = $this->getSentValue('datatype')) {
|
||||||
if (isset($_POST['datatype'])) {
|
|
||||||
$class = $_POST['datatype'];
|
|
||||||
if ($class && array_key_exists($class, $this->enumDataTypes())) {
|
if ($class && array_key_exists($class, $this->enumDataTypes())) {
|
||||||
$this->addSettings($class);
|
$this->addSettings($class);
|
||||||
}
|
}
|
||||||
|
@ -55,9 +53,8 @@ class DirectorDatafieldForm extends DirectorObjectForm
|
||||||
|
|
||||||
public function onSuccess()
|
public function onSuccess()
|
||||||
{
|
{
|
||||||
if (isset($_POST['datatype'])) {
|
if ($class = $this->getValue('datatype')) {
|
||||||
$class = $_POST['datatype'];
|
if (array_key_exists($class, $this->enumDataTypes())) {
|
||||||
if ($class && array_key_exists($class, $this->enumDataTypes())) {
|
|
||||||
$this->addHidden('format', $class::getFormat());
|
$this->addHidden('format', $class::getFormat());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue