--HG--
branch : dev
This commit is contained in:
Louis DeJardin
2010-06-09 22:23:14 -07:00
17 changed files with 162 additions and 26 deletions

View File

@@ -15,3 +15,4 @@ glob:src/Orchard.Azure.suo
glob:src/Orchard.5.0.ReSharper
glob:log.xml
glob:profiling
glob:*.csproj.orig

View File

@@ -63,6 +63,18 @@ Website: http://fluentnhibernate.org/
Copyright: Copyright (c) 2008-2009 James Gregory and contributors
License: New BSD
FluentPath
-----
Website: http://fluentpath.codeplex.com/
Copyright: Copyright (c) 2010 Bertrand Le Roy
License: MS-PL
Html Agility Pack
-----
Website: http://htmlagilitypack.codeplex.com/
Copyright: Copyright (c) 2003-20010 Simon Mourier
License: MS-PL
IESI Collections
-----
Website: http://www.codeproject.com/KB/recipes/sets.aspx
@@ -93,6 +105,12 @@ Log4Net
Website: http://logging.apache.org/log4net/index.html
Copyright: Copyright (c) 2007 Apache Software Foundation
License: Apache Software Foundation License 2.0
Lucene.net
-----
Website: http://incubator.apache.org/projects/lucene.net.html
Copyright: Copyright (c) 2009 Apache Software Foundation
License: Apache Software Foundation License 2.0
Moq
-----
@@ -125,6 +143,12 @@ Website: http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx
Copyright: Copyright (c) 2000-2009 IC#Code
License: Modified GPL: http://www.icsharpcode.net/OpenSource/SharpZipLib/Default.aspx
SpecFlow
-----
Website: http://www.specflow.org/
Copyright: Copyright (c) 2009 TechTalk
License: New BSD
SQLite
-----
Website: http://www.sqlite.org
@@ -137,6 +161,12 @@ WebSite: http://tinymce.moxiecode.com/
Copyright: Copyright (c) 2003-2009 Moxiecode Systems AB
License: LGPL 2.1
WCat
-----
WebSite: http://www.iis.net/community/default.aspx?tabid=34&i=1466&g=6
Copyright: Copyright (c) 2007 Microsoft
License: "Free"
Yamlnet
-----
Website: http://code.google.com/p/yamlnet/

View File

@@ -1811,7 +1811,7 @@ msgstr "Changer le mot de passe"
#: ~/Modules/Orchard.Users/Views/Account/ChangePassword.ascx
#| msgid : "Use the form below to change your password."
msgid "Use the form below to change your password."
msgstr "Veuillez utiliser le forumulaire ci-dessous pour changer votre mot de passe."
msgstr "Veuillez utiliser le formulaire ci-dessous pour changer votre mot de passe."
#: ~/Modules/Orchard.Users/Views/Account/ChangePassword.ascx
#| msgid : "New passwords are required to be a minimum of {0} characters in length."

View File

@@ -124,7 +124,7 @@ namespace Orchard.Core.Indexing.Commands {
}
[CommandName("index delete")]
[CommandHelp("index delete /ContenItem:<content item id>\r\n\t" + "Deletes the specifed <content item id> fromthe index")]
[CommandHelp("index delete /ContenItem:<content item id>\r\n\t" + "Deletes the specifed <content item id> from the index")]
[OrchardSwitches("ContentItem")]
public string Delete() {
int contenItemId;

View File

@@ -169,6 +169,7 @@
<Compile Include="Scheduling\Services\ScheduledTaskManager.cs" />
<Compile Include="Scheduling\Services\ScheduledTaskExecutor.cs" />
<Compile Include="Scheduling\Models\Task.cs" />
<Compile Include="Settings\ViewModels\SiteCulturesViewModel.cs" />
<Compile Include="Settings\Drivers\SiteSettingsDriver.cs" />
<Compile Include="Settings\Metadata\ContentDefinitionManager.cs" />
<Compile Include="Settings\Metadata\Records\ContentFieldDefinitionRecord.cs" />
@@ -224,7 +225,11 @@
<Content Include="Routable\Views\EditorTemplates\Parts\Routable.IsRoutable.ascx" />
<Content Include="Routable\Views\Item\Display.aspx" />
<Content Include="Settings\Module.txt" />
<Content Include="Settings\Styles\admin.css" />
<Content Include="Settings\Views\Admin\Index.ascx" />
<Content Include="Settings\Views\Admin\Culture.ascx" />
<Content Include="Settings\Views\DisplayTemplates\CurrentCulture.ascx" />
<Content Include="Settings\Views\DisplayTemplates\RemovableCulture.ascx" />
<Content Include="Web.config" />
<Content Include="XmlRpc\Module.txt" />
<Content Include="XmlRpc\Views\Home\Index.aspx" />

View File

@@ -1,4 +1,6 @@
using System.Web.Mvc;
using System.Globalization;
using System.Linq;
using System.Web.Mvc;
using Orchard.Core.Settings.Models;
using Orchard.Core.Settings.ViewModels;
using Orchard.Localization;
@@ -29,7 +31,7 @@ namespace Orchard.Core.Settings.Controllers {
var model = new SettingsIndexViewModel {
Site = _siteService.GetSiteSettings().As<SiteSettings>(),
AvailableCultures = _cultureManager.ListCultures()
SiteCultures = _cultureManager.ListCultures()
};
model.ViewModel = Services.ContentManager.BuildEditorModel(model.Site);
return View(model);
@@ -51,6 +53,39 @@ namespace Orchard.Core.Settings.Controllers {
return RedirectToAction("Index");
}
public ActionResult Culture() {
//todo: class and/or method attributes for our auth?
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
return new HttpUnauthorizedResult();
var viewModel = new SiteCulturesViewModel {
CurrentCulture = CultureInfo.CurrentCulture.Name,
SiteCultures = _cultureManager.ListCultures(),
};
viewModel.AvailableSystemCultures = CultureInfo.GetCultures(CultureTypes.SpecificCultures)
.Select(ci => ci.Name)
.Where(s => !viewModel.SiteCultures.Contains(s));
return View(viewModel);
}
[HttpPost]
public ActionResult AddCulture(string cultureName) {
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
return new HttpUnauthorizedResult();
_cultureManager.AddCulture(cultureName);
return RedirectToAction("Culture");
}
[HttpPost]
public ActionResult DeleteCulture(string cultureName) {
if (!Services.Authorizer.Authorize(Permissions.ManageSettings, T("Not authorized to manage settings")))
return new HttpUnauthorizedResult();
_cultureManager.DeleteCulture(cultureName);
return RedirectToAction("Culture");
}
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
return TryUpdateModel(model, prefix, includeProperties, excludeProperties);

View File

@@ -0,0 +1,18 @@
.site-cultures {
font-size:1.2em;
overflow:auto;
}
.site-cultures li {
clear:left;
float:left;
overflow:auto;
padding:1px 6px;
margin:0 0 0 1em;
}
.site-cultures li:hover {
background:#EAEAEA;
}
.site-cultures div {
float:left;
width:6em;
}

View File

@@ -7,7 +7,7 @@ using Orchard.Core.Settings.Models;
namespace Orchard.Core.Settings.ViewModels {
public class SettingsIndexViewModel : BaseViewModel {
public SiteSettings Site { get; set; }
public IEnumerable<string> AvailableCultures { get; set; }
public IEnumerable<string> SiteCultures { get; set; }
public ContentItemViewModel ViewModel { get; set; }

View File

@@ -0,0 +1,10 @@
using System.Collections.Generic;
using Orchard.Mvc.ViewModels;
namespace Orchard.Core.Settings.ViewModels {
public class SiteCulturesViewModel : BaseViewModel {
public string CurrentCulture { get; set; }
public IEnumerable<string> SiteCultures { get; set; }
public IEnumerable<string> AvailableSystemCultures { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<SiteCulturesViewModel>" %>
<%@ Import Namespace="Orchard.Core.Settings.ViewModels" %><%
Html.RegisterStyle("admin.css"); %>
<h1><%:Html.TitleForPage(T("Manage Settings").ToString()) %></h1>
<h2><%:T("Cultures this site supports") %></h2>
<%=Html.UnorderedList(
Model.SiteCultures.OrderBy(s => s),
(s, i) => Html.DisplayFor(scvm => s, s == Model.CurrentCulture ? "CurrentCulture" : "RemovableCulture", "").ToString(),
"site-cultures", "culture", "odd")%>
<% using (Html.BeginFormAntiForgeryPost("AddCulture")) { %>
<%:Html.ValidationSummary() %>
<fieldset>
<legend><%:T("Add a culture...") %></legend>
<%:Html.DropDownList("CultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture)) %>
<button class="primaryAction" type="submit"><%:T("Add") %></button>
</fieldset>
<% } %>

View File

@@ -1,34 +1,35 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<SettingsIndexViewModel>" %>
<%@ Import Namespace="Orchard.Core.Settings.ViewModels"%>
<h1><%: Html.TitleForPage(T("Manage Settings").ToString())%></h1>
<%using (Html.BeginFormAntiForgeryPost()) { %>
<%: Html.ValidationSummary() %>
<%@ Import Namespace="Orchard.Core.Settings.ViewModels" %>
<h1><%:Html.TitleForPage(T("Manage Settings").ToString()) %></h1>
<% using (Html.BeginFormAntiForgeryPost()) { %>
<%:Html.ValidationSummary() %>
<fieldset>
<legend><%: T("Global Settings")%></legend>
<legend><%:T("Global Settings") %></legend>
<div>
<label for="SiteName"><%: T("Site name") %></label>
<%: Html.EditorFor(m => m.SiteName)%>
<%: Html.ValidationMessage("SiteName", "*") %>
<label for="SiteName"><%:T("Site name") %></label>
<%:Html.EditorFor(m => m.SiteName) %>
<%:Html.ValidationMessage("SiteName", "*") %>
</div>
<div>
<label for="SiteCulture"><%:T("Default Site Culture") %></label>
<%=Html.DropDownList("SiteCulture", new SelectList(Model.AvailableCultures, Model.SiteCulture)) %>
<%=Html.ValidationMessage("SiteCulture", "*") %>
<%:Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture)) %>
<%:Html.ValidationMessage("SiteCulture", "*") %>
<%:Html.ActionLink(T("Add or remove supported cultures for the site.").ToString(), "Culture") %>
</div>
<div>
<label for="PageTitleSeparator"><%: T("Page title separator") %></label>
<%: Html.EditorFor(x => x.PageTitleSeparator)%>
<%: Html.ValidationMessage("PageTitleSeparator", "*")%>
<label for="PageTitleSeparator"><%:T("Page title separator") %></label>
<%:Html.EditorFor(x => x.PageTitleSeparator) %>
<%:Html.ValidationMessage("PageTitleSeparator", "*") %>
</div>
<div>
<label for="SuperUser"><%: T("Super user") %></label>
<%: Html.EditorFor(x=>x.SuperUser) %>
<%: Html.ValidationMessage("SuperUser", "*") %>
<label for="SuperUser"><%:T("Super user") %></label>
<%:Html.EditorFor(x=>x.SuperUser) %>
<%:Html.ValidationMessage("SuperUser", "*") %>
</div>
</fieldset>
<%: Html.EditorForItem(Model.ViewModel) %>
<%:Html.EditorForItem(Model.ViewModel) %>
<fieldset>
<%: Html.EditorFor(s => s.Id) %>
<input class="button primaryAction" type="submit" value="<%: T("Save") %>" />
<%:Html.EditorFor(s => s.Id) %>
<input class="button primaryAction" type="submit" value="<%:T("Save") %>" />
</fieldset>
<% } %>

View File

@@ -0,0 +1,2 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<string>" %>
<strong><%:Model %></strong>

View File

@@ -0,0 +1,6 @@
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<string>" %>
<div><%:Model %></div>
<% using (Html.BeginFormAntiForgeryPost(Url.Action("DeleteCulture", "Admin", new { area = "Settings" }), FormMethod.Post, new {@class = "inline link"})) { %>
<%=Html.Hidden("cultureName", Model, new { id = "" }) %>
<button type="submit" title="<%:T("Delete") %>">x</button>
<% } %>

View File

@@ -21,7 +21,7 @@ namespace Orchard.Search.Controllers {
var viewModel = new SearchIndexViewModel {HasIndexToManage = _searchService.HasIndexToManage, IndexUpdatedUtc = _searchService.GetIndexUpdatedUtc()};
if (!viewModel.HasIndexToManage)
Services.Notifier.Information(T("There is not search index to manage for this site."));
Services.Notifier.Information(T("There is no search index to manage for this site."));
return View(viewModel);
}

View File

@@ -4,7 +4,7 @@ author: The Orchard Team
website: http://orchardproject.net
version: 0.1
orchardversion: 0.1.2010.0312
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent ut arcu turpis, et placerat nunc. Nunc sollicitudin iaculis est, in ultricies mi facilisis et. Aenean et tortor non metus adipiscing laoreet in a justo. Pellentesque faucibus nisl ac lectus mollis quis pellentesque tortor egestas. Curabitur vel velit semper nunc gravida scelerisque. Vivamus at tellus dolor, in ultrices quam posuere.
description: Orchard's built-in search module.
features:
Orchard.Search:
Description: Standard interface to Orchard's built-in search.

View File

@@ -32,6 +32,16 @@ namespace Orchard.Localization.Services {
_cultureRepository.Create(new CultureRecord { Culture = cultureName });
}
public void DeleteCulture(string cultureName) {
if (!IsValidCulture(cultureName)) {
throw new ArgumentException("cultureName");
}
var culture = _cultureRepository.Get(cr => cr.Culture == cultureName);
if (culture != null)
_cultureRepository.Delete(culture);
}
public string GetCurrentCulture(HttpContext requestContext) {
var requestCulture = _cultureSelectors
.Select(x => x.GetCulture(requestContext))

View File

@@ -6,6 +6,7 @@ namespace Orchard.Localization.Services {
public interface ICultureManager : IDependency {
IEnumerable<string> ListCultures();
void AddCulture(string cultureName);
void DeleteCulture(string cultureName);
string GetCurrentCulture(HttpContext requestContext);
CultureRecord GetCultureById(int id);
string GetSiteCulture();