Skip to content

Commit

Permalink
choice Felder Abfrage verbessert
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Sep 4, 2018
1 parent 6b6ca05 commit f137a02
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions lib/yform/value/choice.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ public static function getListValues($params)
$field = $params['params']['field'];

$choiceList = self::createChoiceList([
'choice_attributes' => @$field['choice_attributes'],
'choices' => @$field['choices'],
'expanded' => @$field['expanded'],
'group_by' => @$field['group_by'],
'multiple' => @$field['multiple'],
'placeholder' => @$field['placeholder'],
'preferred_choices' => @$field['preferred_choices'],
'choice_attributes' => (isset($field['choice_attributes'])) ? $field['choice_attributes'] : '',
'choices' => (isset($field['choices'])) ? $field['choices'] : [],
'expanded' => (isset($field['expanded'])) ? $field['expanded'] : '',
'group_by' => (isset($field['group_by'])) ? $field['group_by'] : '',
'multiple' => (isset($field['multiple'])) ? $field['multiple'] : false,
'placeholder' => (isset($field['placeholder'])) ? $field['placeholder'] : '',
'preferred_choices' => (isset($field['preferred_choices'])) ? $field['preferred_choices'] : [],
]);

$choices = $choiceList->getChoicesByValues();
Expand Down Expand Up @@ -249,16 +249,17 @@ public function getAttributes($element, array $attributes = [], array $directAtt

public static function getSearchField($params)
{

$choiceList = self::createChoiceList([
'choice_attributes' => @$params['field']['choice_attributes'],
'choices' => @$params['field']['choices'],
'expanded' => @$params['field']['expanded'],
'group_by' => @$params['field']['group_by'],
'multiple' => @$params['field']['multiple'],
'placeholder' => @$params['field']['placeholder'],
'preferred_choices' => @$params['field']['preferred_choices'],
'choice_attributes' => (isset($params['field']['choice_attributes'])) ? $params['field']['choice_attributes'] : '',
'choices' => (isset($params['field']['choices'])) ? $params['field']['choices'] : [],
'expanded' => (isset($params['field']['expanded'])) ? $params['field']['expanded'] : '',
'group_by' => (isset($params['field']['group_by'])) ? $params['field']['group_by'] : '',
'multiple' => (isset($params['field']['multiple'])) ? $params['field']['multiple'] : false,
'placeholder' => (isset($params['field']['placeholder'])) ? $params['field']['placeholder'] : '',
'preferred_choices' => (isset($params['field']['preferred_choices'])) ? $params['field']['preferred_choices'] : [],
]);

$choices = [];
$choices['(empty)'] = '(empty)';
$choices['!(empty)'] = '!(empty)';
Expand Down

0 comments on commit f137a02

Please sign in to comment.