summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/imsettings.php6
-rw-r--r--lib/util.php8
2 files changed, 9 insertions, 5 deletions
diff --git a/actions/imsettings.php b/actions/imsettings.php
index a5e9be307..18666e170 100644
--- a/actions/imsettings.php
+++ b/actions/imsettings.php
@@ -79,9 +79,11 @@ class ImsettingsAction extends SettingsAction {
common_element('h2', NULL, _t('Preferences'));
common_checkbox('jabbernotify',
- _t('Send me notices through Jabber/GTalk.'));
+ _t('Send me notices through Jabber/GTalk.'),
+ $user->jabbernotify);
common_checkbox('updatefrompresence',
- _t('Post a notice when my Jabber/GTalk status changes.'));
+ _t('Post a notice when my Jabber/GTalk status changes.'),
+ $user->updatefrompresence);
common_submit('save', _t('Save'));
common_element_end('form');
diff --git a/lib/util.php b/lib/util.php
index a20f64c85..e3c00b31d 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -319,16 +319,18 @@ function common_input($id, $label, $value=NULL,$instructions=NULL) {
common_element_end('p');
}
-function common_checkbox($id, $label, $instructions=NULL, $value='true')
+function common_checkbox($id, $label, $checked=false, $instructions=NULL, $value='true')
{
common_element_start('p');
$attrs = array('name' => $id,
'type' => 'checkbox',
- 'id' => $id,
- 'value' => $value);
+ 'id' => $id);
if ($value) {
$attrs['value'] = htmlspecialchars($value);
}
+ if ($checked) {
+ $attrs['checked'] = 'checked';
+ }
common_element('input', $attrs);
# XXX: use a <label>
common_text(' ');