コード例 #1
0
        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);

            // allow third party applications to override the title of the current node in the breadcrumb
            SPCLF3.Master_Pages.CLF3PublishingMaster masterPage = (SPCLF3.Master_Pages.CLF3PublishingMaster) this.Page.Master;
            if (String.IsNullOrEmpty(masterPage.PageTitle))
            {
                if (SPContext.Current.ListItem != null && PublishingPage.IsPublishingPage(SPContext.Current.ListItem))
                {
                    PublishingPage publishingPage = PublishingPage.GetPublishingPage(SPContext.Current.ListItem);
                    writer.WriteLine(publishingPage.Title);
                }
                else if (SPContext.Current.ListItem != null)
                {
                    writer.Write(SPContext.Current.ListItem.Title);
                }
                else if (SPContext.Current.List != null)
                {
                    writer.Write(SPContext.Current.List.Title);
                }
            }
            else
            {
                writer.WriteLine(masterPage.PageTitle);
            }
        }
コード例 #2
0
        protected override void  OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            SPCLF3.Master_Pages.CLF3PublishingMaster masterPage = (SPCLF3.Master_Pages.CLF3PublishingMaster) this.Page.Master;
            if (masterPage != null)
            {
                LiteralControl script = new LiteralControl();
                script.Text  = "";
                script.Text += "<script>";
                script.Text += "/* <![CDATA[ */";
                script.Text += "var params = {";
                script.Text += "menubar : \"\"";
                script.Text += masterPage.RenderFeatures();
                script.Text += "};";
                script.Text += "PE.progress(params);";
                script.Text += "/* ]]> */";
                script.Text += "</script>";

                this.Controls.Add(script);
            }
        }