11using System . Collections . Generic ;
2+ using System . IO ;
23using DeveloperTools ;
34using EPiServer . Shell ;
45using EPiServer . Shell . Modules ;
@@ -9,99 +10,46 @@ namespace EPiServer.DeveloperTools.Infrastructure;
910[ MenuProvider ]
1011public class MenuProvider : IMenuProvider
1112{
12- const string GlobalMenuTitle = "Developer Tools" ;
13-
14- const string TimeMetersTitle = "Startup Perf" ;
15- const string TimeMetersPath = "StartupPerf" ;
16-
17- const string TemplatesTitle = "Templates" ;
18- const string TemplatesPath = "global/DeveloperTools/Templates" ;
19-
20- const string IocTitle = "Container" ;
21- const string IocPath = "global/DeveloperTools/IOC" ;
22-
23- const string LoadedAssembliesTitle = "Loaded Assemblies" ;
24- const string LoadedAssembliesPath = "global/DeveloperTools/LoadedAssemblies" ;
25-
26- const string RevertToDefaultTitle = "Revert Content Types" ;
27- const string RevertToDefaultPath = "global/DeveloperTools/RevertToDefault" ;
28-
29- const string ContentTypeAnalyzerTitle = "Content Type Analyzer" ;
30- const string ContentTypeAnalyzerPath = "global/DeveloperTools/ContentTypeAnalyzer" ;
31-
32- const string LogViewerTitle = "Log Viewer" ;
33- const string LogViewerPath = "global/DeveloperTools/LogViewer" ;
34-
35- const string MemoryDumpTitle = "Memory Dump" ;
36- const string MemoryDumpPath = "global/DeveloperTools/Memory Dump" ;
37-
38- const string RemoteEventTitle = "Remote Event" ;
39- const string RemoteEventPath = "global/DeveloperTools/Remote Event" ;
40-
41- const string RoutesTitle = "Routes" ;
42- const string RoutesPath = "global/DeveloperTools/Routes" ;
43-
44- const string ViewLocationsTitle = "View Locations" ;
45- const string ViewLocationsPath = "global/DeveloperTools/ViewLocations" ;
46-
47- const string ModuleDependenciesTitle = "Module Dependencies" ;
48- const string ModuleDependenciesPath = "global/DeveloperTools/ModuleDependencies" ;
49-
50- const string LocalObjectCacheTitle = "Local Object Cache" ;
51- const string LocalObjectCachePath = "global/DeveloperTools/LocalObjectCache" ;
13+ private const string MenuPath = "/cms/DeveloperTools" ;
5214
5315 public IEnumerable < MenuItem > GetMenuItems ( )
5416 {
5517 // Create the top menu section
56- var developerSection = new UrlMenuItem ( GlobalMenuTitle , MenuPaths . Global + "/cms/DeveloperTools" , Paths . ToResource ( GetType ( ) , "default" ) )
18+ var developerSection = new UrlMenuItem ( "Developer Tools" , MenuPaths . Global + MenuPath , Paths . ToResource ( GetType ( ) , "default" ) )
5719 {
5820 SortIndex = 100 ,
5921 AuthorizationPolicy = Constants . PolicyName
6022 } ;
6123
62- var timeMeters = CreateUrlMenuItem ( TimeMetersTitle , TimeMetersPath , "TimeMeters" ) ;
63-
64- //var templates = CreateUrlMenuItem(TemplatesTitle, TemplatesPath, "Templates");
65- //var ioc = CreateUrlMenuItem(IocTitle, IocPath, "IOC");
66- //var loadedAssemblies = CreateUrlMenuItem(LoadedAssembliesTitle, LoadedAssembliesPath, "LoadedAssemblies");
67- //var revertToDefault = CreateUrlMenuItem(RevertToDefaultTitle, RevertToDefaultPath, "RevertToDefault");
68- //var contentTypeAnalyzer = CreateUrlMenuItem(ContentTypeAnalyzerTitle, ContentTypeAnalyzerPath, "ContentTypeAnalyzer");
69- //var logViewer = CreateUrlMenuItem(LogViewerTitle, LogViewerPath, "LogViewer");
70- //var memoryDumperViewer = CreateUrlMenuItem(MemoryDumpTitle, MemoryDumpPath, "MemoryDump");
71- //var remoteEventViewer = CreateUrlMenuItem(RemoteEventTitle, RemoteEventPath, "RemoteEvent");
72- //var routes = CreateUrlMenuItem(RoutesTitle, RoutesPath, "Routes");
73- //var viewLocations = CreateUrlMenuItem(ViewLocationsTitle, ViewLocationsPath, "ViewEngineLocations");
74- //var moduleDependencies = CreateUrlMenuItem(ModuleDependenciesTitle, ModuleDependenciesPath, "ModuleDependencies");
75- //var localObjectCache = CreateUrlMenuItem(LocalObjectCacheTitle, LocalObjectCachePath, "LocalObjectCache");
76-
7724 return new MenuItem [ ]
7825 {
7926 developerSection ,
80- timeMeters ,
81- //ioc,
82- //loadedAssemblies,
83- //revertToDefault,
84- //contentTypeAnalyzer,
85- //templates,
86- //logViewer,
87- //memoryDumperViewer,
88- //remoteEventViewer,
89- //routes,
90- //viewLocations,
91- //moduleDependencies,
92- //localObjectCache
27+ CreateUrlMenuItem ( "Welcome" , "default" , 10 ) ,
28+ CreateUrlMenuItem ( "Startup Perf" , "StartupPerf" , 20 ) ,
29+ CreateUrlMenuItem ( "IoC" , "IOC" , 30 ) ,
30+ CreateUrlMenuItem ( "Loaded Assemblies" , "LoadedAssemblies" , 40 ) ,
31+ CreateUrlMenuItem ( "Revert Content Types" , "RevertToDefault" , 50 ) ,
32+ CreateUrlMenuItem ( "Content Type Analyzer" , "ContentTypeAnalyzer" , 60 ) ,
33+ CreateUrlMenuItem ( "Templates" , "Templates" , 70 ) ,
34+ CreateUrlMenuItem ( "Log Viewer" , "LogViewer" , 80 ) ,
35+ CreateUrlMenuItem ( "Memory Dump" , "MemoryDump" , 90 ) ,
36+ CreateUrlMenuItem ( "Remote Events" , "RemoteEvent" , 100 ) ,
37+ CreateUrlMenuItem ( "Routes" , "Routes" , 110 ) ,
38+ CreateUrlMenuItem ( "View Locations" , "ViewLocations" , 120 ) ,
39+ CreateUrlMenuItem ( "Module Dependencies" , "ModuleDependencies" , 130 ) ,
40+ CreateUrlMenuItem ( "Local Object Cache" , "LocalObjectCache" , 140 )
9341 } ;
9442 }
9543
96- protected virtual UrlMenuItem CreateUrlMenuItem ( string title , string logicalPath , string resourcePath )
44+ protected virtual UrlMenuItem CreateUrlMenuItem ( string title , string path , int index )
9745 {
9846 var link = new UrlMenuItem (
9947 title ,
100- MenuPaths . Global + "/cms/DeveloperTools/ " + logicalPath ,
101- Paths . ToResource ( GetType ( ) , "default# /" + resourcePath ) )
48+ MenuPaths . Global + MenuPath + "/ " + path ,
49+ Paths . ToResource ( GetType ( ) , "/" + path ) )
10250 {
10351 AuthorizationPolicy = Constants . PolicyName ,
104- SortIndex = 10 ,
52+ SortIndex = index ,
10553 Alignment = MenuItemAlignment . Left
10654 } ;
10755
0 commit comments