Skip to content
Snippets Groups Projects
Commit c2f7d5d9 authored by hahn's avatar hahn
Browse files

added support for select and radio

parent 978ed2b5
Branches
No related tags found
1 merge request!11Support für Dropdowns mit Lookup - task #4630
......@@ -224,10 +224,22 @@ class rollout_base implements iRolloutplugin{
} else {
$aEffectiveConfig=$this->getConfig($sPhase);
// echo $sKey.' ... '; print_r($aEffectiveConfig[$sVarname]); echo '<br>';
// mark entry as active ... for select and radio
if(isset($aEffectiveConfig[$sVarname]) && isset($aCallbackData[$aEffectiveConfig[$sVarname]])){
$aCallbackData[$aEffectiveConfig[$sVarname]]['selected']='selected';
// wenn value = defaultvalue, dann value auf '' setzen
$aCallbackData[$aEffectiveConfig[$sVarname]]['checked']='checked';
$aCallbackData[$aEffectiveConfig[$sVarname]]['label'].=' <<<';
} elseif ($aVarinfos['type']==='select') {
$aCallbackData=array_merge(array('NO_SELECTED_ITEM_YET'=>array('value'=>'', 'label'=>'...')), $aCallbackData);
}
// wenn value = defaultvalue, dann value auf '' setzen (damit bei Default vom Scope
// davor ein Leerstring übergeben wird - analog onfocusout im Text Input
if (isset($aCallbackData[$aDefaultValues[$sVarname]])){
$aCallbackData[$aDefaultValues[$sVarname]]['value']='';
$aCallbackData[$aDefaultValues[$sVarname]]['label'].=' (*)';
}
// print_r($aCallbackData[$sVarname]); echo "<br>";
}
// echo '<pre>'.$sCallbackfunktion .' = '. print_r($aMydata,1 ).'</pre>';
......@@ -247,11 +259,11 @@ class rollout_base implements iRolloutplugin{
// 'required' => 'required',
'validate' => 'isastring',
// 'size' => 25,
// 'placeholder' => (isset($this->_aCfgGlobal[$sVarname]) ? $this->_aCfgGlobal[$sVarname] : '') . ' | '.$aDefaultValues[$sVarname],
'placeholder' => $sMyPlaceholder
);
break;
case "select":
case "radio":
$aOptions=$aCallbackData;
$aFormdata[]=array(
'type' => $aVarinfos['type'],
......@@ -262,7 +274,7 @@ class rollout_base implements iRolloutplugin{
'validate' => 'isastring',
'options' => $aOptions,
'placeholder' => $sMyPlaceholder
// 'placeholder' => $sMyPlaceholder
);
break;
case "text":
......@@ -281,7 +293,6 @@ class rollout_base implements iRolloutplugin{
// 'required' => 'required',
'validate' => 'isastring',
// 'size' => 25,
// 'placeholder' => (isset($this->_aCfgGlobal[$sVarname]) ? $this->_aCfgGlobal[$sVarname] : '') . ' | '.$aDefaultValues[$sVarname],
'placeholder' => $sMyPlaceholder
);
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment