Fix undefined variable error

darcs-hash:20080720100024-533db-d2b5b63f169b6e16e08e81c8da63b7f9f69e7521.gz
This commit is contained in:
Mike Cochrane 2008-07-20 06:00:24 -04:00
parent 02325570a6
commit bd0b6970ae

View File

@ -370,20 +370,20 @@ function common_checkbox($id, $label, $checked=false, $instructions=NULL, $value
} }
function common_dropdown($id, $label, $content, $instructions=NULL, $blank_select=FALSE, $selected=NULL) { function common_dropdown($id, $label, $content, $instructions=NULL, $blank_select=FALSE, $selected=NULL) {
common_element_start('p'); common_element_start('p');
common_element('label', array('for' => $id), $label); common_element('label', array('for' => $id), $label);
common_element_start('select', array('id' => $id, 'name' => $id)); common_element_start('select', array('id' => $id, 'name' => $id));
if ($blank_select) { if ($blank_select) {
common_element('option', array('value' => $value)); common_element('option', array('value' => ''));
} }
foreach ($content as $value => $option) { foreach ($content as $value => $option) {
if ($value == $selected) { if ($value == $selected) {
common_element('option', array('value' => $value, 'selected' => $value), $option); common_element('option', array('value' => $value, 'selected' => $value), $option);
} else { } else {
common_element('option', array('value' => $value), $option); common_element('option', array('value' => $value), $option);
} }
} }
common_element_end('select'); common_element_end('select');
if ($instructions) { if ($instructions) {
common_element('span', 'input_instructions', $instructions); common_element('span', 'input_instructions', $instructions);
} }