Code Duplication    Length = 19-20 lines in 2 locations

mod/cp_notifications/start.php 2 locations

@@ 480-499 (lines=20) @@
477
			break;
478
479
480
		case 'cp_hjpost': // gcforums/actions/gcforums/create.php
481
			$message = array(
482
				'cp_hjpost_author' => $params['cp_topic_author'],
483
				'cp_hjpost_title' => $params['cp_topic_title'],
484
				'cp_hjpost_description' => $params['cp_topic_description'],
485
				'cp_hjpost_url' => $params['cp_topic_url'],
486
				'cp_msg_type' => $cp_msg_type
487
				);
488
			$t_user = $params['cp_subscribers'];
489
			$subject = elgg_echo('cp_notify:subject:hjpost',array($params['cp_topic_author'],$params['cp_topic_title']),'en');
490
			$subject .= ' | '.elgg_echo('cp_notify:subject:hjpost',array($params['cp_topic_author'],$params['cp_topic_title']),'fr');
491
			foreach ($t_user as $s_uer)
492
				$to_recipients[] = get_user($s_uer);
493
494
			$info_notif = 'cp_hjpost';												
495
			$content_entity = $params['cp_post'];
496
			$content_url = $params['cp_topic_url'];
497
			$author = $params['cp_post']->getOwnerEntity();
498
499
			break;
500
501
502
		case 'cp_hjtopic': // gcforums/actions/gcforums/create.php
@@ 502-520 (lines=19) @@
499
			break;
500
501
502
		case 'cp_hjtopic': // gcforums/actions/gcforums/create.php
503
			$message = array(
504
				'cp_hjtopic_author' => $params['cp_topic_author'],
505
				'cp_hjtopic_title' => $params['cp_topic_title'],
506
				'cp_hjtopic_description' => $params['cp_topic_description'],
507
				'cp_hjtopic_url' => $params['cp_topic_url'],
508
				'cp_msg_type' => $cp_msg_type
509
				);
510
			$t_user = $params['cp_subscribers'];
511
			$subject = elgg_echo('cp_notify:subject:hjtopic',array($params['cp_topic_author'],$params['cp_topic_title']),'en');
512
			$subject .= ' | '.elgg_echo('cp_notify:subject:hjtopic',array($params['cp_topic_author'],$params['cp_topic_title']),'fr');
513
			foreach ($t_user as $s_uer)
514
				$to_recipients[] = get_user($s_uer);
515
516
			$info_notif = 'cp_hjtopic';															
517
			$content_url = $params['cp_topic_url'];
518
			$content_entity = $params['cp_topic'];
519
			$author = $params['cp_topic']->getOwnerEntity();
520
			break;
521
522
		case 'cp_event_request': // event_calendar/actions/event_calendar/request_personal_calendar.php
523
			$message = array(