' . $message->getEscapedText() . "
\n";
}
return '';
}
// Get non-standard form variables
$refresh = get_form_var('refresh', 'int');
$timetohighlight = get_form_var('timetohighlight', 'int');
// The room select uses a negative value of $room to signify that we want to view all
// rooms in an area. The absolute value of $room is the current room.
if ($room < 0)
{
$room = abs($room);
$view_all = 1;
}
// We only support the day view in kiosk mode at the moment
if (isset($kiosk))
{
$view = 'day';
}
$is_ajax = is_ajax();
// If we're using an authentication type that supports the creation of users, eg 'db'
// or an extension of that type, then check to see if MRBS has just been installed
// and, if so, redirect to the edit_users page so that they can set up users.
if (auth()->canCreateUsers() && (count(auth()->getUsers()) == 0))
{
location_header('edit_users.php');
}
// Check the user is authorised for this page
if (!checkAuthorised(this_page(), $refresh))
{
exit;
}
$calendar = CalendarFactory::create($view, $view_all, $year, $month, $day, $area, $room, $timetohighlight, $kiosk);
$inner_html = $calendar->innerHTML();
$date_heading = get_date_heading($view, $year, $month, $day);
if ($refresh)
{
echo json_encode(array(
'date_heading' => $date_heading,
'inner_html' => $inner_html
));
exit;
}
// print the page header
$context = array(
'view' => $view,
'view_all' => $view_all,
'year' => $year,
'month' => $month,
'day' => $day,
'area' => $area,
'room' => $room ?? null,
'kiosk' => $kiosk ?? null
);
print_header($context);
echo "\n";
echo "
$date_heading
";
echo get_calendar_nav($view, $view_all, $year, $month, $day, $area, $room);
echo message_html();
$classes = array('dwm_main');
if ($times_along_top)
{
$classes[] .= 'times-along-top';
}
if (($view == 'year') || ($view_all && ($view !== 'day')))
{
// "all_rooms" is a bad description as we now also use the class for a single
// room in the year view. Something like "overview" would be better, but we
// keep using "all_rooms" for the moment because there may be people with custom
// CSS that have rules using "all_rooms".
$classes[] = 'all_rooms';
}
echo "
\n";
echo '
\n";
echo $inner_html;
echo "
\n";
echo "
\n";
// The bottom navigation bar is controlled by JavaScript
echo get_calendar_nav($view, $view_all, $year, $month, $day, $area, $room, true);
echo get_color_key();
echo "
\n";
print_footer();