[core] add explicit support for list default value

and implicit support for text and number parameters

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
This commit is contained in:
Pierre Mazière 2016-08-28 11:03:30 +02:00
parent 806f38b42d
commit 74d876b585

View file

@ -317,6 +317,18 @@ abstract class BridgeAbstract implements BridgeInterface {
$this->inputs[$context][$name]['value']=$properties['defaultValue'];
}
break;
case 'list':
if(!isset($properties['defaultValue'])){
$this->inputs[$context][$name]['value']=reset($properties['values']);
}else{
$this->inputs[$context][$name]['value']=$properties['defaultValue'];
}
break;
default:
if(isset($properties['defaultValue'])){
$this->inputs[$context][$name]['value']=$properties['defaultValue'];
}
break;
}
}
}