From ccb6d625239b59b283b4d3fc00da704ab743d74c Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 8 Feb 2011 19:52:10 +0000 Subject: Refs #2543: Updated trunk mods and views to use the new functions from previous 2 commits. git-svn-id: http://code.elgg.org/elgg/trunk@8079 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/blog/actions/blog/auto_save_revision.php | 2 +- mod/blog/actions/blog/save.php | 4 ++-- mod/blog/lib/blog.php | 12 +++++----- mod/blog/views/default/blog/sidebar/archives.php | 2 +- mod/blog/views/default/blog/sidebar/tagcloud.php | 2 +- mod/bookmarks/bookmarklet.php | 4 ++-- mod/bookmarks/pages/all.php | 2 +- mod/bookmarks/pages/owner.php | 2 +- mod/bookmarks/start.php | 6 ++--- .../views/default/bookmarks/bookmarklet.php | 2 +- .../views/default/bookmarks/owner_block.php | 2 +- mod/defaultwidgets/start.php | 4 ++-- .../admin/appearance/default_dashboard_widgets.php | 2 +- .../admin/appearance/default_profile_widgets.php | 2 +- mod/diagnostics/actions/download.php | 2 +- mod/file/actions/file/upload.php | 4 ++-- mod/file/index.php | 4 ++-- mod/file/start.php | 2 +- mod/file/views/default/file/embed_upload.php | 2 +- mod/groups/actions/addtogroup.php | 4 ++-- mod/groups/actions/delete.php | 2 +- mod/groups/actions/discussion/save.php | 2 +- mod/groups/actions/edit.php | 2 +- mod/groups/actions/groupskillinvitation.php | 2 +- mod/groups/actions/groupskillrequest.php | 2 +- mod/groups/actions/invite.php | 2 +- mod/groups/actions/join.php | 2 +- mod/groups/actions/joinrequest.php | 2 +- mod/groups/actions/leave.php | 4 ++-- mod/groups/lib/discussion.php | 2 +- mod/groups/lib/groups.php | 2 +- mod/groups/start.php | 14 +++++------ mod/groups/views/default/forms/groups/edit.php | 2 +- mod/groups/views/default/forms/groups/invite.php | 2 +- mod/groups/views/default/group/default.php | 2 +- .../views/default/groups/invitationrequests.php | 2 +- .../views/default/groups/profile/buttons.php | 2 +- .../default/groups/profile/closed_membership.php | 2 +- mod/groups/views/default/groups/side_menu.php | 6 ++--- mod/invitefriends/actions/invite.php | 2 +- mod/invitefriends/start.php | 2 +- mod/messageboard/actions/add.php | 2 +- mod/messageboard/ajax_endpoint/load.php | 2 +- mod/messageboard/history.php | 2 +- mod/messageboard/index.php | 2 +- .../default/messageboard/messageboard_content.php | 2 +- .../views/default/widgets/messageboard/content.php | 4 ++-- mod/messages/actions/messages/send.php | 2 +- mod/messages/read.php | 2 +- mod/messages/send.php | 2 +- mod/messages/start.php | 28 +++++++++++----------- mod/messages/views/default/messages/topbar.php | 4 ++-- mod/notifications/actions/groupsave.php | 6 ++--- mod/notifications/actions/save.php | 2 +- mod/notifications/groups.php | 4 ++-- mod/notifications/index.php | 4 ++-- mod/notifications/start.php | 4 ++-- .../notifications/subscriptions/collections.php | 8 +++---- .../notifications/subscriptions/forminternals.php | 4 ++-- .../notifications/subscriptions/groupsform.php | 2 +- .../notifications/subscriptions/personal.php | 2 +- mod/pages/actions/pages/edit.php | 2 +- mod/pages/index.php | 2 +- mod/pages/start.php | 4 ++-- mod/profile/start.php | 2 +- mod/profile/views/default/profile/owner_block.php | 4 ++-- mod/reportedcontent/actions/add.php | 2 +- mod/reportedcontent/start.php | 4 ++-- .../views/default/reportedcontent/form.php | 2 +- mod/sitepages/start.php | 2 +- .../views/default/sitepages/custom_frontpage.php | 2 +- mod/thewire/actions/add.php | 2 +- mod/thewire/actions/delete.php | 2 +- mod/thewire/add.php | 2 +- mod/thewire/everyone.php | 2 +- mod/thewire/index.php | 4 ++-- mod/thewire/start.php | 6 ++--- mod/thewire/views/default/object/thewire.php | 2 +- .../views/default/thewire/profile_status.php | 2 +- mod/twitterservice/start.php | 2 +- .../default/usersettings/twitterservice/edit.php | 2 +- 81 files changed, 133 insertions(+), 133 deletions(-) (limited to 'mod') diff --git a/mod/blog/actions/blog/auto_save_revision.php b/mod/blog/actions/blog/auto_save_revision.php index d400dda90..86812c6d3 100644 --- a/mod/blog/actions/blog/auto_save_revision.php +++ b/mod/blog/actions/blog/auto_save_revision.php @@ -6,7 +6,7 @@ */ $guid = get_input('guid'); -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); $title = get_input('title'); $description = get_input('description'); $excerpt = get_input('excerpt'); diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php index 4e6e9133b..dbbe25e04 100644 --- a/mod/blog/actions/blog/save.php +++ b/mod/blog/actions/blog/save.php @@ -11,7 +11,7 @@ // store errors to pass along $error = FALSE; $error_forward_url = REFERER; -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); // edit or create a new entity $guid = get_input('guid'); @@ -146,7 +146,7 @@ if (!$error) { // @todo do we want to alert on updates? if ($new_post && $blog->status == 'published') { - add_to_river('river/object/blog/create', 'create', get_loggedin_userid(), $blog->getGUID()); + add_to_river('river/object/blog/create', 'create', elgg_get_logged_in_user_guid(), $blog->getGUID()); } if ($blog->status == 'published') { forward($blog->getURL()); diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 3a8985026..5e2cc7c52 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -67,7 +67,7 @@ function blog_get_page_content_list($container_guid = NULL) { //'order_by_metadata' => array('name'=>'publish_date', 'direction'=>'DESC', 'as'=>'int') ); - $loggedin_userid = get_loggedin_userid(); + $loggedin_userid = elgg_get_logged_in_user_guid(); if ($container_guid) { $options['container_guid'] = $container_guid; $container = get_entity($container_guid); @@ -90,7 +90,7 @@ function blog_get_page_content_list($container_guid = NULL) { if (elgg_instanceof($container, 'group')) { $return['filter'] = ''; - if ($container->isMember(get_loggedin_user())) { + if ($container->isMember(elgg_get_logged_in_user_entity())) { $url = "pg/blog/add/$container->guid"; $params = array( 'href' => $url, @@ -108,7 +108,7 @@ function blog_get_page_content_list($container_guid = NULL) { // show all posts for admin or users looking at their own blogs // show only published posts for other users. - if (!(isadminloggedin() || (isloggedin() && $container_guid == $loggedin_userid))) { + if (!(elgg_is_admin_logged_in() || (elgg_is_logged_in() && $container_guid == $loggedin_userid))) { $options['metadata_name_value_pairs'] = array( array('name' => 'status', 'value' => 'published'), //array('name' => 'publish_date', 'operand' => '<', 'value' => time()) @@ -162,7 +162,7 @@ function blog_get_page_content_friends($user_guid) { // admin / owners can see any posts // everyone else can only see published posts - if (!(isadminloggedin() || (isloggedin() && $owner_guid == get_loggedin_userid()))) { + if (!(elgg_is_admin_logged_in() || (elgg_is_logged_in() && $owner_guid == elgg_get_logged_in_user_guid()))) { if ($upper > $now) { $upper = $now; } @@ -222,7 +222,7 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) { // admin / owners can see any posts // everyone else can only see published posts - if (!(isadminloggedin() || (isloggedin() && $owner_guid == get_loggedin_userid()))) { + if (!(elgg_is_admin_logged_in() || (elgg_is_logged_in() && $owner_guid == elgg_get_logged_in_user_guid()))) { if ($upper > $now) { $upper = $now; } @@ -321,7 +321,7 @@ function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) { } } else { if (!$guid) { - $container = get_loggedin_user(); + $container = elgg_get_logged_in_user_entity(); } else { $container = get_entity($guid); } diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php index 477e1261e..bd74500ca 100644 --- a/mod/blog/views/default/blog/sidebar/archives.php +++ b/mod/blog/views/default/blog/sidebar/archives.php @@ -3,7 +3,7 @@ * Blog archives */ -$loggedin_user = get_loggedin_user(); +$loggedin_user = elgg_get_logged_in_user_entity(); $page_owner = elgg_get_page_owner_entity(); // This is a limitation of the URL schema. diff --git a/mod/blog/views/default/blog/sidebar/tagcloud.php b/mod/blog/views/default/blog/sidebar/tagcloud.php index f1ef7ffdb..70c454390 100644 --- a/mod/blog/views/default/blog/sidebar/tagcloud.php +++ b/mod/blog/views/default/blog/sidebar/tagcloud.php @@ -3,7 +3,7 @@ * Blog tag cloud */ -$loggedin_user = get_loggedin_user(); +$loggedin_user = elgg_get_logged_in_user_entity(); $page_owner = elgg_get_page_owner_entity(); if ($page_owner && $vars['page'] != 'friends') { diff --git a/mod/bookmarks/bookmarklet.php b/mod/bookmarks/bookmarklet.php index a156cf035..9f9dd5150 100644 --- a/mod/bookmarks/bookmarklet.php +++ b/mod/bookmarks/bookmarklet.php @@ -13,8 +13,8 @@ gatekeeper(); // Get the current page's owner $page_owner = elgg_get_page_owner_entity(); -if ($page_owner === false || is_null($page_owner) && (get_loggedin_user())) { - $page_owner = get_loggedin_user(); +if ($page_owner === false || is_null($page_owner) && (elgg_get_logged_in_user_entity())) { + $page_owner = elgg_get_logged_in_user_entity(); set_page_owner($page_owner->getGUID()); } diff --git a/mod/bookmarks/pages/all.php b/mod/bookmarks/pages/all.php index 2bde462ba..3442f32c7 100644 --- a/mod/bookmarks/pages/all.php +++ b/mod/bookmarks/pages/all.php @@ -10,7 +10,7 @@ elgg_push_breadcrumb(elgg_echo('bookmarks')); $page_owner = elgg_get_page_owner_entity(); if (!$page_owner) { - $page_owner = get_loggedin_userid(); + $page_owner = elgg_get_logged_in_user_guid(); elgg_set_page_owner_guid($page_owner); } diff --git a/mod/bookmarks/pages/owner.php b/mod/bookmarks/pages/owner.php index 1e45bc518..5b864ff48 100644 --- a/mod/bookmarks/pages/owner.php +++ b/mod/bookmarks/pages/owner.php @@ -10,7 +10,7 @@ elgg_push_breadcrumb(elgg_echo('bookmarks'), 'pg/bookmarks/all'); $page_owner = elgg_get_page_owner_entity(); if (!$page_owner) { - $page_owner = get_loggedin_userid(); + $page_owner = elgg_get_logged_in_user_guid(); elgg_set_page_owner_guid($page_owner); } diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index b7e2e5df9..04a452d32 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -59,10 +59,10 @@ function bookmarks_pagesetup() { //add submenu options if (get_context() == "bookmarks") { - if (isloggedin()) { + if (elgg_is_logged_in()) { // link to add bookmark form if ($page_owner instanceof ElggGroup) { - if ($page_owner->isMember(get_loggedin_user())) { + if ($page_owner->isMember(elgg_get_logged_in_user_entity())) { add_submenu_item(elgg_echo('bookmarks:add'), $CONFIG->wwwroot."pg/bookmarks/add/" . $page_owner->username); } } else { @@ -82,7 +82,7 @@ function bookmarks_pagesetup() { } // Bookmarklet - if ((isloggedin()) && (page_owner()) && (can_write_to_container(0, page_owner()))) { + if ((elgg_is_logged_in()) && (page_owner()) && (can_write_to_container(0, page_owner()))) { $bmtext = elgg_echo('bookmarks:bookmarklet'); if ($page_owner instanceof ElggGroup) { diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index bb2cf885e..531619409 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -15,7 +15,7 @@ if ($page_owner instanceof ElggGroup) { $name = $page_owner->username; } -if (!$name && ($user = get_loggedin_user())) { +if (!$name && ($user = elgg_get_logged_in_user_entity())) { $name = $user->username; } diff --git a/mod/bookmarks/views/default/bookmarks/owner_block.php b/mod/bookmarks/views/default/bookmarks/owner_block.php index 654ff9152..d9b31d8d4 100644 --- a/mod/bookmarks/views/default/bookmarks/owner_block.php +++ b/mod/bookmarks/views/default/bookmarks/owner_block.php @@ -1,7 +1,7 @@ username}?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)"; ?> diff --git a/mod/defaultwidgets/start.php b/mod/defaultwidgets/start.php index 653ac6fce..89754f4f4 100644 --- a/mod/defaultwidgets/start.php +++ b/mod/defaultwidgets/start.php @@ -25,7 +25,7 @@ function defaultwidgets_init() { elgg_register_event_handler('create', 'user', 'defaultwidgets_newusers' ); // set the widget access to the default access on validation if this is not an admin-created user - if (!isadminloggedin()) { + if (!elgg_is_admin_logged_in()) { elgg_register_event_handler('validate', 'user', 'defaultwidgets_reset_access'); } @@ -93,7 +93,7 @@ function defaultwidgets_newusers($event, $object_type, $object) { // get the new user guid $guid = $object->guid; - if (isadminloggedin()) { + if (elgg_is_admin_logged_in()) { // this is an admin-created user // no permissions problems, so set proper access now // use system default access (not the admin's default access!, because that could be a personal access level) diff --git a/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php b/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php index b6cc010df..e4a6ca51f 100644 --- a/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php +++ b/mod/defaultwidgets/views/default/admin/appearance/default_dashboard_widgets.php @@ -7,7 +7,7 @@ **/ // Set admin user for user block -set_page_owner(get_loggedin_userid()); +set_page_owner(elgg_get_logged_in_user_guid()); // create the view $time = time(); diff --git a/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php b/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php index bb1f3fbe0..b95a123eb 100644 --- a/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php +++ b/mod/defaultwidgets/views/default/admin/appearance/default_profile_widgets.php @@ -7,7 +7,7 @@ **/ // set admin user for user block -set_page_owner(get_loggedin_userid()); +set_page_owner(elgg_get_logged_in_user_guid()); // create the view $time = time(); diff --git a/mod/diagnostics/actions/download.php b/mod/diagnostics/actions/download.php index 3c096eb0a..a79527f78 100644 --- a/mod/diagnostics/actions/download.php +++ b/mod/diagnostics/actions/download.php @@ -7,7 +7,7 @@ admin_gatekeeper(); - $output = elgg_echo('diagnostics:header', array(date('r'), get_loggedin_user()->name)); + $output = elgg_echo('diagnostics:header', array(date('r'), elgg_get_logged_in_user_entity()->name)); $output = elgg_trigger_plugin_hook('diagnostics:report', 'system', null, $output); header("Cache-Control: public"); diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php index 5ce98c101..1a30b6cef 100644 --- a/mod/file/actions/file/upload.php +++ b/mod/file/actions/file/upload.php @@ -16,7 +16,7 @@ $tags = get_input("tags"); $ajax = get_input('ajax', FALSE); if ($container_guid == 0) { - $container_guid = get_loggedin_userid(); + $container_guid = elgg_get_logged_in_user_guid(); } elgg_make_sticky_form('file'); @@ -166,7 +166,7 @@ if ($new_file) { } else { system_message($message); - add_to_river('river/object/file/create', 'create', get_loggedin_userid(), $file->guid); + add_to_river('river/object/file/create', 'create', elgg_get_logged_in_user_guid(), $file->guid); } } else { // failed to save file object - nothing we can do about this diff --git a/mod/file/index.php b/mod/file/index.php index 44906d72d..4a8e35bdb 100644 --- a/mod/file/index.php +++ b/mod/file/index.php @@ -17,7 +17,7 @@ elgg_push_breadcrumb($owner->name); $params = array(); -if ($owner->guid == get_loggedin_userid()) { +if ($owner->guid == elgg_get_logged_in_user_guid()) { // user looking at own files $title = elgg_echo('file:yours'); $params['filter_context'] = 'mine'; @@ -31,7 +31,7 @@ if ($owner->guid == get_loggedin_userid()) { // group files $title = elgg_echo("file:user", array($owner->name)); $params['filter'] = ''; - if ($owner->isMember(get_loggedin_user())) { + if ($owner->isMember(elgg_get_logged_in_user_entity())) { $url = "pg/file/add/$owner->guid"; $vars = array( 'href' => $url, diff --git a/mod/file/start.php b/mod/file/start.php index 360f64d1f..cea8b6bd5 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -364,7 +364,7 @@ function file_embed_get_sections($hook, $type, $value, $params) { */ function file_embed_get_items($hook, $type, $value, $params) { $options = array( - 'owner_guid' => get_loggedin_userid(), + 'owner_guid' => elgg_get_logged_in_user_guid(), 'type_subtype_pair' => array('object' => 'file'), 'count' => TRUE ); diff --git a/mod/file/views/default/file/embed_upload.php b/mod/file/views/default/file/embed_upload.php index 8a54a4fa9..229fcd40b 100644 --- a/mod/file/views/default/file/embed_upload.php +++ b/mod/file/views/default/file/embed_upload.php @@ -3,7 +3,7 @@ * Files upload form for embed */ -$access_id = get_default_access(get_loggedin_user()); +$access_id = get_default_access(elgg_get_logged_in_user_entity()); if ($categories = elgg_view('categories', $vars)) { $categories = "

$categories

"; } diff --git a/mod/groups/actions/addtogroup.php b/mod/groups/actions/addtogroup.php index 651b90abb..d75c5fdb8 100644 --- a/mod/groups/actions/addtogroup.php +++ b/mod/groups/actions/addtogroup.php @@ -4,7 +4,7 @@ * * @package ElggGroups */ -$logged_in_user = get_loggedin_user(); +$logged_in_user = elgg_get_logged_in_user_entity(); $user_guid = get_input('user_guid'); if (!is_array($user_guid)) @@ -20,7 +20,7 @@ if (sizeof($user_guid)) { if ($user && $group) { - //if (get_loggedin_userid() == $group->owner_guid) + //if (elgg_get_logged_in_user_guid() == $group->owner_guid) if ($group->canEdit()) { // If the group is open or the user has requested membership diff --git a/mod/groups/actions/delete.php b/mod/groups/actions/delete.php index 5672e8c47..a99b3a2c6 100644 --- a/mod/groups/actions/delete.php +++ b/mod/groups/actions/delete.php @@ -16,5 +16,5 @@ if (($entity) && ($entity instanceof ElggGroup)) else register_error(elgg_echo('group:notdeleted')); -$url_name = get_loggedin_user()->username; +$url_name = elgg_get_logged_in_user_entity()->username; forward(elgg_get_site_url() . "pg/groups/member/{$url_name}"); diff --git a/mod/groups/actions/discussion/save.php b/mod/groups/actions/discussion/save.php index 8e8f08a50..f553b562c 100644 --- a/mod/groups/actions/discussion/save.php +++ b/mod/groups/actions/discussion/save.php @@ -67,7 +67,7 @@ elgg_clear_sticky_form('topic'); // handle results differently for new topics and topic edits if ($new_topic) { system_message(elgg_echo('discussion:topic:created')); - add_to_river('river/forum/topic/create', 'create', get_loggedin_userid(), $topic->guid); + add_to_river('river/forum/topic/create', 'create', elgg_get_logged_in_user_guid(), $topic->guid); } else { system_message(elgg_echo('discussion:topic:updated')); } diff --git a/mod/groups/actions/edit.php b/mod/groups/actions/edit.php index c8a68d238..e10739244 100644 --- a/mod/groups/actions/edit.php +++ b/mod/groups/actions/edit.php @@ -34,7 +34,7 @@ foreach ($CONFIG->group as $shortname => $valuetype) { $input['name'] = get_input('name'); $input['name'] = html_entity_decode($input['name'], ENT_COMPAT, 'UTF-8'); -$user = get_loggedin_user(); +$user = elgg_get_logged_in_user_entity(); $group_guid = (int)get_input('group_guid'); $new_group_flag = $group_guid == 0; diff --git a/mod/groups/actions/groupskillinvitation.php b/mod/groups/actions/groupskillinvitation.php index 503c41939..516490bc9 100644 --- a/mod/groups/actions/groupskillinvitation.php +++ b/mod/groups/actions/groupskillinvitation.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); $user = get_entity($user_guid); diff --git a/mod/groups/actions/groupskillrequest.php b/mod/groups/actions/groupskillrequest.php index f7f8a5157..9d45bb25f 100644 --- a/mod/groups/actions/groupskillrequest.php +++ b/mod/groups/actions/groupskillrequest.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); $user = get_entity($user_guid); diff --git a/mod/groups/actions/invite.php b/mod/groups/actions/invite.php index e8eeb3330..1f8281071 100644 --- a/mod/groups/actions/invite.php +++ b/mod/groups/actions/invite.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$logged_in_user = get_loggedin_user(); +$logged_in_user = elgg_get_logged_in_user_entity(); $user_guid = get_input('user_guid'); if (!is_array($user_guid)) { diff --git a/mod/groups/actions/join.php b/mod/groups/actions/join.php index e058cdc22..72294c3ad 100644 --- a/mod/groups/actions/join.php +++ b/mod/groups/actions/join.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); // @todo fix for #287 diff --git a/mod/groups/actions/joinrequest.php b/mod/groups/actions/joinrequest.php index c1d41e8e8..1631712b6 100644 --- a/mod/groups/actions/joinrequest.php +++ b/mod/groups/actions/joinrequest.php @@ -5,7 +5,7 @@ * @package ElggGroups */ -$user_guid = get_input('user_guid', get_loggedin_userid()); +$user_guid = get_input('user_guid', elgg_get_logged_in_user_guid()); $group_guid = get_input('group_guid'); diff --git a/mod/groups/actions/leave.php b/mod/groups/actions/leave.php index a9163a3d1..390870df1 100644 --- a/mod/groups/actions/leave.php +++ b/mod/groups/actions/leave.php @@ -10,7 +10,7 @@ $group_guid = get_input('group_guid'); $user = NULL; if (!$user_guid) { - $user = get_loggedin_user(); + $user = elgg_get_logged_in_user_entity(); } else { $user = get_entity($user_guid); } @@ -20,7 +20,7 @@ $group = get_entity($group_guid); set_page_owner($group->guid); if (($user instanceof ElggUser) && ($group instanceof ElggGroup)) { - if ($group->getOwnerGUID() != get_loggedin_userid()) { + if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { if ($group->leave($user)) { system_message(elgg_echo("groups:left")); } else { diff --git a/mod/groups/lib/discussion.php b/mod/groups/lib/discussion.php index 4a3cd989a..62b0552e0 100644 --- a/mod/groups/lib/discussion.php +++ b/mod/groups/lib/discussion.php @@ -169,7 +169,7 @@ function discussion_handle_view_page($guid) { if ($topic->status == 'closed') { $content .= elgg_view_comments($topic, false); $content .= elgg_view('discussion/closed'); - } elseif ($group->isMember() || isadminloggedin()) { + } elseif ($group->isMember() || elgg_is_admin_logged_in()) { $content .= elgg_view_comments($topic); } else { $content .= elgg_view_comments($topic, false); diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index cff7fe258..8faba3179 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -121,7 +121,7 @@ function groups_handle_edit_page($page, $guid = 0) { gatekeeper(); if ($page == 'add') { - elgg_set_page_owner_guid(get_loggedin_userid()); + elgg_set_page_owner_guid(elgg_get_logged_in_user_guid()); $title = elgg_echo('groups:add'); elgg_push_breadcrumb($title); $content = elgg_view('groups/edit'); diff --git a/mod/groups/start.php b/mod/groups/start.php index 5e318a5f1..44b5363dc 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -130,14 +130,14 @@ function groups_submenus() { if (elgg_get_context() == 'groups') { if ($page_owner instanceof ElggGroup) { - if (isloggedin() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { + if (elgg_is_logged_in() && $page_owner->canEdit() && !$page_owner->isPublicMembership()) { $url = elgg_get_site_url() . "pg/groups/requests/{$page_owner->getGUID()}"; add_submenu_item(elgg_echo('groups:membershiprequests'), $url, 'groupsactions1'); } } else { add_submenu_item(elgg_echo('groups:all'), "pg/groups/world/", 'groupslinks1'); - if ($user = get_loggedin_user()) { + if ($user = elgg_get_logged_in_user_entity()) { add_submenu_item(elgg_echo('groups:owned'), "pg/groups/owned/$user->username", 'groupslinks1'); add_submenu_item(elgg_echo('groups:yours'), "pg/groups/member/$user->username", 'groupslinks1'); add_submenu_item(elgg_echo('groups:invitations'), "pg/groups/invitations/$user->username", 'groupslinks1'); @@ -295,7 +295,7 @@ function groups_create_event_listener($event, $object_type, $object) { */ function groups_read_acl_plugin_hook($hook, $entity_type, $returnvalue, $params) { //error_log("READ: " . var_export($returnvalue)); - $user = get_loggedin_user(); + $user = elgg_get_logged_in_user_entity(); if ($user) { // Not using this because of recursion. // Joining a group automatically add user to ACL, @@ -319,7 +319,7 @@ function groups_read_acl_plugin_hook($hook, $entity_type, $returnvalue, $params) */ function groups_write_acl_plugin_hook($hook, $entity_type, $returnvalue, $params) { $page_owner = elgg_get_page_owner_entity(); - if (!$loggedin = get_loggedin_user()) { + if (!$loggedin = elgg_get_logged_in_user_entity()) { return $returnvalue; } @@ -646,7 +646,7 @@ function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $para if ($method == 'sms') { return elgg_echo("groupforumtopic:new") . ': ' . $url . " ({$owner->name}: {$title})"; } else { - return get_loggedin_user()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL(); + return elgg_get_logged_in_user_entity()->name . ' ' . elgg_echo("groups:viagroups") . ': ' . $title . "\n\n" . $msg . "\n\n" . $entity->getURL(); } } return null; @@ -661,9 +661,9 @@ function groupforumtopic_notify_message($hook, $entity_type, $returnvalue, $para function groups_can_edit_discussion($entity, $group_owner) { //logged in user - $user = get_loggedin_userid(); + $user = elgg_get_logged_in_user_guid(); - if (($entity->owner_guid == $user) || $group_owner == $user || isadminloggedin()) { + if (($entity->owner_guid == $user) || $group_owner == $user || elgg_is_admin_logged_in()) { return true; } else { return false; diff --git a/mod/groups/views/default/forms/groups/edit.php b/mod/groups/views/default/forms/groups/edit.php index e0c90af8d..7d24a3c00 100644 --- a/mod/groups/views/default/forms/groups/edit.php +++ b/mod/groups/views/default/forms/groups/edit.php @@ -66,7 +66,7 @@ if ($group_profile_fields > 0) { if (get_plugin_setting('hidden_groups', 'groups') == 'yes') { $this_owner = $vars['entity']->owner_guid; if (!$this_owner) { - $this_owner = get_loggedin_userid(); + $this_owner = elgg_get_logged_in_user_guid(); } $access = array( ACCESS_FRIENDS => elgg_echo("access:friends:label"), diff --git a/mod/groups/views/default/forms/groups/invite.php b/mod/groups/views/default/forms/groups/invite.php index 8b8ccb665..2c89db384 100644 --- a/mod/groups/views/default/forms/groups/invite.php +++ b/mod/groups/views/default/forms/groups/invite.php @@ -8,7 +8,7 @@ $group = $vars['entity']; $owner = get_entity($vars['entity']->owner_guid); $forward_url = $group->getURL(); - $friends = get_loggedin_user()->getFriends('', 0); + $friends = elgg_get_logged_in_user_entity()->getFriends('', 0); if ($friends) { ?> diff --git a/mod/groups/views/default/group/default.php b/mod/groups/views/default/group/default.php index d025a894b..63e1e4226 100644 --- a/mod/groups/views/default/group/default.php +++ b/mod/groups/views/default/group/default.php @@ -25,7 +25,7 @@ $metadata = "