Code Duplication    Length = 32-37 lines in 2 locations

mod/au_subgroups/lib/groups.php 1 location

@@ 340-371 (lines=32) @@
337
 *
338
 * @param int $guid Group entity GUID
339
 */
340
function groups_handle_activity_page($guid) {
341
342
	elgg_entity_gatekeeper($guid, 'group');
343
	elgg_set_page_owner_guid($guid);
344
	elgg_group_gatekeeper();
345
	$group = get_entity($guid);
346
	$title = elgg_echo('groups:activity');
347
	$db_prefix = elgg_get_config('dbprefix');
348
349
	elgg_push_breadcrumb($group->name, $group->getURL());
350
	elgg_push_breadcrumb($title);
351
352
	$content = elgg_list_river(array(
353
		'joins' => array(
354
			"JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid",
355
			"LEFT JOIN {$db_prefix}entities e2 ON e2.guid = rv.target_guid",
356
		),
357
		'wheres' => array(
358
			"(e1.container_guid = $group->guid OR e2.container_guid = $group->guid)",
359
		),
360
		'no_results' => elgg_echo('groups:activity:none'),
361
	));
362
363
	$params = array(
364
		'content' => $content,
365
		'title' => $title,
366
		'filter' => '',
367
	);
368
	$body = elgg_view_layout('content', $params);
369
370
	echo elgg_view_page($title, $body);
371
}
372
373
/**
374
 * Group members page

mod/groups/lib/groups.php 1 location

@@ 336-372 (lines=37) @@
333
 *
334
 * @param int $guid Group entity GUID
335
 */
336
function groups_handle_activity_page($guid) {
337
338
	elgg_entity_gatekeeper($guid, 'group');
339
340
	elgg_set_page_owner_guid($guid);
341
342
	elgg_group_gatekeeper();
343
344
	$group = get_entity($guid);
345
346
	$title = elgg_echo('groups:activity');
347
348
	elgg_push_breadcrumb($group->name, $group->getURL());
349
	elgg_push_breadcrumb($title);
350
351
	$db_prefix = elgg_get_config('dbprefix');
352
353
	$content = elgg_list_river(array(
354
		'joins' => array(
355
			"JOIN {$db_prefix}entities e1 ON e1.guid = rv.object_guid",
356
			"LEFT JOIN {$db_prefix}entities e2 ON e2.guid = rv.target_guid",
357
		),
358
		'wheres' => array(
359
			"(e1.container_guid = $group->guid OR e2.container_guid = $group->guid)",
360
		),
361
		'no_results' => elgg_echo('groups:activity:none'),
362
	));
363
364
	$params = array(
365
		'content' => $content,
366
		'title' => $title,
367
		'filter' => '',
368
	);
369
	$body = elgg_view_layout('content', $params);
370
371
	echo elgg_view_page($title, $body);
372
}
373
374
/**
375
 * Group members page