Code Duplication    Length = 5-5 lines in 2 locations

Sources/Calendar.php 1 location

@@ 220-224 (lines=5) @@
217
	$context['allow_calendar_event'] = allowedTo('calendar_post');
218
219
	// If you don't allow events not linked to posts and you're not an admin, we have more work to do...
220
	if ($context['allow_calendar_event'] && empty($modSettings['cal_allow_unlinked']) && !$user_info['is_admin'])
221
	{
222
		$boards_can_post = boardsAllowedTo('post_new');
223
		$context['allow_calendar_event'] &= !empty($boards_can_post);
224
	}
225
226
	$context['can_post'] = $context['allow_calendar_event'];
227
	$context['current_day'] = $curPage['day'];

Sources/Subs.php 1 location

@@ 4088-4092 (lines=5) @@
4085
		$context['allow_calendar_event'] = $context['allow_calendar'] && allowedTo('calendar_post');
4086
4087
		// If you don't allow events not linked to posts and you're not an admin, we have more work to do...
4088
		if ($context['allow_calendar'] && $context['allow_calendar_event'] && empty($modSettings['cal_allow_unlinked']) && !$user_info['is_admin'])
4089
		{
4090
			$boards_can_post = boardsAllowedTo('post_new');
4091
			$context['allow_calendar_event'] &= !empty($boards_can_post);
4092
		}
4093
	}
4094
4095
	// There is some menu stuff we need to do if we're coming at this from a non-guest perspective.