aboutsummaryrefslogtreecommitdiff
path: root/mod/messages/start.php
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/messages/start.php
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/messages/start.php')
-rw-r--r--mod/messages/start.php15
1 files changed, 5 insertions, 10 deletions
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);