Browse Source

Merge pull request #279 from emanuele45/master

just a couple of small things
emanuele45 12 years ago
parent
commit
9e4dc4c65d

+ 3 - 1
.gitignore

@@ -44,4 +44,6 @@ Icon?
 Thumbs.db
 *.lnk
 /nbproject/private/
-/nbproject/
+/nbproject/
+.directory
+

+ 1 - 1
Sources/Load.php

@@ -2835,7 +2835,7 @@ function cache_get_data($key, $ttl = 120)
 		$cache_hits[$cache_count]['s'] = isset($value) ? strlen($value) : 0;
 	}
 
-	if (function_exists('call_integration_hook'))
+	if (function_exists('call_integration_hook') && isset($value))
 		call_integration_hook('cache_get_data', array($key, $ttl, $value));
 
 	return empty($value) ? null : @unserialize($value);

+ 3 - 8
Sources/ManageServer.php

@@ -390,14 +390,9 @@ function ModifyCacheSettings($return_config = false)
 		redirectexit('action=admin;area=serversettings;sa=cache;' . $context['session_var'] . '=' . $context['session_id']);
 	}
 
-	// if its off, allow them to clear it as well
-	// @todo why only when its off ?
-	if (empty($cache_enable))
-	{
-		loadLanguage('ManageMaintenance');
-		createToken('admin-maint');
-		$context['template_layers'][] = 'clean_cache_button';
-	}
+	loadLanguage('ManageMaintenance');
+	createToken('admin-maint');
+	$context['template_layers'][] = 'clean_cache_button';
 
 	$context['post_url'] = $scripturl . '?action=admin;area=serversettings;sa=cache;save';
 	$context['settings_title'] = $txt['caching_settings'];

+ 7 - 7
Sources/Post.php

@@ -455,7 +455,7 @@ function Post($post_errors = array())
 		}
 
 		// Only show the preview stuff if they hit Preview.
-		if (($really_previewing == true || isset($_REQUEST['xml'])) && !isset($_POST['id_draft']))
+		if (($really_previewing == true || isset($_REQUEST['xml'])) && !isset($_REQUEST['save_draft']))
 		{
 			// Set up the preview message and subject and censor them...
 			$context['preview_message'] = $form_message;
@@ -540,6 +540,12 @@ function Post($post_errors = array())
 			else
 				isAllowedTo('modify_any');
 
+			if ($context['can_announce'] && !empty($row['id_action']))
+			{
+				loadLanguage('Errors');
+				$context['post_error']['messages'][] = $txt['error_topic_already_announced'];
+			}
+
 			if (!empty($modSettings['attachmentEnable']))
 			{
 				$request = $smcFunc['db_query']('', '
@@ -568,12 +574,6 @@ function Post($post_errors = array())
 				$smcFunc['db_free_result']($request);
 			}
 
-			if ($context['can_announce'] && !empty($row['id_action']))
-			{
-				loadLanguage('Errors');
-				$context['post_error']['messages'][] = $txt['error_topic_already_announced'];
-			}
-
 			// Allow moderators to change names....
 			if (allowedTo('moderate_forum') && !empty($topic))
 			{

+ 3 - 2
Themes/default/Display.template.php

@@ -627,7 +627,6 @@ function template_main()
 							<li class="inline_mod_check" style="display: none;" id="in_topic_mod_check_', $message['id'], '"></li>';
 
 		if ($message['can_approve'] || $context['can_reply'] || $message['can_modify'] || $message['can_remove'] || $context['can_split'] || $context['can_restore_msg'])
-
 			echo '
 						</ul>';
 
@@ -735,7 +734,8 @@ function template_main()
 			echo '
 							<strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
 
-		if ($options['display_quick_reply'] < 3)
+		// Using the full editor
+		if (empty($options['use_editor_quick_reply']))
 		{
 			echo '
 							<div class="quickReplyContent">
@@ -808,6 +808,7 @@ function template_main()
 		echo '
 		<br class="clear" />';
 
+	// draft autosave available and the user has it enabled?
 	if (!empty($context['drafts_autosave']) && !empty($options['drafts_autosave_enabled']))
 		echo '
 			<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/drafts.js?alp21"></script>

+ 1 - 0
Themes/default/ManageMaintenance.template.php

@@ -567,6 +567,7 @@ function template_maintain_topics()
 					</select></p>
 					<input type="submit" value="', $txt['move_topics_now'], '" onclick="if (document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_from\').selectedIndex].disabled || document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_to\').selectedIndex].disabled) return false; var confirmText = \'', $txt['move_topics_confirm'] . '\'; return confirm(confirmText.replace(/%board_from%/, document.getElementById(\'id_board_from\').options[document.getElementById(\'id_board_from\').selectedIndex].text.replace(/^=+&gt;&nbsp;/, \'\')).replace(/%board_to%/, document.getElementById(\'id_board_to\').options[document.getElementById(\'id_board_to\').selectedIndex].text.replace(/^=+&gt;&nbsp;/, \'\')));" class="button_submit" />
 					<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
+					<input type="hidden" name="', $context['admin-maint_token_var'], '" value="', $context['admin-maint_token'], '" />
 				</form>
 			</div>
 		</div>