protected override void StartWizard(ClientPipelineArgs args)
 {
     //If User switched from Preview mode he have no authorisation cookie and so
     //he cannot request nesessary for wizard pages. We have to restore him.
     if (PreviewManager.GetShellUser() != string.Empty)
     {
         PreviewManager.RestoreUser();
     }
     base.StartWizard(args);
     if (args.HasResult)
     {
         SheerResponse.Eval("window.top.location.reload();");
     }
 }
Exemple #2
0
        protected void Run(ClientPipelineArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            if (!SheerResponse.CheckModified())
            {
                return;
            }

            if ((args.Parameters["needconfirmation"] == "false") || args.IsPostBack)
            {
                if (args.Result == "no")
                {
                    return;
                }

                UrlString webSiteUrl = SiteContext.GetWebSiteUrl();
                webSiteUrl.Add("sc_mode", "preview");
                webSiteUrl.Add("sc_compare", true.ToString());

                if (!string.IsNullOrEmpty(args.Parameters["sc_itemid"]))
                {
                    webSiteUrl.Add("sc_itemid", args.Parameters["sc_itemid"]);
                }

                if (!String.IsNullOrEmpty(args.Parameters["sc_lang"]))
                {
                    webSiteUrl.Add("sc_lang", args.Parameters["sc_lang"]);
                }

                PreviewManager.RestoreUser();
                Context.ClientPage.ClientResponse.Eval("window.open('" + webSiteUrl + "', '_blank')");
            }
            else
            {
                SheerResponse.Confirm("The current item does not have layout details; do you want to open the home item instead?");
                args.WaitForPostBack();
            }
        }