Bläddra i källkod

! Custom profile field pages need to indicate they're saving too. (per #802)

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer 11 år sedan
förälder
incheckning
70006517fc
2 ändrade filer med 14 tillägg och 0 borttagningar
  1. 10 0
      Sources/ManageSettings.php
  2. 4 0
      Themes/default/Admin.template.php

+ 10 - 0
Sources/ManageSettings.php

@@ -1158,6 +1158,7 @@ function ShowCustomProfiles()
 		// What we have left!
 		$changes['registration_fields'] = empty($reg_fields) ? '' : implode(',', $reg_fields);
 
+		$_SESSION['adm-save'] = true;
 		if (!empty($changes))
 			updateSettings($changes);
 	}
@@ -1341,6 +1342,14 @@ function ShowCustomProfiles()
 		),
 	);
 	createList($listOptions);
+
+	// There are two different ways we could get to this point. To keep it simple, they both do
+	// the same basic thing.
+	if (isset($_SESSION['adm-save']))
+	{
+		$context['saved_successful'] = true;
+		unset ($_SESSION['adm-save']);
+	}
 }
 
 /**
@@ -1812,6 +1821,7 @@ function EditCustomProfiles()
 		$smcFunc['db_free_result']($request);
 
 		updateSettings(array('displayFields' => serialize($fields)));
+		$_SESSION['adm-save'] = true;
 		redirectexit('action=admin;area=featuresettings;sa=profile');
 	}
 

+ 4 - 0
Themes/default/Admin.template.php

@@ -1002,6 +1002,10 @@ function template_show_custom_profile()
 {
 	global $context, $txt, $settings, $scripturl;
 
+	if (!empty($context['saved_successful']))
+		echo '
+	<div class="infobox">', $txt['settings_saved'], '</div>';
+
 	// Standard fields.
 	template_show_list('standard_profile_fields');