diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-03 17:53:05 +0000 |
commit | 4766f36a4d74924f21ff329c4318ce4e069ffa04 (patch) | |
tree | 969b84632f2a8b0db79788a8a6db8e41d63e5cb4 /mod/friends | |
parent | 57a217fd6b708844407486046a1faa23b46cac08 (diff) | |
download | elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.gz elgg-4766f36a4d74924f21ff329c4318ce4e069ffa04.tar.bz2 |
Pulled in the interface changes.
git-svn-id: http://code.elgg.org/elgg/trunk@5257 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/friends')
-rw-r--r-- | mod/friends/add.php | 29 | ||||
-rw-r--r-- | mod/friends/collections.php | 29 | ||||
-rw-r--r-- | mod/friends/edit.php | 38 | ||||
-rw-r--r-- | mod/friends/languages/en.php | 15 | ||||
-rw-r--r-- | mod/friends/manifest.xml | 10 | ||||
-rw-r--r-- | mod/friends/start.php | 26 | ||||
-rw-r--r-- | mod/friends/views/default/widgets/friends/edit.php | 44 | ||||
-rw-r--r-- | mod/friends/views/default/widgets/friends/view.php | 50 |
8 files changed, 241 insertions, 0 deletions
diff --git a/mod/friends/add.php b/mod/friends/add.php new file mode 100644 index 000000000..aec720811 --- /dev/null +++ b/mod/friends/add.php @@ -0,0 +1,29 @@ +<?php + + /** + * Elgg add a collection of friends + * + * @package ElggFriends + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // You need to be logged in for this one + gatekeeper(); + + $area1 = elgg_view_title(elgg_echo('friends:new')); + + $area2 = elgg_view('friends/forms/edit', array('friends' => get_user_friends($_SESSION['user']->getGUID(),"",9999))); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2); + + // Draw it + page_draw(elgg_echo('friends:add'),$body); + +?>
\ No newline at end of file diff --git a/mod/friends/collections.php b/mod/friends/collections.php new file mode 100644 index 000000000..f80eea55c --- /dev/null +++ b/mod/friends/collections.php @@ -0,0 +1,29 @@ +<?php + + /** + * Elgg collections of friends + * + * @package ElggFriends + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // You need to be logged in for this one + gatekeeper(); + + $area1 = elgg_view_title(elgg_echo('friends:new')); + + $area2 = elgg_view_access_collections($_SESSION['user']->getGUID()); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar',$area1, $area2); + + // Draw it + page_draw(elgg_echo('friends:add'),$body); + +?>
\ No newline at end of file diff --git a/mod/friends/edit.php b/mod/friends/edit.php new file mode 100644 index 000000000..6be47f4d1 --- /dev/null +++ b/mod/friends/edit.php @@ -0,0 +1,38 @@ +<?php + + /** + * Elgg add a collection of friends + * + * @package ElggFriends + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.org/ + */ + + // Start engine + require_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php"); + + // You need to be logged in for this one + gatekeeper(); + + //set the title + $area1 = elgg_view_title(elgg_echo('friends:collectionedit'), false); + + //grab the collection id passed to the edit form + $collection_id = get_input('collection'); + + //get the full collection + $collection = get_access_collection($collection_id); + //get all members of the collection + $collection_members = get_members_of_access_collection($collection_id); + + $area2 = elgg_view('friends/forms/edit', array('collection' => $collection, 'collection_members' => $collection_members)); + + // Format page + $body = elgg_view_layout('two_column_left_sidebar',$area1. $area2); + + // Draw it + page_draw(elgg_echo('friends:add'),$body); + +?>
\ No newline at end of file diff --git a/mod/friends/languages/en.php b/mod/friends/languages/en.php new file mode 100644 index 000000000..aa0945656 --- /dev/null +++ b/mod/friends/languages/en.php @@ -0,0 +1,15 @@ +<?php + + $english = array( + + /** + * Friends widget + */ + 'friends:widget:description' => "Displays some of your friends.", + + + ); + + add_translation("en",$english); + +?>
\ No newline at end of file diff --git a/mod/friends/manifest.xml b/mod/friends/manifest.xml new file mode 100644 index 000000000..faed8ce63 --- /dev/null +++ b/mod/friends/manifest.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<plugin_manifest> + <field key="author" value="Curverider ltd" /> + <field key="version" value="1.7" /> + <field key="description" value="Provides friend widgets for your profile" /> + <field key="website" value="http://www.elgg.org/" /> + <field key="copyright" value="(c) Curverider 2008-2010" /> + <field key="licence" value="GNU Public License version 2" /> + <field key="elgg_version" value="2010030101" /> +</plugin_manifest> diff --git a/mod/friends/start.php b/mod/friends/start.php new file mode 100644 index 000000000..631b54c1d --- /dev/null +++ b/mod/friends/start.php @@ -0,0 +1,26 @@ +<?php + + /** + * Elgg Friends widget + * This plugin allows users to put a list of their friends, on their profile + * + * @package ElggFriends + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider Ltd <info@elgg.com> + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + */ + + function friends_init() { + + // Load system configuration + global $CONFIG; + + //add a widget + add_widget_type('friends',elgg_echo("friends"),elgg_echo('friends:widget:description')); + + } + + register_elgg_event_handler('init','system','friends_init'); + +?>
\ No newline at end of file diff --git a/mod/friends/views/default/widgets/friends/edit.php b/mod/friends/views/default/widgets/friends/edit.php new file mode 100644 index 000000000..0d9d44136 --- /dev/null +++ b/mod/friends/views/default/widgets/friends/edit.php @@ -0,0 +1,44 @@ +<?php + + /** + * Elgg Friends + * Friend widget options + * + * @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/ + */ + +?> + +<p> + <?php echo elgg_echo("friends:num_display"); ?>: + <select name="params[num_display]"> + <option value="1" <?php if($vars['entity']->num_display == 1) echo "SELECTED"; ?>>1</option> + <option value="2" <?php if($vars['entity']->num_display == 2) echo "SELECTED"; ?>>2</option> + <option value="3" <?php if($vars['entity']->num_display == 3) echo "SELECTED"; ?>>3</option> + <option value="4" <?php if($vars['entity']->num_display == 4) echo "SELECTED"; ?>>4</option> + <option value="5" <?php if($vars['entity']->num_display == 5) echo "SELECTED"; ?>>5</option> + <option value="6" <?php if($vars['entity']->num_display == 6) echo "SELECTED"; ?>>6</option> + <option value="7" <?php if($vars['entity']->num_display == 7) echo "SELECTED"; ?>>7</option> + <option value="8" <?php if($vars['entity']->num_display == 8) echo "SELECTED"; ?>>8</option> + <option value="9" <?php if($vars['entity']->num_display == 9) echo "SELECTED"; ?>>9</option> + <option value="10" <?php if($vars['entity']->num_display == 10) echo "SELECTED"; ?>>10</option> + <option value="15" <?php if($vars['entity']->num_display == 15) echo "SELECTED"; ?>>15</option> + <option value="20" <?php if($vars['entity']->num_display == 20) echo "SELECTED"; ?>>20</option> + <option value="30" <?php if($vars['entity']->num_display == 30) echo "SELECTED"; ?>>30</option> + <option value="50" <?php if($vars['entity']->num_display == 50) echo "SELECTED"; ?>>50</option> + <option value="100" <?php if($vars['entity']->num_display == 100) echo "SELECTED"; ?>>100</option> + </select> +</p> + +<p> + <?php echo elgg_echo("friends:icon_size"); ?> + <select name="params[icon_size]"> + <option value="1" <?php if($vars['entity']->icon_size == 1) echo "SELECTED"; ?>><?php echo elgg_echo("friends:small"); ?></option> + <option value="2" <?php if($vars['entity']->icon_size == 2) echo "SELECTED"; ?>><?php echo elgg_echo("friends:tiny"); ?></option> + </select> +</p>
\ No newline at end of file diff --git a/mod/friends/views/default/widgets/friends/view.php b/mod/friends/views/default/widgets/friends/view.php new file mode 100644 index 000000000..ab702399a --- /dev/null +++ b/mod/friends/views/default/widgets/friends/view.php @@ -0,0 +1,50 @@ +<?php + + /** + * Elgg Friends + * Friend widget options + * + * @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/ + */ + + + //the page owner + $owner = get_user($vars['entity']->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) { + + echo "<div id=\"widget_friends_list\">"; + + foreach($friends as $friend) { + echo "<div class=\"widget_friends_singlefriend\" >"; + echo elgg_view("profile/icon",array('entity' => get_user($friend->guid), 'size' => $size_value)); + echo "</div>"; + } + + echo "</div>"; + + } + +?>
\ No newline at end of file |