mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Bug
This commit is contained in:
parent
ef2234c74b
commit
c044e63a07
@ -357,6 +357,26 @@ class Form extends WidgetBase
|
|||||||
$field->arrayName = $this->arrayName;
|
$field->arrayName = $this->arrayName;
|
||||||
$field->idPrefix = $this->getId();
|
$field->idPrefix = $this->getId();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Simple widget field, only widget type is supplied
|
||||||
|
*/
|
||||||
|
if (is_string($config) && $this->isFormWidget($config) !== false) {
|
||||||
|
$field->displayAs('widget', ['widget' => $config]);
|
||||||
|
return $field;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Simple field, only field type is supplied
|
||||||
|
*/
|
||||||
|
elseif (is_string($config)) {
|
||||||
|
$field->displayAs($config);
|
||||||
|
return $field;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$fieldType = isset($config['type']) ? $config['type'] : null;
|
||||||
|
if (!is_string($fieldType) && !is_null($fieldType))
|
||||||
|
throw new ApplicationException(Lang::get('backend::lang.field.invalid_type', ['type'=>gettype($fieldType)]));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Process basic options
|
* Process basic options
|
||||||
*/
|
*/
|
||||||
@ -381,25 +401,6 @@ class Form extends WidgetBase
|
|||||||
*/
|
*/
|
||||||
$field->value = $this->getFieldValue($field);
|
$field->value = $this->getFieldValue($field);
|
||||||
|
|
||||||
/*
|
|
||||||
* Simple widget field, only widget type is supplied
|
|
||||||
*/
|
|
||||||
if (is_string($config) && $this->isFormWidget($config) !== false) {
|
|
||||||
$field->displayAs('widget', ['widget' => $config]);
|
|
||||||
return $field;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Simple field, only field type is supplied
|
|
||||||
*/
|
|
||||||
elseif (is_string($config)) {
|
|
||||||
$field->displayAs($config);
|
|
||||||
return $field;
|
|
||||||
}
|
|
||||||
|
|
||||||
$fieldType = isset($config['type']) ? $config['type'] : null;
|
|
||||||
if (!is_string($fieldType) && !is_null($fieldType))
|
|
||||||
throw new ApplicationException(Lang::get('backend::lang.field.invalid_type', ['type'=>gettype($fieldType)]));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Widget with options
|
* Widget with options
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user