Code Duplication    Length = 24-26 lines in 2 locations

mod/cp_notifications/start.php 2 locations

@@ 875-900 (lines=26) @@
872
873
	    		break;
874
875
	    	case 'comment':
876
877
	    		$content_title_en = gc_explode_translation($content_title, 'en');
878
	    		$content_title_fr = gc_explode_translation($content_title, 'fr');
879
880
	    		$subject = elgg_echo('cp_notify:subject:likes_comment', array($liked_by->name, $content_title_en),'en');
881
	    		$subject .= ' | '.elgg_echo('cp_notify:subject:likes_comment',array($liked_by->name, $content_title_fr),'fr');
882
883
	    		$message = array(
884
	    			'cp_liked_by' => $liked_by->name,
885
	    			'cp_comment_from' => $content_title,
886
	    			'content_url' => $content->getURL(),
887
					'cp_msg_type' => 'cp_likes_comments',
888
				);
889
890
	    		$author = $liked_by;
891
	    		$action_type = "like_comment";
892
893
	    		if (strcmp(elgg_get_plugin_user_setting('cpn_likes_email', $comment_author->getGUID(),'cp_notifications'),'likes_email') == 0)
894
					$to_recipients[$comment_author->getGUID()] = $comment_author;
895
					$get_error_info = 'comment';
896
897
    			if (strcmp(elgg_get_plugin_user_setting('cpn_likes_site', $comment_author->getGUID(),'cp_notifications'),'likes_site') == 0)
898
					$to_recipients_site[$comment_author->getGUID()] = $comment_author;
899
					$get_error_info = 'comment';
900
	    		break;
901
902
	    	case 'discussion_reply':
903
@@ 902-925 (lines=24) @@
899
					$get_error_info = 'comment';
900
	    		break;
901
902
	    	case 'discussion_reply':
903
904
	    		$content_title_en = gc_explode_translation($content_title, 'en');
905
	    		$content_title_fr = gc_explode_translation($content_title, 'fr');
906
907
	    		$subject = elgg_echo('cp_notify:subject:likes_discussion',array($liked_by->name, $content_title_en),'en');
908
	    		$subject .= ' | '.elgg_echo('cp_notify:subject:likes_discussion',array($liked_by->name, $content_title_fr),'fr');
909
910
				$message = array(
911
					'cp_liked_by' => $liked_by->name,
912
					'cp_comment_from' => $content_title,
913
					'content_url' => $content->getURL(),
914
					'cp_msg_type' => 'cp_likes_topic_replies',
915
				);
916
				$author = $liked_by;
917
				$action_type = "like_reply";
918
919
	    		if (strcmp(elgg_get_plugin_user_setting('cpn_likes_email', $comment_author->getGUID(),'cp_notifications'),'likes_email') == 0)
920
					$to_recipients[$comment_author->getGUID()] = $comment_author;
921
					$get_error_info = 'discussion_reply';
922
    			if (strcmp(elgg_get_plugin_user_setting('cpn_likes_site', $comment_author->getGUID(),'cp_notifications'),'likes_site') == 0)
923
					$to_recipients_site[$comment_author->getGUID()] = $comment_author;
924
					$get_error_info = 'discussion_reply';
925
	    		break;
926
927
928
	    	default: