Browse Source

Merge pull request #348 from Labradoodle-360/calendar-template

Calendar Overhaul
Joshua Dickerson 12 years ago
parent
commit
8f2af3477e

+ 37 - 20
Sources/Calendar.php

@@ -34,6 +34,12 @@ function CalendarMain()
 	// Permissions, permissions, permissions.
 	isAllowedTo('calendar_view');
 
+	// Some global template resources.
+	$context['calendar_resources'] = array(
+		'min_year' => $modSettings['cal_minyear'],
+		'max_year' => $modSettings['cal_maxyear'],
+	);
+
 	// Doing something other than calendar viewing?
 	$subActions = array(
 		'ical' => 'iCalDownload',
@@ -91,11 +97,17 @@ function CalendarMain()
 		'show_birthdays' => in_array($modSettings['cal_showbdays'], array(1, 2)),
 		'show_events' => in_array($modSettings['cal_showevents'], array(1, 2)),
 		'show_holidays' => in_array($modSettings['cal_showholidays'], array(1, 2)),
+		'highlight' => array(
+			'events' => isset($modSettings['cal_highlight_events']) ? $modSettings['cal_highlight_events'] : 0,
+			'holidays' => isset($modSettings['cal_highlight_holidays']) ? $modSettings['cal_highlight_holidays'] : 0,
+			'birthdays' => isset($modSettings['cal_highlight_birthdays']) ? $modSettings['cal_highlight_birthdays'] : 0,
+		),
 		'show_week_num' => true,
-		'short_day_titles' => false,
-		'show_next_prev' => true,
-		'show_week_links' => true,
-		'size' => 'large',
+		'tpl_show_week_num' => !empty($modSettings['cal_week_numbers']),
+		'short_day_titles' => !empty($modSettings['cal_short_days']),
+		'short_month_titles' => !empty($modSettings['cal_short_months']),
+		'show_next_prev' => !empty($modSettings['cal_prev_next_links']),
+		'show_week_links' => isset($modSettings['cal_week_links']) ? $modSettings['cal_week_links'] : 0,
 	);
 
 	// Load up the main view.
@@ -105,15 +117,10 @@ function CalendarMain()
 		$context['calendar_grid_main'] = getCalendarGrid($curPage['month'], $curPage['year'], $calendarOptions);
 
 	// Load up the previous and next months.
-	$calendarOptions['show_birthdays'] = $calendarOptions['show_events'] = $calendarOptions['show_holidays'] = false;
-	$calendarOptions['short_day_titles'] = true;
-	$calendarOptions['show_next_prev'] = false;
-	$calendarOptions['show_week_links'] = false;
-	$calendarOptions['size'] = 'small';
 	$context['calendar_grid_current'] = getCalendarGrid($curPage['month'], $curPage['year'], $calendarOptions);
 	// Only show previous month if it isn't pre-January of the min-year
 	if ($context['calendar_grid_current']['previous_calendar']['year'] > $modSettings['cal_minyear'] || $curPage['month'] != 1)
-		$context['calendar_grid_prev'] = getCalendarGrid($context['calendar_grid_current']['previous_calendar']['month'], $context['calendar_grid_current']['previous_calendar']['year'], $calendarOptions);
+		$context['calendar_grid_prev'] = getCalendarGrid($context['calendar_grid_current']['previous_calendar']['month'], $context['calendar_grid_current']['previous_calendar']['year'], $calendarOptions, true);
 	// Only show next month if it isn't post-December of the max-year
 	if ($context['calendar_grid_current']['next_calendar']['year'] < $modSettings['cal_maxyear'] || $curPage['month'] != 12)
 		$context['calendar_grid_next'] = getCalendarGrid($context['calendar_grid_current']['next_calendar']['month'], $context['calendar_grid_current']['next_calendar']['year'], $calendarOptions);
@@ -124,6 +131,8 @@ function CalendarMain()
 	$context['current_month'] = $curPage['month'];
 	$context['current_year'] = $curPage['year'];
 	$context['show_all_birthdays'] = isset($_GET['showbd']);
+	$context['blocks_disabled'] = !empty($modSettings['cal_disable_prev_next']) ? 1 : 0;
+	$context['tpl_show_week_num'] = !empty($calendarOptions['tpl_show_week_num']) ? 1 : 0;
 
 	// Set the page title to mention the month or week, too
 	$context['page_title'] .= ' - ' . ($context['view_week'] ? sprintf($txt['calendar_week_title'], $context['calendar_grid_main']['week_number'], ($context['calendar_grid_main']['week_number'] == 53 ? $context['current_year'] - 1 : $context['current_year'])) : $txt['months'][$context['current_month']] . ' ' . $context['current_year']);
@@ -384,6 +393,7 @@ function iCalDownload()
 	$filecontents .= 'PRODID:-//SimpleMachines//SMF ' . (empty($forum_version) ? 2.0 : strtr($forum_version, array('SMF ' => ''))) . '//EN' . "\n";
 	$filecontents .= 'VERSION:2.0' . "\n";
 	$filecontents .= 'BEGIN:VEVENT' . "\n";
+	// @TODO - Should be the members email who created the event rather than $webmaster_email.
 	$filecontents .= 'ORGANIZER;CN="' . $event['realname'] . '":MAILTO:' . $webmaster_email . "\n";
 	$filecontents .= 'DTSTAMP:' . $datestamp . "\n";
 	$filecontents .= 'DTSTART;VALUE=DATE:' . $datestart . "\n";
@@ -436,11 +446,16 @@ function iCalDownload()
  */
 function clock()
 {
-	global $settings, $context;
+	global $settings, $context, $scripturl;
+
 	$context['onimg'] = $settings['images_url'] . '/bbc/bbc_bg.png';
 	$context['offimg'] = $settings['images_url'] . '/bbc/bbc_hoverbg.png';
 
 	$context['page_title'] = 'Anyone know what time it is?';
+	$context['linktree'][] = array(
+			'url' => $scripturl . '?action=clock',
+			'name' => 'Clock',
+	);
 	$context['robot_no_index'] = true;
 
 	$omfg = isset($_REQUEST['omfg']);
@@ -448,26 +463,35 @@ function clock()
 
 	loadTemplate('Calendar');
 
-	if ($bcd && !$omfg)
+	if ($bcd)
 	{
 		$context['sub_template'] = 'bcd';
+		$context['linktree'][] = array('url' => $scripturl . '?action=clock;bcd', 'name' => 'BCD');
 		$context['clockicons'] = unserialize(base64_decode('YTo2OntzOjI6ImgxIjthOjI6e2k6MDtpOjI7aToxO2k6MTt9czoyOiJoMiI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjI6Im0xIjthOjM6e2k6MDtpOjQ7aToxO2k6MjtpOjI7aToxO31zOjI6Im0yIjthOjQ6e2k6MDtpOjg7aToxO2k6NDtpOjI7aToyO2k6MztpOjE7fXM6MjoiczEiO2E6Mzp7aTowO2k6NDtpOjE7aToyO2k6MjtpOjE7fXM6MjoiczIiO2E6NDp7aTowO2k6ODtpOjE7aTo0O2k6MjtpOjI7aTozO2k6MTt9fQ=='));
 	}
 	elseif (!$omfg && !isset($_REQUEST['time']))
 	{
 		$context['sub_template'] = 'hms';
+		$context['linktree'][] = array('url' => $scripturl . '?action=clock', 'name' => 'Binary');
 		$context['clockicons'] = unserialize(base64_decode('YTozOntzOjE6ImgiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czoxOiJtIjthOjY6e2k6MDtpOjMyO2k6MTtpOjE2O2k6MjtpOjg7aTozO2k6NDtpOjQ7aToyO2k6NTtpOjE7fXM6MToicyI7YTo2OntpOjA7aTozMjtpOjE7aToxNjtpOjI7aTo4O2k6MztpOjQ7aTo0O2k6MjtpOjU7aToxO319'));
 	}
 	elseif ($omfg)
 	{
 		$context['sub_template'] = 'omfg';
+		$context['linktree'][] = array('url' => $scripturl . '?action=clock;omfg', 'name' => 'OMFG');
 		$context['clockicons'] = unserialize(base64_decode('YTo2OntzOjQ6InllYXIiO2E6Nzp7aTowO2k6NjQ7aToxO2k6MzI7aToyO2k6MTY7aTozO2k6ODtpOjQ7aTo0O2k6NTtpOjI7aTo2O2k6MTt9czo1OiJtb250aCI7YTo0OntpOjA7aTo4O2k6MTtpOjQ7aToyO2k6MjtpOjM7aToxO31zOjM6ImRheSI7YTo1OntpOjA7aToxNjtpOjE7aTo4O2k6MjtpOjQ7aTozO2k6MjtpOjQ7aToxO31zOjQ6ImhvdXIiO2E6NTp7aTowO2k6MTY7aToxO2k6ODtpOjI7aTo0O2k6MztpOjI7aTo0O2k6MTt9czozOiJtaW4iO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9czozOiJzZWMiO2E6Njp7aTowO2k6MzI7aToxO2k6MTY7aToyO2k6ODtpOjM7aTo0O2k6NDtpOjI7aTo1O2k6MTt9fQ=='));
 	}
 	elseif (isset($_REQUEST['time']))
 	{
 		$context['sub_template'] = 'thetime';
 		$time = getdate($_REQUEST['time'] == 'now' ? time() : (int) $_REQUEST['time']);
-
+		$year = $time['year'] % 100;
+		$month = $time['mon'];
+		$day = $time['mday'];
+		$hour = $time['hours'];
+		$min = $time['minutes'];
+		$sec = $time['seconds'];
+		$context['linktree'][] = array('url' => $scripturl . '?action=clock;time=' . $_REQUEST['time'], 'name' => 'Requested Time');
 		$context['clockicons'] = array(
 			'year' => array(
 				64 => false,
@@ -517,13 +541,6 @@ function clock()
 			),
 		);
 
-		$year = $time['year'] % 100;
-		$month = $time['mon'];
-		$day = $time['mday'];
-		$hour = $time['hours'];
-		$min = $time['minutes'];
-		$sec = $time['seconds'];
-
 		foreach ($context['clockicons'] as $t => $vs)
 			foreach ($vs as $v => $dumb)
 			{

+ 2 - 5
Sources/Load.php

@@ -507,7 +507,7 @@ function loadBoard()
 		$_REQUEST['msg'] = (int) $_REQUEST['msg'];
 
 		// Looking through the message table can be slow, so try using the cache first.
-		if (($topic = cache_get_data('msg_topic-' . $_REQUEST['msg'], 120)) === NULL)
+		if (($topic = cache_get_data('msg_topic-' . $_REQUEST['msg'], 120)) === null)
 		{
 			$request = $smcFunc['db_query']('', '
 				SELECT id_topic
@@ -1768,7 +1768,6 @@ function loadTheme($id_theme = 0, $initialize = true)
 		'smf_default_theme_url' => '"' . $settings['default_theme_url'] . '"',
 		'smf_images_url' => '"' . $settings['images_url'] . '"',
 		'smf_scripturl' => '"' . $scripturl . '"',
-		'smf_default_theme_url' => '"' . $settings['default_theme_url'] . '"',
 		'smf_iso_case_folding' => $context['server']['iso_case_folding'] ? 'true' : 'false',
 		'smf_charset' => '"' . $context['character_set'] . '"',
 		'smf_session_id' => '"' . $context['session_id'] . '"',
@@ -2086,9 +2085,7 @@ function addJavascriptVar($key, $value, $escape = false)
 function addInlineJavascript($javascript, $defer = false)
 {
 	global $context;
-
-	if (!empty($javascript))
-		$context['javascript_inline'][(!empty($defer) ? 'defer' : 'standard')][] = $javascript;
+	$context['javascript_inline'][($defer === true ? 'defer' : 'standard')][] = $javascript;
 }
 
 /**

+ 18 - 4
Sources/ManageCalendar.php

@@ -24,7 +24,7 @@ if (!defined('SMF'))
  */
 function ManageCalendar()
 {
-	global $context, $txt, $scripturl, $modSettings;
+	global $context, $txt;
 
 	isAllowedTo('admin_forum');
 
@@ -184,7 +184,7 @@ function ModifyHolidays()
  */
 function EditHoliday()
 {
-	global $txt, $context, $scripturl, $smcFunc;
+	global $txt, $context, $smcFunc;
 
 	loadTemplate('ManageCalendar');
 
@@ -290,7 +290,7 @@ function EditHoliday()
  */
 function ModifyCalendarSettings($return_config = false)
 {
-	global $modSettings, $context, $settings, $txt, $boarddir, $sourcedir, $scripturl, $smcFunc;
+	global $context, $txt, $sourcedir, $scripturl, $smcFunc;
 
 	// Load the boards list.
 	$boards = array('');
@@ -333,6 +333,20 @@ function ModifyCalendarSettings($return_config = false)
 			// Calendar spanning...
 			array('check', 'cal_allowspan'),
 			array('int', 'cal_maxspan', 6, 'postinput' => $txt['days_word']),
+		'',
+			// A comment is like a dog marking its territory. ;)
+			array('select', 'cal_highlight_events', array(0 => $txt['setting_cal_highlight_none'], 1 => $txt['setting_cal_highlight_mini'], 2 => $txt['setting_cal_highlight_main'], 3 => $txt['setting_cal_highlight_both'])),
+			array('select', 'cal_highlight_holidays', array(0 => $txt['setting_cal_highlight_none'], 1 => $txt['setting_cal_highlight_mini'], 2 => $txt['setting_cal_highlight_main'], 3 => $txt['setting_cal_highlight_both'])),
+			array('select', 'cal_highlight_birthdays', array(0 => $txt['setting_cal_highlight_none'], 1 => $txt['setting_cal_highlight_mini'], 2 => $txt['setting_cal_highlight_main'], 3 => $txt['setting_cal_highlight_both'])),
+		'',
+			// Miscellaneous layout settings...
+			array('check', 'cal_disable_prev_next'),
+			array('select', 'cal_display_type', array(0 => $txt['setting_cal_display_comfortable'], 1 => $txt['setting_cal_display_compact'])),
+			array('select', 'cal_week_links', array(0 => $txt['setting_cal_week_links_none'], 1 => $txt['setting_cal_week_links_mini'], 2 => $txt['setting_cal_week_links_main'], 3 => $txt['setting_cal_week_links_both'])),
+			array('check', 'cal_prev_next_links'),
+			array('check', 'cal_short_days'),
+			array('check', 'cal_short_months'),
+			array('check', 'cal_week_numbers'),
 	);
 
 	call_integration_hook('integrate_modify_calendar_settings', array(&$config_vars));
@@ -365,7 +379,7 @@ function ModifyCalendarSettings($return_config = false)
 		redirectexit('action=admin;area=managecalendar;sa=settings');
 	}
 
-	// We need this for the in-line permissions
+	// We need this for the inline permissions
 	createToken('admin-mp');
 
 	// Prepare the settings...

+ 26 - 15
Sources/Subs-Calendar.php

@@ -27,7 +27,7 @@ if (!defined('SMF'))
  */
 function getBirthdayRange($low_date, $high_date)
 {
-	global $scripturl, $modSettings, $smcFunc;
+	global $smcFunc;
 
 	// We need to search for any birthday in this range, and whatever year that birthday is on.
 	$year_low = (int) substr($low_date, 0, 4);
@@ -307,9 +307,10 @@ function getTodayInfo()
  * @param int $month
  * @param int $year
  * @param array $calendarOptions
+ * @param int $is_previous
  * @return array containing all the information needed to show a calendar grid for the given month
  */
-function getCalendarGrid($month, $year, $calendarOptions)
+function getCalendarGrid($month, $year, $calendarOptions, $is_previous = false)
 {
 	global $scripturl, $modSettings;
 
@@ -318,10 +319,16 @@ function getCalendarGrid($month, $year, $calendarOptions)
 		'week_days' => array(),
 		'weeks' => array(),
 		'short_day_titles' => !empty($calendarOptions['short_day_titles']),
+		'short_month_titles' => !empty($calendarOptions['short_month_titles']),
+		'highlight' => array(
+			'events' => !empty($calendarOptions['highlight']['events']) && !empty($calendarOptions['show_events']) ? $calendarOptions['highlight']['events'] : 0,
+			'holidays' => !empty($calendarOptions['highlight']['holidays']) && !empty($calendarOptions['show_holidays']) ? $calendarOptions['highlight']['holidays'] : 0,
+			'birthdays' => !empty($calendarOptions['highlight']['birthdays']) && !empty($calendarOptions['show_birthdays']) ? $calendarOptions['highlight']['birthdays'] : 0,
+		),
 		'current_month' => $month,
 		'current_year' => $year,
 		'show_next_prev' => !empty($calendarOptions['show_next_prev']),
-		'show_week_links' => !empty($calendarOptions['show_week_links']),
+		'show_week_links' => isset($calendarOptions['show_week_links']) ? $calendarOptions['show_week_links'] : 0,
 		'previous_calendar' => array(
 			'year' => $month == 1 ? $year - 1 : $year,
 			'month' => $month == 1 ? 12 : $month - 1,
@@ -332,11 +339,10 @@ function getCalendarGrid($month, $year, $calendarOptions)
 			'month' => $month == 12 ? 1 : $month + 1,
 			'disabled' => $modSettings['cal_maxyear'] < ($month == 12 ? $year + 1 : $year),
 		),
-		// @todo Better tweaks?
-		'size' => isset($calendarOptions['size']) ? $calendarOptions['size'] : 'large',
+		'size' => empty($modSettings['cal_display_type']) ? 'large' : 'small',
 	);
 
-	// Get todays date.
+	// Get today's date.
 	$today = getTodayInfo();
 
 	// Get information about this month.
@@ -444,13 +450,21 @@ function getCalendarGrid($month, $year, $calendarOptions)
 				'date' => $date,
 				'is_today' => $date == $today['date'],
 				'is_first_day' => !empty($calendarOptions['show_week_num']) && (($month_info['first_day']['day_of_week'] + $nDay - 1) % 7 == $calendarOptions['start_day']),
+				'is_first_of_month' => $nDay === 1,
 				'holidays' => !empty($holidays[$date]) ? $holidays[$date] : array(),
 				'events' => !empty($events[$date]) ? $events[$date] : array(),
-				'birthdays' => !empty($bday[$date]) ? $bday[$date] : array()
+				'birthdays' => !empty($bday[$date]) ? $bday[$date] : array(),
 			);
 		}
 	}
 
+	// What is the last day of the month?
+	if ($is_previous === true)
+		$calendarGrid['last_of_month'] = $month_info['last_day']['day_of_month'];
+
+	// We'll use the shift in the template.
+	$calendarGrid['shift'] = $nShift;
+
 	// Set the previous and the next month's links.
 	$calendarGrid['previous_calendar']['href'] = $scripturl . '?action=calendar;year=' . $calendarGrid['previous_calendar']['year'] . ';month=' . $calendarGrid['previous_calendar']['month'];
 	$calendarGrid['next_calendar']['href'] = $scripturl . '?action=calendar;year=' . $calendarGrid['next_calendar']['year'] . ';month=' . $calendarGrid['next_calendar']['month'];
@@ -470,7 +484,7 @@ function getCalendarWeek($month, $year, $day, $calendarOptions)
 {
 	global $scripturl, $modSettings;
 
-	// Get todays date.
+	// Get today's date.
 	$today = getTodayInfo();
 
 	// What is the actual "start date" for the passed day.
@@ -501,6 +515,7 @@ function getCalendarWeek($month, $year, $day, $calendarOptions)
 		'next_week' => array(
 			'disabled' => $day > 25 && $modSettings['cal_maxyear'] < ($month == 12 ? $year + 1 : $year),
 		),
+		'size' => empty($modSettings['cal_display_type']) ? 'large' : 'small',
 	);
 
 	// The next week calculation requires a bit more work.
@@ -596,8 +611,6 @@ function getCalendarWeek($month, $year, $day, $calendarOptions)
  */
 function cache_getOffsetIndependentEvents($days_to_index)
 {
-	global $sourcedir;
-
 	$low_date = strftime('%Y-%m-%d', forum_time(false) - 24 * 3600);
 	$high_date = strftime('%Y-%m-%d', forum_time(false) + $days_to_index * 24 * 3600);
 
@@ -621,8 +634,6 @@ function cache_getOffsetIndependentEvents($days_to_index)
  */
 function cache_getRecentEvents($eventOptions)
 {
-	global $modSettings, $user_info, $scripturl;
-
 	// With the 'static' cached data we can calculate the user-specific data.
 	$cached_data = cache_quick_get('calendar_index', 'Subs-Calendar.php', 'cache_getOffsetIndependentEvents', array($eventOptions['num_days_shown']));
 
@@ -739,7 +750,7 @@ function cache_getRecentEvents($eventOptions)
  */
 function validateEventPost()
 {
-	global $modSettings, $txt, $sourcedir, $smcFunc;
+	global $modSettings, $smcFunc;
 
 	if (!isset($_POST['deleteevent']))
 	{
@@ -833,7 +844,7 @@ function getEventPoster($event_id)
  */
 function insertEvent(&$eventOptions)
 {
-	global $modSettings, $smcFunc;
+	global $smcFunc;
 
 	// Add special chars to the title.
 	$eventOptions['title'] = $smcFunc['htmlspecialchars']($eventOptions['title'], ENT_QUOTES);
@@ -877,7 +888,7 @@ function insertEvent(&$eventOptions)
 	// Store the just inserted id_event for future reference.
 	$eventOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}calendar', 'id_event');
 
-	// Update the settings to show something calendarish was updated.
+	// Update the settings to show something calendar-ish was updated.
 	updateSettings(array(
 		'calendar_updated' => time(),
 	));

+ 12 - 2
Sources/Subs.php

@@ -2904,7 +2904,7 @@ function setupThemeContext($forceload = false)
 	// 2.1+: Add the PM popup here instead. Theme authors can still override it simply by editing/removing the 'fPmPopup' in the array.
 	if ($context['show_pm_popup'])
 		addInlineJavascript('
-		$(document).ready(function(){
+		jQuery(document).ready(function($) {
 			new smc_Popup({
 				heading: ' . JavaScriptEscape($txt['show_personal_messages_heading']) . ',
 				content: ' . JavaScriptEscape(sprintf($txt['show_personal_messages'], $context['user']['unread_messages'], $scripturl . '?action=pm')) . ',
@@ -3222,8 +3222,18 @@ function template_javascript($do_defered = false)
 	<script type="text/javascript"><!-- // --><![CDATA[';
 
 		foreach ($context['javascript_vars'] as $key => $value)
-			echo '
+		{
+			if (empty($value))
+			{
+				echo '
+		var ', $key, ';';
+			}
+			else
+			{
+				echo '
 		var ', $key, ' = ', $value, ';';
+			}
+		}
 
 		echo '
 	// ]]></script>';

+ 1 - 1
Themes/default/BoardIndex.template.php

@@ -340,7 +340,7 @@ function template_info_center()
 		// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
 		if (!empty($context['calendar_holidays']))
 			echo '
-				<p class="inline holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</p>';
+				<p class="inline holiday"><span>', $txt['calendar_prompt'], '</span> ', implode(', ', $context['calendar_holidays']), '</p>';
 
 		// People's birthdays. Like mine. And yours, I guess. Kidding.
 		if (!empty($context['calendar_birthdays']))

File diff suppressed because it is too large
+ 576 - 383
Themes/default/Calendar.template.php


+ 148 - 75
Themes/default/css/index.css

@@ -25,7 +25,7 @@ html {
 }
 /* Set a font-size that will look the same in all browsers. */
 body {
-	background: #E9EEF2;
+	background: #e9eef2;
 	/* Start with the best Vista/W7 font, then go to best Mac and Linux, then the old fallbacks.........*/
 	/* Font size is specifically chosen to be exactly 10 point. There are sound reasons for this (hinting, ClearType, etc). */
 	font: 83.33%/150% "Segoe UI", "Helvetica Neue", "Liberation Sans", "Nimbus Sans L", Arial, sans-serif;
@@ -284,6 +284,12 @@ em {
 .largetext {
 	font-size: 1.4em;
 }
+h3.largetext {
+	font-size: large;
+}
+.xlarge_text {
+	font-size: x-large;
+}
 .centertext {
 	margin: 0 auto;
 	text-align: center;
@@ -622,8 +628,8 @@ div.pagesection div.floatright input, div.pagesection div.floatright select {
 	color: #078907;
 }
 
-.holiday {
-	color: #000080;
+.holiday > span {
+	color: rgb(0, 92, 255);
 }
 
 /* Colors for warnings */
@@ -1295,7 +1301,7 @@ img.sort {
 .buttonlist ul li a span {
 	display: block;
 	height: 2.2em;
-	line-height: 2.2em;
+	line-height: 2.5em;
 	padding: 0 8px;
 }
 /* the active one */
@@ -3549,23 +3555,19 @@ dl.addrules dt.floatleft {
 #calendar {
 	overflow: hidden;
 }
-
 /* Used to indicate the current day in the grid. */
-.calendar_today {
+#main_grid .calendar_today span.day_text, #month_grid .calendar_today, .calendar_week tr.days_wrapper td.calendar_today:first-child {
+	font-weight: bold;
+}
+.calendar_today, td.days:hover {
 	background: #fff;
-	border: 1px solid #bbb;
-	box-shadow: 0 2px 5px rgba(0,0,0,0.05) inset;
 }
 #month_grid {
-	padding: 0 15px 0 0;
-	width: 215px;
-	text-align: center;
+	width: 284px;
 	float: left;
-}
-#month_grid div.cat_bar {
-	border-radius: 5px 5px 0 0;
-	margin: 0 1px 0 0;
-	padding: 0 0 0 0;
+	text-align: center;
+	overflow: hidden;
+	margin-right: 1%;
 }
 #month_grid h3 a {
 	padding: 0 6px 0 6px;
@@ -3573,21 +3575,45 @@ dl.addrules dt.floatleft {
 #month_grid table {
 	width: 100%;
 	margin-bottom: 12px;
+	border-collapse: collapse;
+	background: #f0f4f7;
+	border: 1px solid #ccc;
 }
 #main_grid {
-	position: relative;
-	overflow: hidden;
+	overflow: auto;
 }
 #main_grid table {
-	width: 100%;
-	margin-bottom: 2px;
-	padding-bottom: 4px;
+	width: 99.9%;
+	border-collapse: collapse;
+	background: #f0f4f7;
+	margin: 1px 0 0 0;
+	border: 1px solid #ccc;
+	overflow: auto;
+	-moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-sizing: border-box;
+	margin-left: 1px;
 }
 #main_grid .cat_bar {
 	border-radius: 5px 5px 0 0;
 	margin: 0 1px;
 }
-#main_grid h3.catbg {
+#month_grid table th:first-child {
+	background: #e7eaef;
+}
+#month_grid table th.days {
+	background: #e7eaef;
+}
+#month_grid table th.days, #month_grid table td.weeks {
+	padding: 5px;
+	text-align: center;
+}
+#month_grid table td.weeks {
+	font-size: large;
+	background: #e7eaef;
+}
+#month_grid td.weeks a:hover {
+	text-decoration: underline;
+}
+#month_grid h3.catbg, #main_grid h3.catbg {
 	padding: 8px 6px 4px 6px;
 }
 #main_grid h3.catbg span {
@@ -3595,90 +3621,133 @@ dl.addrules dt.floatleft {
 	font-size: 1.5em;
 	margin: -3px 4px 0 4px;
 }
+#main_grid table th:first-child {
+	background: #e7eaef;
+}
 #main_grid table th.days {
 	width: 14%;
-	padding: 4px 0;
+	padding: 10px;
+	text-align: left;
+	background: #e7eaef;
 }
 #main_grid table td.weeks {
 	text-align: center;
 	font-weight: bold;
 	font-size: 1.8em;
+	background: #e7eaef;
 }
 #main_grid table td.weeks a:hover {
 	text-decoration: none;
 }
-#main_grid table td.days {
+/* Main Highlighting */
+#main_grid table td.disabled, #month_grid table td.disabled {
+	background: rgba(238, 238, 238, 1.0);
+}
+#main_grid table td.events, #month_grid table td.events {
+	background: rgba(30, 245, 20, 0.1);
+}
+#main_grid table td.holidays, #month_grid table td.holidays {
+	background: rgba(23, 110, 245, 0.1);
+}
+#main_grid table td.birthdays, #month_grid table td.birthdays {
+	background: rgba(102, 0, 255, 0.1);
+}
+/* Special Case Highlighting */
+#main_grid table td.events:hover, #month_grid table td.events:hover, #month_grid table td.calendar_today.events {
+	background: rgba(30, 245, 20, 0.2);
+}
+#main_grid table td.holidays:hover, #month_grid table td.holidays:hover, #month_grid table td.calendar_today.holidays {
+	background: rgba(23, 110, 245, 0.2);
+}
+#main_grid table td.birthdays:hover, #month_grid table td.birthdays:hover, #month_grid table td.calendar_today.birthdays {
+	background: rgba(153, 51, 255, 0.2);
+}
+#main_grid table td.days, #month_grid table td.days {
 	vertical-align: top;
-	text-align: center;
+	text-align: left;
+	border-right: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
 }
-#main_grid h3.weekly {
+#main_grid table td.days {
+	padding: 10px;
+}
+#month_grid table td.days {
+	padding: 5px;
+	width: 14.28%;
 	text-align: center;
-	font-size: 1.4em;
 }
-#main_grid ul.weeklist, #main_grid ul.weeklist li {
-	margin: 0 0 8px 0;
-	padding: 0;
-	float: left;
-	width: 100%;
-	overflow: hidden;
+#main_grid table tbody tr:nth-child(2) td.days, #month_grid table tbody tr:nth-child(2) {
+	border-top: 1px solid #ccc;
 }
-#main_grid ul.weeklist li {
-	margin: 0 1px 0 1px;
-	border-top: 2px solid #fff;
+#main_grid table tbody tr.days_wrapper > td:nth-child(2), #month_grid table tr.days_wrapper > td:nth-child(2) {
+	border-left: 1px solid #ccc;
+}
+#main_grid table tr.days_wrapper:nth-child(2) > td.weeks {
+	border-top: 1px solid #ccc;
 }
-#main_grid .weeklist h4 {
+#main_grid table:last-child td.weeks {
+	border-bottom: 1px solid #ccc;
+}
+#main_grid td#post_event {
+	background: #e7eaef;
 	text-align: center;
+	padding-top: 12px;
+	margin-right: 0;
+}
+#main_grid img.calendar_icon {
 	float: left;
-	width: 10em;
-	font-size: 1.2em;
-	padding: 15px 0;
+	width: 16px;
+	margin: 2px 2px;
 }
-#main_grid .weeklist h4 a:hover {
-	text-decoration: none;
-	border-bottom: 1px solid #346;
+#main_grid .act_day {
+	font-size: 12pt;
 }
-/* Use the old one true layout trick here. */
-#main_grid .weeklist .windowbg2 {
-	margin: 0 0 -95px 12em;
-	padding: 8px 8px 100px 8px;
-	border-radius: 0;
-	border-left: 2px solid #fff;
+#main_grid .active_post_event > a {
+	color: #999;
 }
-#main_grid .weeklist .calendar_today {
-	margin: 0 0 -95px 12em;
-	padding: 8px 8px 100px 8px;
-	border-left: none;
-	background: #fff;
+div.week_month_title {
+	font-weight: bold;
+	font-size: xx-large;
+	margin: 10px 0 12px 2px;
 }
-a.modify_event {
-	color: red;
+div.week_month_title a {
+	color: #555;
+}
+td.week_post {
+	vertical-align: middle !important;
+}
+div.week_add_event {
+	text-align: center;
+}
+div.week_add_event > a {
+	font-size: x-large;
+	color: #999;
+}
+div.week_add_event > a:hover {
+	color: #555;
 }
 span.hidelink {
 	font-style: italic;
 }
-/* Add a background that fits with the calendar. */
-#calendar_navigation {
-	margin: -6px 1px 0 1px;
-	padding: 12px 0;
-	text-align: center;
-	float: left;
-	width: 100%;
-	background: #e7eaef;
+#view_button {
+	margin-top: -2px;
 }
 /* Cheat and match this to the submit button. */
 #main_grid .buttonlist {
-	position: absolute;
-	bottom: 12px;
-	right: 12px;
+	margin: -4px 12px 0 0;
 }
-#main_grid .buttonlist a {
-	background: #cde7ff url(../images/theme/submit_bg.png) no-repeat;
-	border: 1px solid #aaa;
-	border-radius: 3px;
+#month_grid .compact {
+	padding: 2px;
 }
-#main_grid .buttonlist a:hover {
-	background: #dceeff url(../images/theme/submit_bg.png) no-repeat 0 -140px;
-	color: #222;
+#month_grid .comfortable {
+	padding: 5px;
+}
+#main_grid .compact, .calendar_week .compact {
+	height: 45px;
+}
+#main_grid .comfortable, .calendar_week .comfortable {
+	height: 100px;
+	padding: 10px;
 }
 
 /* Styles for the memberlist section.
@@ -3978,7 +4047,7 @@ span.hidelink {
 /* This lot will be simplified once I get all the styling hooks in place. */
 .generic_list_wrapper, .action_profile  #permissions, #postmodify .roundframe, .add_buddy, #creator .windowbg2,
 #notify_options .windowbg2, #info_center, #profileview, #messageindex, #mlist,
-#main_grid table, .core_posts, #recent .core_posts, #recent .topic_table, #searchform .roundframe {
+.core_posts, #recent .core_posts, #recent .topic_table, #searchform .roundframe {
 	background: #f0f4f7;
 	margin: 12px 0 0 0;
 	padding: 8px 8px 16px 8px;
@@ -4249,4 +4318,8 @@ div#manage_boards dl dd textarea[name=desc] {
 }
 .action_who select {
 	margin-top: -1px !important;
+}
+
+.full_width {
+	width: 100%;
 }

+ 8 - 2
Themes/default/css/rtl.css

@@ -784,16 +784,22 @@ tr.windowbg2 th.stats_month, tr.windowbg2 td.stats_day {
 
 /* Styles for the calendar section.
 ------------------------------------------------- */
+#main_grid .cat_bar {
+	margin: 0 0 0 2px;
+}
 #month_grid {
 	float: right;
+	margin: 0 0 0 1%;
 }
-
 #main_grid table.weeklist td.windowbg {
 
 	border-left: 2px solid #fff;
 	border-bottom: 2px solid #fff;
 }
-
+#main_grid img.calendar_icon {
+	float: right;
+	margin: 0 0 0 4px;
+}
 #main_grid table.weeklist td.weekdays {
 	text-align: left;
 	vertical-align: middle;

+ 10 - 0
Themes/default/languages/Help.english.php

@@ -214,6 +214,16 @@ $helptxt['smileys'] = '<strong>Smiley Center</strong><br />
 $helptxt['calendar'] = '<strong>Manage Calendar</strong><br />
 	Here you can modify the current calendar settings as well as add and remove holidays that appear on the calendar.';
 $helptxt['cal_export'] = 'Exports a text file in the iCal format for importing in to other calendar applications';
+$helptxt['cal_highlight_events'] = 'This setting allows you to highlight events on the Mini Calendars, Main Calendar, both places, or disable event highlighting.';
+$helptxt['cal_highlight_holidays'] = 'This setting allows you to highlight holidays on the Mini Calendars, Main Calendar, both places, or disable event highlighting.';
+$helptxt['cal_highlight_birthdays'] = 'This setting allows you to highlight birthdays on the Mini Calendars, Main Calendar, both places, or disable event highlighting.';
+$helptxt['cal_disable_prev_next'] = 'If this setting is checked, the three month blocks on the left hand side of the page will be disabled.';
+$helptxt['cal_display_type'] = 'This setting allows you to change the display type of the calendar.<br /><br /><strong>Comfortable:</strong> makes the rows of the calendar big.<br /><strong>Compact:</strong> makes the rows of the calendar small.';
+$helptxt['cal_week_links'] = 'If this setting is checked, links will be added alongside each week in the calendar.';
+$helptxt['cal_prev_next_links'] = 'If this setting is checked, previous month and next month links will be added to the top of each month for easy navigation.';
+$helptxt['cal_short_months'] = 'If this setting is checked, month names within the calendar will be shortened.<br /><br /><strong>Enabled:</strong> ' . $txt['months_short'][1] . ' 1<br /><strong>Disabled:</strong> ' . $txt['months_titles'][1] . ' 1';
+$helptxt['cal_short_days'] = 'If this setting is checked, day names within the calendar will be shortened.<br /><br /><strong>Enabled:</strong> ' . $txt['days_short'][1] . '<br /><strong>Disbaled:</strong> ' . $txt['days'][1];
+$helptxt['cal_week_numbers'] = 'If this setting is checked, the first day of every week will have the week number next to that day.<br /><br /><strong>Enabled:</strong> March 3 - Week 10</strong><br /><strong>Disabled:</strong> March 3';
 
 $helptxt['serversettings'] = '<strong>Server Settings</strong><br />
 	Here you can perform the core configuration for your forum. This section includes the database and url settings, as well as other

+ 27 - 0
Themes/default/languages/ManageCalendar.english.php

@@ -29,6 +29,33 @@ $txt['setting_cal_allowspan'] = 'Allow events to span multiple days';
 $txt['setting_cal_maxspan'] = 'Max number of days an event can span';
 $txt['setting_cal_showInTopic'] = 'Show linked events in topic display';
 
+$txt['setting_cal_display_type'] = 'Cell Display Type';
+$txt['setting_cal_display_comfortable'] = 'Comfortable';
+$txt['setting_cal_display_compact'] = 'Compact';
+
+$txt['setting_cal_disable_prev_next'] = 'Disable Three Month Blocks';
+
+$txt['setting_cal_highlight_events'] = 'Highlight Events';
+$txt['setting_cal_highlight_holidays'] = 'Highlight Holidays';
+$txt['setting_cal_highlight_birthdays'] = 'Highlight Birthdays';
+
+$txt['setting_cal_highlight_none'] = 'Nowhere';
+$txt['setting_cal_highlight_mini'] = 'Mini Calendars Only';
+$txt['setting_cal_highlight_main'] = 'Main Calendar Only';
+$txt['setting_cal_highlight_both'] = 'Mini &amp; Main Calendars';
+
+$txt['setting_cal_week_links'] = 'Show Week Links';
+$txt['setting_cal_week_links_none'] = 'Nowhere';
+$txt['setting_cal_week_links_mini'] = 'Mini Calendars Only';
+$txt['setting_cal_week_links_main'] = 'Main Calendar Only';
+$txt['setting_cal_week_links_both'] = 'Mini &amp; Main Calendars';
+$txt['setting_cal_prev_next_links'] = 'Show <em>Previous / Next</em> Month Links';
+
+// The name of this setting is kind of misleading...we can't shorten actual months unfortunately!
+$txt['setting_cal_short_months'] = 'Short Month Titles';
+$txt['setting_cal_short_days'] = 'Short Day Titles';
+$txt['setting_cal_week_numbers'] = 'Show Week Numbers';
+
 // Adding/Editing/Viewing Holidays
 $txt['manage_holidays_desc'] = 'From here you can add and remove holidays from your forum calendar.';
 $txt['current_holidays'] = 'Current Holidays';

+ 10 - 2
Themes/default/languages/index.english.php

@@ -8,7 +8,7 @@ global $forum_copyright, $forum_version, $webmaster_email, $scripturl, $context,
 //   - http://www.php.net/function.pspell-new
 //   - http://www.php.net/function.setlocale
 // Again, SPELLING SHOULD BE '' 99% OF THE TIME!!  Please read this!
-$txt['lang_locale'] = 'en_US';
+$txt['lang_locale'] = '';
 $txt['lang_dictionary'] = 'en';
 $txt['lang_spelling'] = 'american';
 
@@ -21,13 +21,19 @@ $txt['lang_capitalize_dates'] = true;
 // Number format.
 $txt['number_format'] = '1,234.00';
 
+$txt['days_title'] = 'Days';
 $txt['days'] = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
 $txt['days_short'] = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat');
 // Months must start with 1 => 'January'. (or translated, of course.)
+$txt['months_title'] = 'Months';
 $txt['months'] = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
 $txt['months_titles'] = array(1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
 $txt['months_short'] = array(1 => 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');
 
+$txt['minutes_label'] = 'Minutes';
+$txt['hours_label'] = 'Hours';
+$txt['years_title'] = 'Years';
+
 $txt['time_am'] = 'am';
 $txt['time_pm'] = 'pm';
 
@@ -517,6 +523,8 @@ $txt['calendar_event_title'] = 'Event Title';
 $txt['calendar_event_options'] = 'Event Options';
 $txt['calendar_post_in'] = 'Post In:';
 $txt['calendar_edit'] = 'Edit Event';
+$txt['calendar_export'] = 'Export Event';
+$txt['calendar_view_week'] = 'View Week';
 $txt['event_delete_confirm'] = 'Delete this event?';
 $txt['event_delete'] = 'Delete Event';
 $txt['calendar_post_event'] = 'Post Event';
@@ -831,4 +839,4 @@ $txt['debug_tokens'] = 'Tokens: ';
 $txt['debug_browser'] = 'Browser ID: ';
 $txt['debug_hooks'] = 'Hooks called: ';
 
-?>
+?>

+ 10 - 1
other/install_2-1_mysql.sql

@@ -1715,8 +1715,17 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('cal_showholidays', '1'),
 	('cal_showbdays', '1'),
 	('cal_showevents', '1'),
-	('cal_showweeknum', '0'),
 	('cal_maxspan', '7'),
+	('cal_highlight_events', '3'),
+	('cal_highlight_holidays', '3'),
+	('cal_highlight_birthdays', '3'),
+	('cal_disable_prev_next', '0'),
+	('cal_display_type', '0'),
+	('cal_week_links', '2'),
+	('cal_prev_next_links', '1'),
+	('cal_short_days', '0'),
+	('cal_short_months', '0'),
+	('cal_week_numbers', '0'),
 	('smtp_host', ''),
 	('smtp_port', '25'),
 	('smtp_username', ''),

+ 10 - 1
other/install_2-1_postgresql.sql

@@ -2204,8 +2204,17 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_defaultboard', '
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showholidays', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showbdays', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showevents', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showweeknum', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_maxspan', '7');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_highlight_events', '3');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_highlight_holidays', '3');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_highlight_birthdays', '3');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_disable_prev_next', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_display_type', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_week_links', '2');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_prev_next_links', '1');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_short_days', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_short_months', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_week_numbers', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('smtp_host', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('smtp_port', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('smtp_username', '');

+ 10 - 1
other/install_2-1_sqlite.sql

@@ -1857,8 +1857,17 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_defaultboard', '
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showholidays', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showbdays', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showevents', '1');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_showweeknum', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_maxspan', '7');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_highlight_events', '3');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_highlight_holidays', '3');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_highlight_birthdays', '3');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_disable_prev_next', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_display_type', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_week_links', '2');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_prev_next_links', '1');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_short_days', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_short_months', '0');
+INSERT INTO {$db_prefix}settings (variable, value) VALUES ('cal_week_numbers', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('smtp_host', '');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('smtp_port', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('smtp_username', '');

+ 10 - 1
other/upgrade_1-0.sql

@@ -1847,8 +1847,17 @@ VALUES
 	('cal_showeventsonindex', '0'),
 	('cal_showbdaysonindex', '0'),
 	('cal_showholidaysonindex', '0'),
-	('cal_showweeknum', '0'),
 	('cal_maxspan', '7'),
+	('cal_highlight_events', '3'),
+	('cal_highlight_holidays', '3'),
+	('cal_highlight_birthdays', '3'),
+	('cal_disable_prev_next', '0'),
+	('cal_display_type', '0'),
+	('cal_week_links', '2'),
+	('cal_prev_next_links', '1'),
+	('cal_short_days', '0'),
+	('cal_short_months', '0'),
+	('cal_week_numbers', '0'),
 	('smtp_host', ''),
 	('smtp_username', ''),
 	('smtp_password', ''),

Some files were not shown because too many files changed in this diff