From c5cc2821311012a8a4385a304a043c4b41f2afbb Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 31 Aug 2009 19:05:21 +0000 Subject: All line endings are now Unix-style. git-svn-id: https://code.elgg.org/elgg/trunk@3451 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/failsafe/input/checkboxes.php | 78 ++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'views/failsafe/input/checkboxes.php') diff --git a/views/failsafe/input/checkboxes.php b/views/failsafe/input/checkboxes.php index 46894c5cb..0e394af55 100644 --- a/views/failsafe/input/checkboxes.php +++ b/views/failsafe/input/checkboxes.php @@ -1,49 +1,49 @@ - $option) { - //if (!in_array($option,$vars['value'])) { - if (is_array($vars['value'])) { - if (!in_array($option,$vars['value'])) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } + + foreach($vars['options'] as $label => $option) { + //if (!in_array($option,$vars['value'])) { + if (is_array($vars['value'])) { + if (!in_array($option,$vars['value'])) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } } else { - if ($option != $vars['value']) { - $selected = ""; - } else { - $selected = "checked = \"checked\""; - } - } - $labelint = (int) $label; - if ("{$label}" == "{$labelint}") { - $label = $option; + if ($option != $vars['value']) { + $selected = ""; + } else { + $selected = "checked = \"checked\""; + } + } + $labelint = (int) $label; + if ("{$label}" == "{$labelint}") { + $label = $option; } $disabled = ""; - if ($vars['disabled']) $disabled = ' disabled="yes" '; - echo "
"; - } - + if ($vars['disabled']) $disabled = ' disabled="yes" '; + echo "
"; + } + ?> \ No newline at end of file -- cgit v1.2.3