예제 #1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, EventArgs e)
        {
            // Get portalID from querystring
            if (Request.Params["portalID"] != null)
            {
                currentPortalID = Int32.Parse(Request.Params["portalID"]);
            }

            if (currentPortalID != -1)
            {
                // Remove cache for reload settings
                if (!Page.IsPostBack)
                {
                    CurrentCache.Remove(Key.PortalSettings());
                }

                // Obtain PortalSettings of this Portal
                PortalSettings currentPortalSettings = new PortalSettings(currentPortalID);

                // If this is the first visit to the page, populate the site data
                if (!Page.IsPostBack)
                {
                    PortalIDField.Text = currentPortalID.ToString();
                    TitleField.Text    = currentPortalSettings.PortalName;
                    AliasField.Text    = currentPortalSettings.PortalAlias;
                    PathField.Text     = currentPortalSettings.PortalPath;
                }
                EditTable.DataSource =
                    new SortedList(
                        PortalSettings.GetPortalCustomSettings(currentPortalSettings.PortalID,
                                                               PortalSettings.GetPortalBaseSettings(null)));
                EditTable.DataBind();
                EditTable.ObjectID = currentPortalID;
            }
        }
예제 #2
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, EventArgs e)
        {
            string editPortal = Request.Params["selectedTemplate"];

            if (editPortal != null)
            {
                if (Page.IsPostBack == false)
                {
                    List <String> lstPortal = new List <string>();
                    lstPortal.Add(editPortal);
                    ddlXMLTemplates.DataSource = lstPortal;
                    ddlXMLTemplates.DataBind();
                }
            }
            else
            {
                // Verify that the current user has access to access this page
                // Removed by Mario Endara <*****@*****.**> (2004/11/04)
                //            if (PortalSecurity.IsInRoles("Admins") == false)
                //                PortalSecurity.AccessDeniedEdit();
                // If this is the first visit to the page, populate the site data
                if (Page.IsPostBack == false)
                {
                    var templateServices = PortalTemplateFactory.GetPortalTemplateServices(new PortalTemplateRepository());


                    ddlXMLTemplates.DataSource = templateServices.GetTemplates(PortalSettings.PortalAlias, PortalSettings.PortalFullPath);
                    ddlXMLTemplates.DataBind();
                    if (ddlXMLTemplates.Items.Count != 0)
                    {
                        ddlXMLTemplates.SelectedIndex = 0;
                    }
                    else
                    {
                        chkUseXMLTemplate.Enabled = false;
                    }
                }
            }
            var chkbox = Request.Params["chkUseXMLTemplate"];

            if (chkbox != null)
            {
                chkUseXMLTemplate.Checked = bool.Parse(Request.Params["chkUseXMLTemplate"]);
            }
            if (chkUseXMLTemplate.Checked == false)
            {
                // Don't use a template portal, so show the EditTable
                // Remove the cache that can be setted by the new Portal, to get a "clean" PortalBaseSetting
                CurrentCache.Remove(Key.PortalBaseSettings());
                EditTable.DataSource = new SortedList(PortalSettings.GetPortalBaseSettings(null));
                EditTable.DataBind();
                EditTable.Visible       = true;
                ddlXMLTemplates.Enabled = false;
            }
            else
            {
                EditTable.Visible       = false;
                ddlXMLTemplates.Enabled = true;
            }
        }
예제 #3
0
 /// <summary>
 /// Handles the Load event of the PageCustomPropertyPage control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
 private void PageCustomPropertyPage_Load(object sender, EventArgs e)
 {
     EditTable.DataSource =
         new SortedList(
             ModuleSettingsCustom.GetModuleUserSettings(this.ModuleID,
                                                        (Guid)PortalSettings.CurrentUser.Identity.ProviderUserKey, this));
     EditTable.DataBind();
 }
        /// <summary>
        /// The Page_Load server event handler on this user control is used
        /// to populate the current site settings from the config system
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Load(object sender, EventArgs e)
        {
            // If this is the first visit to the page, populate the site data
            if (Page.IsPostBack == false)
            {
                //We flush cache for enable correct localization of items
                PortalSettings.FlushBaseSettingsCache(portalSettings.PortalPath);

                siteName.Text = portalSettings.PortalName;
                sitePath.Text = portalSettings.PortalPath;
            }
            EditTable.DataSource = new SortedList(portalSettings.CustomSettings);
            EditTable.DataBind();
        }
예제 #5
0
 private void PagePropertyPage_Load(object sender, EventArgs e)
 {
     //We reset cache before dispay page to ensure dropdown shows actual data
     //by Pekka Ylenius
     CurrentCache.Remove(Key.ModuleSettings(ModuleID));
     // Using settings grouping tabs or not is set in config file. --Hongwei Shen
     EditTable.UseGroupingTabs = Rainbow.Framework.Settings.Config.UseSettingsGroupingTabs;
     // The width and height will take effect only when using grouping tabs.
     // When not using grouping tabs, width and height should be set in css
     // class -- Hongwei Shen
     EditTable.Width      = Rainbow.Framework.Settings.Config.SettingsGroupingWidth;
     EditTable.Height     = Rainbow.Framework.Settings.Config.SettingsGroupingHeight;
     EditTable.CssClass   = "st_control";
     EditTable.DataSource = new SortedList(moduleSettings);
     EditTable.DataBind();
 }
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void Page_Load(object sender, EventArgs e)
        {
            // Verify that the current user has access to access this page
            // Removed by Mario Endara <*****@*****.**> (2004/11/04)
//            if (PortalSecurity.IsInRoles("Admins") == false)
//                PortalSecurity.AccessDeniedEdit();

            // If this is the first visit to the page, populate the site data
            if (Page.IsPostBack == false)
            {
                // Bind the Portals to the SolutionsList
                SolutionsList.DataSource = GetPortals();
                SolutionsList.DataBind();

                //Preselect default Portal
                if (SolutionsList.Items.FindByValue("Default") != null)
                {
                    SolutionsList.Items.FindByValue("Default").Selected = true;
                }
            }

            if (chkUseTemplate.Checked == false)
            {
                // Don't use a template portal, so show the EditTable
                // Remove the cache that can be setted by the new Portal, to get a "clean" PortalBaseSetting
                CurrentCache.Remove(Key.PortalBaseSettings());
                EditTable.DataSource = new SortedList(PortalSettings.GetPortalBaseSettings(null));
                EditTable.DataBind();
                EditTable.Visible     = true;
                SolutionsList.Enabled = false;
            }
            else
            {
                EditTable.Visible     = false;
                SolutionsList.Enabled = true;
            }
        }
예제 #7
0
        /// <summary>
        /// The Page_Load server event handler on this page is used
        /// to populate a tab's layout settings on the page
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //Confirm delete
            if (!(ClientScript.IsClientScriptBlockRegistered("confirmDelete")))
            {
                string[] s = { "CONFIRM_DELETE" };
                ClientScript.RegisterClientScriptBlock(this.GetType(), "confirmDelete",
                                                       PortalSettings.GetStringResource(
                                                           "CONFIRM_DELETE_SCRIPT", s));
            }

            LeftDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            RightDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");
            ContentDeleteBtn.Attributes.Add("OnClick", "return confirmDelete()");

            // If first visit to the page, update all entries
            if (!Page.IsPostBack)
            {
                msgError.Visible = false;

                // Set images for buttons from current theme
                LeftUpBtn.ImageUrl     = CurrentTheme.GetImage("Buttons_Up", "Up.gif").ImageUrl;
                LeftRightBtn.ImageUrl  = CurrentTheme.GetImage("Buttons_Right", "Right.gif").ImageUrl;
                LeftDownBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Down", "Down.gif").ImageUrl;
                LeftEditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
                LeftDeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;

                ContentUpBtn.ImageUrl     = CurrentTheme.GetImage("Buttons_Up", "Up.gif").ImageUrl;
                ContentLeftBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Left", "Left.gif").ImageUrl;
                ContentRightBtn.ImageUrl  = CurrentTheme.GetImage("Buttons_Right", "Right.gif").ImageUrl;
                ContentDownBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Down", "Down.gif").ImageUrl;
                ContentEditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
                ContentDeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;

                RightUpBtn.ImageUrl     = CurrentTheme.GetImage("Buttons_Up", "Up.gif").ImageUrl;
                RightLeftBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Left", "Left.gif").ImageUrl;
                RightDownBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Down", "Down.gif").ImageUrl;
                RightEditBtn.ImageUrl   = CurrentTheme.GetImage("Buttons_Edit", "Edit.gif").ImageUrl;
                RightDeleteBtn.ImageUrl = CurrentTheme.GetImage("Buttons_Delete", "Delete.gif").ImageUrl;

                BindData();

                SetSecurityAccess();

                // 2/27/2003 Start - Ender Malkoc
                // After up or down button when the page is refreshed, select the previously selected
                // tab from the list.
                if (Request.Params["selectedmodid"] != null)
                {
                    try {
                        int modIndex = Int32.Parse(Request.Params["selectedmodid"]);
                        SelectModule(leftPane, GetModules("LeftPane"), modIndex);
                        SelectModule(contentPane, GetModules("ContentPane"), modIndex);
                        SelectModule(rightPane, GetModules("RightPane"), modIndex);
                    }
                    catch (Exception ex) {
                        ErrorHandler.Publish(LogLevel.Error,
                                             "After up or down button when the page is refreshed, select the previously selected tab from the list.",
                                             ex);
                    }
                }
                // 2/27/2003 end - Ender Malkoc
            }
            // Binds custom settings to table
            EditTable.DataSource = new SortedList(pageSettings);
            EditTable.DataBind();
        }