summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-10-09 10:39:15 +0000
committerDries Buytaert <dries@buytaert.net>2005-10-09 10:39:15 +0000
commitfd96728f3ca312214c4e2ff58649a8ae338b1754 (patch)
treed4deaddca360211b1917544ecc347c0b13e66431 /includes/form.inc
parent6f30f02c16bdbda14a38e574ba79faa28b0e2487 (diff)
downloadbrdo-fd96728f3ca312214c4e2ff58649a8ae338b1754.tar.gz
brdo-fd96728f3ca312214c4e2ff58649a8ae338b1754.tar.bz2
- Second batch of form API fixes by chx.
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc10
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 42240001c..fa7e56368 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -651,7 +651,7 @@ function theme_select($element) {
if (is_array($choice)) {
$select .= '<optgroup label="'. $key .'">';
foreach ($choice as $key => $choice) {
- $select .= '<option value="'. $key .'"'. (is_array($elementp[value]) ? (in_array($key, $element[value]) ? ' selected="selected"' : '') : ($element[value] == $key ? ' selected="selected"' : '')) .'>'. check_plain($choice) .'</option>';
+ $select .= '<option value="'. $key .'"'. (is_array($element[value]) ? (in_array($key, $element[value]) ? ' selected="selected"' : '') : ($element[value] == $key ? ' selected="selected"' : '')) .'>'. check_plain($choice) .'</option>';
}
$select .= '</optgroup>';
}
@@ -781,7 +781,8 @@ function expand_date($element) {
/**
- * Roll out a single checkbox element to a list of checkboxes, using the options array as index.
+ * Roll out a single adios element
+ * to a list of radios, using the options array as index.
*/
function expand_radios($element) {
if (count($element[options]) > 0) {
@@ -861,10 +862,7 @@ function expand_checkboxes($element) {
}
foreach ($element[options] as $key => $choice) {
if (!isset($element[$key])) {
- $element[$key] = array(
- type => 'checkbox', processed => TRUE, title => $choice, tree => TRUE,
- value => in_array($key, $value), attributes => $element[attributes]
- );
+ $element[$key] = array(type => 'checkbox', processed => TRUE, title => $choice, tree => TRUE, default_value => in_array($key, $value), attributes => $element[attributes]);
}
}
}