--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-10-08 11:44:32 -07:00
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");
}

View File

@@ -7,7 +7,8 @@
@Html.ValidationSummary()
<fieldset class="addCulture">
<label for="CultureName">@T("Add a culture...")</label>
@Html.DropDownList("CultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture))
@Html.DropDownList("SystemCultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture))
@T("Other"): @Html.TextBox("CultureName")
<button class="primaryAction" type="submit">@T("Add")</button>
</fieldset>
}

View File

@@ -185,7 +185,6 @@ namespace Orchard.Setup.Services {
// add default culture
var cultureManager = environment.Resolve<ICultureManager>();
cultureManager.AddCulture("en-US");
cultureManager.AddCulture("fr");
var contentManager = environment.Resolve<IContentManager>();