Example #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;
            }
        }
Example #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;
            }
        }
Example #3
0
        private void Page_Load(object sender, System.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
                Rainbow.Settings.Cache.CurrentCache.Remove(Rainbow.Settings.Cache.Key.PortalBaseSettings());
                EditTable.DataSource = new SortedList(PortalSettings.GetPortalBaseSettings(null));
                EditTable.DataBind();
                EditTable.Visible     = true;
                SolutionsList.Enabled = false;
            }
            else
            {
                EditTable.Visible     = false;
                SolutionsList.Enabled = true;
            }
        }