Browse Source

Merge branch 'master' of https://github.com/Spuds/playpen

Graeme Spence 12 years ago
parent
commit
740bfb696e

+ 3 - 2
Sources/Calendar.php

@@ -331,8 +331,9 @@ function iCalDownload()
 {
 	global $smcFunc, $sourcedir, $forum_version, $context, $modSettings, $webmaster_email, $mbname;
 
-	// This requires the export permission
-	isAllowedTo('calendar_export');
+	// You can't export if the calendar export feature is off.
+	if (empty($modSettings['cal_export']))
+		fatal_lang_error('calendar_export_off', false);
 	
 	// Goes without saying that this is required.
 	if (!isset($_REQUEST['eventid']))

+ 1 - 1
Sources/ManageCalendar.php

@@ -314,13 +314,13 @@ function ModifyCalendarSettings($return_config = false)
 			array('permissions', 'calendar_post'),
 			array('permissions', 'calendar_edit_own'),
 			array('permissions', 'calendar_edit_any'),
-			array('permissions', 'calendar_export'),
 		'',
 			// How many days to show on board index, and where to display events etc?
 			array('int', 'cal_days_for_index', 6, 'postinput' => $txt['days_word']),
 			array('select', 'cal_showholidays', array(0 => $txt['setting_cal_show_never'], 1 => $txt['setting_cal_show_cal'], 3 => $txt['setting_cal_show_index'], 2 => $txt['setting_cal_show_all'])),
 			array('select', 'cal_showbdays', array(0 => $txt['setting_cal_show_never'], 1 => $txt['setting_cal_show_cal'], 3 => $txt['setting_cal_show_index'], 2 => $txt['setting_cal_show_all'])),
 			array('select', 'cal_showevents', array(0 => $txt['setting_cal_show_never'], 1 => $txt['setting_cal_show_cal'], 3 => $txt['setting_cal_show_index'], 2 => $txt['setting_cal_show_all'])),
+			array('check', 'cal_export'),
 		'',
 			// Linking events etc...
 			array('select', 'cal_defaultboard', $boards),

+ 0 - 2
Sources/ManagePermissions.php

@@ -1463,7 +1463,6 @@ function loadAllPermissions($loadType = 'classic')
 			'pm_read' => array(false, 'pm', 'use_pm_system'),
 			'pm_send' => array(false, 'pm', 'use_pm_system'),
 			'calendar_view' => array(false, 'calendar', 'view_basic_info'),
-			'calendar_export' => array(false, 'calendar', 'view_basic_info'),
 			'calendar_post' => array(false, 'calendar', 'post_calendar'),
 			'calendar_edit' => array(true, 'calendar', 'post_calendar', 'moderate_general'),
 			'admin_forum' => array(false, 'maintenance', 'administrate'),
@@ -1544,7 +1543,6 @@ function loadAllPermissions($loadType = 'classic')
 		$hiddenPermissions[] = 'calendar_view';
 		$hiddenPermissions[] = 'calendar_post';
 		$hiddenPermissions[] = 'calendar_edit';
-		$hiddenPermissions[] = 'calendar_export';
 	}
 	if (!in_array('w', $context['admin_features']))
 		$hiddenPermissions[] = 'issue_warning';

+ 2 - 2
Sources/Subs-Calendar.php

@@ -177,7 +177,7 @@ function getEventRange($low_date, $high_date, $use_permissions = true)
 					'link' => $row['id_board'] == 0 ? $row['title'] : '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['title'] . '</a>',
 					'can_edit' => allowedTo('calendar_edit_any') || ($row['id_member'] == $user_info['id'] && allowedTo('calendar_edit_own')),
 					'modify_href' => $scripturl . '?action=' . ($row['id_board'] == 0 ? 'calendar;sa=post;' : 'post;msg=' . $row['id_first_msg'] . ';topic=' . $row['id_topic'] . '.0;calendar;') . 'eventid=' . $row['id_event'] . ';' . $context['session_var'] . '=' . $context['session_id'],
-					'can_export' => allowedTo('calendar_export'),
+					'can_export' => !empty($modSettings['cal_export']) ? true : false,
 					'export_href' => $scripturl . '?action=calendar;sa=ical;eventid=' . $row['id_event'] . ';' . $context['session_var'] . '=' . $context['session_id'],
 				);
 			// Otherwise, this is going to be cached and the VIEWER'S permissions should apply... just put together some info.
@@ -192,7 +192,7 @@ function getEventRange($low_date, $high_date, $use_permissions = true)
 					'href' => $row['id_topic'] == 0 ? '' : $scripturl . '?topic=' . $row['id_topic'] . '.0',
 					'link' => $row['id_topic'] == 0 ? $row['title'] : '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['title'] . '</a>',
 					'can_edit' => false,
-					'can_export' => false,
+					'can_export' => !empty($modSettings['cal_export']) ? true : false,
 					'topic' => $row['id_topic'],
 					'msg' => $row['id_first_msg'],
 					'poster' => $row['id_member'],

+ 27 - 17
Sources/Who.php

@@ -684,22 +684,21 @@ function Credits($in_admin = false)
 			),
 		),
 	);
-
-	$context['copyrights'] = array(
-		'smf' => sprintf($forum_copyright, $forum_version),
-		'other' => array(
+	
+	// Give credit to any graphic library's, software library's, plugins etc
+	$context['credits_software_graphics'] = array(
+		'graphics' => array(
 			'<a href="http://p.yusukekamiyamane.com/">Fugue Icons</a> | &copy; 2012 Yusuke Kamiyamane | These icons are licensed under a Creative Commons Attribution 3.0 License',
 		),
-		/* Modification Authors:  You may add a copyright statement to this array for your mods.
-			Copyright statements should be in the form of a value only without a array key.  I.E.:
-				'Some Mod by Thantos &copy; 2010',
-				$txt['some_mod_copyright'],
-		*/
-		'mods' => array(
+		'software' => array(
+			'<a href="http://jquery.org/">JQuery</a> | &copy; John Resig | Licensed under <a href="http://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt">The MIT License (MIT)</a>',
+			'<a href="http://cherne.net/brian/resources/jquery.hoverIntent.html">hoverIntent</a> | &copy; Brian Cherne | Licensed under <a href="http://en.wikipedia.org/wiki/MIT_License">The MIT License (MIT)</a>',
+			'<a href="http://users.tpg.com.au/j_birch/plugins/superfish/">Superfish</a> | &copy; Joel Birch | Licensed under <a href="http://en.wikipedia.org/wiki/MIT_License">The MIT License (MIT)</a>',
 		),
 	);
-
+	
 	// support for mods that use the <credits> tag via the package manager
+	$context['credits_modifications'] = array();
 	if (($mods = cache_get_data('mods_credits', 86400)) === null)
 	{
 		$mods = array();
@@ -715,6 +714,7 @@ function Credits($in_admin = false)
 				'empty' => '',
 			)
 		);
+		
 		while ($row = $smcFunc['db_fetch_assoc']($request))
 		{
 			$credit_info = unserialize($row['credits']);
@@ -730,9 +730,22 @@ function Credits($in_admin = false)
 		}
 		cache_put_data('mods_credits', $mods, 86400);
 	}
-
-	$context['copyrights']['mods'] += $mods;
-
+	$context['credits_modifications'] = $mods;
+	
+	$context['copyrights'] = array(
+		'smf' => sprintf($forum_copyright, $forum_version),
+		/* Modification Authors:  You may add a copyright statement to this array for your mods.
+			Copyright statements should be in the form of a value only without a array key.  I.E.:
+				'Some Mod by Thantos &copy; 2010',
+				$txt['some_mod_copyright'],
+		*/
+		'mods' => array(
+		),
+	);
+	
+	// Support for those that want to use a hook as well
+	call_integration_hook('integrate_credits');
+	
 	if (!$in_admin)
 	{
 		loadTemplate('Who');
@@ -740,9 +753,6 @@ function Credits($in_admin = false)
 		$context['robot_no_index'] = true;
 		$context['page_title'] = $txt['credits'];
 	}
-
-	// Support for those that want to use a hook as well
-	call_integration_hook('integrate_credits');
 }
 
 ?>

+ 55 - 9
Themes/default/Who.template.php

@@ -193,7 +193,62 @@ function template_credits()
 			<span class="botslice"><span></span></span>
 		</div>';
 	}
+	
+	// Other software and graphics
+	if (!empty($context['credits_software_graphics']))
+	{
+		echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['credits_software_graphics'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">';
+		
+		if (!empty($context['credits_software_graphics']['graphics']))
+			echo '
+				<dl>
+					<dt><strong>', $txt['credits_graphics'], '</strong></dt>
+					<dd>', implode('</dd><dd>', $context['credits_software_graphics']['graphics']), '</dd>
+				</dl>';
+		
+		if (!empty($context['credits_software_graphics']['software']))
+			echo '
+				<dl>
+					<dt><strong>', $txt['credits_software'], '</strong></dt>
+					<dd>', implode('</dd><dd>', $context['credits_software_graphics']['software']), '</dd>
+				</dl>';
+	
+		echo '
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>';
+	}
+	
+	// How about Modifications, we all love em
+	if (!empty($context['credits_modifications']))
+	{
+		echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', $txt['credits_modifications'], '</h3>
+		</div>
+		<div class="windowbg">
+			<span class="topslice"><span></span></span>
+			<div class="content">';
+				
+		echo '
+				<dl>
+					<dt><strong>', $txt['credits_modifications'], '</strong></dt>
+					<dd>', implode('</dd><dd>', $context['credits_modifications']), '</dd>
+				</dl>';
+		
+		echo '
+			</div>
+			<span class="botslice"><span></span></span>
+		</div>';
+	}
 
+	// SMF itself
 	echo '
 		<div class="cat_bar">
 			<h3 class="catbg">', $txt['credits_copyright'], '</h3>
@@ -209,15 +264,6 @@ function template_credits()
 					</dd>
 				</dl>';
 				
-	if (!empty($context['copyrights']['other']))
-	{
-		echo '
-				<dl>
-					<dt><strong>', $txt['credits_other'], '</strong></dt>
-					<dd>', implode('</dd><dd>', $context['copyrights']['other']), '</dd>
-				</dl>';
-	}
-
 	if (!empty($context['copyrights']['mods']))
 	{
 		echo '

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

@@ -168,7 +168,7 @@ function template_stats()
 	echo '<', '?xml version="1.0" encoding="', $context['character_set'], '"?', '>
 <smf>';
 	foreach ($context['yearly'] as $year)
-		foreach ($year['months'] as $month);
+		foreach ($year['months'] as $month)
 		{
 			echo '
 	<month id="', $month['date']['year'], $month['date']['month'], '">';

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

@@ -3700,6 +3700,8 @@ span.hidelink
 	}
 }
 
+/* Styles for the tooltips
+------------------------------------------------------- */
 .tooltip
 {
     position: absolute;

+ 1 - 1
Themes/default/languages/Errors.english.php

@@ -64,7 +64,6 @@ $txt['cannot_post_unapproved_replies_own'] = 'You do not have permission to post
 $txt['cannot_post_unapproved_replies_any'] = 'You do not have permission to post unapproved replies to other users\' topics.';
 $txt['cannot_calendar_edit_any'] = 'You cannot edit calendar events.';
 $txt['cannot_calendar_edit_own'] = 'You don\'t have the privileges necessary to edit your own events.';
-$txt['cannot_calendar_export'] = 'Sorry, You cannot export calendar events.';
 $txt['cannot_calendar_post'] = 'Event posting isn\'t allowed - sorry.';
 $txt['cannot_calendar_view'] = 'Sorry, but you are not allowed to view the calendar.';
 $txt['cannot_remove_any'] = 'Sorry, but you don\'t have the privilege to remove just any topic.  Check to make sure this topic wasn\'t just moved to another board.';
@@ -149,6 +148,7 @@ $txt['parent_not_found'] = 'Board structure corrupt: unable to find parent board
 $txt['modify_post_time_passed'] = 'You may not modify this post as the time limit for edits has passed.';
 
 $txt['calendar_off'] = 'You cannot access the calendar right now because it is disabled.';
+$txt['calendar_export_off'] = 'You cannot export calendar events because that feature is currently disabled.';
 $txt['invalid_month'] = 'Invalid month value.';
 $txt['invalid_year'] = 'Invalid year value.';
 $txt['invalid_day'] = 'Invalid day value.';

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

@@ -218,6 +218,7 @@ $helptxt['smileys'] = '<strong>Smiley Center</strong><br />
 	You are also able to edit message icons from here, if you have them enabled on the settings page.';
 $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['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

+ 2 - 2
Themes/default/languages/ManageBoards.english.php

@@ -88,8 +88,8 @@ $txt['recycle_board'] = 'Board for recycled topics';
 $txt['recycle_board_unselected_notice'] = 'You have enabled the recycling of topics without specifying a board to place them in.  This feature will not be enabled until you specify a board to place recycled topics into.';
 $txt['countChildPosts'] = 'Count child\'s posts in parent\'s totals';
 $txt['allow_ignore_boards'] = 'Allow boards to be ignored';
-$txt['deny_boards_access'] = 'Enable the option to deny boards access to a group';
-$txt['boardsaccess_option_desc'] = 'For each permission you can pick either \'Allow\' (A), \'Ignore\' (X), or <span class="alert">\'Deny\' (D)</span>.<br /><br />Remember that if you deny access, any member - whether moderator or otherwise - that is in that group will be denied that as well.<br />For this reason, you should use deny carefully, only when <strong>necessary</strong>. Ignore, on the other hand, denies unless otherwise granted.';
+$txt['deny_boards_access'] = 'Enable the option to deny board access based on membergroup';
+$txt['boardsaccess_option_desc'] = 'For each permission you can choose \'Allow\' (A), \'Ignore\' (X), or <span class="alert">\'Deny\' (D)</span>.<br /><br />If you deny access, any member - (including moderators) - in that group will be denied access.<br />For this reason, you should set deny carefully, only when <strong>necessary</strong>. Ignore, on the other hand, denies unless otherwise granted.';
 
 $txt['mboards_select_destination'] = 'Select destination for board \'<strong>%1$s</strong>\'';
 $txt['mboards_cancel_moving'] = 'Cancel moving';

+ 1 - 1
Themes/default/languages/ManageCalendar.english.php

@@ -7,7 +7,6 @@ $txt['calendar_desc'] = 'From here you can modify all aspects of the calendar.';
 $txt['calendar_settings_desc'] = 'Here you can enable the calendar, and determine the settings that it should use.';
 $txt['save_settings'] = 'Save Settings';
 $txt['groups_calendar_view'] = 'Membergroups allowed to view the calendar';
-$txt['groups_calendar_export'] = 'Membergroups allowed to export calendar events';
 $txt['groups_calendar_post'] = 'Membergroups allowed to create events';
 $txt['groups_calendar_edit_own'] = 'Membergroups allowed to edit their own events';
 $txt['groups_calendar_edit_any'] = 'Membergroups allowed to edit any events';
@@ -17,6 +16,7 @@ $txt['setting_cal_days_for_index'] = 'Max days in advance on board index';
 $txt['setting_cal_showholidays'] = 'Show holidays';
 $txt['setting_cal_showbdays'] = 'Show birthdays';
 $txt['setting_cal_showevents'] = 'Show events';
+$txt['setting_cal_export'] = 'Allow events to be exported in Ical format';
 $txt['setting_cal_show_never'] = 'Never';
 $txt['setting_cal_show_cal'] = 'In calendar only';
 $txt['setting_cal_show_index'] = 'On board index only';

+ 0 - 2
Themes/default/languages/ManagePermissions.english.php

@@ -104,8 +104,6 @@ $txt['permissionname_calendar_edit'] = 'Edit events in the calendar';
 $txt['permissionhelp_calendar_edit'] = 'An Event is a topic linked to a certain date or date range. The event can be edited by clicking the red asterisk (*) next to the event in the calendar view. In order to be able to edit an event, a user must have sufficient permissions to edit the first message of the topic that is linked to the event.';
 $txt['permissionname_calendar_edit_own'] = 'Own events';
 $txt['permissionname_calendar_edit_any'] = 'Any events';
-$txt['permissionname_calendar_export'] = 'Export events from the calendar';
-$txt['permissionhelp_calendar_export'] = 'Exports a text file in the iCal format for importing in to other calendar applications';
 
 $txt['permissiongroup_maintenance'] = 'Forum administration';
 $txt['permissionname_admin_forum'] = 'Administrate forum and database';

+ 3 - 1
Themes/default/languages/Who.english.php

@@ -135,7 +135,9 @@ $txt['credits_anyone'] = 'And for anyone we may have missed, thank you!';
 $txt['credits_copyright'] = 'Copyrights';
 $txt['credits_forum'] = 'Forum';
 $txt['credits_modifications'] = 'Modifications';
-$txt['credits_other'] = 'Software/Graphics';
+$txt['credits_software_graphics'] = 'Software/Graphics';
+$txt['credits_software'] = 'Software';
+$txt['credits_graphics'] = 'Graphics';
 $txt['credits_groups_ps'] = 'Project Support';
 $txt['credits_groups_dev'] = 'Developers';
 $txt['credits_groups_support'] = 'Support Specialists';