private void RegisterCustomCss()
        {
            // add embedded style sheet to parent page
            System.Web.UI.HtmlControls.HtmlLink cssLink = new System.Web.UI.HtmlControls.HtmlLink()
            {
                ID   = "bs-callout-css",
                Href = Page.ClientScript.GetWebResourceUrl(this.GetType(), "WetControls.StyleSheets.bs-callout.css"),
            };
            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");

            bool CssLinkAlreadyExists = false;

            foreach (Control headctrl in Page.Header.Controls)
            {
                if (headctrl.ID == cssLink.ID)
                {
                    CssLinkAlreadyExists = true;
                    break;
                }
            }

            if (!CssLinkAlreadyExists)
            {
                Page.Header.Controls.AddAt(0, cssLink);
            }
        }
Пример #2
0
        void RssHeaderLink_Load(object sender, EventArgs e)
        {
            Controller c = this.Controller;
            do
            {
                foreach (RssFeed rss in c.RssFeeds)
                {
                    System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
                    link.Attributes.Add("rel", "alternate");
                    link.Attributes.Add("type", "application/rss+xml");

                    if (string.IsNullOrEmpty(rss.Title))
                    {
                        link.Attributes.Add("title", rss.Title);
                    }
                    else
                    {
                        link.Attributes.Add("title", c.Title);
                    }
                    if (string.IsNullOrEmpty(rss.RedirectUrl))
                    {
                        link.Attributes.Add("href", MubbleUrl.Url(c.Url.Path, rss.Slug, "RssHandler"));
                    }
                    else
                    {
                        link.Attributes.Add("href", rss.RedirectUrl);
                    }

                    this.Controls.Add(link);
                    this.Controls.Add(new System.Web.UI.LiteralControl("\r\n\t\t"));
                }
            } while ((c = DataBroker.GetController(c.ControllerID)) != null);
        }
 public static bool RegisterStyleSheetInclude(this System.Web.UI.Page page, string key, string styleSheetFilePath)
 {
     styleSheetFilePath = page.ResolveClientUrl(styleSheetFilePath);
     if (page != null)
     {
         System.Web.UI.HtmlControls.HtmlHead head = (System.Web.UI.HtmlControls.HtmlHead)page.Header;
         bool isExistStyleSheet = false;
         foreach (System.Web.UI.Control item in head.Controls)
         {
             if (item is System.Web.UI.HtmlControls.HtmlLink && item.ID == key)
             {
                 isExistStyleSheet = true;
             }
         }
         if (!isExistStyleSheet)
         {
             System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
             link.Attributes.Add("href", page.ResolveClientUrl(styleSheetFilePath));
             link.Attributes.Add("type", "text/css");
             link.Attributes.Add("rel", "stylesheet");
             head.Controls.Add(link);
         }
         return true;
     }
     return false;
 }
Пример #4
0
 public void AddStyleSheet(string Href)
 {
     System.Web.UI.HtmlControls.HtmlLink l = new System.Web.UI.HtmlControls.HtmlLink();
     l.Attributes.Add("rel", "stylesheet");
     l.Attributes.Add("media", "screen");
     l.Attributes.Add("type", "text/css");
     l.Href = Href;
     PageHead.Controls.Add(l);
 }
Пример #5
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            System.Web.UI.HtmlControls.HtmlLink cssLink = new System.Web.UI.HtmlControls.HtmlLink();
            string cssUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "ERPSolution.Common.Controls.css.MessageBox.css");

            cssLink.Href = cssUrl;
            cssLink.Attributes.Add("rel", "stylesheet");
            cssLink.Attributes.Add("type", "text/css");
            this.Page.Header.Controls.Add(cssLink);

            SetControlProperties();
        }
Пример #6
0
        protected void Page_Init(object sender, EventArgs e)
        {
            System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
            link.Href = "~/portals/news/skins/default_skin/css/widget.css";
            link.Attributes.Add("rel", "stylesheet");
            link.Attributes.Add("type", "text/css");
            Page.Header.Controls.Add(link);

            System.Web.UI.HtmlControls.HtmlGenericControl ctrl = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
            ctrl.Attributes.Add("type", "text/javascript");
            ctrl.Attributes.Add("src", Page.ResolveUrl("~/scripts/jquery/jquery.min.js"));
            this.Page.Header.Controls.Add(ctrl);

            //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "jQueryScripts", "<script type=\"text/javascript\" src='" + Page.ResolveUrl("~/scripts/jquery/jquery.min.js") + "'></script>", false);
            // Page.ClientScript.RegisterClientScriptInclude(this.GetType(),"jQueryScripts", Page.ResolveUrl("~/scripts/jquery/jquery.min.js"));
            
        }
Пример #7
0
        /// <summary>
        /// 保留皮肤指定的CSS,其余的全部过滤掉
        /// </summary>
        /// <param name="_HtmlHead">页面HtmlHead对象(Header)</param>
        /// <param name="CssNames">保留的css文件,多个的话用"|"分隔, 后缀名.css可加可不加</param>
        public static void FilterCSS(System.Web.UI.HtmlControls.HtmlHead _HtmlHead, string CssNames)
        {
            _hasFile = new StringBuilder();
            ArrayList _ArrayList = new ArrayList();

            for (int i = 0; i < _HtmlHead.Controls.Count; i++)
            {
                if (_HtmlHead.Controls[i].ToString().ToLower().IndexOf("htmllink") > -1)
                {
                    System.Web.UI.HtmlControls.HtmlLink _HtmlLink = (System.Web.UI.HtmlControls.HtmlLink)_HtmlHead.Controls[i];
                    string HtmlLinkHref = _HtmlLink.Href.ToString();
                    if (!dealCssNames(HtmlLinkHref, CssNames))
                    {
                        _ArrayList.Add(i.ToString());
                    }
                }
            }
            for (int u = _ArrayList.Count - 1; u >= 0; u--)
            {
                _HtmlHead.Controls.RemoveAt(int.Parse(_ArrayList[u].ToString()));
            }
            _hasFile = new StringBuilder();
        }
Пример #8
0
        /// <summary>
        /// OnPreReader事件是在页面已经执行完所有后台代码,并且在生成标准HTML代码前,将要呈现给Page类的时候,此事件发生
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            if (this.Page != null && findControl("CtmTreeSelect_nHGC1") == null)
            {
                #region 嵌入控件所需资源
                ClientScriptManager nCSM = this.Page.ClientScript;
                string CssUrl = nCSM.GetWebResourceUrl(typeof(UnCvTreeSelect), "PUB.Css.CtmTreeSelect.css");
                string JSUrl1 = nCSM.GetWebResourceUrl(typeof(UnCvTreeSelect), "PUB.JScript.CtmPub.js");
                string JSUrl2 = nCSM.GetWebResourceUrl(typeof(UnCvTreeSelect), "PUB.JScript.CtmTreeSelect.js");

                System.Web.UI.HtmlControls.HtmlLink nHGC1 = new System.Web.UI.HtmlControls.HtmlLink();
                nHGC1.ID = "CtmTreeSelect_nHGC1";
                nHGC1.Attributes["type"] = "text/css";
                nHGC1.Attributes["rel"] = "stylesheet";
                nHGC1.Attributes["href"] = CssUrl;

                var nHGC2 = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
                nHGC2.Attributes["type"] = "text/javascript";
                nHGC2.Attributes["src"] = JSUrl1;

                var nHGC3 = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
                nHGC3.Attributes["type"] = "text/javascript";
                nHGC3.Attributes["src"] = JSUrl2;

                Page.Header.Controls.AddAt(2, nHGC1);
                Page.Header.Controls.AddAt(2, nHGC2);
                Page.Header.Controls.AddAt(2, nHGC3);

                #endregion
            }
            base.OnPreRender(e);
        }
Пример #9
0
		private static void GenerateFileLink(string url, Page page)
		{
			if(page == null || page.Header == null || string.IsNullOrWhiteSpace(url))
				return;

			var links = _pageLinks.GetOrAdd(page, new HashSet<string>(StringComparer.Ordinal));

			lock(links)
			{
				//如果添加操作返回假则表示当前Url已经存在,则退出
				if(!links.Add(url.ToLowerInvariant()))
					return;
			}

			if(url.EndsWith(".css", StringComparison.OrdinalIgnoreCase))
			{
				var link = new System.Web.UI.HtmlControls.HtmlLink()
				{
					Href = url,
				};

				link.Attributes.Add("type", "text/css");
				link.Attributes.Add("rel", "Stylesheet");

				page.Header.Controls.Add(link);
			}
			else if(url.EndsWith(".js", StringComparison.OrdinalIgnoreCase))
			{
				var script = new System.Web.UI.HtmlControls.HtmlGenericControl("script");
				script.Attributes.Add("type", "text/javascript");
				script.Attributes.Add("src", page.ResolveClientUrl(url));
				page.Header.Controls.Add(script);
			}
		}
Пример #10
0
        protected override void OnPreRender(EventArgs e)
        {
            // Add the CSS reference link to the page.
            Control lnkCheck = this.Page.Header.FindControl("CalendarCtrlCSS");
            if (lnkCheck == null)
            {
                System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
                link.ID = "CalendarCtrlCSS";
                link.Attributes.Add("href", this.Page.ClientScript.GetWebResourceUrl(typeof(RainstormStudios.Web.UI.WebControls.SlideShow), "RainstormStudios.Web.UI.WebControls.style.calendar.css"));
                link.Attributes.Add("type", "text/css");
                link.Attributes.Add("rel", "stylesheet");
                this.Page.Header.Controls.Add(link);
            }

            // Add the JavaScript file reference to the page.
            this.Page.ClientScript.RegisterClientScriptResource(typeof(RainstormStudios.Web.UI.WebControls.SlideShow), "RainstormStudios.Web.UI.WebControls.scripts.calendar.js");
            //string scriptPathRef = this.Page.ClientScript.GetWebResourceUrl(typeof(RainstormStudios.Web.UI.WebControls.SlideShow), "RainstormStudios.Web.UI.WebControls.scripts.calendar.js");
            //this.Page.ClientScript.RegisterClientScriptInclude(this.Page.GetType(), "CalendarCtrlScript", scriptPathRef);

            // Register "pending appointment" check.
            string callBack = Page.ClientScript.GetCallbackEventReference(this, (this.DisplayUserKey != null ? this.DisplayUserKey.ToString() : null), "CalendarView.CheckAppointments", this.ClientID, "CalendarView.CheckAppointmentsError", true);
            string appointCheckScript = string.Format("setInterval(\"{0}\", {1});", callBack, 15000);
            //this.Page.ClientScript.RegisterStartupScript(this.GetType(), "CalendarViewApptCheck", appointCheckScript, true);

            base.OnPreRender(e);
        }
Пример #11
0
        /// <summary>
        /// SmartGridView的PreRender事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void SmartGridView_PreRender(object sender, EventArgs e)
        {
            if (!this.Page.ClientScript.IsClientScriptIncludeRegistered(this.GetType(), "yy_sgv_ScriptLibrary"))
            {
                // 注册所需脚本
                this.Page.ClientScript.RegisterClientScriptInclude
                (
                    this.GetType(),
                    "yy_sgv_ScriptLibrary",
                    this.Page.ClientScript.GetWebResourceUrl
                    (
                        #if DEBUG
                        this.GetType(), "YYControls.SmartGridView.Resources.ScriptLibraryDebug.js"
                        #else
                        this.GetType(), "YYControls.SmartGridView.Resources.ScriptLibrary.js"
                        #endif
                    )
                );

                // for asp.net ajax
                this.Page.ClientScript.RegisterStartupScript(
                    this.GetType(), 
                    "yy_sgv_ScriptLibrary_ajax", 
                    "if (typeof(Sys) != 'undefined') Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function endRequestHandler(sender, e){yy_sgv_ccListener();yy_sgv_crListener();});", 
                    true);

                // 注册所需样式
                System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
                link.Attributes["type"] = "text/css";
                link.Attributes["rel"] = "stylesheet";
                link.Attributes["href"] = Page.ClientScript.GetWebResourceUrl(this.GetType(), "YYControls.SmartGridView.Resources.StyleLibrary.css");
                this.Page.Header.Controls.Add(link);
            }

            // this.Page.ClientScript.RegisterClientScriptResource(this.GetType(), "YYControls.SmartGridView.ScriptLibrary.js");
Пример #12
0
        private void DisplayList()
        {
            int blogId = -1;
            try
            {
                blogId = Convert.ToInt32( PageParameter( "BlogId" ) );
            }
            catch
            {
                lPosts.Text = "<p class=\"block-warning\">The ID of this blog could not be found in the address of this page</p>";
            }

            if ( blogId != -1 )
            {
                Rock.CMS.BlogService blogService = new Rock.CMS.BlogService();

                // try loading the blog object from the page cache
                Rock.CMS.Blog blog = PageInstance.GetSharedItem( "blog" ) as Rock.CMS.Blog;

                if ( blog == null )
                {
                    blog = blogService.Get( blogId );
                    PageInstance.SaveSharedItem( "blog", blog );
                }

                // add rss link in header if publish location is avail
                if ( blog.PublicFeedAddress != null && blog.PublicFeedAddress != string.Empty )
                {
                    System.Web.UI.HtmlControls.HtmlLink rssLink = new System.Web.UI.HtmlControls.HtmlLink();

                    rssLink.Attributes.Add( "type", "application/rss+xml" );
                    rssLink.Attributes.Add( "rel", "alternate" );
                    rssLink.Attributes.Add( "href", blog.PublicFeedAddress );
                    rssLink.Attributes.Add( "title", "RSS" );

                    PageInstance.AddHtmlLink( this.Page, rssLink );
                }

                lPosts.Text = "";

                // load posts
                //var posts = blog.BlogPosts.Select( p => new { p.Title, p.PublishDate, p.State, AuthorFirstName = p.Author.FirstName, AuthorLastName = p.Author.LastName, p.Content } ).Where( p => p.State == (int)BlogPost.PostStatus.Published && p.PublishDate < DateTime.Now ).OrderByDescending( p => p.PublishDate ).Skip( skipCount ).Take( takeCount + 1 ).ToList();
                IQueryable<BlogPost> qPosts = blog.BlogPosts.Where( p => p.State == (int)BlogPost.PostStatus.Published && p.PublishDate < DateTime.Now ).OrderByDescending( p => p.PublishDate ).Skip( skipCount ).Take( takeCount + 1 ).AsQueryable();

                // add category and tag filters if requested
                if ( categoryId != 0 )
                    qPosts = qPosts.Where( p => p.BlogCategories.Any(c => c.Id == categoryId ));

                if ( tagId != 0 )
                    qPosts = qPosts.Where( p => p.BlogTags.Any( t => t.Id == tagId ) );

                // run query
                var posts = qPosts.ToList();

                // we load one exta post so that we can determine if there is a need to display the older posts button
                int postsToShow = posts.Count();
                if ( postsToShow > takeCount )
                    postsToShow = takeCount;

                try
                {
                    for ( int i = 0; i < postsToShow; i++ )
                    {
                        var post = posts[i];
                        DateTime publishDate = (DateTime)post.PublishDate;

                        StringBuilder sb = new StringBuilder();
                        sb.Append( "<article class=\"blog-post\">\n" );
                        sb.Append( "    <header>\n" );

                        if (postDetailsPage.IsValid)
                            sb.Append( "        <a href=\"" + PageInstance.BuildUrl( postDetailsPage, new Dictionary<string, string>() {{"PostId", post.Id.ToString()}} ) + "\"><h1>" + post.Title + "</h1></a>" );
                        else
                            sb.Append( "         <h1>" + post.Title + "</h1>" );

                        sb.Append( "         Posted " );

                        // determine categories
                        if ( post.BlogCategories.Count > 0 )
                        {
                            sb.Append( "in <ul>" );

                            foreach ( BlogCategory category in post.BlogCategories )
                            {
                                sb.Append( "<li><a href=\"" + PageInstance.BuildUrl( PageInstance.PageReference, new Dictionary<string, string>() { { "Category", category.Id.ToString() }, { "BlogId", blogId.ToString() } } ) + "\">" + category.Name + "</a></li?" );
                            }
                            sb.Append( "</ul> " );
                        }

                        sb.Append( "on " + publishDate.ToString("D") + " by " + post.Author.FirstName + " " + post.Author.LastName + "\n" );

                        // show tags if any
                        if ( post.BlogTags.Count > 0 )
                        {
                            sb.Append( "<div class=\"tags\">Tags:\n\t<ul>" );

                            foreach ( BlogTag tag in post.BlogTags )
                            {
                                sb.Append( "\t\t<li><a href=\"" + PageInstance.BuildUrl( PageInstance.PageReference, new Dictionary<string, string>() { { "Tag", tag.Id.ToString() }, { "BlogId", blogId.ToString() } } ) + "</a></li>\n" );
                            }

                            sb.Append( "\t</ul>\n</div>" );
                        }

                        sb.Append( "     </header>\n" );
                        sb.Append( post.Content + "\n" );
                        sb.Append( "</article>\n" );
                        lPosts.Text += sb.ToString();
                    }

                    // set next prev buttons
                    if ( currentPage == 1 )
                        aNewer.Visible = false;
                    else
                        aNewer.Visible = true;

                    if ( posts.Count() <= takeCount )
                        aOlder.Visible = false;
                    else
                        aOlder.Visible = true;

                   // set next prev button urls
                   aOlder.HRef = PageInstance.BuildUrl( PageInstance.PageReference, new Dictionary<string, string>() { { "Page", ( currentPage + 1 ).ToString() }, {"BlogId", blogId.ToString()} }, HttpContext.Current.Request.QueryString );
                   aNewer.HRef = PageInstance.BuildUrl( PageInstance.PageReference, new Dictionary<string, string>() { { "Page", ( currentPage - 1 ).ToString() }, { "BlogId", blogId.ToString() } }, HttpContext.Current.Request.QueryString );
                }
                catch ( NullReferenceException )
                {
                    lPosts.Text = "<p class=\"block-warning\">The blog ID " + blogId.ToString() + " does not exist.</p>";
                }
            }
        }
Пример #13
0
        protected override void OnPreRender(EventArgs e)
        {
            Control link = this.Page.Header.FindControl("CustomGridViewCss");
            if (link == null)
            {
                System.Web.UI.HtmlControls.HtmlLink newLink = new System.Web.UI.HtmlControls.HtmlLink();
                newLink.ID = "CustomGridViewCss";
                newLink.Attributes.Add("href", this.Page.ClientScript.GetWebResourceUrl(typeof(RainstormStudios.Web.UI.WebControls.GridView), "RainstormStudios.Web.UI.WebControls.style.CustomGridView.css"));
                newLink.Attributes.Add("type", "text/css");
                newLink.Attributes.Add("rel", "stylesheet");
                this.Page.Header.Controls.Add(newLink);
            }

            base.OnPreRender(e);
            this.EnsureChildControls();
        }
Пример #14
0
        private void DrawProfilesModule()
        {
            string label = string.Empty;

            System.Text.StringBuilder html       = new System.Text.StringBuilder();
            System.Text.StringBuilder itembuffer = new System.Text.StringBuilder();

            bool hasitems = false;

            // UCSF OpenSocial items
            string uri = null;

            // code to convert from numeric node ID to URI
            if (base.Namespaces.HasNamespace("rdf"))
            {
                XmlNode node = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces);
                uri = node != null ? node.Value : null;
            }
            foreach (XmlNode propertygroup in this.PropertyListXML.SelectNodes("PropertyList/PropertyGroup"))
            {
                if (base.GetModuleParamXml("PropertyGroupURI") == null || base.GetModuleParamString("PropertyGroupURI") != string.Empty)
                {
                    if ((propertygroup.SelectNodes("Property/Network/Connection").Count > 0 && propertygroup.SelectNodes("Property[@CustomDisplay='false']").Count > 0) || propertygroup.SelectNodes("Property/CustomModule").Count > 0)
                    {
                        //html.Append("<div class='PropertyGroup' tabindex=\"0\" style='cursor:pointer;' onkeypress=\"if (event.keyCode == 13) javascript:toggleBlock('propertygroup','" + propertygroup.SelectSingleNode("@URI").Value + "');\" onclick=\"javascript:toggleBlock('propertygroup','" + propertygroup.SelectSingleNode("@URI").Value + "');\"  role=\"region\"><br>");
                        //html.Append("<img id=\"propertygroup" + propertygroup.SelectSingleNode("@URI").Value + "\" src='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse' style='border: none; text-decoration: none !important' border='0' width='9' height='9'/>&nbsp;"); //add image and onclick here.
                        //html.Append("<input  type='hidden' id=\"imgon" + propertygroup.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse' width='9'/>");
                        //html.Append("<input type='hidden' id=\"imgoff" + propertygroup.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/plusSign.gif' alt='Expand' />");

                        //html.Append(propertygroup.SelectSingleNode("@Label").Value);
                        //html.Append("&nbsp;<br></div>");
                        html.Append("<div class='PropertyGroupItem'  id='" + propertygroup.SelectSingleNode("@URI").Value + "'>");

                        foreach (XmlNode propertyitem in propertygroup.SelectNodes("Property"))
                        {
                            if (base.GetModuleParamXml("PropertyURI") == null || base.GetModuleParamString("PropertyURI") != string.Empty)
                            {
                                itembuffer = new System.Text.StringBuilder();
                                if (propertyitem.SelectSingleNode("@CustomDisplay").Value == "false")
                                {
                                    hasitems = false;

                                    // itembuffer.Append("<input type='hidden' id=\"imgon" + propertyitem.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse'  width='9' height='9'/>");
                                    // itembuffer.Append("<input type='hidden' id=\"imgoff" + propertyitem.SelectSingleNode("@URI").Value + "\" value='" + Root.Domain + "/Profile/Modules/PropertyList/images/plusSign.gif' alt='Expand' />");
                                    itembuffer.Append("<div class='PropertyItemHeader-wrapper'>");
                                    itembuffer.Append("<div class='PropertyItemHeader' style='cursor:pointer;' tabindex=\"0\" role=\"region\">");
                                    //itembuffer.Append("<img id=\"propertyitem" + propertyitem.SelectSingleNode("@URI").Value + "\" src='" + Root.Domain + "/Profile/Modules/PropertyList/images/minusSign.gif' alt='Collapse'  border='0' width='9' height='9' />&nbsp;"); //add image and onclick here.
                                    itembuffer.Append(propertyitem.SelectSingleNode("@Label").Value);
                                    itembuffer.Append("</div>");
                                    itembuffer.Append("<div class='PropertyGroupData'>");
                                    itembuffer.Append("<div style='padding-top:6px;padding-right:6px;padding-left:6px' id='" + propertyitem.SelectSingleNode("@URI").Value + "'>");

                                    foreach (XmlNode connection in propertyitem.SelectNodes("Network/Connection"))
                                    {
                                        if (hasitems)
                                        {
                                            itembuffer.Append("<br>");
                                        }
                                        if (connection.SelectSingleNode("@ResourceURI") != null)
                                        {
                                            itembuffer.Append("<a href='");
                                            itembuffer.Append(connection.SelectSingleNode("@ResourceURI").Value);
                                            itembuffer.Append("'>");
                                            itembuffer.Append(connection.InnerText.Replace("\n", "<br/>"));
                                            itembuffer.Append("</a><br>");
                                            hasitems = true;
                                        }
                                        else
                                        {
                                            itembuffer.Append(connection.InnerText.Replace("\n", "<br/>") + "<br>");
                                            hasitems = true;
                                        }
                                    }

                                    itembuffer.Append("</div></div></div>");
                                }
                                else if (propertyitem.SelectSingleNode("@CustomDisplay").Value == "true" && propertyitem.SelectNodes("CustomModule").Count > 0)
                                {
                                    foreach (XmlNode node in propertyitem.SelectNodes("CustomModule"))
                                    {
                                        Framework.Utilities.ModulesProcessing mp = new ModulesProcessing();
                                        XmlDocument modules = new XmlDocument();
                                        modules.LoadXml(node.OuterXml);

                                        foreach (XmlNode module in modules.GetElementsByTagName("Module"))
                                        {
                                            this.Modules = mp.FetchModules(module);

                                            foreach (Module m in this.Modules)
                                            {
                                                if (m.css != null)
                                                {
                                                    System.Web.UI.HtmlControls.HtmlLink css = new System.Web.UI.HtmlControls.HtmlLink();
                                                    css.Href = m.css;
                                                    css.Attributes["rel"]   = "stylesheet";
                                                    css.Attributes["type"]  = "text/css";
                                                    css.Attributes["media"] = "all";
                                                    Page.Header.Controls.Add(css);
                                                }
                                            }
                                            this.Modules = null;

                                            String propertyItemLabel = propertyitem.SelectSingleNode("@Label").Value;
                                            if (module.Attributes["Label"] != null)
                                            {
                                                propertyItemLabel = module.Attributes["Label"].Value;
                                            }


                                            itembuffer.Append("<div class='PropertyItemHeader-wrapper'>");
                                            itembuffer.Append("<div class='PropertyItemHeader' role=\"region\">");

                                            itembuffer.Append(propertyItemLabel);
                                            itembuffer.Append("</div>");
                                            itembuffer.Append("<div class='PropertyGroupData'>");
                                            itembuffer.Append("<div id='" + propertyitem.SelectSingleNode("@URI").Value + "'>");

                                            itembuffer.Append(base.RenderCustomControl(module.OuterXml, base.BaseData));

                                            itembuffer.Append("</div></div></div>");
                                        }
                                        hasitems = true;
                                    }
                                }



                                if (hasitems)
                                {
                                    html.Append(itembuffer.ToString());
                                }
                            }
                        } //End of property item loop

                        html.Append("</div>");
                    }
                }
            }//End of property group loop

            litPropertyList.Text = html.ToString();
        }
Пример #15
0
        //***************************************************************************
        // Private Methods
        // 
        protected override void OnPreRender(EventArgs e)
        {
            Control lnkCheck = this.Page.Header.FindControl("ModalPopupCss");
            if (lnkCheck == null)
            {
                System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
                link.ID = "ModalPopupCss";
                link.Attributes.Add("href", this.Page.ClientScript.GetWebResourceUrl(typeof(RainstormStudios.Web.UI.WebControls.ModalPopup), "RainstormStudios.Web.UI.WebControls.style.modal.css"));
                link.Attributes.Add("type", "text/css");
                link.Attributes.Add("rel", "stylesheet");
                this.Page.Header.Controls.Add(link);
            }

            base.OnPreRender(e);
        }
Пример #16
0
        protected void Page_Init( object sender, EventArgs e )
        {
            // get block settings

            // get post id
            try
            {
                postId = Convert.ToInt32( PageParameter( "PostId" ) );
            }
            catch ( Exception ex )
            {
            }

            Rock.Services.Cms.BlogPostService postService = new Rock.Services.Cms.BlogPostService();
            post = postService.GetBlogPost( postId );

            lTitle.Text = post.Title;
            lContents.Text = post.Content;

            // prepare post details
            StringBuilder pDetails = new StringBuilder();

            DateTime publishDate = (DateTime)post.PublishDate;
            pDetails.Append( "This entry was posted on " + publishDate.ToString( "D" ) + " at " + String.Format( "{0:t}", publishDate ) + " by " + post.Author.FirstName + " " + post.Author.LastName + "." );

            lPostDetails.Text = pDetails.ToString();

            // check if comments are allowed
            if ( post.Blog.AllowComments )
            {
                LoadComments();
            }
            else
                pnlAddComment.Visible = false;

            // add rss link in header if publish location is avail
            if ( post.Blog.PublicFeedAddress != null && post.Blog.PublicFeedAddress != string.Empty )
            {
                System.Web.UI.HtmlControls.HtmlLink rssLink = new System.Web.UI.HtmlControls.HtmlLink();

                rssLink.Attributes.Add( "type", "application/rss+xml" );
                rssLink.Attributes.Add( "rel", "alternate" );
                rssLink.Attributes.Add( "href", post.Blog.PublicFeedAddress );
                rssLink.Attributes.Add( "title", "RSS" );

                PageInstance.AddHtmlLink( this.Page, rssLink );
            }
        }
Пример #17
0
        protected override void OnPreRender(EventArgs e)
        {
            // Emit CSS reference.
            Control lnkCheck = this.Page.Header.FindControl("DynamicMenuCss");
            if (lnkCheck == null)
            {
                System.Web.UI.HtmlControls.HtmlLink link = new System.Web.UI.HtmlControls.HtmlLink();
                link.ID = "DynamicMenuCss";
                link.Attributes.Add("href", this.Page.ClientScript.GetWebResourceUrl(typeof(RainstormStudios.Web.UI.WebControls.DynamicMenuControl), "RainstormStudios.Web.UI.WebControls.style.dynamicMenu.css"));
                link.Attributes.Add("type", "text/css");
                link.Attributes.Add("rel", "stylesheet");
                this.Page.Header.Controls.Add(link);
            }
            this.Page.ClientScript.RegisterClientScriptResource(typeof(RainstormStudios.Web.UI.WebControls.DynamicMenuControl), "RainstormStudios.Web.UI.WebControls.scripts.dynamicMenu.js");

            base.OnPreRender(e);
        }