public static string Create(string NodeType, int TypeId, int NodeId, string Text)
 {
     return(LegacyDialogHandler.Create(
                new HttpContextWrapper(HttpContext.Current),
                BasePage.Current.getUser(),
                NodeType, NodeId, Text, TypeId));
 }
        protected void sbmt_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                var createMacroVal = 0;
                if (createMacro.Checked)
                {
                    createMacroVal = 1;
                }

                var xsltName = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema ? xsltTemplate.SelectedValue :
                               Path.Combine("schema2", xsltTemplate.SelectedValue);

                var returnUrl = LegacyDialogHandler.Create(
                    new HttpContextWrapper(Context),
                    BasePage.Current.getUser(),
                    helper.Request("nodeType"),
                    createMacroVal,
                    xsltName + "|||" + rename.Text);

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .ChildNodeCreated()
                .CloseModalWindow();
            }
        }
Example #3
0
        protected void sbmt_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                int nodeId;
                if (int.TryParse(Request.QueryString["nodeId"], out nodeId) == false)
                {
                    nodeId = -1;
                }

                try
                {
                    var returnUrl = LegacyDialogHandler.Create(
                        new HttpContextWrapper(Context),
                        new User(Security.CurrentUser),
                        Request.GetItemAsString("nodeType"),
                        nodeId,
                        rename.Text.Trim(),
                        Request.QueryString.AsEnumerable().ToDictionary(x => x.Key, x => (object)x.Value));

                    BasePage.Current.ClientTools
                    .ChangeContentFrameUrl(returnUrl)
                    .ReloadActionNode(false, true)
                    .CloseModalWindow();
                }
                catch (Exception ex)
                {
                    CustomValidation.ErrorMessage = "* " + ex.Message;
                    CustomValidation.IsValid      = false;
                }
            }
        }
Example #4
0
        protected void SubmitClick(object sender, System.EventArgs e)
        {
            int createFolder = 0;

            if (scriptType.SelectedValue == "")
            {
                createFolder = 1;
                ContainsValidator.Enabled = true;
                Page.Validate();
            }

            if (Page.IsValid)
            {
                string returnUrl = LegacyDialogHandler.Create(
                    new HttpContextWrapper(Context),
                    BasePage.Current.getUser(),
                    helper.Request("nodeType"),
                    createFolder,
                    rename.Text + '\u00A4' + scriptType.SelectedValue);

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .ReloadActionNode(false, true)
                .CloseModalWindow();
            }
        }
Example #5
0
        protected void sbmt_Click(object sender, EventArgs e)
        {
            LegacyDialogHandler.Create(
                new HttpContextWrapper(Context),
                BasePage.Current.getUser(),
                helper.Request("nodeType"),
                -1,
                Cultures.SelectedValue);

            BasePage.Current.ClientTools
            .ReloadActionNode(false, true)
            .CloseModalWindow();
        }
        protected void sbmt_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                if (ValidateAlias(rename.Text) == false)
                {
                    BasePage.Current.ClientTools.ShowSpeechBubble(BasePage.speechBubbleIcon.error, "Error",
                                                                  "Name is empty, invalid, or causing an invalid or duplicate alias.");
                    return;
                }

                var createTemplateVal = 0;
                if (createTemplate.Checked)
                {
                    createTemplateVal = 1;
                }

                // check master type
                string masterTypeVal = String.IsNullOrEmpty(Request.GetItemAsString("nodeId")) || Request.GetItemAsString("nodeId") == "init" ? masterType.SelectedValue : Request.GetItemAsString("nodeId");

                // set master type to none if no master type was selected, or the drop down was hidden because there were no doctypes available
                masterTypeVal = string.IsNullOrEmpty(masterTypeVal) ? "0" : masterTypeVal;

                string returnUrl;
                try
                {
                    // this *may* throw even if Page.IsValid because of race conditions
                    returnUrl = LegacyDialogHandler.Create(
                        new HttpContextWrapper(Context),
                        BasePage.Current.getUser(),
                        Request.GetItemAsString("nodeType"),
                        createTemplateVal,
                        rename.Text,
                        int.Parse(masterTypeVal));
                }
                catch (Exception ex)
                {
                    // because it's always nicer to show a message to user vs YSOD
                    BasePage.Current.ClientTools.ShowSpeechBubble(BasePage.speechBubbleIcon.error, "Error",
                                                                  ex.GetType().FullName + ": " + ex.Message);
                    return;
                }

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .ChildNodeCreated()
                .CloseModalWindow();
            }
        }
        private void DoCreation()
        {
            if (Page.IsValid)
            {
                var returnUrl = LegacyDialogHandler.Create(
                    new HttpContextWrapper(Context),
                    BasePage.Current.getUser(),
                    helper.Request("nodeType"),
                    int.Parse(Request["nodeID"]),
                    rename.Text,
                    int.Parse(nodeType.SelectedValue));

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .CloseModalWindow();
            }
        }
Example #8
0
        protected void sbmt_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                var returnUrl = LegacyDialogHandler.Create(
                    new HttpContextWrapper(Context),
                    new User(Security.CurrentUser),
                    Request.GetItemAsString("nodeType"),
                    int.Parse(Request["nodeID"]),
                    rename.Text,
                    int.Parse(nodeType.SelectedValue));

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .CloseModalWindow();
            }
        }
Example #9
0
        protected void sbmt_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                var memberType  = memberChooser.Visible ? int.Parse(nodeType.SelectedValue) : -1;
                var emailAppend = String.IsNullOrEmpty(Email.Text) ? "" : String.Format("|{0}|{1}|{2}", Email.Text, Password.Text, Login.Text);
                var returnUrl   = LegacyDialogHandler.Create(
                    new HttpContextWrapper(Context),
                    BasePage.Current.getUser(),
                    helper.Request("nodeType"),
                    -1,
                    rename.Text + emailAppend,
                    memberType);

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .CloseModalWindow();
            }
        }
Example #10
0
        protected void sbmt_Click(object sender, System.EventArgs e)
        {
            if (Page.IsValid)
            {
                var createMacroVal = 0;
                if (createMacro.Checked)
                {
                    createMacroVal = 1;
                }

                var returnUrl = LegacyDialogHandler.Create(
                    new HttpContextWrapper(Context),
                    BasePage.Current.getUser(),
                    helper.Request("nodeType"),
                    createMacroVal,
                    template.SelectedValue + "|||" + rename.Text + "." + filetype.SelectedValue);

                BasePage.Current.ClientTools
                .ChangeContentFrameUrl(returnUrl)
                .ChildNodeCreated()
                .CloseModalWindow();
            }
        }