Code Duplication    Length = 11-11 lines in 4 locations

Sources/Search.php 1 location

@@ 172-182 (lines=11) @@
169
170
	// Now, let's sort the list of categories into the boards for templates that like that.
171
	$temp_boards = array();
172
	foreach ($context['categories'] as $category)
173
	{
174
		$temp_boards[] = array(
175
			'name' => $category['name'],
176
			'child_ids' => array_keys($category['boards'])
177
		);
178
		$temp_boards = array_merge($temp_boards, array_values($category['boards']));
179
180
		// Include a list of boards per category for easy toggling.
181
		$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);
182
	}
183
184
	$max_boards = ceil(count($temp_boards) / 2);
185
	if ($max_boards == 1)

Sources/ManageMembergroups.php 2 locations

@@ 574-584 (lines=11) @@
571
572
	// Now, let's sort the list of categories into the boards for templates that like that.
573
	$temp_boards = array();
574
	foreach ($context['categories'] as $category)
575
	{
576
		$temp_boards[] = array(
577
			'name' => $category['name'],
578
			'child_ids' => array_keys($category['boards'])
579
		);
580
		$temp_boards = array_merge($temp_boards, array_values($category['boards']));
581
582
		// Include a list of boards per category for easy toggling.
583
		$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);
584
	}
585
586
	createToken('admin-mmg');
587
}
@@ 1123-1133 (lines=11) @@
1120
1121
		// Now, let's sort the list of categories into the boards for templates that like that.
1122
		$temp_boards = array();
1123
		foreach ($context['categories'] as $category)
1124
		{
1125
			$temp_boards[] = array(
1126
				'name' => $category['name'],
1127
				'child_ids' => array_keys($category['boards'])
1128
			);
1129
			$temp_boards = array_merge($temp_boards, array_values($category['boards']));
1130
1131
			// Include a list of boards per category for easy toggling.
1132
			$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);
1133
		}
1134
	}
1135
1136
	// Get a list of all the image formats we can select.

Sources/Profile-Modify.php 1 location

@@ 2884-2894 (lines=11) @@
2881
2882
	// Now, let's sort the list of categories into the boards for templates that like that.
2883
	$temp_boards = array();
2884
	foreach ($context['categories'] as $category)
2885
	{
2886
		// Include a list of boards per category for easy toggling.
2887
		$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);
2888
2889
		$temp_boards[] = array(
2890
			'name' => $category['name'],
2891
			'child_ids' => array_keys($category['boards'])
2892
		);
2893
		$temp_boards = array_merge($temp_boards, array_values($category['boards']));
2894
	}
2895
2896
	$max_boards = ceil(count($temp_boards) / 2);
2897
	if ($max_boards == 1)