diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-09 14:55:22 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-09 14:55:22 +0000 |
commit | a173f54d6fe468f9bc3868ac493570af2eb689a7 (patch) | |
tree | 65597369027af515d0adcce5ea4b07f19bf1b433 /mod/notifications/views/default | |
parent | bbfc74f5fd5002d2bf88045f1d3479a3ac720f3d (diff) | |
download | elgg-a173f54d6fe468f9bc3868ac493570af2eb689a7.tar.gz elgg-a173f54d6fe468f9bc3868ac493570af2eb689a7.tar.bz2 |
Group notifications, all friends notification option
git-svn-id: https://code.elgg.org/elgg/trunk@2686 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/notifications/views/default')
-rw-r--r-- | mod/notifications/views/default/notifications/subscriptions/collections.php | 57 | ||||
-rw-r--r-- | mod/notifications/views/default/notifications/subscriptions/groupsform.php | 9 |
2 files changed, 54 insertions, 12 deletions
diff --git a/mod/notifications/views/default/notifications/subscriptions/collections.php b/mod/notifications/views/default/notifications/subscriptions/collections.php index 8582069a8..41c3f76c8 100644 --- a/mod/notifications/views/default/notifications/subscriptions/collections.php +++ b/mod/notifications/views/default/notifications/subscriptions/collections.php @@ -1,8 +1,3 @@ -<?php
-
- if ($collections = get_user_access_collections($vars['user']->guid)) {
- global $NOTIFICATION_HANDLERS;
-?>
<script type="text/javascript">
@@ -44,7 +39,53 @@ <td> </td>
</tr>
<?php
+ global $NOTIFICATION_HANDLERS;
+ $members = array();
+ if ($friends = get_user_friends($vars['user']->guid,'',9999,0)) {
+ foreach($friends as $friend)
+ $members[] = $friend->guid;
+ }
+ $memberno = sizeof($members);
+ $members = implode(',',$members);
+
+?>
+ <tr>
+ <td class="namefield">
+ <p>
+ <?php echo elgg_echo('friends:all'); ?> (<?php echo $memberno; ?>)
+ </p>
+ </td>
+<?php
+
+ $fields = '';
+ $i = 0;
+ 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(0,$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}collections0" class="{$method}toggleOff" onclick="adjust{$method}_alt('{$method}collections0'); setCollection([{$members}],'{$method}',0);">
+ <input type="checkbox" name="{$method}collections[]" id="{$method}checkbox" onclick="adjust{$method}('{$method}collections0');" value="0" {$collectionschecked[$method]} /></a></td>
+END;
+ $i++;
+ }
+ echo $fields;
+
+?>
+ </tr>
+<?php
+ if ($collections = get_user_access_collections($vars['user']->guid)) {
foreach($collections as $collection) {
$members = get_members_of_access_collection($collection->id, true);
$memberno = sizeof($members);
@@ -92,12 +133,8 @@ END; <?php
}
+}
?>
</table>
</div>
-<?php
-
- }
-
-?>
\ No newline at end of file diff --git a/mod/notifications/views/default/notifications/subscriptions/groupsform.php b/mod/notifications/views/default/notifications/subscriptions/groupsform.php index 5c0ee1057..56d90c6d1 100644 --- a/mod/notifications/views/default/notifications/subscriptions/groupsform.php +++ b/mod/notifications/views/default/notifications/subscriptions/groupsform.php @@ -3,6 +3,11 @@ global $NOTIFICATION_HANDLERS;
foreach($NOTIFICATION_HANDLERS as $method => $foo) {
$subsbig[$method] = get_entities_from_relationship('notify' . $method,$vars['user']->guid,false,'group','',0,'',99999);
+ $tmparray = array();
+ foreach($subsbig[$method] as $tmpent) {
+ $tmparray[] = $tmpent->guid;
+ }
+ $subsbig[$method] = $tmparray;
}
?>
@@ -13,7 +18,7 @@ <?php
echo elgg_view('notifications/subscriptions/jsfuncs',$vars);
?>
- <?php echo elgg_view_title(elgg_echo('notifications:subscriptions:groups')); ?>
+ <?php echo elgg_view_title(elgg_echo('notifications:subscriptions:changesettings:groups')); ?>
<p>
<?php
@@ -50,7 +55,7 @@ $i = 0;
foreach($NOTIFICATION_HANDLERS as $method => $foo) {
- if (in_array($group->guid,$subs[$method])) {
+ if (in_array($group->guid,$subsbig[$method])) {
$checked[$method] = 'checked="checked"';
} else {
$checked[$method] = '';
|