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

added support for select and radio

parent 978ed2b5
No related branches found
No related tags found
1 merge request!11Support für Dropdowns mit Lookup - task #4630
...@@ -224,10 +224,22 @@ class rollout_base implements iRolloutplugin{ ...@@ -224,10 +224,22 @@ class rollout_base implements iRolloutplugin{
} else { } else {
$aEffectiveConfig=$this->getConfig($sPhase); $aEffectiveConfig=$this->getConfig($sPhase);
// echo $sKey.' ... '; print_r($aEffectiveConfig[$sVarname]); echo '<br>'; // echo $sKey.' ... '; print_r($aEffectiveConfig[$sVarname]); echo '<br>';
// mark entry as active ... for select and radio
if(isset($aEffectiveConfig[$sVarname]) && isset($aCallbackData[$aEffectiveConfig[$sVarname]])){ if(isset($aEffectiveConfig[$sVarname]) && isset($aCallbackData[$aEffectiveConfig[$sVarname]])){
$aCallbackData[$aEffectiveConfig[$sVarname]]['selected']='selected'; $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>"; // print_r($aCallbackData[$sVarname]); echo "<br>";
} }
// echo '<pre>'.$sCallbackfunktion .' = '. print_r($aMydata,1 ).'</pre>'; // echo '<pre>'.$sCallbackfunktion .' = '. print_r($aMydata,1 ).'</pre>';
...@@ -247,11 +259,11 @@ class rollout_base implements iRolloutplugin{ ...@@ -247,11 +259,11 @@ class rollout_base implements iRolloutplugin{
// 'required' => 'required', // 'required' => 'required',
'validate' => 'isastring', 'validate' => 'isastring',
// 'size' => 25, // 'size' => 25,
// 'placeholder' => (isset($this->_aCfgGlobal[$sVarname]) ? $this->_aCfgGlobal[$sVarname] : '') . ' | '.$aDefaultValues[$sVarname],
'placeholder' => $sMyPlaceholder 'placeholder' => $sMyPlaceholder
); );
break; break;
case "select": case "select":
case "radio":
$aOptions=$aCallbackData; $aOptions=$aCallbackData;
$aFormdata[]=array( $aFormdata[]=array(
'type' => $aVarinfos['type'], 'type' => $aVarinfos['type'],
...@@ -262,7 +274,7 @@ class rollout_base implements iRolloutplugin{ ...@@ -262,7 +274,7 @@ class rollout_base implements iRolloutplugin{
'validate' => 'isastring', 'validate' => 'isastring',
'options' => $aOptions, 'options' => $aOptions,
'placeholder' => $sMyPlaceholder // 'placeholder' => $sMyPlaceholder
); );
break; break;
case "text": case "text":
...@@ -281,7 +293,6 @@ class rollout_base implements iRolloutplugin{ ...@@ -281,7 +293,6 @@ class rollout_base implements iRolloutplugin{
// 'required' => 'required', // 'required' => 'required',
'validate' => 'isastring', 'validate' => 'isastring',
// 'size' => 25, // 'size' => 25,
// 'placeholder' => (isset($this->_aCfgGlobal[$sVarname]) ? $this->_aCfgGlobal[$sVarname] : '') . ' | '.$aDefaultValues[$sVarname],
'placeholder' => $sMyPlaceholder 'placeholder' => $sMyPlaceholder
); );
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment