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

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

mod/gc_mobile_api/models/user.php 1 location

@@ 1151-1162 (lines=12) @@
1148
			);
1149
1150
			// cyu - 04/04/2016: use new notification system hook instead (if activated)
1151
			if (elgg_is_active_plugin('cp_notifications')) {
1152
				$message = array(
1153
					'object' => $user_entity,
1154
					'cp_request_guid' => $friend->getGUID(),
1155
					'cp_approver' => $user_entity->name,
1156
					'cp_approver_profile' => $user_entity->getURL(),
1157
					'cp_msg_type' => 'cp_friend_approve'
1158
				);
1159
				$result = elgg_trigger_plugin_hook('cp_overwrite_notification', 'all', $message);
1160
			} else {
1161
				notify_user($friend->getGUID(), $user_entity->getGUID(), $subject, $message, $params);
1162
			}
1163
1164
			// add to river
1165
			elgg_create_river_item(array(