diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-05 18:45:02 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-05 18:45:02 +0000 |
commit | b2128acbdccfa8289cb6b8978870a8a2a6886896 (patch) | |
tree | f81919b13269fbec8ca17859214d5994574d8037 /mod/notifications/views | |
parent | 6d6591d8097661c5e64623972d18664913378ab4 (diff) | |
download | elgg-b2128acbdccfa8289cb6b8978870a8a2a6886896.tar.gz elgg-b2128acbdccfa8289cb6b8978870a8a2a6886896.tar.bz2 |
Friends collections preferences are saved
git-svn-id: https://code.elgg.org/elgg/trunk@2661 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/notifications/views')
-rw-r--r-- | mod/notifications/views/default/notifications/subscriptions/collections.php | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/mod/notifications/views/default/notifications/subscriptions/collections.php b/mod/notifications/views/default/notifications/subscriptions/collections.php index 41ce4118f..8cac8cf12 100644 --- a/mod/notifications/views/default/notifications/subscriptions/collections.php +++ b/mod/notifications/views/default/notifications/subscriptions/collections.php @@ -43,16 +43,26 @@ $fields = '';
$i = 0;
- foreach($NOTIFICATION_HANDLERS as $method => $foo) {
- if ($i > 0) $fields .= "<td class=\"spacercolumn\"> </td>";
- $toggle = elgg_echo('toggle');
- $fields .= <<< END
- <td class="{$method}togglefield">
- <a href="#" class="{$method}toggleOn"></a>
- </td>
-END;
- $i++;
+ foreach($NOTIFICATION_HANDLERS as $method => $foo) {
+ $metaname = 'collections_notifications_preferences_' . $method;
+ if ($collections_preferences = $vars['user']->$metaname) {
+ if (!empty($collections_preferences) && !is_array($collections_preferences))
+ $collections_preferences = array($collections_preferences);
+ if (is_array($collections_preferences))
+ if (in_array($collection->id,$collections_preferences)) {
+ $collectionschecked[$method] = 'checked="checked"';
+ } else {
+ $collectionschecked[$method] = '';
+ }
}
+ if ($i > 0) $fields .= "<td class=\"spacercolumn\"> </td>";
+ $fields .= <<< END
+ <td class="{$method}togglefield">
+ <a href="#" border="0" id="{$method}collections" class="{$method}toggleOff" onclick="adjust{$method}_alt('{$method}collections');">
+ <input type="checkbox" name="{$method}collections[]" id="{$method}checkbox" onclick="adjust{$method}('{$method}collections');" value="{$collection->id}" {$collectionschecked[$method]} /></a></td>
+END;
+ $i++;
+ }
echo $fields;
?>
|