$info['disabled'] = 'disabled';
}
$field = HTMLForm::loadInputFromParameters( $name, $info, $dummyForm ); // For validation
- $globalDefault = isset( $defaultOptions[$name] )
- ? $defaultOptions[$name]
- : null;
+ $globalDefault = $defaultOptions[$name] ?? null;
// If it validates, set it as the default
if ( isset( $info['default'] ) ) {
if ( ( isset( $info['type'] ) && $info['type'] == 'multiselect' ) ||
( isset( $info['class'] ) && $info['class'] == \HTMLMultiSelectField::class ) ) {
$options = HTMLFormField::flattenOptions( $info['options'] );
- $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
+ $prefix = $info['prefix'] ?? $name;
$val = [];
foreach ( $options as $value ) {
( isset( $info['class'] ) && $info['class'] == \HTMLCheckMatrix::class ) ) {
$columns = HTMLFormField::flattenOptions( $info['columns'] );
$rows = HTMLFormField::flattenOptions( $info['rows'] );
- $prefix = isset( $info['prefix'] ) ? $info['prefix'] : $name;
+ $prefix = $info['prefix'] ?? $name;
$val = [];
foreach ( $columns as $column ) {
protected function submitForm( array $formData, HTMLForm $form ) {
$res = $this->saveFormData( $formData, $form );
- if ( $res ) {
+ if ( $res === true ) {
$context = $form->getContext();
-
$urlOptions = [];
if ( $res === 'eauth' ) {
$context->getOutput()->redirect( $url );
}
- return Status::newGood();
+ return ( $res === true ? Status::newGood() : $res );
}
/**