Code Duplication    Length = 12-13 lines in 3 locations

mod/friend_request/actions/approve.php 1 location

@@ 30-41 (lines=12) @@
27
		);
28
29
		// cyu - 04/04/2016: use new notification system hook instead (if activated)
30
		if (elgg_is_active_plugin('cp_notifications')) {
31
			$message = array(
32
				'object' => $user,
33
				'cp_request_guid' => $friend->getGUID(),
34
				'cp_approver' => $user->name,
35
				'cp_approver_profile' => $user->getURL(),
36
				'cp_msg_type' => 'cp_friend_approve'
37
			);
38
			$result = elgg_trigger_plugin_hook('cp_overwrite_notification','all',$message);
39
		} else {
40
			notify_user($friend->getGUID(), $user->getGUID(), $subject, $message, $params);
41
		}
42
43
		system_message(elgg_echo("friend_request:approve:successful", array($friend->name)));
44
		

mod/group_tools/lib/functions.php 1 location

@@ 1014-1026 (lines=13) @@
1011
			);
1012
	
1013
			// cyu - work order #323 TFS
1014
			if (elgg_is_active_plugin('cp_notifications')) {
1015
				$message = array(
1016
					'cp_msg_type' => 'cp_grp_admin_transfer',
1017
					'cp_group_name' => $group->name,
1018
					'cp_group_url' => $group->getURL(),
1019
					'cp_new_owner' => $new_owner->name,
1020
					'cp_appointer' => $loggedin_user->name,
1021
					'cp_new_owner_user' => $new_owner,
1022
				);
1023
				$result = elgg_trigger_plugin_hook('cp_overwrite_notification','all',$message);
1024
			} else {
1025
				notify_user($new_owner->getGUID(), $group->getGUID(), $subject, $message);
1026
			}
1027
		}
1028
			
1029
		$result = true;

mod/gc_mobile_api/models/user.php 1 location

@@ 983-994 (lines=12) @@
980
			);
981
982
			// cyu - 04/04/2016: use new notification system hook instead (if activated)
983
			if (elgg_is_active_plugin('cp_notifications')) {
984
				$message = array(
985
					'object' => $user_entity,
986
					'cp_request_guid' => $friend->getGUID(),
987
					'cp_approver' => $user_entity->name,
988
					'cp_approver_profile' => $user_entity->getURL(),
989
					'cp_msg_type' => 'cp_friend_approve'
990
				);
991
				$result = elgg_trigger_plugin_hook('cp_overwrite_notification','all',$message);
992
			} else {
993
				notify_user($friend->getGUID(), $user_entity->getGUID(), $subject, $message, $params);
994
			}
995
			
996
			// add to river
997
			elgg_create_river_item(array(