From ce26d502a4095c995150a53e5a17b89b59885308 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 15 Sep 2017 02:31:28 -0400 Subject: allow plugins to inject menus --- MediaBrowser.WebDashboard/Api/ConfigurationPageInfo.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.WebDashboard/Api/ConfigurationPageInfo.cs') diff --git a/MediaBrowser.WebDashboard/Api/ConfigurationPageInfo.cs b/MediaBrowser.WebDashboard/Api/ConfigurationPageInfo.cs index 33289e76c..b69c14fee 100644 --- a/MediaBrowser.WebDashboard/Api/ConfigurationPageInfo.cs +++ b/MediaBrowser.WebDashboard/Api/ConfigurationPageInfo.cs @@ -11,6 +11,9 @@ namespace MediaBrowser.WebDashboard.Api /// /// The name. public string Name { get; set; } + public bool EnableInMainMenu { get; set; } + + public string DisplayName { get; set; } /// /// Gets the type of the configuration page. @@ -27,15 +30,22 @@ namespace MediaBrowser.WebDashboard.Api public ConfigurationPageInfo(IPluginConfigurationPage page) { Name = page.Name; + ConfigurationPageType = page.ConfigurationPageType; - // Don't use "N" because it needs to match Plugin.Id - PluginId = page.Plugin.Id.ToString(); + if (page.Plugin != null) + { + DisplayName = page.Plugin.Name; + // Don't use "N" because it needs to match Plugin.Id + PluginId = page.Plugin.Id.ToString(); + } } public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page) { Name = page.Name; + EnableInMainMenu = page.EnableInMainMenu; + DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin.Name : page.DisplayName; // Don't use "N" because it needs to match Plugin.Id PluginId = plugin.Id.ToString(); -- cgit v1.2.3