rendering of edit subscription form

This commit is contained in:
Jonathan Labreuille
2016-02-26 19:59:55 +01:00
parent e6337216cf
commit d2be407ccb
4 changed files with 138 additions and 10 deletions

View File

@@ -23,8 +23,17 @@ class Select extends Base {
foreach($block['params']['values'] as $option) {
$is_selected = (isset($option['is_checked']) && $option['is_checked'])
? 'selected="selected"' : '';
$html .= '<option value="'.$option['value'].'" '.$is_selected.'>';
$html .= $option['value'];
if(is_array($option['value'])) {
$value = key($option['value']);
$label = reset($option['value']);
} else {
$value = $option['value'];
$label = $option['value'];
}
$html .= '<option value="'.$value.'" '.$is_selected.'>';
$html .= $label;
$html .= '</option>';
}
$html .= '</select>';