Add freeform entry to Add Supported Culture. Removed 'fr' as available culture from setup (enter 'fr' in freeform to add it back).

Verified module-provided ICultureSelector can supercede the site default culture.

--HG--
branch : dev
This commit is contained in:
Dave Reed
2010-10-08 11:41:07 -07:00
parent 45933ca700
commit 49a45400ed
3 changed files with 10 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using System.Globalization;
using System;
using System.Globalization;
using System.Linq;
using System.Web.Mvc;
using Orchard.Core.Settings.Models;
@@ -74,11 +75,15 @@ namespace Orchard.Core.Settings.Controllers {
}
[HttpPost]
public ActionResult AddCulture(string cultureName) {
public ActionResult AddCulture(string systemCultureName, string cultureName) {
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
return new HttpUnauthorizedResult();
_cultureManager.AddCulture(cultureName);
cultureName = string.IsNullOrWhiteSpace(cultureName) ? systemCultureName : cultureName;
if (!string.IsNullOrWhiteSpace(cultureName)) {
_cultureManager.AddCulture(cultureName);
}
return RedirectToAction("Culture");
}