public override PipelineProcessorResponseValue ProcessRequest()
        {
            Assert.IsNotNullOrEmpty(this.RequestContext.Value, "Could not get string value for requestArgs:{0}", (object)this.Args.Data);
            string mode = string.Empty;

            using (new SecurityDisabler())
            {
                Item obj = Client.CoreDatabase.GetItem(new ID(HttpUtility.UrlDecode(this.RequestContext.Value)));
                if (obj != null)
                {
                    mode = obj["Message"];
                }
            }
            switch (mode)
            {
            case "sharedsource:system:compare":
                return(new PipelineProcessorResponseValue()
                {
                    Value = WebEditUtility.CanPreview()
                });

            default:
                return(base.ProcessRequest());
            }
        }
Esempio n. 2
0
        protected override object GetModel()
        {
            if (Tracker.Current == null || Tracker.Current.Interaction == null) //todo: missing !this.DemoStateService.IsDemoEnabled
            {
                return(null);
            }

            var explorerContext        = DependencyResolver.Current.GetService <IExplorerContext>();
            var isInExperienceExplorer = explorerContext?.IsExplorerMode() ?? false;

            if (Context.Site.DisplayMode != DisplayMode.Normal || WebEditUtility.IsDebugActive(Context.Site) || isInExperienceExplorer)
            {
                return(null);
            }

            return(_sidebarRepository.GetModel());
        }
Esempio n. 3
0
        public ActionResult ExperienceData()
        {
            if (Tracker.Current == null || Tracker.Current.Interaction == null || !this.DemoStateService.IsDemoEnabled)
            {
                return(null);
            }
            var explorerContext        = DependencyResolver.Current.GetService <IExplorerContext>();
            var isInExperienceExplorer = explorerContext?.IsExplorerMode() ?? false;

            if (Context.Site.DisplayMode != DisplayMode.Normal || WebEditUtility.IsDebugActive(Context.Site) || isInExperienceExplorer)
            {
                return(new EmptyResult());
            }

            var experienceData = ServiceLocator.ServiceProvider.GetService <ExperienceData>();

            return(this.View(experienceData));
        }
Esempio n. 4
0
        public override PipelineProcessorResponseValue ProcessRequest()
        {
            var response = base.ProcessRequest();

            if (response.AbortMessage != null)
            {
                return(response);
            }

            string    mode = string.Empty;
            UrlString url  = new UrlString(response.Value.ToString());

            string[] strArray = this.RequestContext.Value.Split('|');

            using (new SecurityDisabler())
            {
                Item obj = Client.CoreDatabase.GetItem(new ID(HttpUtility.UrlDecode(strArray[0])));
                if (obj != null)
                {
                    mode = obj["Message"];
                }
            }

            if (mode == "webedit:preview")
            {
                url.Parameters["sc_compare"] = "false";
                response.Value = url.ToString();
            }

            if (mode == "sharedsource:system:compare")
            {
                WebUtil.SetCookieValue("sc_last_page_mode_command", mode);
                WebEditUtility.ActivatePreview(url);
                url.Parameters["sc_compare"] = "true";
                response.Value = url.ToString();
            }

            return(response);
        }
Esempio n. 5
0
        public ActionResult ExperienceData()
        {
            if (Tracker.Current == null || Tracker.Current.Interaction == null || this.IsDemoDisabled)
            {
                return(null);
            }
            if (Context.Site.DisplayMode != DisplayMode.Normal || ModuleManager.IsExpViewModeActive || WebEditUtility.IsDebugActive(Context.Site))
            {
                return(new EmptyResult());
            }

            return(this.View(new ExperienceData(this.contactProfileProvider, this.profileProvider)));
        }
Esempio n. 6
0
 public static bool NoOverlay(this SiteContext siteContext) => siteContext.DisplayMode == DisplayMode.Normal && !ModuleManager.IsExpViewModeActive && !WebEditUtility.IsDebugActive(siteContext);