mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Merge branch '1.10.x' into dev
# Conflicts: # src/Orchard.Web/Modules/Markdown/Markdown.csproj # src/Orchard.Web/Modules/Orchard.Projections/Handlers/FieldIndexPartHandler.cs # src/Orchard.Web/Modules/Orchard.Recipes/Views/Admin/Index.cshtml # src/Orchard.Web/Modules/Orchard.Taxonomies/Views/TermAdmin/Index.cshtml # src/Orchard.sln
This commit is contained in:
commit
b960866531
@ -191,11 +191,11 @@ Website: https://lucenenet.apache.org/
|
|||||||
Copyright: Copyright (c) 2009 Apache Software Foundation
|
Copyright: Copyright (c) 2009 Apache Software Foundation
|
||||||
License: Apache Software Foundation License 2.0
|
License: Apache Software Foundation License 2.0
|
||||||
|
|
||||||
MarkdownSharp
|
Markdig
|
||||||
-----
|
-----
|
||||||
Website: http://code.google.com/p/markdownsharp/
|
Website: https://github.com/lunet-io/markdig
|
||||||
Copyright: Copyright (c) 2009-2011 Jeff Atwood
|
Copyright: Copyright (c) 2018-2019, Alexandre Mutel
|
||||||
License: MIT
|
License: BSD 2-Clause
|
||||||
|
|
||||||
Mono Class Library
|
Mono Class Library
|
||||||
-----
|
-----
|
||||||
|
6
src/NuGet.config
Normal file
6
src/NuGet.config
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<config>
|
||||||
|
<add key="repositoryPath" value="./packages" />
|
||||||
|
</config>
|
||||||
|
</configuration>
|
@ -4,6 +4,9 @@ using Orchard.ContentManagement.Handlers;
|
|||||||
namespace Orchard.Core.Contents.Handlers {
|
namespace Orchard.Core.Contents.Handlers {
|
||||||
public class ContentsHandler : ContentHandlerBase {
|
public class ContentsHandler : ContentHandlerBase {
|
||||||
public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
|
public override void GetContentItemMetadata(GetContentItemMetadataContext context) {
|
||||||
|
if (string.IsNullOrWhiteSpace(context.Metadata.DisplayText))
|
||||||
|
context.Metadata.DisplayText = context.ContentItem.ContentType;
|
||||||
|
|
||||||
if (context.Metadata.CreateRouteValues == null) {
|
if (context.Metadata.CreateRouteValues == null) {
|
||||||
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
context.Metadata.CreateRouteValues = new RouteValueDictionary {
|
||||||
{"Area", "Contents"},
|
{"Area", "Contents"},
|
||||||
@ -12,6 +15,7 @@ namespace Orchard.Core.Contents.Handlers {
|
|||||||
{"Id", context.ContentItem.ContentType}
|
{"Id", context.ContentItem.ContentType}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Metadata.EditorRouteValues == null) {
|
if (context.Metadata.EditorRouteValues == null) {
|
||||||
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
context.Metadata.EditorRouteValues = new RouteValueDictionary {
|
||||||
{"Area", "Contents"},
|
{"Area", "Contents"},
|
||||||
@ -20,6 +24,7 @@ namespace Orchard.Core.Contents.Handlers {
|
|||||||
{"Id", context.ContentItem.Id}
|
{"Id", context.ContentItem.Id}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Metadata.DisplayRouteValues == null) {
|
if (context.Metadata.DisplayRouteValues == null) {
|
||||||
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
|
context.Metadata.DisplayRouteValues = new RouteValueDictionary {
|
||||||
{"Area", "Contents"},
|
{"Area", "Contents"},
|
||||||
@ -28,6 +33,7 @@ namespace Orchard.Core.Contents.Handlers {
|
|||||||
{"Id", context.ContentItem.Id}
|
{"Id", context.ContentItem.Id}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (context.Metadata.RemoveRouteValues == null) {
|
if (context.Metadata.RemoveRouteValues == null) {
|
||||||
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
context.Metadata.RemoveRouteValues = new RouteValueDictionary {
|
||||||
{"Area", "Contents"},
|
{"Area", "Contents"},
|
||||||
|
@ -54,9 +54,8 @@
|
|||||||
<Prefer32Bit>false</Prefer32Bit>
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="MarkdownSharp, Version=1.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Markdig.Signed, Version=0.18.0.0, Culture=neutral, PublicKeyToken=870da25a133885f8, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\..\packages\StackExchange.MarkdownSharp.1.5.1.0\lib\net35\MarkdownSharp.dll</HintPath>
|
<HintPath>..\..\..\packages\Markdig.Signed.0.18.0\lib\net40\Markdig.Signed.dll</HintPath>
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
<HintPath>..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
<HintPath>..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web.ApplicationServices;
|
|
||||||
using Orchard.Services;
|
using Orchard.Services;
|
||||||
|
|
||||||
namespace Markdown.Services {
|
namespace Markdown.Services {
|
||||||
@ -12,9 +11,7 @@ namespace Markdown.Services {
|
|||||||
if (string.IsNullOrEmpty(text))
|
if (string.IsNullOrEmpty(text))
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
|
|
||||||
var markdown = new MarkdownSharp.Markdown();
|
return Markdig.Markdown.ToHtml(text);
|
||||||
|
|
||||||
return markdown.Transform(text);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="Markdig.Signed" version="0.18.0" targetFramework="net452" />
|
||||||
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
|
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
|
||||||
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
|
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
|
||||||
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
|
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net452" />
|
||||||
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net452" />
|
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="2.0.1" targetFramework="net452" />
|
||||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
|
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net452" />
|
||||||
<package id="StackExchange.MarkdownSharp" version="1.5.1.0" targetFramework="net452" />
|
|
||||||
</packages>
|
</packages>
|
@ -13,6 +13,7 @@ using Orchard.Logging;
|
|||||||
using Orchard.UI.Admin;
|
using Orchard.UI.Admin;
|
||||||
using Orchard.UI.Notify;
|
using Orchard.UI.Notify;
|
||||||
using Orchard.Services;
|
using Orchard.Services;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Orchard.AntiSpam.Drivers {
|
namespace Orchard.AntiSpam.Drivers {
|
||||||
public class ReCaptchaPartDriver : ContentPartDriver<ReCaptchaPart> {
|
public class ReCaptchaPartDriver : ContentPartDriver<ReCaptchaPart> {
|
||||||
@ -35,14 +36,16 @@ namespace Orchard.AntiSpam.Drivers {
|
|||||||
public Localizer T { get; set; }
|
public Localizer T { get; set; }
|
||||||
public ILogger Logger { get; set; }
|
public ILogger Logger { get; set; }
|
||||||
protected override DriverResult Editor(ReCaptchaPart part, dynamic shapeHelper) {
|
protected override DriverResult Editor(ReCaptchaPart part, dynamic shapeHelper) {
|
||||||
var workContext = _workContextAccessor.GetContext();
|
|
||||||
|
// we want to be returning a shape even when it should display nothing, because
|
||||||
// don't display the part in the admin
|
// other features may need the Shape's type, or some other of its properties
|
||||||
if (AdminFilter.IsApplied(workContext.HttpContext.Request.RequestContext)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ContentShape("Parts_ReCaptcha_Fields", () => {
|
return ContentShape("Parts_ReCaptcha_Fields", () => {
|
||||||
|
var workContext = _workContextAccessor.GetContext();
|
||||||
|
// don't display the part in the admin
|
||||||
|
if (AdminFilter.IsApplied(workContext.HttpContext.Request.RequestContext)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var settings = workContext.CurrentSite.As<ReCaptchaSettingsPart>();
|
var settings = workContext.CurrentSite.As<ReCaptchaSettingsPart>();
|
||||||
|
|
||||||
if (settings.TrustAuthenticatedUsers && workContext.CurrentUser != null) {
|
if (settings.TrustAuthenticatedUsers && workContext.CurrentUser != null) {
|
||||||
@ -73,7 +76,7 @@ namespace Orchard.AntiSpam.Drivers {
|
|||||||
var context = workContext.HttpContext;
|
var context = workContext.HttpContext;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var result = ExecuteValidateRequest(
|
var result = ValidateRequest(//ExecuteValidateRequest(
|
||||||
settings.PrivateKey,
|
settings.PrivateKey,
|
||||||
context.Request.ServerVariables["REMOTE_ADDR"],
|
context.Request.ServerVariables["REMOTE_ADDR"],
|
||||||
context.Request.Form["g-recaptcha-response"]
|
context.Request.Form["g-recaptcha-response"]
|
||||||
@ -104,13 +107,27 @@ namespace Orchard.AntiSpam.Drivers {
|
|||||||
return Editor(part, shapeHelper);
|
return Editor(part, shapeHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ExecuteValidateRequest(string privateKey, string remoteip, string response) {
|
// temporarily save <postData, response> pairs, to prevent sending the same exact request
|
||||||
var postData = String.Format(CultureInfo.InvariantCulture,
|
// more than once in a single Request.
|
||||||
|
private Dictionary<string, string> ValidationResponse;
|
||||||
|
|
||||||
|
private string ValidateRequest(string privateKey, string remoteip, string response) {
|
||||||
|
if (ValidationResponse == null) {
|
||||||
|
ValidationResponse = new Dictionary<string, string>();
|
||||||
|
}
|
||||||
|
var postData = string.Format(CultureInfo.InvariantCulture,
|
||||||
"secret={0}&response={1}&remoteip={2}",
|
"secret={0}&response={1}&remoteip={2}",
|
||||||
privateKey,
|
privateKey,
|
||||||
response,
|
response,
|
||||||
remoteip
|
remoteip
|
||||||
);
|
);
|
||||||
|
if (!ValidationResponse.ContainsKey(postData)) {
|
||||||
|
ValidationResponse.Add(postData, ExecuteValidateRequest(postData));
|
||||||
|
}
|
||||||
|
return ValidationResponse[postData];
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string ExecuteValidateRequest(string postData) {
|
||||||
|
|
||||||
WebRequest request = WebRequest.Create(ReCaptchaSecureUrl + "?" + postData);
|
WebRequest request = WebRequest.Create(ReCaptchaSecureUrl + "?" + postData);
|
||||||
request.Method = "GET";
|
request.Method = "GET";
|
||||||
@ -123,5 +140,6 @@ namespace Orchard.AntiSpam.Drivers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,10 +11,12 @@ namespace Orchard.ArchiveLater.Handlers {
|
|||||||
|
|
||||||
OnLoading<ArchiveLaterPart>((context, part) => LazyLoadHandlers(part));
|
OnLoading<ArchiveLaterPart>((context, part) => LazyLoadHandlers(part));
|
||||||
OnVersioning<ArchiveLaterPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
|
OnVersioning<ArchiveLaterPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart));
|
||||||
|
OnRemoved<ArchiveLaterPart>((context, part) => _archiveLaterService.RemoveArchiveLaterTasks(part.ContentItem));
|
||||||
|
OnDestroyed<ArchiveLaterPart>((context, part) => _archiveLaterService.RemoveArchiveLaterTasks(part.ContentItem));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void LazyLoadHandlers(ArchiveLaterPart part) {
|
protected void LazyLoadHandlers(ArchiveLaterPart part) {
|
||||||
part.ScheduledArchiveUtc.Loader(() => _archiveLaterService.GetScheduledArchiveUtc(part));
|
part.ScheduledArchiveUtc.Loader(() => _archiveLaterService.GetScheduledArchiveUtc(part));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,10 +15,10 @@ namespace Orchard.Blogs.Handlers {
|
|||||||
private readonly IWorkContextAccessor _workContextAccessor;
|
private readonly IWorkContextAccessor _workContextAccessor;
|
||||||
private readonly IContentManager _contentManager;
|
private readonly IContentManager _contentManager;
|
||||||
// contains the creation time of a blog part before it has been changed
|
// contains the creation time of a blog part before it has been changed
|
||||||
private readonly Dictionary<int, DateTime> _previousCreatedUtc = new Dictionary<int,DateTime>();
|
private readonly Dictionary<int, DateTime> _previousCreatedUtc = new Dictionary<int, DateTime>();
|
||||||
|
|
||||||
public BlogPartArchiveHandler(
|
public BlogPartArchiveHandler(
|
||||||
IRepository<BlogPartArchiveRecord> blogArchiveRepository,
|
IRepository<BlogPartArchiveRecord> blogArchiveRepository,
|
||||||
IBlogPostService blogPostService,
|
IBlogPostService blogPostService,
|
||||||
IWorkContextAccessor workContextAccessor,
|
IWorkContextAccessor workContextAccessor,
|
||||||
IContentManager contentManager) {
|
IContentManager contentManager) {
|
||||||
@ -26,11 +26,11 @@ namespace Orchard.Blogs.Handlers {
|
|||||||
_workContextAccessor = workContextAccessor;
|
_workContextAccessor = workContextAccessor;
|
||||||
_contentManager = contentManager;
|
_contentManager = contentManager;
|
||||||
|
|
||||||
OnUpdating<CommonPart>((context, cp) => { if(context.ContentItem.Has<BlogPostPart>()) SavePreviousCreatedDate(context.Id);});
|
OnUpdating<CommonPart>((context, cp) => { if (context.ContentItem.Has<BlogPostPart>()) SavePreviousCreatedDate(context.Id); });
|
||||||
OnRemoving<BlogPostPart>((context, bp) => SavePreviousCreatedDate(context.Id));
|
OnRemoving<BlogPostPart>((context, bp) => SavePreviousCreatedDate(context.Id));
|
||||||
OnUnpublishing<BlogPostPart>((context, bp) => SavePreviousCreatedDate(context.Id));
|
OnUnpublishing<BlogPostPart>((context, bp) => SavePreviousCreatedDate(context.Id));
|
||||||
|
|
||||||
OnPublished<BlogPostPart>((context, bp) => IncreaseBlogArchive(bp));
|
OnPublished<BlogPostPart>((context, bp) => ManageBlogArchiveSync(bp));
|
||||||
OnUnpublished<BlogPostPart>((context, bp) => ReduceBlogArchive(bp));
|
OnUnpublished<BlogPostPart>((context, bp) => ReduceBlogArchive(bp));
|
||||||
OnRemoved<BlogPostPart>((context, bp) => ReduceBlogArchive(bp));
|
OnRemoved<BlogPostPart>((context, bp) => ReduceBlogArchive(bp));
|
||||||
}
|
}
|
||||||
@ -71,58 +71,56 @@ namespace Orchard.Blogs.Handlers {
|
|||||||
&& x.Month == datetime.Month
|
&& x.Month == datetime.Month
|
||||||
&& x.Year == datetime.Year);
|
&& x.Year == datetime.Year);
|
||||||
|
|
||||||
if(previousArchiveRecord == null)
|
if (previousArchiveRecord == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (previousArchiveRecord.PostCount > 1)
|
if (previousArchiveRecord.PostCount > 1)
|
||||||
previousArchiveRecord.PostCount--;
|
previousArchiveRecord.PostCount--;
|
||||||
else
|
else
|
||||||
_blogArchiveRepository.Delete(previousArchiveRecord);
|
_blogArchiveRepository.Delete(previousArchiveRecord);
|
||||||
|
|
||||||
|
blogPostPart.ArchiveSync = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ReduceBlogArchiveByDate(int BlogPartId, DateTime? dateBlogPost) {
|
||||||
|
_blogArchiveRepository.Flush();
|
||||||
|
|
||||||
|
if (BlogPartId!= 0 && dateBlogPost.HasValue) {
|
||||||
|
var previousArchiveRecord = _blogArchiveRepository.Table
|
||||||
|
.FirstOrDefault(x => x.BlogPart.Id == BlogPartId
|
||||||
|
&& x.Month == dateBlogPost.Value.Month
|
||||||
|
&& x.Year == dateBlogPost.Value.Year);
|
||||||
|
|
||||||
|
if (previousArchiveRecord == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (previousArchiveRecord.PostCount > 1)
|
||||||
|
previousArchiveRecord.PostCount--;
|
||||||
|
else
|
||||||
|
_blogArchiveRepository.Delete(previousArchiveRecord);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void IncreaseBlogArchive(BlogPostPart blogPostPart) {
|
private void IncreaseBlogArchive(BlogPostPart blogPostPart) {
|
||||||
_blogArchiveRepository.Flush();
|
_blogArchiveRepository.Flush();
|
||||||
|
|
||||||
var commonPart = blogPostPart.As<ICommonPart>();
|
var commonPart = blogPostPart.As<ICommonPart>();
|
||||||
if(commonPart == null || !commonPart.CreatedUtc.HasValue)
|
if (commonPart == null || !commonPart.CreatedUtc.HasValue)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// get the time zone for the current request
|
// get the time zone for the current request
|
||||||
var timeZone = _workContextAccessor.GetContext().CurrentTimeZone;
|
var timeZone = _workContextAccessor.GetContext().CurrentTimeZone;
|
||||||
|
|
||||||
var previousCreatedUtc = _previousCreatedUtc.ContainsKey(blogPostPart.Id) ? _previousCreatedUtc[blogPostPart.Id] : DateTime.MinValue;
|
|
||||||
previousCreatedUtc = TimeZoneInfo.ConvertTimeFromUtc(previousCreatedUtc, timeZone);
|
|
||||||
|
|
||||||
var previousMonth = previousCreatedUtc.Month;
|
|
||||||
var previousYear = previousCreatedUtc.Year;
|
|
||||||
|
|
||||||
var newCreatedUtc = commonPart.CreatedUtc;
|
var newCreatedUtc = commonPart.CreatedUtc;
|
||||||
newCreatedUtc = TimeZoneInfo.ConvertTimeFromUtc(newCreatedUtc.Value, timeZone);
|
newCreatedUtc = TimeZoneInfo.ConvertTimeFromUtc(newCreatedUtc.Value, timeZone);
|
||||||
|
|
||||||
var newMonth = newCreatedUtc.Value.Month;
|
var newMonth = newCreatedUtc.Value.Month;
|
||||||
var newYear = newCreatedUtc.Value.Year;
|
var newYear = newCreatedUtc.Value.Year;
|
||||||
|
|
||||||
// if archives are the same there is nothing to do
|
|
||||||
if (previousMonth == newMonth && previousYear == newYear) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// decrement previous archive record
|
|
||||||
var previousArchiveRecord = _blogArchiveRepository
|
|
||||||
.Table
|
|
||||||
.FirstOrDefault(x => x.BlogPart.Id == blogPostPart.BlogPart.Id
|
|
||||||
&& x.Month == previousMonth
|
|
||||||
&& x.Year == previousYear);
|
|
||||||
|
|
||||||
if (previousArchiveRecord != null && previousArchiveRecord.PostCount > 0) {
|
|
||||||
previousArchiveRecord.PostCount--;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if previous count is now zero, delete the record
|
|
||||||
if (previousArchiveRecord != null && previousArchiveRecord.PostCount == 0) {
|
|
||||||
_blogArchiveRepository.Delete(previousArchiveRecord);
|
|
||||||
}
|
|
||||||
|
|
||||||
// increment new archive record
|
// increment new archive record
|
||||||
var newArchiveRecord = _blogArchiveRepository
|
var newArchiveRecord = _blogArchiveRepository
|
||||||
.Table
|
.Table
|
||||||
@ -136,7 +134,31 @@ namespace Orchard.Blogs.Handlers {
|
|||||||
_blogArchiveRepository.Create(newArchiveRecord);
|
_blogArchiveRepository.Create(newArchiveRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
newArchiveRecord.PostCount++;
|
newArchiveRecord.PostCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ManageBlogArchiveSync(BlogPostPart blogPostPart) {
|
||||||
|
var commonPart = blogPostPart.As<ICommonPart>();
|
||||||
|
if (commonPart == null || !commonPart.CreatedUtc.HasValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var timeZone = _workContextAccessor.GetContext().CurrentTimeZone;
|
||||||
|
var creationDate = TimeZoneInfo.ConvertTimeFromUtc(commonPart.CreatedUtc.Value, timeZone);
|
||||||
|
|
||||||
|
if (blogPostPart.ArchiveSync == null) {
|
||||||
|
IncreaseBlogArchive(blogPostPart);
|
||||||
|
blogPostPart.ArchiveSync = creationDate;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (creationDate == blogPostPart.ArchiveSync) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ReduceBlogArchiveByDate(blogPostPart.BlogPart.Id, blogPostPart.ArchiveSync);
|
||||||
|
IncreaseBlogArchive(blogPostPart);
|
||||||
|
blogPostPart.ArchiveSync = creationDate;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -49,5 +49,10 @@ namespace Orchard.Blogs.Models {
|
|||||||
public DateTime? PublishedUtc {
|
public DateTime? PublishedUtc {
|
||||||
get { return this.As<ICommonPart>().PublishedUtc; }
|
get { return this.As<ICommonPart>().PublishedUtc; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DateTime? ArchiveSync {
|
||||||
|
get { return this.Retrieve(x => x.ArchiveSync); }
|
||||||
|
set { this.Store(x => x.ArchiveSync, value); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -223,11 +223,25 @@ namespace Orchard.Indexing.Services {
|
|||||||
.OrderBy(x => x.Id)
|
.OrderBy(x => x.Id)
|
||||||
.Take(ContentItemsPerLoop)
|
.Take(ContentItemsPerLoop)
|
||||||
.ToList()
|
.ToList()
|
||||||
// In some rare cases a ContentItemRecord without a ContentType can end up in the DB.
|
.Where(x => x.ContentItemRecord != null)
|
||||||
// We need to filter out such records, otherwise they will crash the ContentManager.
|
|
||||||
.Where(x => x.ContentItemRecord != null && x.ContentItemRecord.ContentType != null)
|
|
||||||
.GroupBy(x => x.ContentItemRecord.Id)
|
.GroupBy(x => x.ContentItemRecord.Id)
|
||||||
.Select(group => new { TaskId = group.Max(task => task.Id), Delete = group.Last().Action == IndexingTaskRecord.Delete, Id = group.Key, ContentItem = _contentManager.Get(group.Key, VersionOptions.Latest) })
|
.Select(group => new {
|
||||||
|
TaskId = group.Max(task => task.Id),
|
||||||
|
Delete = group.Last().Action == IndexingTaskRecord.Delete,
|
||||||
|
Id = group.Key,
|
||||||
|
// We can only have a ContentItem if the ContentItemRecord matches
|
||||||
|
// something that still exists in our records.
|
||||||
|
ContentItem = group.All(x => {
|
||||||
|
try {
|
||||||
|
return x.ContentItemRecord != null
|
||||||
|
// ContentType is required to build the ContentItem
|
||||||
|
&& x.ContentItemRecord.ContentType != null;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}) ? _contentManager.Get(group.Key, VersionOptions.Latest) : null // Set to null to "tell" it's a delete/destroy
|
||||||
|
})
|
||||||
.OrderBy(x => x.TaskId)
|
.OrderBy(x => x.TaskId)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
@ -274,7 +288,7 @@ namespace Orchard.Indexing.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} while (loop);
|
} while (loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
// save current state of the index
|
// save current state of the index
|
||||||
indexSettings.LastIndexedUtc = _clock.UtcNow;
|
indexSettings.LastIndexedUtc = _clock.UtcNow;
|
||||||
|
@ -9,7 +9,6 @@ using Orchard.Core.Common.Models;
|
|||||||
using Orchard.Core.Containers.Models;
|
using Orchard.Core.Containers.Models;
|
||||||
using Orchard.Core.Containers.Services;
|
using Orchard.Core.Containers.Services;
|
||||||
using Orchard.Core.Containers.ViewModels;
|
using Orchard.Core.Containers.ViewModels;
|
||||||
using Orchard.Core.Contents;
|
|
||||||
using Orchard.Core.Contents.ViewModels;
|
using Orchard.Core.Contents.ViewModels;
|
||||||
using Orchard.Core.Title.Models;
|
using Orchard.Core.Title.Models;
|
||||||
using Orchard.Data;
|
using Orchard.Data;
|
||||||
@ -39,7 +38,7 @@ namespace Orchard.Lists.Controllers {
|
|||||||
IOrchardServices services,
|
IOrchardServices services,
|
||||||
IContentDefinitionManager contentDefinitionManager,
|
IContentDefinitionManager contentDefinitionManager,
|
||||||
IShapeFactory shapeFactory,
|
IShapeFactory shapeFactory,
|
||||||
IContainerService containerService,
|
IContainerService containerService,
|
||||||
IListViewService listViewService,
|
IListViewService listViewService,
|
||||||
ITransactionManager transactionManager) {
|
ITransactionManager transactionManager) {
|
||||||
|
|
||||||
@ -92,7 +91,7 @@ namespace Orchard.Lists.Controllers {
|
|||||||
var pager = new Pager(_services.WorkContext.CurrentSite, pagerParameters);
|
var pager = new Pager(_services.WorkContext.CurrentSite, pagerParameters);
|
||||||
var pagerShape = Shape.Pager(pager).TotalItemCount(query.Count());
|
var pagerShape = Shape.Pager(pager).TotalItemCount(query.Count());
|
||||||
var pageOfLists = query.Slice(pager.GetStartIndex(), pager.PageSize);
|
var pageOfLists = query.Slice(pager.GetStartIndex(), pager.PageSize);
|
||||||
|
|
||||||
var listsShape = Shape.List();
|
var listsShape = Shape.List();
|
||||||
listsShape.AddRange(pageOfLists.Select(x => _contentManager.BuildDisplay(x, "SummaryAdmin")).ToList());
|
listsShape.AddRange(pageOfLists.Select(x => _contentManager.BuildDisplay(x, "SummaryAdmin")).ToList());
|
||||||
var viewModel = Shape.ViewModel()
|
var viewModel = Shape.ViewModel()
|
||||||
@ -171,10 +170,10 @@ namespace Orchard.Lists.Controllers {
|
|||||||
if (containerTypes.Count > 1) {
|
if (containerTypes.Count > 1) {
|
||||||
return RedirectToAction("SelectType");
|
return RedirectToAction("SelectType");
|
||||||
}
|
}
|
||||||
return RedirectToAction("Create", new {id = containerTypes.First().Name});
|
return RedirectToAction("Create", new { id = containerTypes.First().Name });
|
||||||
}
|
}
|
||||||
|
|
||||||
return RedirectToAction("Create", "Admin", new {area = "Contents", id, returnUrl = Url.Action("Index", "Admin", new { area = "Orchard.Lists" })});
|
return RedirectToAction("Create", "Admin", new { area = "Contents", id, returnUrl = Url.Action("Index", "Admin", new { area = "Orchard.Lists" }) });
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult SelectType() {
|
public ActionResult SelectType() {
|
||||||
@ -312,11 +311,11 @@ namespace Orchard.Lists.Controllers {
|
|||||||
LocalizedString message;
|
LocalizedString message;
|
||||||
|
|
||||||
if (previousItemContainer == null) {
|
if (previousItemContainer == null) {
|
||||||
message = T("{0} was moved to <a href=\"{1}\">{2}</a>", itemMetadata.DisplayText, Url.RouteUrl(containerMetadata.AdminRouteValues), containerMetadata.DisplayText);
|
message = T("{0} was moved to <a href=\"{1}\">{2}</a>.", itemMetadata.DisplayText, Url.RouteUrl(containerMetadata.AdminRouteValues), containerMetadata.DisplayText);
|
||||||
}
|
}
|
||||||
else if (previousItemContainer.Id != containerId) {
|
else if (previousItemContainer.Id != containerId) {
|
||||||
var previousItemContainerMetadata = _contentManager.GetItemMetadata(commonPart.Container);
|
var previousItemContainerMetadata = _contentManager.GetItemMetadata(commonPart.Container);
|
||||||
message = T("{0} was moved from <a href=\"{3}\">{4}</a> to <a href=\"{1}\">{2}</a>",
|
message = T("{0} was moved from <a href=\"{3}\">{4}</a> to <a href=\"{1}\">{2}</a>.",
|
||||||
itemMetadata.DisplayText,
|
itemMetadata.DisplayText,
|
||||||
Url.RouteUrl(containerMetadata.AdminRouteValues),
|
Url.RouteUrl(containerMetadata.AdminRouteValues),
|
||||||
containerMetadata.DisplayText,
|
containerMetadata.DisplayText,
|
||||||
@ -374,7 +373,7 @@ namespace Orchard.Lists.Controllers {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RedirectToAction("List", new {containerId, page = pagerParameters.Page, pageSize = pagerParameters.PageSize});
|
return RedirectToAction("List", new { containerId, page = pagerParameters.Page, pageSize = pagerParameters.PageSize });
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost, ActionName("List")]
|
[HttpPost, ActionName("List")]
|
||||||
@ -393,7 +392,7 @@ namespace Orchard.Lists.Controllers {
|
|||||||
/// Only publishes the content if it is already published.
|
/// Only publishes the content if it is already published.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void RePublish(IContent content) {
|
private void RePublish(IContent content) {
|
||||||
if(content.ContentItem.VersionRecord.Published)
|
if (content.ContentItem.VersionRecord.Published)
|
||||||
_contentManager.Publish(content.ContentItem);
|
_contentManager.Publish(content.ContentItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,7 +438,7 @@ namespace Orchard.Lists.Controllers {
|
|||||||
if (!_services.Authorizer.Authorize(Orchard.Core.Contents.Permissions.EditContent, item, T("Couldn't move selected content."))) {
|
if (!_services.Authorizer.Authorize(Orchard.Core.Contents.Permissions.EditContent, item, T("Couldn't move selected content."))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the item can be in that container.
|
// Ensure the item can be in that container.
|
||||||
if (itemContentTypes.Any() && itemContentTypes.All(x => x.Name != item.ContentItem.ContentType)) {
|
if (itemContentTypes.Any() && itemContentTypes.All(x => x.Name != item.ContentItem.ContentType)) {
|
||||||
_services.TransactionManager.Cancel();
|
_services.TransactionManager.Cancel();
|
||||||
|
@ -32,6 +32,12 @@
|
|||||||
clear: both;
|
clear: both;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.media-library-picker .media-thumbnail-image {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TRSkVB6sUcchQnSyIijhKFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi5Oik6CIl/i8ptIjx4Lgf7+497t4BQqPCVLNrAlA1y0jFY2I2tyr2vEJAGAEMYVBipp5IL2bgOb7u4ePrXZRneZ/7c/QpeZMBPpF4jumGRbxBPLNp6Zz3iUOsJCnE58TjBl2Q+JHrsstvnIsOCzwzZGRS88QhYrHYwXIHs5KhEk8TRxRVo3wh67LCeYuzWqmx1j35C4N5bSXNdZojiGMJCSQhQkYNZVRgIUqrRoqJFO3HPPzDjj9JLplcZTByLKAKFZLjB/+D392ahalJNykYA7pfbPtjFOjZBZp12/4+tu3mCeB/Bq60tr/aAGY/Sa+3tcgR0L8NXFy3NXkPuNwBwk+6ZEiO5KcpFArA+xl9Uw4YuAUCa25vrX2cPgAZ6mr5Bjg4BMaKlL3u8e7ezt7+PdPq7wdPt3KZgxNbzAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAPFJREFUeNrt3LENhDAQRcHlsExA/03SAMjY5mI6YKV5HXxPsJmX4zieSF6tNfZ9j1JK6h3XdcUv9KmAABEQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAdGrUmtNP2Jd15hzRu89/Zblvu/0P8rNOaO1FmOM1Du2bYuS/Vu8iIjee4wxorWWHsQNcdQFBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICRED0ajnP8/EM3+kPz+EneeiZXCUAAAAASUVORK5CYII=");
|
||||||
|
background-size: 15%;
|
||||||
|
background-repeat: repeat;
|
||||||
|
}
|
||||||
|
|
||||||
.overlay {
|
.overlay {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 20px;
|
bottom: 20px;
|
||||||
|
@ -6,4 +6,10 @@ background-position:0 -30px !important;
|
|||||||
}
|
}
|
||||||
.summary .media-thumbnail {
|
.summary .media-thumbnail {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary .media-thumbnail-image {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TRSkVB6sUcchQnSyIijhKFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi5Oik6CIl/i8ptIjx4Lgf7+497t4BQqPCVLNrAlA1y0jFY2I2tyr2vEJAGAEMYVBipp5IL2bgOb7u4ePrXZRneZ/7c/QpeZMBPpF4jumGRbxBPLNp6Zz3iUOsJCnE58TjBl2Q+JHrsstvnIsOCzwzZGRS88QhYrHYwXIHs5KhEk8TRxRVo3wh67LCeYuzWqmx1j35C4N5bSXNdZojiGMJCSQhQkYNZVRgIUqrRoqJFO3HPPzDjj9JLplcZTByLKAKFZLjB/+D392ahalJNykYA7pfbPtjFOjZBZp12/4+tu3mCeB/Bq60tr/aAGY/Sa+3tcgR0L8NXFy3NXkPuNwBwk+6ZEiO5KcpFArA+xl9Uw4YuAUCa25vrX2cPgAZ6mr5Bjg4BMaKlL3u8e7ezt7+PdPq7wdPt3KZgxNbzAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAPFJREFUeNrt3LENhDAQRcHlsExA/03SAMjY5mI6YKV5HXxPsJmX4zieSF6tNfZ9j1JK6h3XdcUv9KmAABEQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAdGrUmtNP2Jd15hzRu89/Zblvu/0P8rNOaO1FmOM1Du2bYuS/Vu8iIjee4wxorWWHsQNcdQFBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICRED0ajnP8/EM3+kPz+EneeiZXCUAAAAASUVORK5CYII=");
|
||||||
|
background-size: 15%;
|
||||||
|
background-repeat: repeat;
|
||||||
}
|
}
|
@ -267,13 +267,18 @@
|
|||||||
#media-library-main-list .media-thumbnail {
|
#media-library-main-list .media-thumbnail {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
overflow:hidden;
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
#media-library-main-editor-focus .media-item-summary-admin img {
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TRSkVB6sUcchQnSyIijhKFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi5Oik6CIl/i8ptIjx4Lgf7+497t4BQqPCVLNrAlA1y0jFY2I2tyr2vEJAGAEMYVBipp5IL2bgOb7u4ePrXZRneZ/7c/QpeZMBPpF4jumGRbxBPLNp6Zz3iUOsJCnE58TjBl2Q+JHrsstvnIsOCzwzZGRS88QhYrHYwXIHs5KhEk8TRxRVo3wh67LCeYuzWqmx1j35C4N5bSXNdZojiGMJCSQhQkYNZVRgIUqrRoqJFO3HPPzDjj9JLplcZTByLKAKFZLjB/+D392ahalJNykYA7pfbPtjFOjZBZp12/4+tu3mCeB/Bq60tr/aAGY/Sa+3tcgR0L8NXFy3NXkPuNwBwk+6ZEiO5KcpFArA+xl9Uw4YuAUCa25vrX2cPgAZ6mr5Bjg4BMaKlL3u8e7ezt7+PdPq7wdPt3KZgxNbzAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAPFJREFUeNrt3LENhDAQRcHlsExA/03SAMjY5mI6YKV5HXxPsJmX4zieSF6tNfZ9j1JK6h3XdcUv9KmAABEQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAdGrUmtNP2Jd15hzRu89/Zblvu/0P8rNOaO1FmOM1Du2bYuS/Vu8iIjee4wxorWWHsQNcdQFBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICRED0ajnP8/EM3+kPz+EneeiZXCUAAAAASUVORK5CYII=");
|
||||||
|
background-size: 15%;
|
||||||
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
#media-library-main-selection .media-thumbnail {
|
#media-library-main-selection .media-thumbnail {
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 120px;
|
height: 120px;
|
||||||
overflow:hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-thumbnail-o-embed {
|
.media-thumbnail-o-embed {
|
||||||
@ -294,6 +299,9 @@
|
|||||||
-o-background-size: cover;
|
-o-background-size: cover;
|
||||||
-webkit-background-size: cover;
|
-webkit-background-size: cover;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
|
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TRSkVB6sUcchQnSyIijhKFYtgobQVWnUwufQLmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi5Oik6CIl/i8ptIjx4Lgf7+497t4BQqPCVLNrAlA1y0jFY2I2tyr2vEJAGAEMYVBipp5IL2bgOb7u4ePrXZRneZ/7c/QpeZMBPpF4jumGRbxBPLNp6Zz3iUOsJCnE58TjBl2Q+JHrsstvnIsOCzwzZGRS88QhYrHYwXIHs5KhEk8TRxRVo3wh67LCeYuzWqmx1j35C4N5bSXNdZojiGMJCSQhQkYNZVRgIUqrRoqJFO3HPPzDjj9JLplcZTByLKAKFZLjB/+D392ahalJNykYA7pfbPtjFOjZBZp12/4+tu3mCeB/Bq60tr/aAGY/Sa+3tcgR0L8NXFy3NXkPuNwBwk+6ZEiO5KcpFArA+xl9Uw4YuAUCa25vrX2cPgAZ6mr5Bjg4BMaKlL3u8e7ezt7+PdPq7wdPt3KZgxNbzAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAPFJREFUeNrt3LENhDAQRcHlsExA/03SAMjY5mI6YKV5HXxPsJmX4zieSF6tNfZ9j1JK6h3XdcUv9KmAABEQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAREQIAICRECACAgQAdGrUmtNP2Jd15hzRu89/Zblvu/0P8rNOaO1FmOM1Du2bYuS/Vu8iIjee4wxorWWHsQNcdQFBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICREAEBIiAABEQIAICRED0ajnP8/EM3+kPz+EneeiZXCUAAAAASUVORK5CYII=");
|
||||||
|
background-size: 15%;
|
||||||
|
background-repeat: repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.media-thumbnail-video {
|
.media-thumbnail-video {
|
||||||
|
@ -45,7 +45,10 @@ namespace Orchard.Projections.Handlers {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void Updated(UpdateContentContext context, FieldIndexPart fieldIndexPart) {
|
private void Updated(UpdateContentContext context, FieldIndexPart fieldIndexPart) {
|
||||||
if (context.UpdatingItemVersionRecord.Latest) { // updates projection draft indexes only if it is the latest version
|
// there are two different item types: saved in memory and saved to db
|
||||||
|
// those saved in memory don't have correctly the populated record and this generate NullReferenceException
|
||||||
|
if (context.UpdatingItemVersionRecord != null && context.UpdatingItemVersionRecord.Latest) {
|
||||||
|
// updates projection draft indexes only if it is the latest version
|
||||||
DescribeValuesToIndex(fieldIndexPart, (indexServiceContext) => {
|
DescribeValuesToIndex(fieldIndexPart, (indexServiceContext) => {
|
||||||
_fieldIndexService.Set(
|
_fieldIndexService.Set(
|
||||||
fieldIndexPart,
|
fieldIndexPart,
|
||||||
@ -114,4 +117,4 @@ namespace Orchard.Projections.Handlers {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@
|
|||||||
<Compile Include="Providers\Executors\RemoveContentDefinitionStep.cs" />
|
<Compile Include="Providers\Executors\RemoveContentDefinitionStep.cs" />
|
||||||
<Compile Include="Providers\Executors\RemoveContentStep.cs" />
|
<Compile Include="Providers\Executors\RemoveContentStep.cs" />
|
||||||
<Compile Include="Providers\Executors\RecipesStep.cs" />
|
<Compile Include="Providers\Executors\RecipesStep.cs" />
|
||||||
|
<Compile Include="Providers\Executors\RemoveFromContentTypeStep.cs" />
|
||||||
<Compile Include="ViewModels\ContentExecutionStepViewModel.cs" />
|
<Compile Include="ViewModels\ContentExecutionStepViewModel.cs" />
|
||||||
<Compile Include="Providers\Executors\ContentStep.cs" />
|
<Compile Include="Providers\Executors\ContentStep.cs" />
|
||||||
<Compile Include="Providers\Executors\ContentDefinitionStep.cs" />
|
<Compile Include="Providers\Executors\ContentDefinitionStep.cs" />
|
||||||
|
@ -0,0 +1,89 @@
|
|||||||
|
using System;
|
||||||
|
using System.Xml;
|
||||||
|
using Orchard.ContentManagement.MetaData;
|
||||||
|
using Orchard.ContentTypes.Events;
|
||||||
|
using Orchard.Localization;
|
||||||
|
using Orchard.Logging;
|
||||||
|
using Orchard.Recipes.Models;
|
||||||
|
using Orchard.Recipes.Services;
|
||||||
|
|
||||||
|
namespace Orchard.Recipes.Providers.Executors {
|
||||||
|
public class RemoveFromContentTypeStep : RecipeExecutionStep {
|
||||||
|
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||||
|
private readonly IContentDefinitionEventHandler _contentDefinitionEventHandlers;
|
||||||
|
|
||||||
|
public RemoveFromContentTypeStep(RecipeExecutionLogger logger, IContentDefinitionManager contentDefinitionManager,
|
||||||
|
IContentDefinitionEventHandler contentDefinitonEventHandlers) : base(logger) {
|
||||||
|
_contentDefinitionManager = contentDefinitionManager;
|
||||||
|
_contentDefinitionEventHandlers = contentDefinitonEventHandlers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string Name {
|
||||||
|
get { return "RemoveFromContentType"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override LocalizedString DisplayName {
|
||||||
|
get { return T("Remove From Content Type"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
public override LocalizedString Description {
|
||||||
|
get { return T("Removes a list of parts and fields from a content type."); }
|
||||||
|
}
|
||||||
|
|
||||||
|
// <RemoveFromContentType>
|
||||||
|
// <Blog>
|
||||||
|
// <Parts>
|
||||||
|
// </Parts>
|
||||||
|
// <Fields>
|
||||||
|
// </Fields>
|
||||||
|
// </Blog>
|
||||||
|
// </RemoveFromContentType>
|
||||||
|
public override void Execute(RecipeExecutionContext context) {
|
||||||
|
foreach (var metadataElementType in context.RecipeStep.Step.Elements()) {
|
||||||
|
Logger.Debug("Processing element '{0}'.", metadataElementType.Name.LocalName);
|
||||||
|
var typeName = XmlConvert.DecodeName(metadataElementType.Name.LocalName);
|
||||||
|
|
||||||
|
foreach (var metadataElement in metadataElementType.Elements()) {
|
||||||
|
switch (metadataElement.Name.LocalName) {
|
||||||
|
case "Parts":
|
||||||
|
foreach (var element in metadataElement.Elements()) {
|
||||||
|
var partName = XmlConvert.DecodeName(element.Name.LocalName);
|
||||||
|
|
||||||
|
Logger.Information("Removing content part '{0}' from content type '{1}'.", partName, typeName);
|
||||||
|
try {
|
||||||
|
_contentDefinitionManager.AlterTypeDefinition(typeName, typeBuilder => typeBuilder.RemovePart(partName));
|
||||||
|
_contentDefinitionEventHandlers.ContentPartDetached(new ContentPartDetachedContext { ContentTypeName = typeName, ContentPartName = partName });
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Logger.Error(ex, "Error while removing content part '{0}' from content type'{1}'.", partName, typeName);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "Fields":
|
||||||
|
foreach (var element in metadataElement.Elements()) {
|
||||||
|
var fieldName = XmlConvert.DecodeName(element.Name.LocalName);
|
||||||
|
|
||||||
|
Logger.Information("Removing content field '{0}' from content type '{1}'.", fieldName, typeName);
|
||||||
|
try {
|
||||||
|
_contentDefinitionManager.AlterPartDefinition(typeName, typeBuilder => typeBuilder.RemoveField(fieldName));
|
||||||
|
_contentDefinitionEventHandlers.ContentFieldDetached(new ContentFieldDetachedContext { ContentPartName = typeName, ContentFieldName = fieldName });
|
||||||
|
}
|
||||||
|
catch (Exception ex) {
|
||||||
|
Logger.Error(ex, "Error while removing content field '{0}' from content type'{1}'.", fieldName, typeName);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Logger.Warning("Unrecognized element '{0}' encountered; skipping",
|
||||||
|
metadataElement.Name.LocalName);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -29,7 +29,7 @@
|
|||||||
<br />
|
<br />
|
||||||
<div>
|
<div>
|
||||||
<h4>@recipe.Name - @Html.ActionLink(T("Execute").Text, "Recipes", "Admin", new { area = "Orchard.Recipes", moduleId = descriptor.Id, name = recipe.Name }, new { itemprop = "UnsafeUrl" })</h4>
|
<h4>@recipe.Name - @Html.ActionLink(T("Execute").Text, "Recipes", "Admin", new { area = "Orchard.Recipes", moduleId = descriptor.Id, name = recipe.Name }, new { itemprop = "UnsafeUrl" })</h4>
|
||||||
<p>@recipe.Description</p>
|
<p style="white-space: pre-line;">@recipe.Description</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -3,12 +3,24 @@ using Orchard.Data;
|
|||||||
using Orchard.ContentManagement.Handlers;
|
using Orchard.ContentManagement.Handlers;
|
||||||
using Orchard.Localization;
|
using Orchard.Localization;
|
||||||
using Orchard.SecureSocketsLayer.Models;
|
using Orchard.SecureSocketsLayer.Models;
|
||||||
|
using Orchard.Caching;
|
||||||
|
|
||||||
namespace Orchard.SecureSocketsLayer.Handlers {
|
namespace Orchard.SecureSocketsLayer.Handlers {
|
||||||
public class SslSettingsPartHandler : ContentHandler {
|
public class SslSettingsPartHandler : ContentHandler {
|
||||||
public SslSettingsPartHandler() {
|
private readonly ISignals _signals;
|
||||||
|
|
||||||
|
public SslSettingsPartHandler(ISignals signals) {
|
||||||
|
|
||||||
|
_signals = signals;
|
||||||
|
|
||||||
T = NullLocalizer.Instance;
|
T = NullLocalizer.Instance;
|
||||||
|
|
||||||
Filters.Add(new ActivatingFilter<SslSettingsPart>("Site"));
|
Filters.Add(new ActivatingFilter<SslSettingsPart>("Site"));
|
||||||
|
|
||||||
|
// Evict cached content when updated, removed or destroyed.
|
||||||
|
OnPublished<SslSettingsPart>((context, part) => Invalidate(part));
|
||||||
|
OnRemoved<SslSettingsPart>((context, part) => Invalidate(part));
|
||||||
|
OnDestroyed<SslSettingsPart>((context, part) => Invalidate(part));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Localizer T { get; set; }
|
public Localizer T { get; set; }
|
||||||
@ -22,5 +34,10 @@ namespace Orchard.SecureSocketsLayer.Handlers {
|
|||||||
Position = "2"
|
Position = "2"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Invalidate(SslSettingsPart content) {
|
||||||
|
_signals.Trigger($"SslSettingsPart_{content.Id}");
|
||||||
|
_signals.Trigger("SslSettingsPart_EvictAll");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Orchard.Caching;
|
||||||
using Orchard.ContentManagement;
|
using Orchard.ContentManagement;
|
||||||
using Orchard.Logging;
|
using Orchard.Logging;
|
||||||
using Orchard.Owin;
|
using Orchard.Owin;
|
||||||
@ -8,11 +9,19 @@ using Owin;
|
|||||||
namespace Orchard.SecureSocketsLayer.Services {
|
namespace Orchard.SecureSocketsLayer.Services {
|
||||||
public class StrictTransportSecurityMiddlewareProvider : IOwinMiddlewareProvider {
|
public class StrictTransportSecurityMiddlewareProvider : IOwinMiddlewareProvider {
|
||||||
private readonly IWorkContextAccessor _wca;
|
private readonly IWorkContextAccessor _wca;
|
||||||
|
private readonly ICacheManager _cacheManager;
|
||||||
|
private readonly ISignals _signals;
|
||||||
|
|
||||||
public ILogger Logger { get; set; }
|
public ILogger Logger { get; set; }
|
||||||
|
|
||||||
public StrictTransportSecurityMiddlewareProvider(IWorkContextAccessor wca) {
|
public StrictTransportSecurityMiddlewareProvider(
|
||||||
|
IWorkContextAccessor wca,
|
||||||
|
ICacheManager cacheManager,
|
||||||
|
ISignals signals) {
|
||||||
|
|
||||||
_wca = wca;
|
_wca = wca;
|
||||||
|
_cacheManager = cacheManager;
|
||||||
|
_signals = signals;
|
||||||
|
|
||||||
Logger = NullLogger.Instance;
|
Logger = NullLogger.Instance;
|
||||||
}
|
}
|
||||||
@ -22,7 +31,13 @@ namespace Orchard.SecureSocketsLayer.Services {
|
|||||||
new OwinMiddlewareRegistration {
|
new OwinMiddlewareRegistration {
|
||||||
Configure = app =>
|
Configure = app =>
|
||||||
app.Use(async (context, next) => {
|
app.Use(async (context, next) => {
|
||||||
var sslSettings = _wca.GetContext().CurrentSite.As<SslSettingsPart>();
|
var cacheKey = "Orchard.SecureSocketsLayer.Services.StrictTransportSecurityMiddlewareProvider.GetOwinMiddlewares";
|
||||||
|
var sslSettings = _cacheManager.Get(cacheKey, true, ctx =>{
|
||||||
|
// check whether the cache should be invalidated
|
||||||
|
ctx.Monitor(_signals.When("SslSettingsPart_EvictAll"));
|
||||||
|
// cache this and save recomputing it each call
|
||||||
|
return _wca.GetContext().CurrentSite.As<SslSettingsPart>();
|
||||||
|
});
|
||||||
|
|
||||||
if (sslSettings.SendStrictTransportSecurityHeaders) {
|
if (sslSettings.SendStrictTransportSecurityHeaders) {
|
||||||
string responseValue = "max-age=" + sslSettings.StrictTransportSecurityMaxAge;
|
string responseValue = "max-age=" + sslSettings.StrictTransportSecurityMaxAge;
|
||||||
|
@ -56,6 +56,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if (!taxonomyEntry.IsInternal) {
|
@if (!taxonomyEntry.IsInternal) {
|
||||||
|
@Html.ItemDisplayLink(T("View").Text, taxonomyEntry.ContentItem) <text>|</text>
|
||||||
if (Authorizer.Authorize(Permissions.CreateTaxonomy)) {
|
if (Authorizer.Authorize(Permissions.CreateTaxonomy)) {
|
||||||
@Html.ItemEditLink(T("Edit").Text, taxonomyEntry.ContentItem, new { ReturnUrl = Request.RawUrl }) <text>|</text>
|
@Html.ItemEditLink(T("Edit").Text, taxonomyEntry.ContentItem, new { ReturnUrl = Request.RawUrl }) <text>|</text>
|
||||||
}
|
}
|
||||||
|
@ -41,14 +41,20 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" value="@Model.Terms[termIndex].Id" name="@Html.NameOf(m => m.Terms[ti].Id)" />
|
<input type="hidden" value="@Model.Terms[termIndex].Id" name="@Html.NameOf(m => m.Terms[ti].Id)" />
|
||||||
@* Tabs for levels *@ @for (var i = 1; i <= termEntry.GetLevels(); i++) { <span class="gap"> </span> }
|
@* Tabs for levels *@ @for (var i = 1; i <= termEntry.GetLevels(); i++) {<span class="gap"> </span>}
|
||||||
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Terms[ti].IsChecked)" />
|
<input type="checkbox" value="true" name="@Html.NameOf(m => m.Terms[ti].IsChecked)" />
|
||||||
@Html.ItemDisplayLink(termEntry.Name, termEntry.ContentItem)
|
@if (Authorizer.Authorize(Permissions.EditTerm)) {
|
||||||
@if (termEntry.HasDraft) {
|
@Html.ItemEditLink(termEntry.Name, termEntry.ContentItem, new { returnUrl = Url.Action("Index", "TermAdmin", new { taxonomyId = Model.Taxonomy.Id }) })
|
||||||
<text>@T(" (Draft)")</text>
|
}
|
||||||
|
else {
|
||||||
|
@Html.ItemDisplayText(termEntry.ContentItem)
|
||||||
|
@if (termEntry.HasDraft) {
|
||||||
|
<text>@T(" (Draft)")</text>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@Html.ItemDisplayLink(T("View").Text, termEntry.ContentItem) <text>|</text>
|
||||||
@if (Authorizer.Authorize(Permissions.EditTerm)) {
|
@if (Authorizer.Authorize(Permissions.EditTerm)) {
|
||||||
@Html.ItemEditLink(T("Edit").Text, termEntry.ContentItem, new { returnUrl = Url.Action("Index", "TermAdmin", new { taxonomyId = Model.Taxonomy.Id }) }) <text>|</text>
|
@Html.ItemEditLink(T("Edit").Text, termEntry.ContentItem, new { returnUrl = Url.Action("Index", "TermAdmin", new { taxonomyId = Model.Taxonomy.Id }) }) <text>|</text>
|
||||||
@Html.ActionLink(T("Move").ToString(), "MoveTerm", new { taxonomyId = Model.Taxonomy.Id, termIds = termEntry.Id })
|
@Html.ActionLink(T("Move").ToString(), "MoveTerm", new { taxonomyId = Model.Taxonomy.Id, termIds = termEntry.Id })
|
||||||
|
@ -269,6 +269,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
..\.deployment = ..\.deployment
|
..\.deployment = ..\.deployment
|
||||||
.editorconfig = .editorconfig
|
.editorconfig = .editorconfig
|
||||||
..\deploy.ps1 = ..\deploy.ps1
|
..\deploy.ps1 = ..\deploy.ps1
|
||||||
|
NuGet.config = NuGet.config
|
||||||
..\DeploymentUtility.psm1 = ..\DeploymentUtility.psm1
|
..\DeploymentUtility.psm1 = ..\DeploymentUtility.psm1
|
||||||
Rebracer.xml = Rebracer.xml
|
Rebracer.xml = Rebracer.xml
|
||||||
WebEssentials-Settings.json = WebEssentials-Settings.json
|
WebEssentials-Settings.json = WebEssentials-Settings.json
|
||||||
|
@ -1,22 +1,36 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
using Orchard.Caching;
|
||||||
|
|
||||||
namespace Orchard.Localization.Services {
|
namespace Orchard.Localization.Services {
|
||||||
public class SiteCultureSelector : ICultureSelector {
|
public class SiteCultureSelector : ICultureSelector {
|
||||||
private readonly IWorkContextAccessor _workContextAccessor;
|
private readonly IWorkContextAccessor _workContextAccessor;
|
||||||
|
private readonly ICacheManager _cacheManager;
|
||||||
|
private readonly ISignals _signals;
|
||||||
|
|
||||||
|
public SiteCultureSelector(
|
||||||
|
IWorkContextAccessor workContextAccessor,
|
||||||
|
ICacheManager cacheManager,
|
||||||
|
ISignals signals) {
|
||||||
|
|
||||||
public SiteCultureSelector(IWorkContextAccessor workContextAccessor) {
|
|
||||||
_workContextAccessor = workContextAccessor;
|
_workContextAccessor = workContextAccessor;
|
||||||
|
_cacheManager = cacheManager;
|
||||||
|
_signals = signals;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CultureSelectorResult GetCulture(HttpContextBase context) {
|
public CultureSelectorResult GetCulture(HttpContextBase context) {
|
||||||
string currentCultureName = _workContextAccessor.GetContext().CurrentSite.SiteCulture;
|
var cacheKey = "Orchard.Localization.Services.SiteCultureSelector.GetCulture";
|
||||||
|
return _cacheManager.Get(cacheKey, true, ctx => {
|
||||||
|
// this is the same signal used in Orchard.Framework.DefaultCultureManager
|
||||||
|
ctx.Monitor(_signals.When("culturesChanged"));
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(currentCultureName)) {
|
string currentCultureName = _workContextAccessor.GetContext().CurrentSite.SiteCulture;
|
||||||
return null;
|
if (String.IsNullOrEmpty(currentCultureName)) {
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
return new CultureSelectorResult { Priority = -5, CultureName = currentCultureName };
|
return new CultureSelectorResult { Priority = -5, CultureName = currentCultureName };
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
NonNullOrEmpty(linkText, metadata.DisplayText, "view"),
|
NonNullOrEmpty(linkText, metadata.DisplayText, "view"),
|
||||||
Convert.ToString(metadata.DisplayRouteValues["action"]),
|
Convert.ToString(metadata.DisplayRouteValues["action"]),
|
||||||
metadata.DisplayRouteValues,
|
metadata.DisplayRouteValues,
|
||||||
new RouteValueDictionary(htmlAttributes));
|
HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ItemDisplayUrl(this UrlHelper urlHelper, IContent content) {
|
public static string ItemDisplayUrl(this UrlHelper urlHelper, IContent content) {
|
||||||
@ -111,7 +111,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
NonNullOrEmpty(linkText, metadata.DisplayText, content.ContentItem.TypeDefinition.DisplayName),
|
NonNullOrEmpty(linkText, metadata.DisplayText, content.ContentItem.TypeDefinition.DisplayName),
|
||||||
Convert.ToString(metadata.EditorRouteValues["action"]),
|
Convert.ToString(metadata.EditorRouteValues["action"]),
|
||||||
metadata.EditorRouteValues.Merge(additionalRouteValues),
|
metadata.EditorRouteValues.Merge(additionalRouteValues),
|
||||||
new RouteValueDictionary(htmlAttributes));
|
HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MvcHtmlString ItemAdminLink(this HtmlHelper html, IContent content) {
|
public static MvcHtmlString ItemAdminLink(this HtmlHelper html, IContent content) {
|
||||||
|
@ -52,7 +52,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MvcHtmlString SelectOption<T>(this HtmlHelper html, T currentValue, T optionValue, string text, object htmlAttributes) {
|
public static MvcHtmlString SelectOption<T>(this HtmlHelper html, T currentValue, T optionValue, string text, object htmlAttributes) {
|
||||||
return SelectOption(html, optionValue, object.Equals(optionValue, currentValue), text, new RouteValueDictionary(htmlAttributes));
|
return SelectOption(html, optionValue, object.Equals(optionValue, currentValue), text, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MvcHtmlString SelectOption<T>(this HtmlHelper html, T currentValue, T optionValue, string text, RouteValueDictionary htmlAttributes) {
|
public static MvcHtmlString SelectOption<T>(this HtmlHelper html, T currentValue, T optionValue, string text, RouteValueDictionary htmlAttributes) {
|
||||||
@ -64,7 +64,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static MvcHtmlString SelectOption(this HtmlHelper html, object optionValue, bool selected, string text, object htmlAttributes) {
|
public static MvcHtmlString SelectOption(this HtmlHelper html, object optionValue, bool selected, string text, object htmlAttributes) {
|
||||||
return SelectOption(html, optionValue, selected, text, new RouteValueDictionary(htmlAttributes));
|
return SelectOption(html, optionValue, selected, text, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MvcHtmlString SelectOption(this HtmlHelper html, object optionValue, bool selected, string text, RouteValueDictionary htmlAttributes) {
|
public static MvcHtmlString SelectOption(this HtmlHelper html, object optionValue, bool selected, string text, RouteValueDictionary htmlAttributes) {
|
||||||
@ -203,7 +203,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
#region Image
|
#region Image
|
||||||
|
|
||||||
public static MvcHtmlString Image(this HtmlHelper htmlHelper, string src, string alt, object htmlAttributes) {
|
public static MvcHtmlString Image(this HtmlHelper htmlHelper, string src, string alt, object htmlAttributes) {
|
||||||
return htmlHelper.Image(src, alt, new RouteValueDictionary(htmlAttributes));
|
return htmlHelper.Image(src, alt, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MvcHtmlString Image(this HtmlHelper htmlHelper, string src, string alt, IDictionary<string, object> htmlAttributes) {
|
public static MvcHtmlString Image(this HtmlHelper htmlHelper, string src, string alt, IDictionary<string, object> htmlAttributes) {
|
||||||
@ -238,7 +238,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString Link(this HtmlHelper htmlHelper, string linkContents, string href, object htmlAttributes) {
|
public static IHtmlString Link(this HtmlHelper htmlHelper, string linkContents, string href, object htmlAttributes) {
|
||||||
return htmlHelper.Link(linkContents, href, new RouteValueDictionary(htmlAttributes));
|
return htmlHelper.Link(linkContents, href, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString Link(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes) {
|
public static IHtmlString Link(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes) {
|
||||||
@ -264,7 +264,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString LinkOrDefault(this HtmlHelper htmlHelper, string linkContents, string href, object htmlAttributes) {
|
public static IHtmlString LinkOrDefault(this HtmlHelper htmlHelper, string linkContents, string href, object htmlAttributes) {
|
||||||
return htmlHelper.LinkOrDefault(linkContents, href, new RouteValueDictionary(htmlAttributes));
|
return htmlHelper.LinkOrDefault(linkContents, href, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString LinkOrDefault(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes) {
|
public static IHtmlString LinkOrDefault(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes) {
|
||||||
@ -290,7 +290,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString Hint(this HtmlHelper htmlHelper, LocalizedString text, object htmlAttributes) {
|
public static IHtmlString Hint(this HtmlHelper htmlHelper, LocalizedString text, object htmlAttributes) {
|
||||||
return Hint(htmlHelper, text, htmlAttributes != null ? new RouteValueDictionary(htmlAttributes) : null);
|
return Hint(htmlHelper, text, htmlAttributes != null ? HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes) : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString Hint(this HtmlHelper htmlHelper, LocalizedString text, IDictionary<string, object> htmlAttributes) {
|
public static IHtmlString Hint(this HtmlHelper htmlHelper, LocalizedString text, IDictionary<string, object> htmlAttributes) {
|
||||||
@ -392,7 +392,7 @@ namespace Orchard.Mvc.Html {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString AntiForgeryTokenValueOrchardLink(this HtmlHelper htmlHelper, string linkContents, string href, object htmlAttributes) {
|
public static IHtmlString AntiForgeryTokenValueOrchardLink(this HtmlHelper htmlHelper, string linkContents, string href, object htmlAttributes) {
|
||||||
return htmlHelper.AntiForgeryTokenValueOrchardLink(linkContents, href, new RouteValueDictionary(htmlAttributes));
|
return htmlHelper.AntiForgeryTokenValueOrchardLink(linkContents, href, HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IHtmlString AntiForgeryTokenValueOrchardLink(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes) {
|
public static IHtmlString AntiForgeryTokenValueOrchardLink(this HtmlHelper htmlHelper, string linkContents, string href, IDictionary<string, object> htmlAttributes) {
|
||||||
|
Loading…
Reference in New Issue
Block a user