示例#1
0
        /// <summary>
        /// SetHelpVisibility Adds the Help actions to the Action Menu
        /// </summary>
        /// <remarks>
        /// </remarks>
        private void SetHelpVisibility()
        {
            //Add Help Menu Action
            ModuleAction helpAction = new ModuleAction(GetNextActionID());

            helpAction.Title           = Localization.GetString(ModuleActionType.ModuleHelp, Localization.GlobalResourceFile);
            helpAction.CommandName     = ModuleActionType.ModuleHelp;
            helpAction.CommandArgument = "";
            helpAction.Icon            = "help.gif";
            helpAction.Url             = Globals.NavigateURL(TabId, "Help", "ctlid=" + ModuleConfiguration.ModuleControlId, "moduleid=" + ModuleId);
            helpAction.Secure          = SecurityAccessLevel.Edit;
            helpAction.Visible         = true;
            helpAction.NewWindow       = false;
            helpAction.UseActionEvent  = true;
            _actions.Add(helpAction);

            //Add OnLine Help Action
            string helpUrl = Globals.GetOnLineHelp(ModuleConfiguration.HelpUrl, ModuleConfiguration);

            if (!Null.IsNull(helpUrl))
            {
                //Add OnLine Help menu action
                helpAction                 = new ModuleAction(GetNextActionID());
                helpAction.Title           = Localization.GetString(ModuleActionType.OnlineHelp, Localization.GlobalResourceFile);
                helpAction.CommandName     = ModuleActionType.OnlineHelp;
                helpAction.CommandArgument = "";
                helpAction.Icon            = "help.gif";
                helpAction.Url             = Globals.FormatHelpUrl(helpUrl, PortalSettings, ModuleConfiguration.FriendlyName);
                helpAction.Secure          = SecurityAccessLevel.Edit;
                helpAction.UseActionEvent  = true;
                helpAction.Visible         = true;
                helpAction.NewWindow       = true;
                _actions.Add(helpAction);
            }
        }
示例#2
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// AddHelpActions Adds the Help actions to the Action Menu
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	05/12/2005	Documented
        ///     [cnurse]    01/19/2006  Moved from ActionBase
        ///     [cnurse]    12/24/2007  Renamed (from SetHelpVisibility)
        /// </history>
        /// -----------------------------------------------------------------------------
        private void AddHelpActions()
        {
            var helpAction = new ModuleAction(GetNextActionID())
            {
                Title           = Localization.GetString(ModuleActionType.ModuleHelp, Localization.GlobalResourceFile),
                CommandName     = ModuleActionType.ModuleHelp,
                CommandArgument = "",
                Icon            = "action_help.gif",
                Url             = NavigateUrl(TabId, "Help", false, "ctlid=" + Configuration.ModuleControlId, "moduleid=" + ModuleId),
                Secure          = SecurityAccessLevel.Edit,
                Visible         = true,
                NewWindow       = false,
                UseActionEvent  = true
            };

            //Add Help Menu Action
            _moduleGenericActions.Actions.Add(helpAction);

            //Add OnLine Help Action
            string helpURL = Globals.GetOnLineHelp(Configuration.ModuleControl.HelpURL, Configuration);

            if (!string.IsNullOrEmpty(helpURL))
            {
                //Add OnLine Help menu action
                helpAction = new ModuleAction(GetNextActionID())
                {
                    Title           = Localization.GetString(ModuleActionType.OnlineHelp, Localization.GlobalResourceFile),
                    CommandName     = ModuleActionType.OnlineHelp,
                    CommandArgument = "",
                    Icon            = "action_help.gif",
                    Secure          = SecurityAccessLevel.Edit,
                    UseActionEvent  = true,
                    Visible         = true,
                    NewWindow       = true
                };
                var version = Configuration.DesktopModule.Version;
                helpAction.Url = Globals.FormatHelpUrl(helpURL, PortalSettings, Configuration.DesktopModule.FriendlyName, version);
                _moduleGenericActions.Actions.Add(helpAction);
            }
        }
示例#3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            imgAddModule.Click                 += imgAddModule_Click;
            optMode.SelectedIndexChanged       += optMode_SelectedIndexChanged;
            optModuleType.SelectedIndexChanged += optModuleType_SelectedIndexChanged;
            cboTabs.SelectedIndexChanged       += cboTabs_SelectedIndexChanged;
            cmdVisibility.Click                += cmdVisibility_Click;
            cboPanes.SelectedIndexChanged      += cboPanes_SelectedIndexChanged;
            cboPosition.SelectedIndexChanged   += cboPosition_SelectedIndexChanged;
            imgAdmin.Click     += imgAdmin_Click;
            cmdAdmin.Click     += cmdAdmin_Click;
            imgHost.Click      += imgHost_Click;
            cmdHost.Click      += cmdHost_Click;
            cmdAddModule.Click += AddModule_Click;

            cmdAddTab.Click        += PageFunctions_Click;
            cmdAddTabIcon.Click    += PageFunctions_Click;
            cmdEditTab.Click       += PageFunctions_Click;
            cmdEditTabIcon.Click   += PageFunctions_Click;
            cmdDeleteTab.Click     += PageFunctions_Click;
            cmdDeleteTabIcon.Click += PageFunctions_Click;
            cmdCopyTab.Click       += PageFunctions_Click;
            cmdCopyTabIcon.Click   += PageFunctions_Click;
            cmdExportTab.Click     += PageFunctions_Click;
            cmdExportTabIcon.Click += PageFunctions_Click;
            cmdImportTab.Click     += PageFunctions_Click;
            cmdImportTabIcon.Click += PageFunctions_Click;

            cmdExtensions.Click     += CommonTasks_Click;
            cmdExtensionsIcon.Click += CommonTasks_Click;
            cmdFiles.Click          += CommonTasks_Click;
            cmdFilesIcon.Click      += CommonTasks_Click;
            cmdRoles.Click          += CommonTasks_Click;
            cmdRolesIcon.Click      += CommonTasks_Click;
            cmdSite.Click           += CommonTasks_Click;
            cmdSiteIcon.Click       += CommonTasks_Click;
            cmdUsers.Click          += CommonTasks_Click;
            cmdUsersIcon.Click      += CommonTasks_Click;

            try
            {
                if (IsPageAdmin())
                {
                    tblControlPanel.Visible = true;
                    cmdVisibility.Visible   = true;
                    rowControlPanel.Visible = true;

                    Localize();

                    if (Globals.IsAdminControl())
                    {
                        cmdAddModule.Enabled = false;
                    }
                    if (!Page.IsPostBack)
                    {
                        optModuleType.Items.FindByValue("0").Selected = true;

                        if (!TabPermissionController.CanAddPage())
                        {
                            DisableAction(imgAddTabIcon, "iconbar_addtab_bw.gif", cmdAddTabIcon, cmdAddTab);
                        }
                        if (!TabPermissionController.CanManagePage())
                        {
                            DisableAction(imgEditTabIcon, "iconbar_edittab_bw.gif", cmdEditTabIcon, cmdEditTab);
                        }
                        if (!TabPermissionController.CanDeletePage() || TabController.IsSpecialTab(TabController.CurrentPage.TabID, PortalSettings))
                        {
                            DisableAction(imgDeleteTabIcon, "iconbar_deletetab_bw.gif", cmdDeleteTabIcon, cmdDeleteTab);
                        }
                        else
                        {
                            ClientAPI.AddButtonConfirm(cmdDeleteTab, Localization.GetString("DeleteTabConfirm", LocalResourceFile));
                            ClientAPI.AddButtonConfirm(cmdDeleteTabIcon, Localization.GetString("DeleteTabConfirm", LocalResourceFile));
                        }
                        if (!TabPermissionController.CanCopyPage())
                        {
                            DisableAction(imgCopyTabIcon, "iconbar_copytab_bw.gif", cmdCopyTabIcon, cmdCopyTab);
                        }
                        if (!TabPermissionController.CanExportPage())
                        {
                            DisableAction(imgExportTabIcon, "iconbar_exporttab_bw.gif", cmdExportTabIcon, cmdExportTab);
                        }
                        if (!TabPermissionController.CanImportPage())
                        {
                            DisableAction(imgImportTabIcon, "iconbar_importtab_bw.gif", cmdImportTabIcon, cmdImportTab);
                        }
                        if (!TabPermissionController.CanAddContentToPage())
                        {
                            pnlModules.Visible = false;
                        }
                        if (!GetModulePermission(PortalSettings.PortalId, "Site Settings"))
                        {
                            DisableAction(imgSiteIcon, "iconbar_site_bw.gif", cmdSiteIcon, cmdSite);
                        }
                        if (GetModulePermission(PortalSettings.PortalId, "User Accounts") == false)
                        {
                            DisableAction(imgUsersIcon, "iconbar_users_bw.gif", cmdUsersIcon, cmdUsers);
                        }
                        if (GetModulePermission(PortalSettings.PortalId, "Security Roles") == false)
                        {
                            DisableAction(imgRolesIcon, "iconbar_roles_bw.gif", cmdRolesIcon, cmdRoles);
                        }
                        if (GetModulePermission(PortalSettings.PortalId, "Digital Asset Management") == false)
                        {
                            DisableAction(imgFilesIcon, "iconbar_files_bw.gif", cmdFilesIcon, cmdFiles);
                        }
                        if (GetModulePermission(PortalSettings.PortalId, "Extensions") == false)
                        {
                            DisableAction(imgExtensionsIcon, "iconbar_extensions_bw.gif", cmdExtensionsIcon, cmdExtensions);
                        }
                        UserInfo objUser = UserController.GetCurrentUserInfo();
                        if (objUser != null)
                        {
                            if (objUser.IsSuperUser)
                            {
                                hypMessage.ImageUrl = Upgrade.UpgradeIndicator(DotNetNukeContext.Current.Application.Version, Request.IsLocal, Request.IsSecureConnection);
                                if (!String.IsNullOrEmpty(hypMessage.ImageUrl))
                                {
                                    hypMessage.ToolTip     = Localization.GetString("hypUpgrade.Text", LocalResourceFile);
                                    hypMessage.NavigateUrl = Upgrade.UpgradeRedirect();
                                }
                                cmdHost.Visible = true;
                            }
                            else //branding
                            {
                                if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) && Host.DisplayCopyright)
                                {
                                    hypMessage.ImageUrl    = "~/images/branding/iconbar_logo.png";
                                    hypMessage.ToolTip     = DotNetNukeContext.Current.Application.Description;
                                    hypMessage.NavigateUrl = Localization.GetString("hypMessageUrl.Text", LocalResourceFile);
                                }
                                else
                                {
                                    hypMessage.Visible = false;
                                }
                                cmdHost.Visible  = false;
                                cmdAdmin.Visible = GetModulePermission(PortalSettings.PortalId, "Console");
                            }
                            imgHost.Visible  = cmdHost.Visible;
                            imgAdmin.Visible = cmdAdmin.Visible;
                        }
                        BindData();
                        int intItem;
                        for (intItem = 0; intItem <= PortalSettings.ActiveTab.Panes.Count - 1; intItem++)
                        {
                            cboPanes.Items.Add(Convert.ToString(PortalSettings.ActiveTab.Panes[intItem]));
                        }
                        if (cboPanes.Items.FindByValue(Globals.glbDefaultPane) != null)
                        {
                            cboPanes.Items.FindByValue(Globals.glbDefaultPane).Selected = true;
                        }
                        if (cboPermission.Items.Count > 0)
                        {
                            cboPermission.SelectedIndex = 0; //view
                        }
                        LoadPositions();

                        if (!string.IsNullOrEmpty(Host.HelpURL))
                        {
                            var version = Globals.FormatVersion(DotNetNukeContext.Current.Application.Version, false);
                            cmdHelp.NavigateUrl     = Globals.FormatHelpUrl(Host.HelpURL, PortalSettings, version);
                            cmdHelpIcon.NavigateUrl = cmdHelp.NavigateUrl;
                            cmdHelp.Enabled         = true;
                            cmdHelpIcon.Enabled     = true;
                        }
                        else
                        {
                            cmdHelp.Enabled     = false;
                            cmdHelpIcon.Enabled = false;
                        }
                        SetMode(false);
                        SetVisibility(false);
                    }

                    //Register jQuery
                    jQuery.RequestRegistration();
                }
                else if (IsModuleAdmin())
                {
                    tblControlPanel.Visible = true;
                    cmdVisibility.Visible   = false;
                    rowControlPanel.Visible = false;
                    if (!Page.IsPostBack)
                    {
                        SetMode(false);
                        SetVisibility(false);
                    }
                }
                else
                {
                    tblControlPanel.Visible = false;
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
示例#4
0
        /// <summary>
        /// Page_Load runs when the control is loaded.
        /// </summary>
        /// <history>
        ///     [cnurse]	10/06/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Page.IsPostBack)
                {
                    // localization
                    lblPageFunctions.Text = Localization.GetString("PageFunctions", this.LocalResourceFile);
                    optModuleType.Items.FindByValue("0").Selected = true;
                    lblCommonTasks.Text         = Localization.GetString("CommonTasks", this.LocalResourceFile);
                    imgAddTabIcon.AlternateText = Localization.GetString("AddTab.AlternateText", this.LocalResourceFile);
                    cmdAddTab.Text = Localization.GetString("AddTab", this.LocalResourceFile);
                    imgEditTabIcon.AlternateText = Localization.GetString("EditTab.AlternateText", this.LocalResourceFile);
                    cmdEditTab.Text = Localization.GetString("EditTab", this.LocalResourceFile);
                    imgDeleteTabIcon.AlternateText = Localization.GetString("DeleteTab.AlternateText", this.LocalResourceFile);
                    cmdDeleteTab.Text            = Localization.GetString("DeleteTab", this.LocalResourceFile);
                    imgCopyTabIcon.AlternateText = Localization.GetString("CopyTab.AlternateText", this.LocalResourceFile);
                    cmdCopyTab.Text = Localization.GetString("CopyTab", this.LocalResourceFile);
                    imgPreviewTabIcon.AlternateText = Localization.GetString("PreviewTab.AlternateText", this.LocalResourceFile);
                    cmdPreviewTab.Text = Localization.GetString("PreviewTab", this.LocalResourceFile);
                    if (IsPreview)
                    {
                        imgPreviewTabIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_unpreviewtab.gif";
                    }
                    lblModule.Text = Localization.GetString("Module", this.LocalResourceFile);
                    lblPane.Text   = Localization.GetString("Pane", this.LocalResourceFile);
                    lblTitle.Text  = Localization.GetString("Title", this.LocalResourceFile);
                    lblAlign.Text  = Localization.GetString("Align", this.LocalResourceFile);
                    imgAddModuleIcon.AlternateText = Localization.GetString("AddModule.AlternateText", this.LocalResourceFile);
                    cmdAddModule.Text          = Localization.GetString("AddModule", this.LocalResourceFile);
                    cmdInstallFeatures.Text    = Localization.GetString("InstallFeatures", this.LocalResourceFile);
                    imgRolesIcon.AlternateText = Localization.GetString("Roles.AlternateText", this.LocalResourceFile);
                    cmdRoles.Text             = Localization.GetString("Roles", this.LocalResourceFile);
                    imgSiteIcon.AlternateText = Localization.GetString("Site.AlternateText", this.LocalResourceFile);
                    cmdSite.Text = Localization.GetString("Site", this.LocalResourceFile);
                    imgUsersIcon.AlternateText = Localization.GetString("Users.AlternateText", this.LocalResourceFile);
                    cmdUsers.Text = Localization.GetString("Users", this.LocalResourceFile);
                    imgFilesIcon.AlternateText = Localization.GetString("Files.AlternateText", this.LocalResourceFile);
                    cmdFiles.Text             = Localization.GetString("Files", this.LocalResourceFile);
                    imgHelpIcon.AlternateText = Localization.GetString("Help.AlternateText", this.LocalResourceFile);
                    cmdHelp.Text = Localization.GetString("Help", this.LocalResourceFile);

                    if (PortalSettings.ActiveTab.IsAdminTab)
                    {
                        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, Localization.GetString("DeleteTabConfirm", this.LocalResourceFile));
                        ClientAPI.AddButtonConfirm(cmdDeleteTabIcon, Localization.GetString("DeleteTabConfirm", this.LocalResourceFile));
                    }

                    if (Globals.IsAdminControl())
                    {
                        cmdAddModule.Enabled      = false;
                        imgAddModuleIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_addmodule_bw.gif";
                        cmdAddModuleIcon.Enabled  = false;
                    }

                    if (PortalSecurity.IsInRole(PortalSettings.AdministratorRoleName) == 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;
                        imgRolesIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_roles_bw.gif";
                        cmdRoles.Enabled      = false;
                        cmdRolesIcon.Enabled  = false;
                        imgFilesIcon.ImageUrl = "~/Admin/ControlPanel/images/iconbar_files_bw.gif";
                        cmdFiles.Enabled      = false;
                        cmdFilesIcon.Enabled  = false;
                    }

                    UserInfo objUser = UserController.GetCurrentUserInfo();
                    if (objUser != null)
                    {
                        if (!objUser.IsSuperUser)
                        {
                            rowInstallModule.Visible = false;
                        }
                    }

                    BindData();

                    if (PortalSettings.ActiveTab.IsAdminTab == false & Globals.IsAdminControl() == false)
                    {
                        for (int intItem = 0; intItem < PortalSettings.ActiveTab.Panes.Count; intItem++)
                        {
                            cboPanes.Items.Add(Convert.ToString(PortalSettings.ActiveTab.Panes[intItem]));
                        }
                    }
                    else
                    {
                        cboPanes.Items.Add(Globals.glbDefaultPane);
                    }
                    if (cboPanes.Items.FindByValue(Globals.glbDefaultPane) != null)
                    {
                        cboPanes.Items.FindByValue(Globals.glbDefaultPane).Selected = true;
                    }

                    if (cboPermission.Items.Count > 0)
                    {
                        cboPermission.SelectedIndex = 0; // view
                    }

                    if (cboAlign.Items.Count > 0)
                    {
                        cboAlign.SelectedIndex = 0; // left
                    }

                    if (cboPosition.Items.Count > 0)
                    {
                        cboPosition.SelectedIndex = 1; // bottom
                    }

                    if (Convert.ToString(PortalSettings.HostSettings["HelpURL"]) != "")
                    {
                        cmdHelp.NavigateUrl     = Globals.FormatHelpUrl(Convert.ToString(PortalSettings.HostSettings["HelpURL"]), PortalSettings, "");
                        cmdHelpIcon.NavigateUrl = cmdHelp.NavigateUrl;
                        cmdHelp.Enabled         = true;
                        cmdHelpIcon.Enabled     = true;
                    }
                    else
                    {
                        cmdHelp.Enabled     = false;
                        cmdHelpIcon.Enabled = false;
                    }
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }