Depending on the functionality that you are implementing, it may be necessary to expose contextual management options within the front UI of Telligent Community. The contextual management UI is completely defined by plugins, so its easy to add to.
[toc]
Types of contextual management UI extensions
The contextual management UI is available throughout the front UI via the pencil icon in the upper left corner of the page (visible when there are contextual management panels available). The contextual management UI reviews the contextual data relative to the page via the data supplied by the currently active URL route's page context definition. The contextual management UI will identify panels related to containers, applications, and themes. Additionally, panels can be used for ad-hoc contexts (for example, managerial or moderation actions on content that could exist on any page).
The following panel types are supported by the contextual management UI:
- Container Panels. Container panels are exposed when the matching container type exists in the current context. See the content model for more information about containers.
- Application Panels. Application panels are exposed when the matching application type exists in the current context. See content model for more information about applications.
- Theme Panels. Theme panels are exposed for the current contextual theme context/type. See themes for more information about themes.
- Explicit Panels. Explicit panels are not included within the browseable navigation of the contextual panel UI and, instead, represent managerial functionality that could be accessed from any context. Explicit panels are opened by their URL directly.
Container panels
TBD
using System using Telligent.Evolution.Extensibility; using Telligent.Evolution.Extensibility.Administration.Version1; namespace Samples { public class SampleContainerPanel : IContainerPanel { private readonly Guid _id = new Guid("5edcdc07-411d-406c-ab2f-b456c617beb1"); #region IPlugin // ... #endregion #region IContainerPanel public Guid[] ContainerTypes { get { var groupsApi = Apis.Get<Telligent.Evolution.Extensibility.Api.Version1.IGroups>(); if (groupsApi != null) return new Guid[] { groupsApi.ContainerTypeId }; else return new Guid[0]; } } public string CssClass { get { return string.Empty; } } public int? DisplayOrder { get { return null; } } public bool IsCacheable { get { return true; } } public Guid PanelId { get { return _id; } } public bool VaryCacheByUser { get { return false; } } public bool HasAccess(int userId, Guid containerType, Guid containerId) { return true; } public string GetPanelName(Guid containerType, Guid containerId) { return "Sample Container Panel"; } public string GetPanelDescription(Guid containerType, Guid containerId) { return "A sample container panel."; } public string GetViewHtml(Guid containerType, Guid containerId) { return "This is the content of the sample container panel."; } #endregion } }
Application panels
TBD
using System using Telligent.Evolution.Extensibility; using Telligent.Evolution.Extensibility.Administration.Version1; namespace Samples { public class SampleApplicationPanel : IApplicationPanel { private readonly Guid _id = new Guid("975fb78f-fb81-47e5-9046-f3f73835b100"); #region IPlugin // ... #endregion #region IApplicationPanel public Guid[] ApplicationTypes { get { var forumsApi = Apis.Get<Telligent.Evolution.Extensibility.Api.Version1.IForums>(); if (forumsApi != null) return new Guid[] { forumsApi.ApplicationTypeId }; else return new Guid[0]; } } public string CssClass { get { return string.Empty; } } public int? DisplayOrder { get { return null; } } public bool IsCacheable { get { return true; } } public Guid PanelId { get { return _id; } } public bool VaryCacheByUser { get { return false; } } public bool HasAccess(int userId, Guid containerType, Guid containerId) { return true; } public string GetPanelName(Guid applicationType, Guid applicationId) { return "Sample Application Panel"; } public string GetPanelDescription(Guid applicationType, Guid applicationId) { return "A sample application panel."; } public string GetViewHtml(Guid applicationType, Guid applicationId) { return "This is the content of the sample application panel."; } #endregion } }
Theme panels
TBD
using System using Telligent.Evolution.Extensibility; using Telligent.Evolution.Extensibility.Administration.Version1; namespace Samples { public class SampleThemePanel : IThemePanel { private readonly Guid _id = new Guid("4bc58386-44e9-4a4d-933f-53a1031af339"); #region IPlugin // ... #endregion #region IThemePanel public string CssClass { get { return string.Empty; } } public int? DisplayOrder { get { return null; } } public bool IsCacheable { get { return true; } } public Guid PanelId { get { return _id; } } public bool VaryCacheByUser { get { return false; } } public bool HasAccess(int userId, Guid themeType, Guid themeApplicationId, bool forceDefault) { return true; } public string GetPanelName(Guid themeType, Guid themeApplicationId, bool forceDefault) { return "Sample Theme Panel"; } public string GetPanelDescription(Guid themeType, Guid themeApplicationId, bool forceDefault) { return "A sample theme panel."; } public string GetViewHtml(Guid themeType, Guid themeApplicationId, bool forceDefault) { return "This is the content of the sample theme panel."; } #endregion } }
Explicit panels
TBD
using System using Telligent.Evolution.Extensibility; using Telligent.Evolution.Extensibility.Administration.Version1; using System.Collections.Specialized; namespace Samples { public class SampleExplicitPanel : IExplicitPanel { private readonly Guid _id = new Guid("ab05b86b-979e-4ccf-ab68-f90f953279a6"); private IExplicitPanelController _explictPanelController; #region IPlugin // ... #endregion #region IExplicitPanel public void SetController(IExplicitPanelController controller) { _explictPanelController = controller; } public string CssClass { get { return string.Empty; } } public int? DisplayOrder { get { return null; } } public bool IsCacheable { get { return true; } } public Guid PanelId { get { return _id; } } public bool VaryCacheByUser { get { return false; } } public bool HasAccess(int userId, NameValueCollection parameters) { return true; } public string GetPanelName(NameValueCollection parameters) { return "Sample Explicit Panel"; } public string GetPanelDescription(NameValueCollection parameters) { return "A sample explicit panel."; } public string GetViewHtml(NameValueCollection parameters) { return "The content of the sample explicit panel."; } #endregion } }