data->get_parameter("translate"); $s = "
\n"; $option_count = count($data['options']); foreach ($data['options'] as $option){ //basics $s .= "
"; $s .= "form_type}\" name=\"{$data['name']}"; $s .= ($this->form_type == 'checkbox' && $option_count > 1 ? '[]' : ""); $s .= "\" id=\"form_{$option['value']}\" value=\"{$option['value']}\" "; if (isset($form[$data['name']]) AND $form[$data['name']] == $option['value']){ $s .= 'checked'; } if (isset($data['other_option_name'])){ if (!isset($data['attributes'])) $data['attributes'] = array(); $data['attributes']['class'][] = "sm_select_has_other"; } //add attributes if (isset($data['attributes'])){ foreach($data['attributes'] as $att_key => $att_array){ $s .= " $att_key=\"" . implode(" ", (array)$att_array) . '" '; } } //end with label and closing tag $s .= ">\n"; $s .= "
\n"; } $s .= "
\n"; if (isset($data['other_option_name'])){ $s .= "
\n"; $s .= $translation->trans("Other, please state"); $s .= " \n"; $s .= "
\n"; } return $s; } }