aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-07 12:45:22 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-09-07 12:45:22 +0000
commitb8a00eb11c817edcea1d4148f2675e69a1db5805 (patch)
tree627a453f549c6ef411bb5f425be27c65c06919c0
parent4904ed24816685ab2df1e9fe88e5f2cbb0b4e9f9 (diff)
downloadelgg-b8a00eb11c817edcea1d4148f2675e69a1db5805.tar.gz
elgg-b8a00eb11c817edcea1d4148f2675e69a1db5805.tar.bz2
Fixes 334: Radio buttons were part of the problem, label and option were the wrong way round (compare with input/checkboxes).
Second part of the problem was actually with views/default/notifications/settings/usersettings.php, where the value of the field was incorrectly being extracted from the settings array. Thanks for the spot! git-svn-id: https://code.elgg.org/elgg/trunk@2058 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--views/default/input/checkboxes.php2
-rw-r--r--views/default/input/radio.php4
-rw-r--r--views/default/notifications/settings/usersettings.php7
3 files changed, 7 insertions, 6 deletions
diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php
index ff3ab8523..2b9970aaa 100644
--- a/views/default/input/checkboxes.php
+++ b/views/default/input/checkboxes.php
@@ -14,7 +14,7 @@
* @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
- * @uses $vars['options'] An array of strings representing the options for the checkbox field
+ * @uses $vars['options'] An array of strings representing the label => options for the checkbox field
*
*/
diff --git a/views/default/input/radio.php b/views/default/input/radio.php
index 4ddbdf77f..be5554e8b 100644
--- a/views/default/input/radio.php
+++ b/views/default/input/radio.php
@@ -14,14 +14,14 @@
* @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
* @uses $vars['internalname'] The name of the input field
- * @uses $vars['options'] An array of strings representing the options for the radio field
+ * @uses $vars['options'] An array of strings representing the options for the radio field as "label" => option
*
*/
$class = $vars['class'];
if (!$class) $class = "input-radio";
- foreach($vars['options'] as $option => $label) {
+ foreach($vars['options'] as $label => $option) {
if ($option != $vars['value']) {
$selected = "";
} else {
diff --git a/views/default/notifications/settings/usersettings.php b/views/default/notifications/settings/usersettings.php
index 4bf43e254..02a4e67b4 100644
--- a/views/default/notifications/settings/usersettings.php
+++ b/views/default/notifications/settings/usersettings.php
@@ -11,7 +11,8 @@
*/
global $NOTIFICATION_HANDLERS;
- $notification_settings = get_user_notification_settings(page_owner());
+ $notification_settings = get_user_notification_settings(page_owner());
+
?>
<h3><?php echo elgg_echo('notifications:usersettings'); ?></h3>
@@ -29,12 +30,12 @@
<td>
<?php
- if ($notification_settings->k) {
+ if ($notification_settings->$k) {
$val = "yes";
} else {
$val = "no";
}
- echo elgg_view('input/radio',array('internalname' => "method[{$k}]", 'options' => array('yes','no'), 'value' => $val));
+ echo elgg_view('input/radio',array('internalname' => "method[{$k}]", 'options' => array('yes' => 'yes','no' => 'no'), 'value' => $val));
?>
</td>