mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-19 18:27:55 +08:00
Moving zone/zoneitem debug rendering to ThemeZoneManagerEvents
- still not permenant but better than being in DesignerNotes.ZoneManagerEvents --HG-- branch : dev
This commit is contained in:
@@ -153,6 +153,7 @@
|
|||||||
<Compile Include="Themes\Models\ThemeSiteSettingsRecord.cs" />
|
<Compile Include="Themes\Models\ThemeSiteSettingsRecord.cs" />
|
||||||
<Compile Include="Themes\Services\SiteThemeSelector.cs" />
|
<Compile Include="Themes\Services\SiteThemeSelector.cs" />
|
||||||
<Compile Include="Themes\Services\ThemeService.cs" />
|
<Compile Include="Themes\Services\ThemeService.cs" />
|
||||||
|
<Compile Include="Themes\Services\ThemeZoneManagerEvents.cs" />
|
||||||
<Compile Include="Themes\ViewModels\PreviewViewModel.cs" />
|
<Compile Include="Themes\ViewModels\PreviewViewModel.cs" />
|
||||||
<Compile Include="Themes\ViewModels\ThemesIndexViewModel.cs" />
|
<Compile Include="Themes\ViewModels\ThemesIndexViewModel.cs" />
|
||||||
<Compile Include="XmlRpc\Controllers\HomeController.cs" />
|
<Compile Include="XmlRpc\Controllers\HomeController.cs" />
|
||||||
|
@@ -50,23 +50,9 @@ namespace Orchard.Core.Themes.DesignerNotes {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void ZoneItemRendering(ZoneRenderContext context, ZoneItem item) {
|
public void ZoneItemRendering(ZoneRenderContext context, ZoneItem item) {
|
||||||
#if DEBUG
|
|
||||||
var writer = context.Html.ViewContext.Writer;
|
|
||||||
if (item is RenderPartialZoneItem)
|
|
||||||
writer.Write(string.Format("<!-- begin: {0} -->", (item as RenderPartialZoneItem).TemplateName));
|
|
||||||
else if (item is ContentPartDisplayZoneItem)
|
|
||||||
writer.Write(string.Format("<!-- begin: {0} -->", (item as ContentPartDisplayZoneItem).TemplateName));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ZoneItemRendered(ZoneRenderContext context, ZoneItem item) {
|
public void ZoneItemRendered(ZoneRenderContext context, ZoneItem item) {
|
||||||
#if DEBUG
|
|
||||||
var writer = context.Html.ViewContext.Writer;
|
|
||||||
if (item is RenderPartialZoneItem)
|
|
||||||
writer.Write(string.Format("<!-- end: {0} -->", (item as RenderPartialZoneItem).TemplateName));
|
|
||||||
else if (item is ContentPartDisplayZoneItem)
|
|
||||||
writer.Write(string.Format("<!-- end: {0} -->", (item as ContentPartDisplayZoneItem).TemplateName));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ZoneRendered(ZoneRenderContext context) {
|
public void ZoneRendered(ZoneRenderContext context) {
|
||||||
|
@@ -0,0 +1,50 @@
|
|||||||
|
using Orchard.Localization;
|
||||||
|
using Orchard.UI.Zones;
|
||||||
|
|
||||||
|
namespace Orchard.Core.Themes.Services {
|
||||||
|
public class ThemeZoneManagerEvents : IZoneManagerEvents {
|
||||||
|
public ThemeZoneManagerEvents() {
|
||||||
|
T = NullLocalizer.Instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Localizer T { get; set; }
|
||||||
|
|
||||||
|
public void ZoneRendering(ZoneRenderContext context) {
|
||||||
|
#if DEBUG
|
||||||
|
context.Html.ViewContext.Writer.WriteLine(T("<!-- begin zone: {0} -->", 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} -->", context.ZoneName ?? T("etc. (ZonesAny)")));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user