-
Notifications
You must be signed in to change notification settings - Fork 4
/
AdminMenu.cs
44 lines (38 loc) · 1.73 KB
/
AdminMenu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using Smartstore.Collections;
using Smartstore.Core.Content.Menus;
using Smartstore.Web.Rendering.Builders;
namespace MyOrg.DomainTutorial
{
public class AdminMenu : AdminMenuProvider
{
protected override void BuildMenuCore(TreeNode<MenuItem> modulesNode)
{
var myMenuItem = new MenuItem().ToBuilder()
.ResKey("Plugins.MyOrg.DomainTutorial.MyMenuItem")
.Icon("gear", "bi")
.Action("Configure", "DomainTutorialAdmin", new { area = "Admin" })
.AsItem();
var menuNode = new TreeNode<MenuItem>(myMenuItem);
var refNode = modulesNode.Root.SelectNodeById("settings");
menuNode.InsertAfter(refNode);
var secondMenuItem = new MenuItem().ToBuilder()
.ResKey("Plugins.MyOrg.DomainTutorial.MySecondMenuItem")
.AsItem();
var subMenuItem = new MenuItem().ToBuilder()
.ResKey("Plugins.MyOrg.DomainTutorial.MySubMenuItem")
.Action("Configure", "DomainTutorialAdmin", new { area = "Admin" })
.AsItem();
var secondMenuNode = new TreeNode<MenuItem>(secondMenuItem);
var subMenuNode = new TreeNode<MenuItem>(subMenuItem);
secondMenuNode.InsertAfter(menuNode);
secondMenuNode.Append(subMenuNode);
// All notifications
modulesNode.Append(new MenuItem().ToBuilder()
.ResKey("Plugins.MyOrg.DomainTutorial.Grid.Notification.Title")
.Icon("chat-left-text", "bi")
.Id("domain-tutorial-notifications")
.Action("List", "NotificationAdmin", new { area = "Admin" })
.AsItem());
}
}
}