function template_main() { global $context, $settings, $options, $txt, $scripturl, $modSettings; echo ' <div id="calendar"> <div id="month_grid"> ', template_show_month_grid('prev'), ' ', template_show_month_grid('current'), ' ', template_show_month_grid('next'), ' </div> <div id="main_grid" style="', $context['browser']['is_ie'] && !$context['browser']['is_ie8'] ? 'float: ' . ($context['right_to_left'] ? 'right; padding-right' : 'left; padding-left') . ': 20px;' : 'margin-' . ($context['right_to_left'] ? 'right' : 'left') . ': 220px; ', '"> ', $context['view_week'] ? template_show_week_grid('main') : template_show_month_grid('main'); // Build the calendar button array. $calendar_buttons = array('post_event' => array('test' => 'can_post', 'text' => 'calendar_post_event', 'image' => 'calendarpe.gif', 'lang' => true, 'url' => $scripturl . '?action=calendar;sa=post;month=' . $context['current_month'] . ';year=' . $context['current_year'] . ';' . $context['session_var'] . '=' . $context['session_id'])); template_button_strip($calendar_buttons, 'right'); // Show some controls to allow easy calendar navigation. echo ' <form id="calendar_navigation" action="', $scripturl, '?action=calendar" method="post" accept-charset="', $context['character_set'], '"> <select name="month">'; // Show a select box with all the months. foreach ($txt['months'] as $number => $month) { echo ' <option value="', $number, '"', $number == $context['current_month'] ? ' selected="selected"' : '', '>', $month, '</option>'; } echo ' </select> <select name="year">'; // Show a link for every year..... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { echo ' <option value="', $year, '"', $year == $context['current_year'] ? ' selected="selected"' : '', '>', $year, '</option>'; } echo ' </select> <input type="submit" class="button_submit" value="', $txt['view'], '" />'; echo ' </form> <br class="clear" /> </div> </div>'; }
/** * The main calendar - January, for example. */ function template_show_calendar() { global $context, $txt, $scripturl, $modSettings; echo ' <div id="calendar"> <div id="month_grid"> ', template_show_month_grid('prev'), ' ', template_show_month_grid('current'), ' ', template_show_month_grid('next'), ' </div> <div id="main_grid"> ', $context['view_week'] ? template_show_week_grid('main') : template_show_month_grid('main'); // Show some controls to allow easy calendar navigation. echo ' <form id="calendar_navigation" action="', $scripturl, '?action=calendar" method="post" accept-charset="UTF-8">'; template_button_strip($context['calendar_buttons'], 'right'); echo ' <select name="month">'; // Show a select box with all the months. foreach ($txt['months'] as $number => $month) { echo ' <option value="', $number, '"', $number == $context['current_month'] ? ' selected="selected"' : '', '>', $month, '</option>'; } echo ' </select> <select name="year">'; // Show a link for every year..... for ($year = $modSettings['cal_minyear']; $year <= $modSettings['cal_maxyear']; $year++) { echo ' <option value="', $year, '"', $year == $context['current_year'] ? ' selected="selected"' : '', '>', $year, '</option>'; } echo ' </select> <input type="submit" class="button_submit" value="', $txt['view'], '" /> </form> </div> </div>'; }