From fcc68792fd00a2778746f6813efd0a5d879584d6 Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 16 Dec 2010 02:12:03 +0000 Subject: moved friends widget into core git-svn-id: http://code.elgg.org/elgg/trunk@7640 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/widgets/friends/content.php | 36 +++++++++++++++++++ views/default/widgets/friends/edit.php | 57 +++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 views/default/widgets/friends/content.php create mode 100644 views/default/widgets/friends/edit.php (limited to 'views') diff --git a/views/default/widgets/friends/content.php b/views/default/widgets/friends/content.php new file mode 100644 index 000000000..2f9ab71ea --- /dev/null +++ b/views/default/widgets/friends/content.php @@ -0,0 +1,36 @@ +owner_guid); + +// the number of friends to display +$num = (int) $vars['entity']->num_display; + +// get the correct size +$size = $vars['entity']->icon_size; + +// Get the user's friends +$friends = $owner->getFriends("", $num); + +// If there are any friends to view, view them +if (is_array($friends) && sizeof($friends) > 0) { + + echo "
"; + + foreach($friends as $friend) { + echo "
"; + echo elgg_view("profile/icon",array('entity' => get_user($friend->guid), 'size' => $size)); + echo "
"; + } + + echo "
"; +} diff --git a/views/default/widgets/friends/edit.php b/views/default/widgets/friends/edit.php new file mode 100644 index 000000000..9a6499ede --- /dev/null +++ b/views/default/widgets/friends/edit.php @@ -0,0 +1,57 @@ +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'; +} +?> + +

+ : + +

+ +

+ + +

-- cgit v1.2.3