From 1ab250f2a8e90c4aa24ada873f98c81dbdd4ae93 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 26 Feb 2011 12:43:16 +0000 Subject: fixed friends picker js include git-svn-id: http://code.elgg.org/elgg/trunk@8489 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/input/friendspicker.php | 327 ++++++++++++++++++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 views/default/input/friendspicker.php (limited to 'views/default/input/friendspicker.php') diff --git a/views/default/input/friendspicker.php b/views/default/input/friendspicker.php new file mode 100644 index 000000000..b95640b0b --- /dev/null +++ b/views/default/input/friendspicker.php @@ -0,0 +1,327 @@ +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->guid] = $user; + } +} + +// sort users in letters alphabetically +foreach ($users as $letter => $letter_users) { + usort($letter_users, create_function('$a, $b', ' + return strcasecmp($a->name, $b->name); + ')); + $users[$letter] = $letter_users; +} + +if (!$callback) { + ?> + +
+ + + +
+ + + + + + +
+ + + +
+
+
+ +
+
+

+ "; + $col = 0; + + foreach($users[$letter] as $friend) { + if ($col == 0) { + echo ""; + } + + //echo "

" . $user->name . "

"; + $label = elgg_view_entity_icon($friend, 'tiny', array('override' => true)); + $options[$label] = $friend->getGUID(); + + if ($vars['highlight'] == 'all' + && !in_array($letter,$activeletters)) { + + $activeletters[] = $letter; + } + + + if (in_array($friend->getGUID(),$vars['value'])) { + $checked = "checked = \"checked\""; + if (!in_array($letter,$activeletters) && $vars['highlight'] == 'default') { + $activeletters[] = $letter; + } + } else { + $checked = ""; + } + ?> + + + + name="[]" value="" /> + + + + + +
+ +
+ + + name; ?> + + "; + $col = 0; + } + } + if ($col < 3) { + echo ""; + } + + echo ""; + } + +?> + +
+
+ +
+ + +
+
+ + +
+ + + + +
+
+ + + +
+
+ + + + + + + +