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

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

Sources/Profile-Modify.php 1 location

@@ 2800-2810 (lines=11) @@
2797
2798
	// Now, let's sort the list of categories into the boards for templates that like that.
2799
	$temp_boards = array();
2800
	foreach ($context['categories'] as $category)
2801
	{
2802
		// Include a list of boards per category for easy toggling.
2803
		$context['categories'][$category['id']]['child_ids'] = array_keys($category['boards']);
2804
2805
		$temp_boards[] = array(
2806
			'name' => $category['name'],
2807
			'child_ids' => array_keys($category['boards'])
2808
		);
2809
		$temp_boards = array_merge($temp_boards, array_values($category['boards']));
2810
	}
2811
2812
	$max_boards = ceil(count($temp_boards) / 2);
2813
	if ($max_boards == 1)