/// <summary>
        /// Renders the page design mode.
        /// </summary>
        /// <param name="output">The output.</param>
        private void RenderPlaceholderPageDesignMode(HtmlTextWriter output)
        {
            Assert.ArgumentNotNull((object)output, "output");
            bool flag = true;

            if (!this.CanDesign(Sitecore.Context.Database) || !Policy.IsAllowed("Page Editor/Can Design"))
            {
                flag = false;
            }
            Item contextItem = this.GetContextItem();

            if (contextItem != null && !WebEditUtil.CanDesignItem(contextItem))
            {
                flag = false;
            }
            string            qualifiedKey = this.GetQualifiedKey();
            Item              obj          = this.GetItem();
            GetChromeDataArgs args         = obj != null ? new GetChromeDataArgs("placeholder", obj) : new GetChromeDataArgs("placeholder");

            args.CustomData["placeHolderKey"] = (object)qualifiedKey;
            GetChromeDataPipeline.Run(args);
            ChromeData chromeData  = args.ChromeData;
            string     startMarker = Placeholder72.GetStartMarker(qualifiedKey, chromeData, flag);

            output.Write(startMarker);
            for (int index = 0; index < this.Controls.Count; ++index)
            {
                Control control = this.Controls[index];
                this.RenderControlPageDesignMode(output, flag, control);
            }
            string endMarker = Placeholder72.GetEndMarker(chromeData);

            output.Write(endMarker);
        }
        /// <summary>
        /// Gets the control data.
        ///
        /// </summary>
        /// <param name="reference">The reference.</param><param name="item">The item.</param>
        /// <returns>
        /// The chrome data.
        /// </returns>
        public static ChromeData GetControlData(RenderingReference reference, Item item)
        {
            Assert.ArgumentNotNull((object)reference, "reference");
            Assert.ArgumentNotNull((object)item, "item");
            Item obj = item;

            if (!string.IsNullOrEmpty(reference.Settings.DataSource))
            {
                if (MainUtil.IsFullPath(reference.Settings.DataSource))
                {
                    if (Sitecore.Context.Database != null)
                    {
                        obj = Sitecore.Context.Database.GetItem(reference.Settings.DataSource);
                    }
                }
                else
                {
                    obj = item.Axes.GetItem(reference.Settings.DataSource);
                }
            }
            GetChromeDataArgs args = new GetChromeDataArgs("rendering", obj ?? item);

            args.CustomData["renderingReference"] = (object)reference;
            GetChromeDataPipeline.Run(args);
            return(args.ChromeData);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets the client data.
        /// </summary>
        /// <returns>Client data</returns>
        protected virtual ChromeData GetClientData()
        {
            var args = new GetChromeDataArgs("rendering", this.renderingContext.Rendering.Item);

            GetChromeDataPipeline.Run(args);

            return(args.ChromeData);
        }
        protected ChromeData GetClientData()
        {
            var args = new GetChromeDataArgs("rendering", this.RenderingContext.Rendering.Item);
            var renderingReference = this.RenderingContext.Rendering.GetRenderingReference(Context.Language,
                                                                                           this.RenderingContext.PageContext.Database);

            args.CustomData["renderingReference"] = (object)renderingReference;
            GetChromeDataPipeline.Run(args);

            return(args.ChromeData);
        }