From 84cbd976f3e38cb9e8e7fce1d8f040ff767de1cb Mon Sep 17 00:00:00 2001 From: Matt Beckett Date: Wed, 23 Oct 2013 12:38:02 -0700 Subject: [PATCH] whitespace fix --- lib/events.php | 78 +++++++++++++++++++++++++------------------------- start.php | 4 +-- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lib/events.php b/lib/events.php index 78fa072b..c9ec5106 100644 --- a/lib/events.php +++ b/lib/events.php @@ -111,49 +111,49 @@ function group_tools_multiple_admin_group_leave($event, $type, $params){ function group_tools_membership_request($event, $type, $relationship) { - if (!($relationship instanceof ElggRelationship)) { - return; - } - - $group = get_entity($relationship->guid_two); - $user = get_user($relationship->guid_one); - - if (!elgg_instanceof($group, 'group') || !elgg_instanceof($user, 'user')) { - return; - } - - // Notify group owner - $url = elgg_get_site_url() . "groups/requests/$group->guid"; - $subject = elgg_echo('groups:request:subject', array( - $user->name, - $group->name, - )); - $body = elgg_echo('groups:request:body', array( - $group->getOwnerEntity()->name, - $user->name, - $group->name, - $user->getURL(), - $url, - )); - - $options = array( + if (!($relationship instanceof ElggRelationship)) { + return; + } + + $group = get_entity($relationship->guid_two); + $user = get_user($relationship->guid_one); + + if (!elgg_instanceof($group, 'group') || !elgg_instanceof($user, 'user')) { + return; + } + + // Notify group owner + $url = elgg_get_site_url() . "groups/requests/$group->guid"; + $subject = elgg_echo('groups:request:subject', array( + $user->name, + $group->name, + )); + $body = elgg_echo('groups:request:body', array( + $group->getOwnerEntity()->name, + $user->name, + $group->name, + $user->getURL(), + $url, + )); + + $options = array( "relationship" => "group_admin", "relationship_guid" => $group->getGUID(), "inverse_relationship" => true, "type" => "user", "limit" => false, "wheres" => array("e.guid <> " . $group->owner_guid), - "callback" => false + "callback" => false ); - - $admins = elgg_get_entities_from_relationship($options); - - $guids = array(); - foreach ($admins as $a) { - $guids[] = $a->guid; - } - - if ($guids) { - notify_user($guids, $user->getGUID(), $subject, $body); - } - } \ No newline at end of file + + $admins = elgg_get_entities_from_relationship($options); + + $guids = array(); + foreach ($admins as $a) { + $guids[] = $a->guid; + } + + if ($guids) { + notify_user($guids, $user->getGUID(), $subject, $body); + } + } diff --git a/start.php b/start.php index 91603278..a7abb717 100644 --- a/start.php +++ b/start.php @@ -35,8 +35,8 @@ function group_tools_init(){ // register on group leave elgg_register_event_handler("leave", "group", "group_tools_multiple_admin_group_leave"); - //notify admin on membership request - elgg_register_event_handler('create', 'membership_request', 'group_tools_membership_request'); + //notify admin on membership request + elgg_register_event_handler('create', 'membership_request', 'group_tools_membership_request'); } // register group activity widget