Browse Source

Calendar Overhaul - Part II

Not sure that I can fully describe everything that I did, so I'm not
even going to try, just look at the code or the final product.

- Can declare JavaScript variables for later assignment by leaving the
value empty with the function addInlineJavaScript.

Signed-Off: Matthew "Labradoodle-360" Kerle <[email protected]>
Matthew Kerle 12 years ago
parent
commit
e9b9bd9ac8

+ 28 - 14
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',
@@ -96,12 +102,12 @@ function CalendarMain()
 			'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' => !empty($modSettings['cal_week_numbers']),
+		'show_week_num' => true,
+		'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,
-		'size' => empty($modSettings['cal_display_type']) ? 'large' : 'small',
 	);
 
 	// Load up the main view.
@@ -111,7 +117,6 @@ 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;
 	$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)
@@ -127,6 +132,7 @@ function CalendarMain()
 	$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']);
@@ -340,7 +346,7 @@ function CalendarPost()
  */
 function iCalDownload()
 {
-	global $smcFunc, $sourcedir, $forum_version, $context, $modSettings, $webmaster_email, $mbname;
+	global $smcFunc, $sourcedir, $forum_version, $modSettings, $webmaster_email, $mbname;
 
 	// You can't export if the calendar export feature is off.
 	if (empty($modSettings['cal_export']))
@@ -387,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";
@@ -439,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']);
@@ -451,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,
@@ -520,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;
 }
 
 /**

+ 4 - 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('');
@@ -379,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...

+ 9 - 13
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);
@@ -339,11 +339,10 @@ function getCalendarGrid($month, $year, $calendarOptions, $is_previous = false)
 			'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.
@@ -463,7 +462,7 @@ function getCalendarGrid($month, $year, $calendarOptions, $is_previous = false)
 	if ($is_previous === true)
 		$calendarGrid['last_of_month'] = $month_info['last_day']['day_of_month'];
 
-	// A comment is like...a dog marking its territory. ;)
+	// We'll use the shift in the template.
 	$calendarGrid['shift'] = $nShift;
 
 	// Set the previous and the next month's links.
@@ -485,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.
@@ -516,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.
@@ -611,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);
 
@@ -636,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']));
 
@@ -754,7 +750,7 @@ function cache_getRecentEvents($eventOptions)
  */
 function validateEventPost()
 {
-	global $modSettings, $txt, $sourcedir, $smcFunc;
+	global $modSettings, $smcFunc;
 
 	if (!isset($_POST['deleteevent']))
 	{
@@ -848,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);
@@ -892,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>';

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


+ 74 - 33
Themes/default/css/index.css

@@ -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;
@@ -1294,7 +1300,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 */
@@ -3544,9 +3550,8 @@ dl.addrules dt.floatleft {
 #calendar {
 	overflow: hidden;
 }
-
 /* Used to indicate the current day in the grid. */
-#main_grid .calendar_today span.day_text, #month_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 {
@@ -3573,24 +3578,32 @@ dl.addrules dt.floatleft {
 	overflow: auto;
 }
 #main_grid table {
-	width: 100%;
+	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;
 }
+#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 td.weeks {
+#month_grid table td.weeks {
 	font-size: large;
+	background: #e7eaef;
 }
 #month_grid td.weeks a:hover {
 	text-decoration: underline;
@@ -3603,22 +3616,27 @@ 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: 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 Highlighting */
 #main_grid table td.disabled, #month_grid table td.disabled {
-	background: #eee;
+	background: rgba(238, 238, 238, 1.0);
 }
 #main_grid table td.events, #month_grid table td.events {
 	background: rgba(30, 245, 20, 0.1);
@@ -3656,57 +3674,76 @@ dl.addrules dt.floatleft {
 #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 table tr.days_wrapper > td:nth-child(2), #month_grid table tr.days_wrapper > td:nth-child(2) {
+#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;
 }
-
-a.modify_event {
-	color: red;
+#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: 16px;
+	margin: 2px 2px;
+}
+#main_grid .act_day {
+	font-size: 12pt;
+}
+#main_grid .active_post_event > a {
+	color: #999;
+}
+div.week_month_title {
+	font-weight: bold;
+	font-size: xx-large;
+	margin: 10px 0 12px 2px;
+}
+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 {
-	padding: 12px 0;
-	text-align: center;
-	width: 100%;
-	background: #e7eaef;
+#view_button {
+	margin-top: -2px;
 }
 /* Cheat and match this to the submit button. */
 #main_grid .buttonlist {
-	margin: 6px 12px 0 0;
+	margin: -4px 12px 0 0;
 }
-
-#footer_cont {
-	margin-right: 1px;
-	border-right: 1px solid #ccc;
-	border-bottom: 1px solid #ccc;
-	border-left: 1px solid #ccc;
-}
-
 #month_grid .compact {
 	padding: 2px;
 }
 #month_grid .comfortable {
 	padding: 5px;
 }
-#main_grid .compact {
+#main_grid .compact, .calendar_week .compact {
 	height: 45px;
 }
-#main_grid .comfortable {
+#main_grid .comfortable, .calendar_week .comfortable {
 	height: 100px;
 	padding: 10px;
 }
-#calendar_week .compact {
-	height: 45px;
-}
-#calendar_week .comfortable {
-	padding: 10px;
-}
 
 /* Styles for the memberlist section.
 ------------------------------------------------- */
@@ -4271,4 +4308,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

@@ -754,16 +754,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;

+ 3 - 1
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';
 
@@ -523,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';

+ 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