protected override void RenderContents(HtmlTextWriter output) { var extensionPointManager = new ExtensionPointManager(); var str = new StringBuilder(); var filter = new CompositeFilter() .And(new FilterByHostMenu(this.IsHost)) .And(new FilterByUnauthenticated(HttpContext.Current.Request.IsAuthenticated)); foreach (var extension in extensionPointManager.GetToolBarButtonExtensionPoints(Module, Group, filter)) { if (extension is IToolBarMenuButtonExtensionPoint) { btnRenderer = new ToolBarMenuButtonRenderer(); str.AppendFormat(btnRenderer.GetOutput(extension)); } else { btnRenderer = new ToolBarButtonRenderer(); str.AppendFormat(btnRenderer.GetOutput(extension)); } } output.Write(str.ToString()); }
/// <inheritdoc/> protected override void OnInit(EventArgs e) { var extensionPointManager = new ExtensionPointManager(); var tabs = (HtmlGenericControl)this.Parent.FindControl(this.TabControlId); var panel = this.Parent.FindControl(this.PanelControlId); foreach (var extension in extensionPointManager.GetEditPageTabExtensionPoints(this.Module, this.Group)) { if (extension.Visible) { var liElement = new HtmlGenericControl("li") { InnerHtml = "<a href=\"#" + extension.EditPageTabId + "\">" + extension.Text + "</a>", }; liElement.Attributes.Add("class", extension.CssClass); tabs.Controls.Add(liElement); var container = new PanelTabExtensionControl { PanelId = extension.EditPageTabId }; var control = this.Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); container.Controls.Add(control); panel.Controls.Add(container); } } }
protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); StringBuilder str = new StringBuilder(); foreach (var extension in extensionPointManager.GetContextMenuItemExtensionPoints(Module, Group)) { var icon = extension.Icon; if (icon.StartsWith("~/")) { icon = Globals.ResolveUrl(icon); } str.Append(@"<li id=""" + extension.CtxMenuItemId + @""" class=""" + extension.CssClass + @"""> <a id=""" + extension.CtxMenuItemId + @"_link"" href=""#"" onclick=""" + extension.Action + @""" > <img id=""" + extension.CtxMenuItemId + @"_icon"" alt=""" + extension.AltText + @""" src=""" + icon + @""" title=""" + extension.AltText + @"""> <span id=""" + extension.CtxMenuItemId + @"_text"">"+extension.Text+@"</span> </a> </li>"); } content = str.ToString(); }
protected override void OnInit(EventArgs e) { var extensionPointManager = new ExtensionPointManager(); var tabs = (HtmlGenericControl)Parent.FindControl(TabControlId); var panel = Parent.FindControl(PanelControlId); foreach (var extension in extensionPointManager.GetEditPageTabExtensionPoints(Module, Group)) { if (extension.Visible) { var liElement = new HtmlGenericControl("li") { InnerHtml = "<a href=\"#" + extension.EditPageTabId + "\">" + extension.Text + "</a>", }; liElement.Attributes.Add("class", extension.CssClass); tabs.Controls.Add(liElement); var container = new PanelTabExtensionControl { PanelId = extension.EditPageTabId }; var control = Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); container.Controls.Add(control); panel.Controls.Add(container); } } }
/// <inheritdoc/> protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); StringBuilder str = new StringBuilder(); foreach (var extension in extensionPointManager.GetContextMenuItemExtensionPoints(this.Module, this.Group)) { var icon = extension.Icon; if (icon.StartsWith("~/")) { icon = Globals.ResolveUrl(icon); } str.Append(@"<li id=""" + extension.CtxMenuItemId + @""" class=""" + extension.CssClass + @"""> <a id=""" + extension.CtxMenuItemId + @"_link"" href=""#"" onclick=""" + extension.Action + @""" > <img id=""" + extension.CtxMenuItemId + @"_icon"" alt=""" + extension.AltText + @""" src=""" + icon + @""" title=""" + extension.AltText + @"""> <span id=""" + extension.CtxMenuItemId + @"_text"">" + extension.Text + @"</span> </a> </li>"); } this.content = str.ToString(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); var str = new StringBuilder(); var filter = new CompositeFilter() .And(new FilterByHostMenu(Globals.IsHostTab(PortalController.GetCurrentPortalSettings().ActiveTab.TabID))) .And(new FilterByUnauthenticated(HttpContext.Current.Request.IsAuthenticated)); foreach (var extension in extensionPointManager.GetToolBarButtonExtensionPoints(Module, Group, filter)) { if (extension is IToolBarMenuButtonExtensionPoint) { btnRenderer = new ToolBarMenuButtonRenderer(); str.AppendFormat(btnRenderer.GetOutput(extension)); } else { btnRenderer = new ToolBarButtonRenderer(); str.AppendFormat(btnRenderer.GetOutput(extension)); } } content = str.ToString(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); if (!string.IsNullOrEmpty(this.Name)) { var extension = extensionPointManager.GetUserControlExtensionPointFirstByPriority(this.Module, this.Name); this.LoadControl(extension); } else { foreach (var extension in extensionPointManager.GetUserControlExtensionPoints(this.Module, this.Group)) { this.LoadControl(extension); } } }
protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); if (!String.IsNullOrEmpty(Name)) { var extension = extensionPointManager.GetEditPagePanelExtensionPointFirstByPriority(Module, Name); LoadControl(extension); } else { foreach (var extension in extensionPointManager.GetEditPagePanelExtensionPoints(Module, Group)) { LoadControl(extension); } } }
protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); StringBuilder str = new StringBuilder(); foreach (var extension in extensionPointManager.GetContextMenuItemExtensionPoints(Module, Group)) { str.Append(@"<li id=""" + extension.CtxMenuItemId + @""" class=""" + extension.CssClass + @"""> <a id=""" + extension.CtxMenuItemId + @"_link"" href=""#"" onclick=""" + extension.Action + @""" > <img id=""" + extension.CtxMenuItemId + @"_icon"" alt=""" + extension.AltText + @""" src=""" + extension.Icon + @""" title=""" + extension.AltText + @"""> <span id=""" + extension.CtxMenuItemId + @"_text"">" + extension.Text + @"</span> </a> </li>"); } content = str.ToString(); }
protected override void OnInit(EventArgs e) { base.OnInit(e); var extensionPointManager = new ExtensionPointManager(); var str = new StringBuilder(); foreach (var extension in extensionPointManager.GetToolBarButtonExtensionPoints(Module, Group)) { if (extension is IToolBarMenuButtonExtensionPoint) { btnRenderer = new ToolBarMenuButtonRenderer(); str.AppendFormat(btnRenderer.GetOutput(extension)); } else { btnRenderer = new ToolBarButtonRenderer(); str.AppendFormat(btnRenderer.GetOutput(extension)); } } content = str.ToString(); }
protected override void OnInit(EventArgs e) { try { base.OnInit(e); jQuery.RequestDnnPluginsRegistration(); var fileId = Convert.ToInt32(Request.Params["FileId"]); file = FileManager.Instance.GetFile(fileId, true); fileItem = controller.GetFile(fileId); folder = FolderManager.Instance.GetFolder(file.FolderId); SaveButton.Click += OnSaveClick; CancelButton.Click += OnCancelClick; if (FolderPermissionController.CanViewFolder((FolderInfo)folder)) { var mef = new ExtensionPointManager(); var preViewPanelExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "PreviewInfoPanelExtensionPoint"); previewPanelControl = Page.LoadControl(preViewPanelExtension.UserControlSrc); PreviewPanelContainer.Controls.Add(previewPanelControl); var fileFieldsExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "FileFieldsControlExtensionPoint"); fileFieldsControl = Page.LoadControl(fileFieldsExtension.UserControlSrc); fileFieldsControl.ID = fileFieldsControl.GetType().BaseType.Name; FileFieldsContainer.Controls.Add(fileFieldsControl); PrepareFilePreviewInfoControl(); PrepareFileFieldsControl(); // Tab Extension Point var tabContentControlsInstances = new List<PropertiesTabContentControl>(); foreach (var extension in mef.GetEditPageTabExtensionPoints("DigitalAssets", "FilePropertiesTab")) { if (FolderPermissionController.HasFolderPermission(folder.FolderPermissions, extension.Permission)) { var liElement = new HtmlGenericControl("li") { InnerHtml = "<a href=\"#" + extension.EditPageTabId + "\">" + extension.Text + "</a>", }; liElement.Attributes.Add("class", extension.CssClass); liElement.Attributes.Add("id", extension.EditPageTabId + "_tab"); Tabs.Controls.Add(liElement); var container = new PanelTabExtensionControl { PanelId = extension.EditPageTabId }; var control = (PortalModuleBase)Page.LoadControl(extension.UserControlSrc); control.ID = Path.GetFileNameWithoutExtension(extension.UserControlSrc); control.ModuleConfiguration = ModuleConfiguration; var contentControl = control as PropertiesTabContentControl; if (contentControl != null) { contentControl.OnItemUpdated += OnItemUpdated; tabContentControlsInstances.Add(contentControl); } container.Controls.Add(control); TabsPanel.Controls.Add(container); } } tabContentControls = tabContentControlsInstances.ToList(); } } catch (Exception ex) { Exceptions.ProcessModuleLoadException(this, ex); } }
protected override void OnInit(EventArgs e) { try { base.OnInit(e); JavaScript.RequestRegistration(CommonJs.DnnPlugins); var folderId = Convert.ToInt32(Request.Params["FolderId"]); Folder = FolderManager.Instance.GetFolder(folderId); HasFullControl = UserInfo.IsSuperUser || FolderPermissionController.HasFolderPermission(Folder.FolderPermissions, "FULLCONTROL"); FolderViewModel rootFolder; switch (SettingsRepository.GetMode(ModuleId)) { case DigitalAssestsMode.Group: var groupId = Convert.ToInt32(Request.Params["GroupId"]); rootFolder = controller.GetGroupFolder(groupId, PortalSettings); if (rootFolder == null) { throw new Exception("Invalid group folder"); } break; case DigitalAssestsMode.User: rootFolder = controller.GetUserFolder(PortalSettings.UserInfo); break; default: rootFolder = controller.GetRootFolder(ModuleId); break; } isRootFolder = rootFolder.FolderID == folderId; folderViewModel = isRootFolder ? rootFolder : controller.GetFolder(folderId); // Setup controls CancelButton.Click += OnCancelClick; SaveButton.Click += OnSaveClick; PrepareFolderPreviewInfo(); cmdCopyPerm.Click += cmdCopyPerm_Click; var mef = new ExtensionPointManager(); var folderFieldsExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "FolderFieldsControlExtensionPoint"); if (folderFieldsExtension != null) { folderFieldsControl = Page.LoadControl(folderFieldsExtension.UserControlSrc); folderFieldsControl.ID = folderFieldsControl.GetType().BaseType.Name; FolderDynamicFieldsContainer.Controls.Add(folderFieldsControl); var fieldsControl = folderFieldsControl as IFieldsControl; if (fieldsControl != null) { fieldsControl.SetController(controller); fieldsControl.SetItemViewModel(new ItemViewModel { ItemID = folderViewModel.FolderID, IsFolder = true, PortalID = folderViewModel.PortalID, ItemName = folderViewModel.FolderName }); } } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
protected override void OnInit(EventArgs e) { try { base.OnInit(e); jQuery.RequestDnnPluginsRegistration(); var folderId = Convert.ToInt32(Request.Params["FolderId"]); Folder = FolderManager.Instance.GetFolder(folderId); if (string.IsNullOrEmpty(Folder.FolderPath)) { folderViewModel = controller.GetRootFolder(); isRootFolder = true; } else { folderViewModel = controller.GetFolder(folderId); } // Setup controls CancelButton.Click += OnCancelClick; SaveButton.Click += OnSaveClick; PrepareFolderPreviewInfo(); cmdCopyPerm.Click += cmdCopyPerm_Click; var mef = new ExtensionPointManager(); var folderFieldsExtension = mef.GetUserControlExtensionPointFirstByPriority("DigitalAssets", "FolderFieldsControlExtensionPoint"); if (folderFieldsExtension != null) { folderFieldsControl = Page.LoadControl(folderFieldsExtension.UserControlSrc); folderFieldsControl.ID = folderFieldsControl.GetType().BaseType.Name; FolderDynamicFieldsContainer.Controls.Add(folderFieldsControl); var fieldsControl = folderFieldsControl as IFieldsControl; if (fieldsControl != null) { fieldsControl.SetController(controller); fieldsControl.SetItemViewModel(new ItemViewModel() { ItemID = folderViewModel.FolderID, IsFolder = true, PortalID = folderViewModel.PortalID, ItemName = folderViewModel.FolderName }); } } } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }