mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -293,8 +293,14 @@
|
||||
<Content Include="Settings\Styles\admin.css" />
|
||||
<Content Include="Settings\Views\Admin\Index.cshtml" />
|
||||
<Content Include="Settings\Views\Admin\Culture.cshtml" />
|
||||
<Content Include="Settings\Views\DisplayTemplates\CurrentCulture.ascx" />
|
||||
<Content Include="Settings\Views\DisplayTemplates\RemovableCulture.ascx" />
|
||||
<None Include="Routable\Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Settings\Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Settings\Views\DisplayTemplates\CurrentCulture.cshtml" />
|
||||
<None Include="Settings\Views\DisplayTemplates\RemovableCulture.cshtml" />
|
||||
<Content Include="Shapes\Module.txt" />
|
||||
<Content Include="Shapes\Scripts\base.js" />
|
||||
<Content Include="Shapes\Scripts\html5.js" />
|
||||
|
@@ -44,7 +44,8 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
}
|
||||
|
||||
protected override DriverResult Display(RoutePart part, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_RoutableTitle", "Header:5", () => shapeHelper.Parts_RoutableTitle(ContentPart: part, Title: part.Title, Path: part.Path));
|
||||
return ContentShape("Parts_RoutableTitle",
|
||||
() => shapeHelper.Parts_RoutableTitle(ContentPart: part, Title: part.Title, Path: part.Path));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(RoutePart part, dynamic shapeHelper) {
|
||||
@@ -69,10 +70,9 @@ namespace Orchard.Core.Routable.Drivers {
|
||||
: "";
|
||||
}
|
||||
|
||||
// TODO: andrerod convert to new shape API. Location code kept for reference.
|
||||
//var location = part.GetLocation("Editor");
|
||||
model.PromoteToHomePage = model.Id != 0 && part.Path != null && _routableHomePageProvider != null && CurrentSite.HomePage == _routableHomePageProvider.GetSettingValue(model.Id);
|
||||
return ContentPartTemplate(model, TemplateName, Prefix); //.Location(location);
|
||||
return ContentShape("Parts_Routable_Edit",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(RoutePart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
|
4
src/Orchard.Web/Core/Routable/Placement.info
Normal file
4
src/Orchard.Web/Core/Routable/Placement.info
Normal file
@@ -0,0 +1,4 @@
|
||||
<Placement>
|
||||
<Place Parts_RoutableTitle="Header:5"/>
|
||||
<Place Parts_Routable_Edit="Primary:before.5"/>
|
||||
</Placement>
|
@@ -9,8 +9,10 @@
|
||||
<fieldset class="permalink">
|
||||
<label class="sub" for="Slug">@T("Permalink")<br /><span>@Request.ToRootUrlString()/@Model.DisplayLeadingPath</span></label>
|
||||
<span>@Html.TextBoxFor(m => m.Slug, new { @class = "text" })</span>
|
||||
@Html.EditorFor(m => m.PromoteToHomePage)
|
||||
<label for="@ViewData.TemplateInfo.GetFullHtmlFieldId("PromoteToHomePage")" class="forcheckbox">@T("Set as home page")</label>
|
||||
<span class="checkbox-and-label">
|
||||
@Html.EditorFor(m => m.PromoteToHomePage)
|
||||
<label for="@ViewData.TemplateInfo.GetFullHtmlFieldId("PromoteToHomePage")" class="forcheckbox">@T("Set as home page")</label>
|
||||
</span>
|
||||
</fieldset>
|
||||
@using(Script.Foot()){
|
||||
<script type="text/javascript">
|
||||
|
@@ -27,17 +27,18 @@ namespace Orchard.Core.Settings.Drivers {
|
||||
SiteCultures = _cultureManager.ListCultures()
|
||||
};
|
||||
|
||||
return ContentPartTemplate(model, "Parts/Settings.SiteSettingsPart");
|
||||
return ContentShape("Parts_Settings_SiteSettingsPart",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Settings.SiteSettingsPart", Model: model));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(SiteSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
var site = _siteService.GetSiteSettings().As<SiteSettingsPart>();
|
||||
var model = new SiteSettingsPartViewModel { Site = site };
|
||||
|
||||
if (updater.TryUpdateModel(model, Prefix, null, null)) {
|
||||
}
|
||||
updater.TryUpdateModel(model, Prefix, null, null);
|
||||
|
||||
return ContentPartTemplate(model, "Parts/Settings.SiteSettingsPart");
|
||||
return ContentShape("Parts_Settings_SiteSettingsPart",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts/Settings.SiteSettingsPart", Model: model));
|
||||
}
|
||||
}
|
||||
}
|
3
src/Orchard.Web/Core/Settings/Placement.info
Normal file
3
src/Orchard.Web/Core/Settings/Placement.info
Normal file
@@ -0,0 +1,3 @@
|
||||
<Placement>
|
||||
<Place Parts_Settings_SiteSettingsPart="Primary:1"/>
|
||||
</Placement>
|
@@ -8,7 +8,7 @@
|
||||
<fieldset class="addCulture">
|
||||
<label for="CultureName">@T("Add a culture...")</label>
|
||||
@Html.DropDownList("SystemCultureName", new SelectList(Model.AvailableSystemCultures.OrderBy(s => s), Model.CurrentCulture))
|
||||
@T("Other"): @Html.TextBox("CultureName")
|
||||
@T("Other"): @Html.TextBox("CultureName")
|
||||
<button class="primaryAction" type="submit">@T("Add")</button>
|
||||
</fieldset>
|
||||
}
|
||||
|
@@ -1,2 +0,0 @@
|
||||
<%@ Control Language="C#" Inherits="Orchard.Mvc.ViewUserControl<string>" %>
|
||||
<strong><%:Model %></strong>
|
@@ -0,0 +1 @@
|
||||
<strong>@Model</strong>
|
@@ -1,6 +0,0 @@
|
||||
<%@ 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" class="remove" title="<%:T("Delete") %>">x</button>
|
||||
<% } %>
|
@@ -0,0 +1,7 @@
|
||||
<div>
|
||||
@Model
|
||||
@using (Html.BeginFormAntiForgeryPost(Url.Action("DeleteCulture", "Admin", new { area = "Settings" }), FormMethod.Post, new {@class = "inline link"})) {
|
||||
@Html.Hidden("cultureName", (string)Model, new { id = "" })
|
||||
<button type="submit" class="remove" title="@T("Delete")">x</button>
|
||||
}
|
||||
</div>
|
@@ -1,11 +1,11 @@
|
||||
@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel
|
||||
@using Orchard.Settings;
|
||||
@{
|
||||
var resourceDebugMode = new SelectList(new object[] {
|
||||
new { Id = (int)ResourceDebugMode.FromAppSetting, Text = "Use web.config setting" },
|
||||
new { Id = (int)ResourceDebugMode.Enabled, Text = "Enabled" },
|
||||
new { Id = (int)ResourceDebugMode.Disabled, Text = "Disabled" },
|
||||
}, "Id", "Text", (int)Model.ResourceDebugMode);
|
||||
var resourceDebugMode = new SelectList(new object[] {
|
||||
new { Id = (int)ResourceDebugMode.FromAppSetting, Text = "Use web.config setting" },
|
||||
new { Id = (int)ResourceDebugMode.Enabled, Text = "Enabled" },
|
||||
new { Id = (int)ResourceDebugMode.Disabled, Text = "Disabled" },
|
||||
}, "Id", "Text", (int)Model.ResourceDebugMode);
|
||||
}
|
||||
<fieldset>
|
||||
<legend>@T("Global Settings")</legend>
|
||||
@@ -30,9 +30,9 @@
|
||||
@Html.EditorFor(x=>x.SuperUser)
|
||||
@Html.ValidationMessage("SuperUser", "*")
|
||||
</div>
|
||||
<div>
|
||||
<label for="SiteDebugMode">@T("Resource Debug Mode")</label>
|
||||
@Html.DropDownList("ResourceDebugMode", resourceDebugMode)
|
||||
<p>@T("Determines whether scripts and stylesheets load in their debuggable or minified form.")</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div>
|
||||
<label for="SiteDebugMode">@T("Resource Debug Mode")</label>
|
||||
@Html.DropDownList("ResourceDebugMode", resourceDebugMode)
|
||||
<p>@T("Determines whether scripts and stylesheets load in their debuggable or minified form.")</p>
|
||||
</div>
|
||||
</fieldset>
|
@@ -1,24 +1,19 @@
|
||||
using System;
|
||||
using Orchard;
|
||||
using Orchard.ArchiveLater.Models;
|
||||
using Orchard.ArchiveLater.Services;
|
||||
using Orchard.ArchiveLater.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Core.Common.Services;
|
||||
using Orchard.Localization;
|
||||
|
||||
namespace ArchiveLater.Drivers {
|
||||
namespace Orchard.ArchiveLater.Drivers {
|
||||
public class ArchiveLaterPartDriver : ContentPartDriver<ArchiveLaterPart> {
|
||||
private const string TemplatePrefix = "ArchiveLater";
|
||||
private readonly ICommonService _commonService;
|
||||
private const string TemplateName = "Parts/ArchiveLater";
|
||||
private readonly IArchiveLaterService _archiveLaterService;
|
||||
|
||||
public ArchiveLaterPartDriver(
|
||||
IOrchardServices services,
|
||||
ICommonService commonService,
|
||||
IArchiveLaterService archiveLaterService) {
|
||||
_commonService = commonService;
|
||||
_archiveLaterService = archiveLaterService;
|
||||
T = NullLocalizer.Instance;
|
||||
Services = services;
|
||||
@@ -27,6 +22,8 @@ namespace ArchiveLater.Drivers {
|
||||
public Localizer T { get; set; }
|
||||
public IOrchardServices Services { get; set; }
|
||||
|
||||
protected override string Prefix { get { return "ArchiveLater"; } }
|
||||
|
||||
protected override DriverResult Display(ArchiveLaterPart part, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_ArchiveLater_Metadata_SummaryAdmin",
|
||||
shape => {
|
||||
@@ -40,20 +37,24 @@ namespace ArchiveLater.Drivers {
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ArchiveLaterPart part, dynamic shapeHelper) {
|
||||
return ArchiveEditor(part, null, shapeHelper);
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ArchiveLaterPart instance, IUpdateModel updater, dynamic shapeHelper) {
|
||||
return ArchiveEditor(instance, updater, shapeHelper);
|
||||
}
|
||||
|
||||
DriverResult ArchiveEditor(ArchiveLaterPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
var model = new ArchiveLaterViewModel(part);
|
||||
|
||||
if ( updater != null && updater.TryUpdateModel(model, TemplatePrefix, null, null) ) {
|
||||
if (model.ArchiveLater) {
|
||||
model.ScheduledArchiveUtc = part.ScheduledArchiveUtc.Value;
|
||||
model.ArchiveLater = model.ScheduledArchiveUtc.HasValue;
|
||||
model.ScheduledArchiveDate = model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value.ToLocalTime().ToShortDateString() : String.Empty;
|
||||
model.ScheduledArchiveTime = model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value.ToLocalTime().ToShortTimeString() : String.Empty;
|
||||
|
||||
return ContentShape("Parts_ArchiveLater_Edit",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(ArchiveLaterPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
var model = new ArchiveLaterViewModel(part);
|
||||
|
||||
if (updater.TryUpdateModel(model, Prefix, null, null) ) {
|
||||
if ( model.ArchiveLater ) {
|
||||
DateTime scheduled;
|
||||
if (DateTime.TryParse(string.Format("{0} {1}", model.ScheduledArchiveDate, model.ScheduledArchiveTime), out scheduled))
|
||||
if ( DateTime.TryParse(string.Format("{0} {1}", model.ScheduledArchiveDate, model.ScheduledArchiveTime), out scheduled) )
|
||||
model.ScheduledArchiveUtc = scheduled.ToUniversalTime();
|
||||
_archiveLaterService.ArchiveLater(model.ContentItem, model.ScheduledArchiveUtc.HasValue ? model.ScheduledArchiveUtc.Value : DateTime.MaxValue);
|
||||
}
|
||||
@@ -63,7 +64,7 @@ namespace ArchiveLater.Drivers {
|
||||
}
|
||||
|
||||
return ContentShape("Parts_ArchiveLater_Edit",
|
||||
() => shapeHelper.EditorTemplate(TemplateName: "Parts/ArchiveLater", Model: model, Prefix: Prefix));
|
||||
() => shapeHelper.EditorTemplate(TemplateName: TemplateName, Model: model, Prefix: Prefix));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -9,4 +9,4 @@ Features:
|
||||
Orchard.ArchiveLater:
|
||||
Description: Scheduled archiving.
|
||||
Category: Content
|
||||
Dependencies: Common, Settings
|
||||
Dependencies: Common, Settings, Orchard.jQuery
|
||||
|
@@ -21,7 +21,10 @@
|
||||
@Html.EditorFor(m => m.ScheduledArchiveTime)
|
||||
</div>
|
||||
</fieldset>
|
||||
<script type="text/javascript"> $(function () {
|
||||
@using(Script.Foot()) {
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
$(function () {
|
||||
//todo: (heskew) make a plugin
|
||||
$("label.forpicker").each(function () {
|
||||
var $this = $(this);
|
||||
@@ -34,6 +37,9 @@
|
||||
.blur(function () { var $this = $(this); setTimeout(function () { if (!$this.val()) { $this.addClass("hinted").val($this.data("hint")) } }, 300) });
|
||||
}
|
||||
});
|
||||
$(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveDate"))).datepicker({ showAnim: "" }).focus(function () { $(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater"))).attr("checked", "checked") });
|
||||
$(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveTime"))).timepickr().focus(function () { $(@string.Format("\"#{0}\"", ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater"))).attr("checked", "checked") });
|
||||
})</script>
|
||||
$('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveDate")').datepicker({ showAnim: "" }).focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater")').attr("checked", "checked") });
|
||||
$('#@ViewData.TemplateInfo.GetFullHtmlFieldId("ScheduledArchiveTime")').timepickr().focus(function () { $('#@ViewData.TemplateInfo.GetFullHtmlFieldId("Command_ArchiveLater")').attr("checked", "checked") });
|
||||
})
|
||||
//]]>
|
||||
</script>
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Blogs.Models;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Environment.Extensions;
|
||||
|
||||
namespace Orchard.Blogs.Drivers {
|
||||
[UsedImplicitly]
|
||||
[OrchardFeature("Orchard.Blogs.RemotePublishing")]
|
||||
public class RemoteBlogPublishingDriver : ContentPartDriver<BlogPart> {
|
||||
protected override DriverResult Display(BlogPart part, string displayType, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_Blogs_RemotePublishing", shape => shape.Slug(part.Slug));
|
||||
}
|
||||
}
|
||||
}
|
@@ -69,6 +69,7 @@
|
||||
<Compile Include="AdminMenu.cs" />
|
||||
<Compile Include="Drivers\BlogArchivesPartDriver.cs" />
|
||||
<Compile Include="Drivers\BlogPagerPartDriver.cs" />
|
||||
<Compile Include="Drivers\RemoteBlogPublishingDriver.cs" />
|
||||
<Compile Include="Drivers\RecentBlogPostsPartDriver.cs" />
|
||||
<Compile Include="Handlers\BlogArchivesPartHandler.cs" />
|
||||
<Compile Include="Handlers\RecentBlogPostsPartHandler.cs" />
|
||||
@@ -108,7 +109,6 @@
|
||||
<Compile Include="Services\IBlogPostService.cs" />
|
||||
<Compile Include="Services\IBlogService.cs" />
|
||||
<Compile Include="Services\XmlRpcHandler.cs" />
|
||||
<Compile Include="RemoteBlogPublishingShapes.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Content\Admin\images\draft.gif" />
|
||||
@@ -156,7 +156,7 @@
|
||||
<None Include="Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<Content Include="Views\RemoteBlogPublishing.cshtml" />
|
||||
<Content Include="Views\Parts\Blogs.RemotePublishing.cshtml" />
|
||||
<Content Include="Views\Parts\Blogs.BlogArchives.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Blogs.RecentBlogPosts.cshtml" />
|
||||
<Content Include="Views\EditorTemplates\Parts\Blogs.BlogArchives.cshtml" />
|
||||
|
@@ -20,8 +20,10 @@
|
||||
<Match ContentType="Blog">
|
||||
<Match DisplayType="Detail">
|
||||
<!-- blog posts currently added to the blog within the controller into Content:5 <Place Parts_Blogs_BlogPost_List="Content:5" />-->
|
||||
<!-- Parts_Blogs_RemotePublishing is made available with the "Remote Blog Publishing" feature -->
|
||||
<Place Parts_Blogs_Blog_Pager="Content:after"
|
||||
Parts_Blogs_Blog_Description="Content:before" />
|
||||
Parts_Blogs_Blog_Description="Content:before"
|
||||
Parts_Blogs_RemotePublishing="Content"/>
|
||||
</Match>
|
||||
<Match DisplayType="DetailAdmin">
|
||||
<Place Parts_Blogs_BlogPost_List_Admin="Content:5"
|
||||
|
@@ -1,16 +0,0 @@
|
||||
using Orchard.DisplayManagement.Descriptors;
|
||||
using Orchard.Environment.Extensions;
|
||||
|
||||
namespace Orchard.Blogs {
|
||||
[OrchardFeature("Remote Blog Publishing")]
|
||||
public class RemoteBlogPublishingShapes : IShapeTableProvider {
|
||||
public void Discover(ShapeTableBuilder builder) {
|
||||
builder.Describe("Content__Blog")
|
||||
.OnDisplaying(displaying => {
|
||||
if (displaying.ShapeMetadata.DisplayType == "Detail") {
|
||||
displaying.ShapeMetadata.Wrappers.Add("RemoteBlogPublishing");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@@ -19,7 +19,7 @@ using Orchard.Blogs.Extensions;
|
||||
|
||||
namespace Orchard.Blogs.Services {
|
||||
[UsedImplicitly]
|
||||
[OrchardFeature("Remote Blog Publishing")]
|
||||
[OrchardFeature("Orchard.Blogs.RemotePublishing")]
|
||||
public class XmlRpcHandler : IXmlRpcHandler {
|
||||
private readonly IBlogService _blogService;
|
||||
private readonly IBlogPostService _blogPostService;
|
||||
|
@@ -3,5 +3,4 @@
|
||||
@{
|
||||
RegisterLink(new LinkEntry { Rel = "wlwmanifest", Type = "application/wlwmanifest+xml", Href = Url.BlogLiveWriterManifest((string)Model.Slug) });
|
||||
RegisterLink(new LinkEntry { Rel = "EditURI", Type = "application/rsd+xml", Title = "RSD", Href = Url.BlogRsd((string)Model.Slug) });
|
||||
}
|
||||
@Display.PlaceChildContent(Source: Model)
|
||||
}
|
@@ -16,20 +16,7 @@ namespace Orchard.Experimental.ViewModels {
|
||||
|
||||
public IEnumerable<TemplateViewModel> Editors {
|
||||
get {
|
||||
#if REFACTORING
|
||||
return EditorModel.Zones
|
||||
.SelectMany(z => z.Value.Items
|
||||
.OfType<ContentPartEditorZoneItem>()
|
||||
.Select(x => new { ZoneName = z.Key, Item = x }))
|
||||
.Select(x => new TemplateViewModel(x.Item.Model, x.Item.Prefix) {
|
||||
Model = x.Item.Model,
|
||||
TemplateName = x.Item.TemplateName,
|
||||
WasUsed = x.Item.WasExecuted,
|
||||
ZoneName = x.ZoneName,
|
||||
});
|
||||
#else
|
||||
return new List<TemplateViewModel>();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<select id="sourceId" name="sourceId">
|
||||
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
||||
@foreach (var source in Model.Sources) {
|
||||
Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle);
|
||||
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
||||
}
|
||||
</select>
|
||||
<button type="submit">@T("Apply")</button>
|
||||
|
@@ -13,7 +13,7 @@
|
||||
<select id="sourceId" name="sourceId">
|
||||
@Html.SelectOption("", Model.SelectedSource == null, T("Any (show all feeds)").ToString())
|
||||
@foreach (var source in Model.Sources) {
|
||||
Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle);
|
||||
@Html.SelectOption(source.Id, Model.SelectedSource != null && Model.SelectedSource.Id == source.Id, source.FeedTitle)
|
||||
}
|
||||
</select>
|
||||
<button type="submit">@T("Apply")</button>
|
||||
|
@@ -71,7 +71,6 @@ namespace Orchard.Setup.Services {
|
||||
"Shapes",
|
||||
"PublishLater",
|
||||
"Contents",
|
||||
"ContentsLocation",
|
||||
"Dashboard",
|
||||
"Reports",
|
||||
"Feeds",
|
||||
|
@@ -1,87 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc.Html;
|
||||
using Orchard.Environment.Descriptor;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.Services;
|
||||
using Orchard.UI.Zones;
|
||||
|
||||
namespace Orchard.Themes.DesignerNotes {
|
||||
#if REFACTORING
|
||||
public class ZoneManagerEvents : IZoneManagerEvents {
|
||||
private readonly IThemeService _themeService;
|
||||
private readonly IAuthorizationService _authorizationService;
|
||||
private readonly IShellDescriptorManager _shellDescriptorManager;
|
||||
private readonly IEnumerable<IHtmlFilter> _htmlFilters;
|
||||
|
||||
public ZoneManagerEvents(IThemeService themeService,
|
||||
IAuthorizationService authorizationService,
|
||||
IShellDescriptorManager shellDescriptorManager,
|
||||
IEnumerable<IHtmlFilter> htmlFilters) {
|
||||
|
||||
_themeService = themeService;
|
||||
_authorizationService = authorizationService;
|
||||
_shellDescriptorManager = shellDescriptorManager;
|
||||
_htmlFilters = htmlFilters;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public virtual IUser CurrentUser { get; set; }
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public void ZoneRendering(ZoneRenderContext context) {
|
||||
if (context.RenderingItems.Any())
|
||||
return;
|
||||
|
||||
var requestContext = context.Html.ViewContext.RequestContext;
|
||||
var theme = _themeService.GetRequestTheme(requestContext);
|
||||
var virtualPath = "~/Themes/" + theme.ThemeName + "/Zones/" + context.ZoneName + ".html";
|
||||
var physicalPath = requestContext.HttpContext.Server.MapPath(virtualPath);
|
||||
if (!File.Exists(physicalPath))
|
||||
return;
|
||||
|
||||
var accessAdminPanel = _authorizationService.TryCheckAccess(
|
||||
StandardPermissions.AccessAdminPanel, CurrentUser, null);
|
||||
if (accessAdminPanel) {
|
||||
//Temporary: Don't show "edit" button if "Orchard.Widgets" is not enabled.
|
||||
accessAdminPanel = _shellDescriptorManager
|
||||
.GetShellDescriptor()
|
||||
.Features
|
||||
.Any(f => f.Name == "Orchard.Widgets");
|
||||
}
|
||||
|
||||
var writer = context.Html.ViewContext.Writer;
|
||||
if (accessAdminPanel) {
|
||||
writer.Write("<div class=\"managewrapper\"><div class=\"manage\">");
|
||||
writer.Write(context.Html.ActionLink(T("Edit").ToString(), "AddWidget", new {
|
||||
Area = "Orchard.Widgets",
|
||||
Controller = "Admin",
|
||||
context.ZoneName,
|
||||
theme.ThemeName,
|
||||
ReturnUrl = requestContext.HttpContext.Request.RawUrl,
|
||||
}));
|
||||
writer.Write("</div>");
|
||||
}
|
||||
|
||||
var fileText = _htmlFilters
|
||||
.Aggregate(File.ReadAllText(physicalPath), (text, filter) => filter.ProcessContent(text));
|
||||
|
||||
writer.Write(fileText);
|
||||
if (accessAdminPanel) {
|
||||
writer.Write("</div>");
|
||||
}
|
||||
}
|
||||
|
||||
public void ZoneItemRendering(ZoneRenderContext context, ZoneItem item) {
|
||||
}
|
||||
|
||||
public void ZoneItemRendered(ZoneRenderContext context, ZoneItem item) {
|
||||
}
|
||||
|
||||
public void ZoneRendered(ZoneRenderContext context) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
@@ -74,7 +74,6 @@
|
||||
<Compile Include="ResourceManifest.cs" />
|
||||
<Compile Include="Controllers\AdminController.cs" />
|
||||
<Compile Include="Migrations.cs" />
|
||||
<Compile Include="DesignerNotes\ZoneManagerEvents.cs" />
|
||||
<Compile Include="Handlers\ThemeSiteSettingsPartHandler.cs" />
|
||||
<Compile Include="Models\Theme.cs" />
|
||||
<Compile Include="Models\ThemeSiteSettingsPart.cs" />
|
||||
@@ -88,7 +87,6 @@
|
||||
<Compile Include="Services\SafeModeThemeSelector.cs" />
|
||||
<Compile Include="Services\SiteThemeSelector.cs" />
|
||||
<Compile Include="Services\ThemeService.cs" />
|
||||
<Compile Include="Services\ThemeZoneManagerEvents.cs" />
|
||||
<Compile Include="ViewModels\ThemesIndexViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@@ -1,52 +0,0 @@
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Zones;
|
||||
|
||||
namespace Orchard.Themes.Services {
|
||||
#if REFACTORING
|
||||
public class ThemeZoneManagerEvents : IZoneManagerEvents {
|
||||
public ThemeZoneManagerEvents() {
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public void ZoneRendering(ZoneRenderContext context) {
|
||||
#if DEBUG
|
||||
context.Html.ViewContext.Writer.WriteLine(T("<!-- begin zone: {0} -->", LocalizedString.TextOrDefault(context.ZoneName, T("etc. (ZonesAny)"))));
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ZoneItemRendering(ZoneRenderContext context, ZoneItem item) {
|
||||
#if DEBUG
|
||||
//info: doesn't cover all ZoneItem types
|
||||
var writer = context.Html.ViewContext.Writer;
|
||||
if (item is RenderPartialZoneItem)
|
||||
writer.WriteLine(T("<!-- begin: {0} -->", (item as RenderPartialZoneItem).TemplateName));
|
||||
else if (item is ContentPartDisplayZoneItem)
|
||||
writer.WriteLine(T("<!-- begin: {0} -->", (item as ContentPartDisplayZoneItem).TemplateName));
|
||||
else if (item is ContentPartEditorZoneItem)
|
||||
writer.WriteLine(T("<!-- begin: {0} -->", (item as ContentPartEditorZoneItem).TemplateName));
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ZoneItemRendered(ZoneRenderContext context, ZoneItem item) {
|
||||
#if DEBUG
|
||||
//info: doesn't cover all ZoneItem types
|
||||
var writer = context.Html.ViewContext.Writer;
|
||||
if (item is RenderPartialZoneItem)
|
||||
writer.WriteLine(T("<!-- end: {0} -->", (item as RenderPartialZoneItem).TemplateName));
|
||||
else if (item is ContentPartDisplayZoneItem)
|
||||
writer.WriteLine(T("<!-- end: {0} -->", (item as ContentPartDisplayZoneItem).TemplateName));
|
||||
else if (item is ContentPartEditorZoneItem)
|
||||
writer.WriteLine(T("<!-- end: {0} -->", (item as ContentPartEditorZoneItem).TemplateName));
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ZoneRendered(ZoneRenderContext context) {
|
||||
#if DEBUG
|
||||
context.Html.ViewContext.Writer.WriteLine(T("<!-- end zone: {0} -->", LocalizedString.TextOrDefault(context.ZoneName, T("etc. (ZonesAny)"))));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
@@ -98,7 +98,9 @@
|
||||
<Content Include="Views\Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Placement.info" />
|
||||
<None Include="Placement.info">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
|
@@ -815,6 +815,9 @@ table .button {
|
||||
border-color:#666d51;
|
||||
border-style:solid;
|
||||
}
|
||||
.permalink .checkbox-and-label {
|
||||
white-space:nowrap;
|
||||
}
|
||||
/* Settings */
|
||||
.settings fieldset {
|
||||
margin:.5em 0;
|
||||
|
Reference in New Issue
Block a user