Code Duplication    Length = 5-5 lines in 2 locations

Sources/Calendar.php 1 location

@@ 230-234 (lines=5) @@
227
	$context['allow_calendar_event'] = allowedTo('calendar_post');
228
229
	// If you don't allow events not linked to posts and you're not an admin, we have more work to do...
230
	if ($context['allow_calendar_event'] && empty($modSettings['cal_allow_unlinked']) && !$user_info['is_admin'])
231
	{
232
		$boards_can_post = boardsAllowedTo('post_new');
233
		$context['allow_calendar_event'] &= !empty($boards_can_post);
234
	}
235
236
	$context['can_post'] = $context['allow_calendar_event'];
237
	$context['current_day'] = $curPage['day'];

Sources/Subs.php 1 location

@@ 3953-3957 (lines=5) @@
3950
		$context['allow_calendar_event'] = $context['allow_calendar'] && allowedTo('calendar_post');
3951
3952
		// If you don't allow events not linked to posts and you're not an admin, we have more work to do...
3953
		if ($context['allow_calendar'] && $context['allow_calendar_event'] && empty($modSettings['cal_allow_unlinked']) && !$user_info['is_admin'])
3954
		{
3955
			$boards_can_post = boardsAllowedTo('post_new');
3956
			$context['allow_calendar_event'] &= !empty($boards_can_post);
3957
		}
3958
	}
3959
3960
	// There is some menu stuff we need to do if we're coming at this from a non-guest perspective.