Here is the best I could come up with so far
In IconBar.ascx.vb file make the following changes (see underlined text):
Private
Sub BindData()
Select Case optModuleType.SelectedItem.Value
Case "0" ' new module
cboTabs.Visible = False
cboModules.Visible = False
cboDesktopModules.Visible = True
txtTitle.Visible = True
lblModule.Text = Services.Localization.Localization.GetString("Module", Me.LocalResourceFile)
lblTitle.Text = Services.Localization.Localization.GetString("Title", Me.LocalResourceFile)
cboPermission.Enabled = True
'added
If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) = False Then
cboTabs.Enabled = False
cboModules.Enabled = False
cboPanes.Enabled = False
cboPermission.Enabled = False
cboAlign.Enabled = False
cboPosition.Enabled = False
optModuleType.Enabled = False
cboDesktopModules.Enabled = False
Else
cboPermission.Enabled = True
cboDesktopModules.Enabled = True
End If
Dim objDesktopModules As New DesktopModuleController
cboDesktopModules.DataSource = objDesktopModules.GetDesktopModulesByPortal(PortalSettings.PortalId)
cboDesktopModules.DataBind()
cboDesktopModules.Items.Insert(0, New ListItem("<" + Services.Localization.Localization.GetString("SelectModule", Me.LocalResourceFile) + ">", "-1"))
Case "1" ' existing module
cboTabs.Visible = True
cboModules.Visible = True
cboDesktopModules.Visible = False
txtTitle.Visible = False
lblModule.Text = Services.Localization.Localization.GetString("Tab", Me.LocalResourceFile)
lblTitle.Text = Services.Localization.Localization.GetString("Module", Me.LocalResourceFile)
cboPermission.Enabled = False
'added
If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) = False Then
cboTabs.Enabled = False
cboModules.Enabled = False
cboPanes.Enabled = False
cboAlign.Enabled = False
cboPosition.Enabled = False
optModuleType.Enabled = False
cboDesktopModules.Enabled = False
End If
Dim arrTabs As New ArrayList
Dim objTab As TabInfo
Dim arrPortalTabs As ArrayList = GetPortalTabs(PortalSettings.DesktopTabs, True, True)
For Each objTab In arrPortalTabs
If objTab.TabID = -1 Then
' <none specified>
objTab.TabName = "<" & Services.Localization.Localization.GetString("SelectPage", Me.LocalResourceFile) & ">"
arrTabs.Add(objTab)
Else
If objTab.TabID <> PortalSettings.ActiveTab.TabID Then
If PortalSecurity.IsInRoles(objTab.AuthorizedRoles) Then
arrTabs.Add(objTab)
End If
End If
End If
Next
cboTabs.DataSource = arrTabs
cboTabs.DataBind()
End Select
End Sub
Private
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
If Not Page.IsPostBack Then
' localization
lblPageFunctions.Text = Services.Localization.Localization.GetString("PageFunctions", Me.LocalResourceFile)
optModuleType.Items.FindByValue("0").Selected = True
lblCommonTasks.Text = Services.Localization.Localization.GetString("CommonTasks", Me.LocalResourceFile)
imgAddTabIcon.AlternateText = Services.Localization.Localization.GetString("AddTab.AlternateText", Me.LocalResourceFile)
cmdAddTab.Text = Services.Localization.Localization.GetString("AddTab", Me.LocalResourceFile)
imgEditTabIcon.AlternateText = Services.Localization.Localization.GetString("EditTab.AlternateText", Me.LocalResourceFile)
cmdEditTab.Text = Services.Localization.Localization.GetString("EditTab", Me.LocalResourceFile)
imgDeleteTabIcon.AlternateText = Services.Localization.Localization.GetString("DeleteTab.AlternateText", Me.LocalResourceFile)
cmdDeleteTab.Text = Services.Localization.Localization.GetString("DeleteTab", Me.LocalResourceFile)
imgCopyTabIcon.AlternateText = Services.Localization.Localization.GetString("CopyTab.AlternateText", Me.LocalResourceFile)
cmdCopyTab.Text = Services.Localization.Localization.GetString("CopyTab", Me.LocalResourceFile)
imgPreviewTabIcon.AlternateText = Services.Localization.Localization.GetString("PreviewTab.AlternateText", Me.LocalResourceFile)
cmdPreviewTab.Text = Services.Localization.Localization.GetString("PreviewTab", Me.LocalResourceFile)
If Not Request.Cookies("_Tab_Admin_Preview" & PortalSettings.PortalId.ToString) Is Nothing Then
Dim objPreview As HttpCookie
objPreview = Request.Cookies("_Tab_Admin_Preview" & PortalSettings.PortalId.ToString)
If objPreview.Value = "True" Then
imgPreviewTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_previewtab_on.gif"
End If
End If
lblModule.Text = Services.Localization.Localization.GetString("Module", Me.LocalResourceFile)
lblPane.Text = Services.Localization.Localization.GetString("Pane", Me.LocalResourceFile)
lblTitle.Text = Services.Localization.Localization.GetString("Title", Me.LocalResourceFile)
lblAlign.Text = Services.Localization.Localization.GetString("Align", Me.LocalResourceFile)
imgAddModuleIcon.AlternateText = Services.Localization.Localization.GetString("AddModule.AlternateText", Me.LocalResourceFile)
cmdAddModule.Text = Services.Localization.Localization.GetString("AddModule", Me.LocalResourceFile)
imgWizardIcon.AlternateText = Services.Localization.Localization.GetString("Wizard.AlternateText", Me.LocalResourceFile)
cmdWizard.Text = Services.Localization.Localization.GetString("Wizard", Me.LocalResourceFile)
imgSiteIcon.AlternateText = Services.Localization.Localization.GetString("Site.AlternateText", Me.LocalResourceFile)
cmdSite.Text = Services.Localization.Localization.GetString("Site", Me.LocalResourceFile)
imgUsersIcon.AlternateText = Services.Localization.Localization.GetString("Users.AlternateText", Me.LocalResourceFile)
cmdUsers.Text = Services.Localization.Localization.GetString("Users", Me.LocalResourceFile)
imgFilesIcon.AlternateText = Services.Localization.Localization.GetString("Files.AlternateText", Me.LocalResourceFile)
cmdFiles.Text = Services.Localization.Localization.GetString("Files", Me.LocalResourceFile)
imgHelpIcon.AlternateText = Services.Localization.Localization.GetString("Help.AlternateText", Me.LocalResourceFile)
cmdHelp.Text = Services.Localization.Localization.GetString("Help", Me.LocalResourceFile)
If PortalSettings.ActiveTab.IsAdminTab Then
imgEditTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_edittab_bw.gif"
cmdEditTab.Enabled = False
cmdEditTabIcon.Enabled = False
imgDeleteTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_deletetab_bw.gif"
cmdDeleteTab.Enabled = False
cmdDeleteTabIcon.Enabled = False
imgCopyTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_copytab_bw.gif"
cmdCopyTab.Enabled = False
cmdCopyTabIcon.Enabled = False
Else
ClientAPI.AddButtonConfirm(cmdDeleteTab, Services.Localization.Localization.GetString("DeleteTabConfirm", Me.LocalResourceFile))
ClientAPI.AddButtonConfirm(cmdDeleteTabIcon, Services.Localization.Localization.GetString("DeleteTabConfirm", Me.LocalResourceFile))
End If
If IsAdminControl() Then
cmdAddModule.Enabled = False
imgAddModuleIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_addmodule_bw.gif"
cmdAddModuleIcon.Enabled = False
End If
If PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) = False Then
imgWizardIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_wizard_bw.gif"
cmdWizard.Enabled = False
cmdWizardIcon.Enabled = False
imgSiteIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_site_bw.gif"
cmdSite.Enabled = False
cmdSiteIcon.Enabled = False
imgUsersIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_users_bw.gif"
cmdUsers.Enabled = False
cmdUsersIcon.Enabled = False
imgFilesIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_files_bw.gif"
cmdFiles.Enabled = False
cmdFilesIcon.Enabled = False
'added
imgAddTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_addtab_bw.gif"
cmdAddTab.Enabled = False
cmdAddTabIcon.Enabled = False
imgEditTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_edittab_bw.gif"
cmdEditTab.Enabled = False
cmdEditTabIcon.Enabled = False
imgDeleteTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_deletetab_bw.gif"
cmdDeleteTab.Enabled = False
cmdDeleteTabIcon.Enabled = False
imgCopyTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_copytab_bw.gif"
cmdCopyTab.Enabled = False
cmdCopyTabIcon.Enabled = False
cmdAddModule.Enabled = False
imgAddModuleIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_addmodule_bw.gif"
cmdAddModuleIcon.Enabled = False
optModuleType.Enabled = False
End If
BindData()
If PortalSettings.ActiveTab.IsAdminTab = False And IsAdminControl() = False Then
Dim intItem As Integer
For intItem = 0 To PortalSettings.ActiveTab.Panes.Count - 1
cboPanes.Items.Add(Convert.ToString(PortalSettings.ActiveTab.Panes(intItem)))
Next intItem
Else
cboPanes.Items.Add(glbDefaultPane)
End If
If Not cboPanes.Items.FindByValue(glbDefaultPane) Is Nothing Then
cboPanes.Items.FindByValue(glbDefaultPane).Selected = True
End If
If cboPermission.Items.Count > 0 Then
cboPermission.SelectedIndex = 0 ' view
End If
If cboAlign.Items.Count > 0 Then
cboAlign.SelectedIndex = 0 ' left
End If
If cboPosition.Items.Count > 0 Then
cboPosition.SelectedIndex = 1 ' bottom
End If
If Convert.ToString(PortalSettings.HostSettings("HelpURL")) <> "" Then
cmdHelp.NavigateUrl = FormatHelpUrl(Convert.ToString(PortalSettings.HostSettings("HelpURL")), PortalSettings, "")
cmdHelpIcon.NavigateUrl = cmdHelp.NavigateUrl
cmdHelp.Enabled = True
cmdHelpIcon.Enabled = True
Else
cmdHelp.Enabled = False
cmdHelpIcon.Enabled = False
End If
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Then in the ModularSettings.ascx.vb file make the following changes (see underlined text):
Private
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim objModules As New ModuleController
' Verify that the current user has access to edit this module
'commented out
'If PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) = False And PortalSecurity.IsInRoles(PortalSettings.ActiveTab.AdministratorRoles.ToString) = False Then
'Response.Redirect(NavigateURL("Access Denied"), True)
'End If
'this needs to execute always to the client script code is registred in InvokePopupCal
cmdStartCalendar.NavigateUrl = Common.Utilities.Calendar.InvokePopupCal(txtStartDate)
cmdEndCalendar.NavigateUrl = Common.Utilities.Calendar.InvokePopupCal(txtEndDate)
If Page.IsPostBack = False Then
ctlIcon.FileFilter = glbImageFileTypes
dgPermissions.ModuleID = ModuleId
DotNetNuke.UI.Utilities.ClientAPI.AddButtonConfirm(cmdDelete, Services.Localization.Localization.GetString("DeleteItem"))
cboTab.DataSource = GetPortalTabs(PortalSettings.DesktopTabs, -1, False, True, False, False, True)
cboTab.DataBind()
'if is and admin or host tab, then add current tab
If PortalSettings.ActiveTab.ParentId = PortalSettings.AdminTabId Or PortalSettings.ActiveTab.ParentId = PortalSettings.SuperTabId Then
cboTab.Items.Insert(0, New ListItem(PortalSettings.ActiveTab.TabName, PortalSettings.ActiveTab.TabID.ToString))
End If
' tab administrators can only manage their own tab
If PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) = False Then
chkAllTabs.Enabled = False
chkDefault.Enabled = False
chkAllModules.Enabled = False
cboTab.Enabled = False
End If
If ModuleId <> -1 Then
BindData()
Else
cboVisibility.SelectedIndex = 0 ' maximized
chkAllTabs.Checked = False
cmdDelete.Visible = False
End If
'Set visibility of Specific Settings
If ctlSpecific Is Nothing = False Then
'Get the module settings from the PortalSettings and pass the
'two settings hashtables to the sub control to process
ctlSpecific.LoadSettings()
dshSpecific.Visible = True
tblSpecific.Visible = True
Else
dshSpecific.Visible = False
tblSpecific.Visible = False
End If
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
If PortalSecurity.IsInRoles(PortalSettings.AdministratorRoleName) = False Then
Dim AD_URL As String
AD_URL = NavigateURL("Access Denied")
Response.Redirect(AD_URL, True)
End If
End Sub