aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 23:15:43 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-22 23:15:43 +0000
commit60c1387a16ea4944674b0c9da2273158d1fbf0b4 (patch)
tree6f94aaf77a7d794f489212ff50f08f5211a18126 /mod
parentca08eb6d170d375ef4fca53604956f3474c7db19 (diff)
downloadelgg-60c1387a16ea4944674b0c9da2273158d1fbf0b4.tar.gz
elgg-60c1387a16ea4944674b0c9da2273158d1fbf0b4.tar.bz2
Merged r6757:6810 from 1.7 branch into trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6850 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r--mod/friends/add.php29
-rw-r--r--mod/friends/collections.php29
-rw-r--r--mod/friends/edit.php38
-rw-r--r--mod/friends/languages/en.php24
-rw-r--r--mod/friends/start.php40
-rw-r--r--mod/friends/views/default/widgets/friends/edit.php89
-rw-r--r--mod/friends/views/default/widgets/friends/view.php78
-rw-r--r--mod/htmlawed/start.php2
-rw-r--r--mod/messages/start.php15
-rw-r--r--mod/messages/views/default/widgets/messages/edit.php0
-rw-r--r--mod/messages/views/default/widgets/messages/view.php13
-rw-r--r--mod/pages/languages/en.php6
-rw-r--r--mod/riverdashboard/languages/en.php2
13 files changed, 124 insertions, 241 deletions
diff --git a/mod/friends/add.php b/mod/friends/add.php
deleted file mode 100644
index aec720811..000000000
--- a/mod/friends/add.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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
deleted file mode 100644
index f80eea55c..000000000
--- a/mod/friends/collections.php
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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
deleted file mode 100644
index 6be47f4d1..000000000
--- a/mod/friends/edit.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?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
index aa0945656..1d09cfca6 100644
--- a/mod/friends/languages/en.php
+++ b/mod/friends/languages/en.php
@@ -1,15 +1,15 @@
<?php
- $english = array(
-
- /**
- * Friends widget
- */
- 'friends:widget:description' => "Displays some of your friends.",
-
-
- );
-
- add_translation("en",$english);
+$english = array(
-?> \ No newline at end of file
+ /**
+ * Friends widget
+ */
+ 'friends:widget:description' => "Displays some of your friends.",
+ 'friends:num_display' => "Number of friends to display",
+ 'friends:icon_size' => "Icon size",
+ 'friends:tiny' => "tiny",
+ 'friends:small' => "small",
+);
+
+add_translation("en", $english);
diff --git a/mod/friends/start.php b/mod/friends/start.php
index 631b54c1d..c0729ac90 100644
--- a/mod/friends/start.php
+++ b/mod/friends/start.php
@@ -1,26 +1,18 @@
<?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
+/**
+ * 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() {
+ add_widget_type('friends', elgg_echo("friends"), elgg_echo('friends:widget:description'));
+}
+
+register_elgg_event_handler('init', 'system', 'friends_init');
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 @@
<?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/
- */
-
+/**
+ * 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/
+ */
+
+$selections = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100);
+$icon_sizes = array('small', 'tiny');
+
+// set defaults
+if (!isset($vars['entity']->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';
+}
?>
<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>
+ <?php echo elgg_echo("friends:num_display"); ?>:
+ <select name="params[num_display]">
+<?php
+foreach ($selections as $selection) {
+ $selected = '';
+ if ($vars['entity']->num_display == $selection) {
+ $selected = 'selected="selected"';
+ }
+ echo "<option value=\"$selection\" $selected>$selection</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
+ <?php echo elgg_echo("friends:icon_size"); ?>
+ <select name="params[icon_size]">
+<?php
+foreach ($icon_sizes as $size) {
+ $selected = '';
+ if ($vars['entity']->icon_size == $size) {
+ $selected = 'selected="selected"';
+ }
+ $label = elgg_echo("friends:$size");
+ echo "<option value=\"$size\" $selected>$label</option>";
+}
+?>
+ </select>
+</p>
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 @@
<?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) {
+/**
+ * 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 "<div id=\"widget_friends_list\">";
+// get the correct size
+$size = $vars['entity']->icon_size;
- 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>";
- }
+// 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 "<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));
echo "</div>";
-
- }
-
-?> \ No newline at end of file
+ }
+
+ echo "</div>";
+}
diff --git a/mod/htmlawed/start.php b/mod/htmlawed/start.php
index 419034f5a..523b4d264 100644
--- a/mod/htmlawed/start.php
+++ b/mod/htmlawed/start.php
@@ -13,7 +13,7 @@
*
*/
function htmlawed_init() {
- /** For now declare allowed tags and protocols here, TODO: Make this configurable */
+ /** For now declare allowed tags and protocols here, @todo Make this configurable */
global $CONFIG;
$CONFIG->htmlawed_config = array(
// seems to handle about everything we need.
diff --git a/mod/messages/start.php b/mod/messages/start.php
index 198494474..fbf9bc543 100644
--- a/mod/messages/start.php
+++ b/mod/messages/start.php
@@ -20,7 +20,6 @@
* @param unknown_type $object_type
* @param unknown_type $object
*/
-
function messages_init() {
// Load system configuration
@@ -28,7 +27,7 @@ function messages_init() {
//add submenu options
if (get_context() == "messages") {
- add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . $_SESSION['user']->username);
+ add_submenu_item(elgg_echo('messages:inbox'), $CONFIG->wwwroot . "pg/messages/" . get_loggedin_user()->username);
add_submenu_item(elgg_echo('messages:sentmessages'), $CONFIG->wwwroot . "mod/messages/sent.php");
}
@@ -50,12 +49,8 @@ function messages_init() {
// Register a notification handler for site messages
register_notification_handler("site", "messages_site_notify_handler");
register_plugin_hook('notify:entity:message','object','messages_notification_msg');
- if (is_callable('register_notification_object'))
- register_notification_object('object','messages',elgg_echo('messages:new'));
-
- // Shares widget
- // add_widget_type('messages',elgg_echo("messages:recent"),elgg_echo("messages:widget:description"));
-
+ register_notification_object('object','messages',elgg_echo('messages:new'));
+
// Override metadata permissions
register_plugin_hook('permissions_check:metadata','object','messages_can_edit_metadata');
@@ -295,10 +290,10 @@ function count_unread_messages() {
//get the users inbox messages
//$num_messages = get_entities_from_metadata("toId", $_SESSION['user']->getGUID(), "object", "messages", 0, 10, 0, "", 0, false);
$num_messages = elgg_get_entities_from_metadata(array('metadata_name_value_pairs' => array(
- 'toId' => $_SESSION['user']->guid,
+ 'toId' => get_loggedin_userid(),
'readYet' => 0,
'msg' => 1
- ), 'owner_guid' => $_SESSION['user']->guid));
+ ), 'owner_guid' => get_loggedin_userid()));
if (is_array($num_messages))
$counter = sizeof($num_messages);
diff --git a/mod/messages/views/default/widgets/messages/edit.php b/mod/messages/views/default/widgets/messages/edit.php
deleted file mode 100644
index e69de29bb..000000000
--- a/mod/messages/views/default/widgets/messages/edit.php
+++ /dev/null
diff --git a/mod/messages/views/default/widgets/messages/view.php b/mod/messages/views/default/widgets/messages/view.php
deleted file mode 100644
index e4d138562..000000000
--- a/mod/messages/views/default/widgets/messages/view.php
+++ /dev/null
@@ -1,13 +0,0 @@
-
- <?php
-
- $num_messages = count_unread_messages();
-
- if($num_messages == 0)
- echo "<h3 class=\"new_messages_count\">You have no new messages.</h3>";
- else {
- echo "<h3 class=\"new_messages_count\">" . $num_messages . " new message(s).</h3>";
- echo "<a href=\"" . $vars['url'] . "pg/messages/" . $_SESSION['user']->username ."\">check them out</a>";
- }
-
- ?>
diff --git a/mod/pages/languages/en.php b/mod/pages/languages/en.php
index 295c0ef09..1c20a4297 100644
--- a/mod/pages/languages/en.php
+++ b/mod/pages/languages/en.php
@@ -61,11 +61,11 @@ $english = array(
* Status and error messages
*/
'pages:noaccess' => 'No access to page',
- 'pages:cantedit' => 'You can not edit this page',
- 'pages:saved' => 'Pages saved',
+ 'pages:cantedit' => 'You cannot edit this page',
+ 'pages:saved' => 'Page saved',
'pages:notsaved' => 'Page could not be saved',
'pages:notitle' => 'You must specify a title for your page.',
- 'pages:delete:success' => 'Your page was successfully deleted.',
+ 'pages:delete:success' => 'The page was successfully deleted.',
'pages:delete:failure' => 'The page could not be deleted.',
/**
diff --git a/mod/riverdashboard/languages/en.php b/mod/riverdashboard/languages/en.php
index d317b8688..a07853680 100644
--- a/mod/riverdashboard/languages/en.php
+++ b/mod/riverdashboard/languages/en.php
@@ -25,8 +25,6 @@ $english = array(
'river:clustered' => 'Clustered',
'river:type' => 'Would you like the activity stream to be in classic format (chronological) or clustered?',
'river:widget:description' => "Show your latest activity.",
- 'river:widget:title:friends' => "Friends' activity",
- 'river:widget:description:friends' => "Show what your friends are up to.",
'river:widgets:friends' => "Friends",
'river:widgets:mine' => "Mine",
'river:friends' => "My friends' activity",