From 60c1387a16ea4944674b0c9da2273158d1fbf0b4 Mon Sep 17 00:00:00 2001
From: cash
Date: Sun, 22 Aug 2010 23:15:43 +0000
Subject: Merged r6757:6810 from 1.7 branch into trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6850 36083f99-b078-4883-b0ff-0f9b5a30f544
---
mod/friends/views/default/widgets/friends/edit.php | 89 +++++++++++++---------
mod/friends/views/default/widgets/friends/view.php | 78 +++++++++----------
2 files changed, 87 insertions(+), 80 deletions(-)
(limited to 'mod/friends/views/default')
diff --git a/mod/friends/views/default/widgets/friends/edit.php b/mod/friends/views/default/widgets/friends/edit.php
index 0d9d44136..50c44af3c 100644
--- a/mod/friends/views/default/widgets/friends/edit.php
+++ b/mod/friends/views/default/widgets/friends/edit.php
@@ -1,44 +1,61 @@
num_display)) {
+ $vars['entity']->num_display = 12;
+ $vars['entity']->icon_size = 'small';
+}
+
+// handle upgrade to 1.7.2 from previous versions
+if ($vars['entity']->icon_size == 1) {
+ $vars['entity']->icon_size = 'small';
+} elseif ($vars['entity']->icon_size == 2) {
+ $vars['entity']->icon_size = 'tiny';
+}
?>
- :
-
- num_display == 1) echo "SELECTED"; ?>>1
- num_display == 2) echo "SELECTED"; ?>>2
- num_display == 3) echo "SELECTED"; ?>>3
- num_display == 4) echo "SELECTED"; ?>>4
- num_display == 5) echo "SELECTED"; ?>>5
- num_display == 6) echo "SELECTED"; ?>>6
- num_display == 7) echo "SELECTED"; ?>>7
- num_display == 8) echo "SELECTED"; ?>>8
- num_display == 9) echo "SELECTED"; ?>>9
- num_display == 10) echo "SELECTED"; ?>>10
- num_display == 15) echo "SELECTED"; ?>>15
- num_display == 20) echo "SELECTED"; ?>>20
- num_display == 30) echo "SELECTED"; ?>>30
- num_display == 50) echo "SELECTED"; ?>>50
- num_display == 100) echo "SELECTED"; ?>>100
-
+ :
+
+num_display == $selection) {
+ $selected = 'selected="selected"';
+ }
+ echo "$selection ";
+}
+?>
+
-
-
- icon_size == 1) echo "SELECTED"; ?>>
- icon_size == 2) echo "SELECTED"; ?>>
-
-
\ No newline at end of file
+
+
+icon_size == $size) {
+ $selected = 'selected="selected"';
+ }
+ $label = elgg_echo("friends:$size");
+ echo "$label ";
+}
+?>
+
+
diff --git a/mod/friends/views/default/widgets/friends/view.php b/mod/friends/views/default/widgets/friends/view.php
index ab702399a..4532e7ace 100644
--- a/mod/friends/views/default/widgets/friends/view.php
+++ b/mod/friends/views/default/widgets/friends/view.php
@@ -1,50 +1,40 @@
owner_guid);
-
- //the number of files to display
- $num = (int) $vars['entity']->num_display;
- if (!$num)
- $num = 8;
-
- //get the correct size
- $size = (int) $vars['entity']->icon_size;
- if (!$size || $size == 1){
- $size_value = "small";
- }else{
- $size_value = "tiny";
- }
-
- // Get the users friends
- $friends = $owner->getFriends("", $num, $offset = 0);
-
- // If there are any $friend to view, view them
- if (is_array($friends) && sizeof($friends) > 0) {
+/**
+ * Elgg Friends
+ * Friend widget display view
+ *
+ * @package ElggFriends
+ * @subpackage Core
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2010
+ * @link http://elgg.org/
+ */
+
+
+// owner of the profile page
+$owner = get_user($vars['entity']->owner_guid);
+
+// the number of friends to display
+$num = (int) $vars['entity']->num_display;
- echo "