Selaa lähdekoodia

Set a nice confirmation message

Signed-off-by: Suki <[email protected]>
Suki 10 vuotta sitten
vanhempi
commit
5b504dca35

+ 2 - 1
Sources/Subs-Themes.php

@@ -399,7 +399,8 @@ function remove_theme($themeID)
 {
 	global $smcFunc, $modSetting;
 
-	if (empty($themeID))
+	// Can't delete the default theme, sorry!
+	if (empty($themeID) || $themeID == 1)
 		return false;
 
 	$known = explode(',', $modSettings['knownThemes']);

+ 1 - 1
Sources/Themes.php

@@ -857,7 +857,7 @@ function EnableTheme()
 	updateSettings(array('enableThemes' => $enableThemes));
 
 	// Done!
-	redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id']);
+	redirectexit('action=admin;area=theme;sa=list;' . $context['session_var'] . '=' . $context['session_id'] .';done='. (isset($_GET['disabled']) ? 'disabling' : 'enabling'));
 }
 
 /**

+ 7 - 0
Themes/default/Themes.template.php

@@ -202,6 +202,13 @@ function template_list_themes()
 	global $context, $settings, $options, $scripturl, $txt;
 	global $modSettings;
 
+	// Show a nice confirmation message.
+	if (isset($_GET['done']))
+		echo '
+	<div class="infobox">
+		', $txt['theme_confirmed_'. $_GET['done']] ,'
+	</div>';
+
 	echo '
 	<div id="admincenter">';
 

+ 3 - 0
Themes/default/languages/Themes.english.php

@@ -16,6 +16,9 @@ $txt['theme_disable'] = 'disable';
 $txt['theme_remove_confirm'] = 'Are you sure you want to permanently remove this theme?';
 $txt['theme_enable_confirm'] = 'Are you sure you want to enable this theme?';
 $txt['theme_disable_confirm'] = 'Are you sure you want to disable this theme?';
+$txt['theme_confirmed_disabling'] = 'The theme was successfully disabled.';
+$txt['theme_confirmed_enabling'] = 'The theme was successfully enabled.';
+$txt['theme_confirmed_removing'] = 'The theme was successfully removed.';
 
 $txt['theme_install'] = 'Install a New Theme';
 $txt['theme_install_file'] = 'From an archive (e.g. .zip, .tar.gz)';