Browse Source

Merge pull request #1430 from live627/a

Seems good :)  we can always blame you if something gets borked later :tongue:
Jessica González 10 years ago
parent
commit
16b12fd8b7

+ 5 - 4
Sources/Calendar.php

@@ -49,13 +49,14 @@ function CalendarMain()
 	if (isset($_GET['sa']) && isset($subActions[$_GET['sa']]) && !WIRELESS)
 		return $subActions[$_GET['sa']]();
 
-	// This is gonna be needed...
-	loadTemplate('Calendar');
-
 	// You can't do anything if the calendar is off.
 	if (empty($modSettings['cal_enabled']))
 		fatal_lang_error('calendar_off', false);
 
+	// This is gonna be needed...
+	loadTemplate('Calendar');
+	loadCSSFile('calendar.css', array('force_current' => false, 'validate' => true, 'rtl' => 'calendar.rtl.css'));
+
 	// Did the specify an individual event ID? If so, let's splice the year/month in to what we would otherwise be doing.
 	if (isset($_GET['event']))
 	{
@@ -160,7 +161,7 @@ function CalendarMain()
 
 	// Basic template stuff.
 	$context['allow_calendar_event'] = allowedTo('calendar_post');
-	
+
 	// If you don't allow events not linked to posts and you're not an admin, we have more work to do...
 	if ($context['allow_calendar_event'] && empty($modSettings['cal_allow_unlinked']) && !$user_info['is_admin'])
 	{

+ 5 - 2
Sources/Load.php

@@ -2078,6 +2078,9 @@ function loadCSSFile($filename, $params = array(), $id = '')
 	// Add it to the array for use in the template
 	if (!empty($filename))
 		$context['css_files'][$id] = array('filename' => $filename, 'options' => $params);
+
+	if (!empty($context['right_to_left']) && !empty($params['rtl']))
+		loadCSSFile($params['rtl'], array_diff_key($params, array('rtl' => 0)));
 }
 
 /**
@@ -2714,7 +2717,7 @@ function loadDatabase()
 
 	$db_options = array();
 
-	// Add in the port if needed	
+	// Add in the port if needed
 	if (!empty($db_port))
 		$db_options['port'] = $db_port;
 
@@ -2722,7 +2725,7 @@ function loadDatabase()
 	if (SMF == 'SSI' && !empty($ssi_db_user) && !empty($ssi_db_passwd))
 	{
 		$options = array_merge($db_options, array('persist' => $db_persist, 'non_fatal' => true, 'dont_select_db' => true));
-		
+
 		$db_connection = smf_db_initiate($db_server, $db_name, $ssi_db_user, $ssi_db_passwd, $db_prefix, $options);
 	}
 

+ 1 - 1
Sources/Themes.php

@@ -1388,7 +1388,7 @@ function InstallCopy()
 	mkdir($context['to_install']['theme_dir'] . '/scripts', 0777);
 
 	// Copy over the default non-theme files.
-	$to_copy = array('/index.php', '/index.template.php', '/css/index.css', '/css/rtl.css', '/css/admin.css', '/scripts/theme.js');
+	$to_copy = array('/index.php', '/index.template.php', '/css/index.css', '/css/rtl.css', '/css/calendar.css', '/css/calendar.rtl.css', '/css/admin.css', '/scripts/theme.js');
 
 	foreach ($to_copy as $file)
 	{

+ 199 - 0
Themes/default/css/calendar.css

@@ -0,0 +1,199 @@
+/* Styles for the calendar section.
+------------------------------------------------- */
+#calendar {
+	overflow: hidden;
+}
+/* Used to indicate the current day in the grid. */
+#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;
+}
+#month_grid {
+	width: 284px;
+	float: left;
+	text-align: center;
+	overflow: hidden;
+	margin-right: 1%;
+}
+#month_grid h3 a {
+	padding: 0 6px 0 6px;
+}
+#month_grid table {
+	width: 100%;
+	margin-bottom: 12px;
+	border-collapse: collapse;
+	background: #f0f4f7;
+	border: 1px solid #ccc;
+}
+#main_grid {
+	overflow: auto;
+}
+#main_grid table {
+	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 0 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 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 {
+	display: block;
+	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: 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: left;
+	border-right: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
+}
+#main_grid table td.days {
+	padding: 10px;
+}
+#month_grid table td.days {
+	padding: 5px;
+	width: 14.28%;
+	text-align: center;
+}
+#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 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 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;
+}
+#view_button {
+	margin-top: -2px;
+}
+/* Cheat and match this to the submit button. */
+#main_grid .buttonlist {
+	margin: -4px 12px 0 0;
+}
+#month_grid .compact {
+	padding: 2px;
+}
+#month_grid .comfortable {
+	padding: 5px;
+}
+#main_grid .compact, .calendar_week .compact {
+	height: 45px;
+}
+#main_grid .comfortable, .calendar_week .comfortable {
+	height: 100px;
+	padding: 10px;
+}

+ 24 - 0
Themes/default/css/calendar.rtl.css

@@ -0,0 +1,24 @@
+/* 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;
+	border-right: 2px solid #fff;
+	border-bottom: 2px solid #fff;
+}

+ 0 - 200
Themes/default/css/index.css

@@ -3603,206 +3603,6 @@ dl.addrules dt.floatleft {
 	margin-right:10px;
 }
 
-/* Styles for the calendar section.
-------------------------------------------------- */
-#calendar {
-	overflow: hidden;
-}
-/* Used to indicate the current day in the grid. */
-#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;
-}
-#month_grid {
-	width: 284px;
-	float: left;
-	text-align: center;
-	overflow: hidden;
-	margin-right: 1%;
-}
-#month_grid h3 a {
-	padding: 0 6px 0 6px;
-}
-#month_grid table {
-	width: 100%;
-	margin-bottom: 12px;
-	border-collapse: collapse;
-	background: #f0f4f7;
-	border: 1px solid #ccc;
-}
-#main_grid {
-	overflow: auto;
-}
-#main_grid table {
-	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 0 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 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 {
-	display: block;
-	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: 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: left;
-	border-right: 1px solid #ccc;
-	border-bottom: 1px solid #ccc;
-}
-#main_grid table td.days {
-	padding: 10px;
-}
-#month_grid table td.days {
-	padding: 5px;
-	width: 14.28%;
-	text-align: center;
-}
-#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 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 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;
-}
-#view_button {
-	margin-top: -2px;
-}
-/* Cheat and match this to the submit button. */
-#main_grid .buttonlist {
-	margin: -4px 12px 0 0;
-}
-#month_grid .compact {
-	padding: 2px;
-}
-#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.
 ------------------------------------------------- */
 #mlist_search {

+ 0 - 25
Themes/default/css/rtl.css

@@ -749,31 +749,6 @@ tr.windowbg2 th.stats_month, tr.windowbg2 td.stats_day {
 	text-align: right;
 }
 
-/* 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;
-	border-right: 2px solid #fff;
-	border-bottom: 2px solid #fff;
-}
-
 /* Styles for the advanced search section.
 ------------------------------------------------- */
 #searchform fieldset {