Skip to content

Commit

Permalink
Merge pull request #1 from bdukes/ddr
Browse files Browse the repository at this point in the history
Template Arguments for Razor Action Menu Template
  • Loading branch information
ohine committed Mar 17, 2014
2 parents 5d8aee8 + 3b78d40 commit 570ad45
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion DNN Platform/Modules/DDRMenu/Actions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web.UI;
Expand Down Expand Up @@ -64,6 +64,7 @@ protected override void OnPreRender(EventArgs e)

try
{
navProvider.TemplateArguments = TemplateArguments;
BindMenu(Navigation.GetActionNodes(ActionRoot, this, -1));
}
catch (Exception exc)
Expand Down
7 changes: 5 additions & 2 deletions DNN Platform/Modules/DDRMenu/DDRMenuNavigationProvider.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Web.UI;
Expand Down Expand Up @@ -102,6 +102,8 @@ public class DDRMenuNavigationProvider : NavigationProvider

public string MenuStyle { get; set; }

public List<TemplateArgument> TemplateArguments { get; set; }

public override void Initialize()
{
menuControl = new DDRMenuControl {ID = ControlID, EnableViewState = false};
Expand Down Expand Up @@ -183,7 +185,8 @@ public void Bind(DNNNodeCollection objNodes, bool localise)
IncludeNodes = GetCustomAttribute("IncludeNodes"),
ExcludeNodes = GetCustomAttribute("ExcludeNodes"),
NodeManipulator = GetCustomAttribute("NodeManipulator"),
ClientOptions = clientOptions
ClientOptions = clientOptions,
TemplateArguments = TemplateArguments,
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.IO;
Expand Down Expand Up @@ -38,7 +38,8 @@ public void Render(object source, HtmlTextWriter htmlWriter, TemplateDefinition
model.ManifestPath = resolver.Resolve("/", PathResolver.RelativeTo.Manifest);
model.PortalPath = resolver.Resolve("/", PathResolver.RelativeTo.Portal);
model.SkinPath = resolver.Resolve("/", PathResolver.RelativeTo.Skin);

var modelDictionary = model as IDictionary<string, object>;
liveDefinition.TemplateArguments.ForEach(a => modelDictionary.Add(a.Name, a.Value));

var razorEngine = new RazorEngine(liveDefinition.TemplateVirtualPath, null, null);
var writer = new StringWriter();
Expand Down
7 changes: 7 additions & 0 deletions DNN_Platform.sln
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ Global
{1A0646A3-CB4A-4E8E-A497-2C677DE320FF}.Release|Any CPU.Build.0 = Release|Any CPU
{1A0646A3-CB4A-4E8E-A497-2C677DE320FF}.Release|x86.ActiveCfg = Release|x86
{1A0646A3-CB4A-4E8E-A497-2C677DE320FF}.Release|x86.Build.0 = Release|x86
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345}.Debug|x86.ActiveCfg = Debug|Any CPU
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345}.Release|Any CPU.Build.0 = Release|Any CPU
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345}.Release|x86.ActiveCfg = Release|Any CPU
{839E7C68-1867-4B99-8507-FB50CE45EB10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{839E7C68-1867-4B99-8507-FB50CE45EB10}.Debug|Any CPU.Build.0 = Debug|Any CPU
{839E7C68-1867-4B99-8507-FB50CE45EB10}.Debug|x86.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -523,6 +529,7 @@ Global
{CA056730-5759-41F8-A6C1-420F9C0C63E7} = {1DFA65CE-5978-49F9-83BA-CFBD0C7A1814}
{5DEAB0D5-0F54-44C9-A167-F48264A04B3D} = {FDDC95FE-3341-4AED-A93E-7A5DF85A55C2}
{1A0646A3-CB4A-4E8E-A497-2C677DE320FF} = {FDDC95FE-3341-4AED-A93E-7A5DF85A55C2}
{A86EBC44-2BC8-4C4A-997B-2708E4AAC345} = {FDDC95FE-3341-4AED-A93E-7A5DF85A55C2}
{839E7C68-1867-4B99-8507-FB50CE45EB10} = {FDDC95FE-3341-4AED-A93E-7A5DF85A55C2}
{CD8732D8-B4DD-435D-BF21-A90C2964ABA4} = {FDDC95FE-3341-4AED-A93E-7A5DF85A55C2}
{E242FA80-7523-4AE5-A804-809175D0E702} = {FDDC95FE-3341-4AED-A93E-7A5DF85A55C2}
Expand Down

0 comments on commit 570ad45

Please sign in to comment.