protected void Page_Load(object sender, EventArgs e)
        {
            CouncilPlanUtility.SetContentPolicy(Response.Headers);

            leader.Visible    = leaderPhoto.HasContent;
            chiefExec.Visible = chiefExecPhoto.HasContent;
            logo1.Visible     = logo1.HasContent;
            logo2.Visible     = logo2.HasContent;
            logos.Visible     = (logo1.Visible || logo2.Visible);
            image1.Visible    = image1.HasContent;
            image2.Visible    = image2.HasContent;
            image3.Visible    = image3.HasContent;
            image4.Visible    = image4.HasContent;
            images.Visible    = (image1.Visible || image2.Visible || image3.Visible || image4.Visible);

            // Single column if second column not used
            var singleCol = (!aims.HasContent && !content3.HasContent && !logo1.HasContent && !logo2.HasContent);

            if (singleCol)
            {
                columns.Attributes.Remove("class");
                column1.Attributes.Remove("class");
                column2.Attributes.Remove("class");
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CouncilPlanUtility.SetContentPolicy(Response.Headers);

            // Get the parent page
            var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
            var currentPage   = umbracoHelper.TypedContent(Model.Metadata.SystemId);
            var parentPage    = currentPage.Parent;

            aimsLink1.HRef = parentPage.Url;
            aimsLink2.HRef = parentPage.Url;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            CouncilPlanUtility.SetContentPolicy(Response.Headers);

            // This placeholder is intended as a title, but sometimes used as a paragraph. Assume more than 6 words means they intended a paragraph.
            var title = CmsUtilities.Placeholders["phDefPriorityTitle"].Value.ToString().Split(' ');

            if (title.Length > 6)
            {
                phDefPriorityTitle.ElementName = "p";
            }

            leader.Visible    = leaderPhoto.HasContent;
            chiefExec.Visible = chiefExecPhoto.HasContent;
            logo1.Visible     = logo1.HasContent;
            logo2.Visible     = logo2.HasContent;
            logos.Visible     = (logo1.Visible || logo2.Visible);
            figure1.Visible   = image1.HasContent;
            figure2.Visible   = image2.HasContent;
            figure3.Visible   = image3.HasContent;
            figure4.Visible   = image4.HasContent;

            figure9.Visible  = phImage09.HasContent;
            figure10.Visible = phImage10.HasContent;
            figure11.Visible = phImage11.HasContent;
            figure12.Visible = phImage12.HasContent;
            figure13.Visible = phImage13.HasContent;
            figure14.Visible = phImage14.HasContent;
            figure15.Visible = phImage15.HasContent;
            images.Visible   = (image1.Visible || image2.Visible || image3.Visible || image4.Visible);

            // Single column if second column not used
            var singleCol = (!aims.HasContent && !content3.HasContent && !logo1.HasContent && !logo2.HasContent);

            if (singleCol)
            {
                columns.Attributes.Remove("class");
                column1.Attributes.Remove("class");
                column2.Attributes.Remove("class");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            CouncilPlanUtility.SetContentPolicy(Response.Headers);

            Uri svgImageUrl = null;

            IPublishedContent phDefSvg = (IPublishedContent)CmsUtilities.Placeholders["phDefSvg"].Value;

            if (phDefSvg != null)
            {
                svgImageUrl = new Uri(phDefSvg.Url, UriKind.Relative);
            }

            var html = new StringBuilder();

            html.Append("<div class=\"intrinsic-container\">");
            html.Append("<iframe src=\"" + svgImageUrl + "\" allowfullscreen></iframe>");
            html.Append("</div>");

            objectTag.Text = html.ToString();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            var umbracoHelper = new UmbracoHelper(UmbracoContext.Current);
            var currentPage   = umbracoHelper.TypedContent(Model.Metadata.SystemId);

            // Create a list of visible pages, including the home page
            var pages = new List <IPublishedContent>();

            var homePage = currentPage.AncestorOrSelf("CouncilPlanHomePage");

            if (homePage != null)
            {
                pages.Add(homePage);

                var children = homePage.Children.Where(p => p.IsVisible()).OrderBy(o => o.SortOrder);
                pages.AddRange(children);
            }

            foreach (var menuItem in pages)
            {
                var itemHtml      = new StringBuilder();
                var priorityClass = CouncilPlanUtility.PriorityClass(menuItem.Id);

                itemHtml.Append("<li>");

                var classString = string.Format(CultureInfo.InvariantCulture, "class=\"council-plan {0}\"", priorityClass);
                var encodedName = HttpUtility.HtmlEncode(menuItem.Name);

                if (menuItem.Id == currentPage.Id)
                {
                    itemHtml.AppendFormat("<em {0}>{1}</em>", classString, encodedName);
                }
                else
                {
                    itemHtml.AppendFormat("<a href=\"{0}\" {1}>{2}</a>", menuItem.Url, classString, encodedName);
                }
                itemHtml.Append("</li>");
                list.Controls.Add(new LiteralControl(itemHtml.ToString()));
            }
        }
Ejemplo n.º 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CouncilPlanUtility.SetContentPolicy(Response.Headers);

            var svg = CmsUtilities.Placeholders["phDefSvg"].Value.ToString();

            var pngPh = CmsUtilities.Placeholders["phDefFallbackImage"].Value;
            var html  = new StringBuilder();

            if (!String.IsNullOrEmpty(svg))
            {
                html.Append("<object type=\"image/svg+xml\" data=\"").Append(svg).Append("\">");
            }
            if (pngPh != null)
            {
                var png = CmsUtilities.Placeholders["phDefFallbackImage"].Value.ToString().Replace(" border=\"0\"", " /");
                html.Append(png);
            }
            if (!String.IsNullOrEmpty(svg))
            {
                html.Append("</object>");
            }
            objectTag.Text = html.ToString();
        }