From 4766f36a4d74924f21ff329c4318ce4e069ffa04 Mon Sep 17 00:00:00 2001 From: brettp Date: Wed, 3 Mar 2010 17:53:05 +0000 Subject: Pulled in the interface changes. git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../notifications/subscriptions/forminternals.php | 315 +++++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 mod/notifications/views/default/notifications/subscriptions/forminternals.php (limited to 'mod/notifications/views/default/notifications/subscriptions/forminternals.php') diff --git a/mod/notifications/views/default/notifications/subscriptions/forminternals.php b/mod/notifications/views/default/notifications/subscriptions/forminternals.php new file mode 100644 index 000000000..673e30cc3 --- /dev/null +++ b/mod/notifications/views/default/notifications/subscriptions/forminternals.php @@ -0,0 +1,315 @@ +

+ +

+

+ +

+guid,'',9999,0); + + global $NOTIFICATION_HANDLERS; + foreach($NOTIFICATION_HANDLERS as $method => $foo) { + $subsbig[$method] = elgg_get_entities_from_relationship(array('relationship' => 'notify' . $method, 'relationship_guid' => $vars['user']->guid, 'types' => 'user', 'limit' => 99999)); + } + + $subs = array(); + foreach($subsbig as $method => $big) { + if (is_array($subsbig[$method]) && sizeof($subsbig[$method])) { + foreach($subsbig[$method] as $u) { $subs[$method][] = $u->guid; } + } + } + + // Let the system know that the friends picker is in use + global $pickerinuse; + $pickerinuse = true; + $chararray = elgg_echo('friendspicker:chararray'); + + // Initialise internalname + if (!isset($vars['internalname'])) { + $internalname = "friend"; + } else { + $internalname = $vars['internalname']; + } + + // Initialise values + if (!isset($vars['value'])) { + $vars['value'] = array(); + } else { + if (!is_array($vars['value'])) { + $vars['value'] = (int) $vars['value']; + $vars['value'] = array($vars['value']); + } + } + + // Initialise whether we're calling back or not + if (isset($vars['callback'])) { + $callback = $vars['callback']; + } else { + $callback = false; + } + + // We need to count the number of friends pickers on the page. + if (!isset($vars['friendspicker'])) { + global $friendspicker; + if (!isset($friendspicker)) $friendspicker = 0; + $friendspicker++; + } else { + $friendspicker = $vars['friendspicker']; + } + + $users = array(); + $activeletters = array(); + + // Are we displaying form tags and submit buttons? + // (If we've been given a target, then yes! Otherwise, no.) + if (isset($vars['formtarget'])) { + $formtarget = $vars['formtarget']; + } else { + $formtarget = false; + } + + // Sort users by letter + if (is_array($friends) && sizeof($friends)) + foreach($friends as $user) { + + if (is_callable('mb_substr')) + $letter = strtoupper(mb_substr($user->name,0,1)); + else + $letter = strtoupper(substr($user->name,0,1)); + if (!substr_count($chararray,$letter)) { + $letter = "*"; + } + if (!isset($users[$letter])) { + $users[$letter] = array(); + } + $users[$letter][$user->name] = $user; + + } + + if (!$callback) { + +?> + +
+ + + +
+ + + + + + + + +
+
+
+ +
+
+

+ + + + + + + $foo) { + if ($i > 0) + echo ""; +?> + + + + + + 0) + foreach($users[$letter] as $friend) { + if ($friend instanceof ElggUser ) { + + if (!in_array($letter,$activeletters)) + $activeletters[] = $letter; + + $method = array(); + $fields = ''; + $i = 0; + + foreach($NOTIFICATION_HANDLERS as $method => $foo) { + if (in_array($friend->guid,$subs[$method])) { + $checked[$method] = 'checked="checked"'; + } else { + $checked[$method] = ''; + } + if ($i > 0) $fields .= ""; + $fields .= <<< END + +END; + $i++; + } +?> + + + + + + + + + + + +
   
  + +
+ $friend, 'size' => 'tiny', 'override' => true)); +?> +  
+ + + +
+
+ +
+
+
+ + + +
+
+ + + + + + + + + + + + +
+
+ +
+ + + \ No newline at end of file -- cgit v1.2.3