Exemple #1
0
        /// <summary>
        /// The SavePageData helper method is used to persist the
        /// current tab settings to the database.
        /// </summary>
        /// <returns></returns>
        private int SavePageData()
        {
            // Construct Authorized User Roles string
            string authorizedRoles = "";

            foreach (ListItem item in authRoles.Items)
            {
                if (item.Selected == true)
                {
                    authorizedRoles = authorizedRoles + item.Text + ";";
                }
            }

            // Add Page info in the database
            int NewPageID =
                new PagesDB().AddPage(this.PortalSettings.PortalID, Int32.Parse(parentPage.SelectedItem.Value), tabName.Text,
                                      990000, authorizedRoles, showMobile.Checked, mobilePageName.Text);

            //Clear SiteMaps Cache
            AppleseedSiteMapProvider.ClearAllAppleseedSiteMapCaches();

            // Update custom settings in the database
            EditTable.UpdateControls();
            return(NewPageID);
        }
Exemple #2
0
        /// <summary>
        /// Persists the changes to database
        /// </summary>
        protected override void OnUpdate(EventArgs e)
        {
            base.OnUpdate(e);

            // Only Update if Input Data is Valid
            if (Page.IsValid == true)
            {
                // Update settings in the database
                EditTable.UpdateControls();
            }
        }
Exemple #3
0
        /// <summary>
        /// OnUpdate
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        protected override void OnUpdate(EventArgs e)
        {
            base.OnUpdate(e);

            if (Page.IsValid)
            {
                //Get Solutions
                PortalsDB portals = new PortalsDB();

                try {
                    PathField.Text = PathField.Text.Replace("/", string.Empty);
                    PathField.Text = PathField.Text.Replace("\\", string.Empty);
                    PathField.Text = PathField.Text.Replace(".", string.Empty);

                    if (!chkUseXMLTemplate.Checked)
                    {
                        // Create portal the "old" way
                        int NewPortalID =
                            portals.CreatePortal(this.PortalSettings.PortalID, AliasField.Text, TitleField.Text, PathField.Text);

                        // Update custom settings in the database
                        EditTable.ObjectID = NewPortalID;
                        EditTable.UpdateControls();
                    }
                    else
                    {
                        bool createdOk   = true;
                        int  newPortalID = CreatePortal(out createdOk);
                        if (!createdOk)
                        {
                            string aux = General.GetString("NEW_PORTAL_ERROR", "There was an error on creating the portal", this);

                            ErrorMessage.Visible = true;
                            ErrorMessage.Text    = aux + "<br>";
                            return;
                        }
                    }


                    // Redirect back to calling page
                    RedirectBackToReferringPage();
                } catch (Exception ex) {
                    string aux =
                        General.GetString("NEW_PORTAL_ERROR", "There was an error on creating the portal", this);
                    ErrorHandler.Publish(LogLevel.Error, aux, ex);

                    ErrorMessage.Visible = true;
                    ErrorMessage.Text    = aux + "<br>";
                }
            }
        }
Exemple #4
0
        /// <summary>
        /// Persists the changes to database
        /// </summary>
        protected override void OnUpdate(EventArgs e)
        {
            base.OnUpdate(e);

            // Only Update if Input Data is Valid
            if (Page.IsValid == true)
            {
                // Update settings in the database
                EditTable.UpdateControls();
            }

            if (Request.QueryString.GetValues("ModalChangeMaster") != null)
            {
                Response.Write("<script type=\"text/javascript\">window.parent.location = window.parent.location.href;</script>");
            }
        }
Exemple #5
0
        /// <summary>
        /// OnUpdate
        /// </summary>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        protected override void OnUpdate(EventArgs e)
        {
            base.OnUpdate(e);

            if (Page.IsValid)
            {
                //Update main settings and Tab info in the database
                new PortalsDB().UpdatePortalInfo(currentPortalID, TitleField.Text, PathField.Text, false);

                // Update custom settings in the database
                EditTable.ObjectID = currentPortalID;
                EditTable.UpdateControls();

                // Remove cache for reload settings before redirect
                CurrentCache.Remove(Key.PortalSettings());
                // Redirect back to calling page
                RedirectBackToReferringPage();
            }
        }
        /// <summary>
        /// Is used to update the Site Settings within the Portal Config System
        /// </summary>
        /// <param name="e"></param>
        protected override void OnUpdate(EventArgs e)
        {
            // Flush the cache for recovery the changes. [email protected] (30/07/2004)
            PortalSettings.FlushBaseSettingsCache(portalSettings.PortalPath);
            //Call base
            base.OnUpdate(e);

            // Only Update if Input Data is Valid
            if (Page.IsValid == true)
            {
                //Update main settings and Tab info in the database
                new PortalsDB().UpdatePortalInfo(portalSettings.PortalID, siteName.Text, sitePath.Text, false);

                // Update custom settings in the database
                EditTable.UpdateControls();

                // Redirect to this site to refresh
                Response.Redirect(Request.RawUrl);
            }
        }
        /// <summary>
        /// Is used to update the Site Settings within the Portal Config System
        /// </summary>
        /// <param name="e"></param>
        protected override void OnUpdate(EventArgs e)
        {
            // Flush the cache for recovery the changes. [email protected] (30/07/2004)
            PortalSettings.FlushBaseSettingsCache(this.PortalSettings.PortalPath);
            //Call base
            base.OnUpdate(e);

            // Only Update if Input Data is Valid
            if (Page.IsValid == true)
            {
                //Update main settings and Tab info in the database
                new PortalsDB().UpdatePortalInfo(this.PortalSettings.PortalID, siteName.Text, String.IsNullOrEmpty(sitePath.Text) ? this.PortalSettings.PortalPath : sitePath.Text, false);

                // Update custom settings in the database
                EditTable.UpdateControls();

                // Redirect to this site to refresh
                Response.Redirect(HttpUrlBuilder.BuildUrl(this.PortalSettings.ActivePage.PageID));
            }
        }
Exemple #8
0
        /// <summary>
        /// The SavePageData helper method is used to persist the
        /// current tab settings to the database.
        /// </summary>
        private void SavePageData()
        {
            // Construct Authorized User Roles string
            string authorizedRoles = string.Empty;

            foreach (ListItem item in authRoles.Items)
            {
                if (item.Selected == true)
                {
                    authorizedRoles = authorizedRoles + item.Text + ";";
                }
            }

            // update Page info in the database
            new PagesDB().UpdatePage(portalSettings.PortalID, PageID, Int32.Parse(parentPage.SelectedItem.Value),
                                     tabName.Text, portalSettings.ActivePage.PageOrder, authorizedRoles,
                                     mobilePageName.Text, showMobile.Checked);

            // Update custom settings in the database
            EditTable.UpdateControls();
        }
Exemple #9
0
        /// <summary>
        /// Persists the changes to database
        /// </summary>
        protected override void OnUpdate(EventArgs e)
        {
            base.OnUpdate(e);

            // Only Update if Input Data is Valid
            if (Page.IsValid == true)
            {
                // Update settings in the database
                EditTable.UpdateControls();
            }

            if (Request.QueryString.GetValues("ModalChangeMaster") != null)
            {
                if (this.Module.GuidID == new Guid("{5AB6843E-5A24-4D36-BB3D-0AE815DDB3B1}"))
                {
                    Response.Write("<script type=\"text/javascript\">window.parent.location = window.parent.location.href.split('?')[0];</script>");
                }
                else
                {
                    Response.Write("<script type=\"text/javascript\">window.parent.location = window.parent.location.href;</script>");
                }
            }
        }