', $control->attributes(array("name"=>$selectname))); $type = isset($value['type']) ? $value['type'] : null; $text = isset($value['text']) ? $value['text'] : null; foreach ($node->children('option') as $option) { // set attributes $attributes = array('value' => $option->attr('value')); // is checked ? if ($option->attr('value') == $type) { $attributes = array_merge($attributes, array('selected' => 'selected')); } printf('', $control->attributes($attributes), $option->text()); } printf(''); printf(' ', $control->attributes(array_merge($node->attr(), array('type' => 'text', 'name' => $textname, 'value' => $text)), array('label', 'description', 'default')));