Exemplo n.º 1
0
 private void LocalizePage()
 {
     SetBrowserLanguage();
     Page.Title               = LocalizeString("Title");
     versionLabel.Text        = string.Format(LocalizeString("Version"), Globals.FormatVersion(ApplicationVersion));
     currentVersionLabel.Text = string.Format(LocalizeString("CurrentVersion"), Globals.FormatVersion(DatabaseVersion));
 }
Exemplo n.º 2
0
        public override void UpdatePackage()
        {
            bool        bUpdateSupportedFeatures = Null.NullBoolean;
            PackageInfo _Package = PackageController.GetPackage(PackageID);

            //Update module settings
            if (desktopModuleForm.IsValid)
            {
                var desktopModule = desktopModuleForm.DataSource as DesktopModuleInfo;
                if (desktopModule != null && _Package != null)
                {
                    desktopModule.Shareable    = (ModuleSharing)Enum.Parse(typeof(ModuleSharing), Shareable.ComboBox.SelectedValue.ToString());
                    desktopModule.FriendlyName = _Package.FriendlyName;
                    desktopModule.Version      = Globals.FormatVersion(_Package.Version);
                    if (string.IsNullOrEmpty(desktopModule.BusinessControllerClass))
                    {
                        desktopModule.SupportedFeatures = 0;
                        //If there is no BusinessControllerClass, then there is no any implementation
                    }
                    else
                    {
                        DesktopModuleController controller = new DesktopModuleController();
                        controller.UpdateModuleInterfaces(ref desktopModule);
                    }
                    DesktopModuleController.SaveDesktopModule(desktopModule, false, true);
                }
            }
        }
Exemplo n.º 3
0
        /// -----------------------------------------------------------------------------
        /// <summary>
        /// LocalizePage sets up the Localized Text
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///     [cnurse]	02/09/2007 Created
        /// </history>
        /// -----------------------------------------------------------------------------
        private void LocalizePage()
        {
            //Main Title
            Title = LocalizeString("Title");

            //Page Titles
            for (int i = 0; i <= wizInstall.WizardSteps.Count - 1; i++)
            {
                wizInstall.WizardSteps[i].Title = LocalizeString("Page" + i + ".Title");
            }

            //Wizard Buttons
            LinkButton nextButton = GetWizardButton("StepNavigationTemplateContainerID", "StepNextButton");

            nextButton.Text = LocalizeString("Next");

            nextButton      = GetWizardButton("StartNavigationTemplateContainerID", "StartNextButton");
            nextButton.Text = LocalizeString("Next");

            LinkButton previousButton = GetWizardButton("StepNavigationTemplateContainerID", "StepPreviousButton");

            previousButton.Text = LocalizeString("Previous");

            switch (wizInstall.ActiveStepIndex)
            {
            case 0:     //Page 0 - Welcome
                versionLabel.Text        = string.Format(LocalizeString("Version"), Globals.FormatVersion(ApplicationVersion));
                currentVersionLabel.Text = string.Format(LocalizeString("CurrentVersion"), Globals.FormatVersion(DatabaseVersion));
                introDetailLabel.Text    = LocalizeString("IntroDetail");
                bestPracticesLabel.Text  = LocalizeString("BestPractices");

                break;
            }
        }
Exemplo n.º 4
0
        public override void UpdatePackage()
        {
            bool        bUpdateSupportedFeatures = Null.NullBoolean;
            PackageInfo _Package = PackageController.GetPackage(PackageID);

            //Update module settings
            if (desktopModuleForm.IsValid)
            {
                var desktopModule = desktopModuleForm.DataSource as DesktopModuleInfo;
                if (desktopModule != null && _Package != null)
                {
                    desktopModule.FriendlyName = _Package.FriendlyName;
                    desktopModule.Version      = Globals.FormatVersion(_Package.Version);
                    if (string.IsNullOrEmpty(desktopModule.BusinessControllerClass))
                    {
                        desktopModule.SupportedFeatures = 0;
                    }
                    else
                    {
                        bUpdateSupportedFeatures = true;
                    }
                    DesktopModuleController.SaveDesktopModule(desktopModule, false, true);
                }

                if (bUpdateSupportedFeatures)
                {
                    DesktopModuleController controller = new DesktopModuleController();
                    controller.UpdateModuleInterfaces(ref desktopModule);
                }
            }
        }
Exemplo n.º 5
0
 private static string GetScriptPath(JavaScriptLibrary js)
 {
     if (Host.CdnEnabled)
     {
         //cdn enabled but jsl does not have one defined
         if (!String.IsNullOrEmpty(js.CDNPath))
         {
             return(js.CDNPath);
         }
     }
     return("~/Resources/libraries/" + js.LibraryName + "/" + Globals.FormatVersion(js.Version, "00", 3, "_") + "/" + js.FileName);
 }
 private void LocalizePage()
 {
     SetBrowserLanguage();
     Page.Title = LocalizeString("Title");
     if (Globals.FormatVersion(ApplicationVersion) == Globals.FormatVersion(CurrentVersion))
     {
         versionLabel.Visible        = false;
         currentVersionLabel.Visible = false;
         versionsMatch.Text          = LocalizeString("VersionsMatch");
     }
     else
     {
         versionLabel.Text        = string.Format(LocalizeString("Version"), Globals.FormatVersion(ApplicationVersion));
         currentVersionLabel.Text = string.Format(LocalizeString("CurrentVersion"), Globals.FormatVersion(CurrentVersion));
     }
 }
Exemplo n.º 7
0
 private void LocalizePage()
 {
     this.SetBrowserLanguage();
     this.Page.Title = this.LocalizeString("Title");
     if (Globals.FormatVersion(this.ApplicationVersion) == Globals.FormatVersion(this.CurrentVersion))
     {
         this.versionLabel.Visible        = false;
         this.currentVersionLabel.Visible = false;
         this.versionsMatch.Text          = this.LocalizeString("VersionsMatch");
         if (Globals.IncrementalVersionExists(this.CurrentVersion))
         {
             this.versionsMatch.Text = this.LocalizeString("VersionsMatchButIncrementalExists");
         }
     }
     else
     {
         this.versionLabel.Text        = string.Format(this.LocalizeString("Version"), Globals.FormatVersion(this.ApplicationVersion));
         this.currentVersionLabel.Text = string.Format(this.LocalizeString("CurrentVersion"), Globals.FormatVersion(this.CurrentVersion));
     }
 }
Exemplo n.º 8
0
        protected void OnExecuteClick(object sender, EventArgs e)
        {
            ValidateSuperUser();
            if (IsValidXmlMergDocument(txtScript.Text))
            {
                try
                {
                    var doc = new XmlDocument();
                    doc.LoadXml(txtScript.Text);
                    Application.Application app = DotNetNukeContext.Current.Application;
                    var merge = new Services.Installer.XmlMerge(doc, Globals.FormatVersion(app.Version), app.Description);
                    merge.UpdateConfigs();

                    UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("Success", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess);
                }
                catch (Exception ex)
                {
                    UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ERROR_Merge", LocalResourceFile), ModuleMessage.ModuleMessageType.RedError);
                    Exceptions.LogException(ex);
                }
            }
        }
Exemplo n.º 9
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);
            }
        }
Exemplo n.º 10
0
        private static void RegisterScript(Page page, JavaScriptLibrary jsl)
        {
            ClientResourceManager.RegisterScript(page, GetScriptPath(jsl), GetFileOrder(jsl), GetScriptLocation(jsl));

            //workaround to support IE specific script unti we move to IE version that no longer requires this
            if (jsl.LibraryName == CommonJs.jQueryFileUpload)
            {
                ClientResourceManager.RegisterScript(page,
                                                     "~/Resources/Shared/Scripts/jquery/jquery.iframe-transport.js");
            }

            if (Host.CdnEnabled && !String.IsNullOrEmpty(jsl.ObjectName))
            {
                string pagePortion;
                switch (jsl.PreferredScriptLocation)
                {
                case ScriptLocation.PageHead:

                    pagePortion = "ClientDependencyHeadJs";
                    break;

                case ScriptLocation.BodyBottom:
                    pagePortion = "ClientResourcesFormBottom";
                    break;

                case ScriptLocation.BodyTop:
                    pagePortion = "BodySCRIPTS";
                    break;

                default:
                    pagePortion = "BodySCRIPTS";
                    break;
                }
                Control scriptloader = page.FindControl(pagePortion);
                var     fallback     = new DnnJsIncludeFallback(jsl.ObjectName, VirtualPathUtility.ToAbsolute("~/Resources/libraries/" + jsl.LibraryName + "/" + Globals.FormatVersion(jsl.Version, "00", 3, "_") + "/" + jsl.FileName));
                if (scriptloader != null)
                {
                    //add the fallback control after script loader.
                    var index = scriptloader.Parent.Controls.IndexOf(scriptloader);
                    scriptloader.Parent.Controls.AddAt(index + 1, fallback);
                }
            }
        }