예제 #1
0
        public static HtmlString RenderBody(TextFieldZone zone)
        {
            string bodyText = String.Empty;

            switch (zone)
            {
            case TextFieldZone.TextLeft:
                bodyText = CmsPage.ThePage.LeftPageText;
                break;

            case TextFieldZone.TextCenter:
                bodyText = CmsPage.ThePage.PageText;
                break;

            case TextFieldZone.TextRight:
                bodyText = CmsPage.ThePage.RightPageText;
                break;

            default:
                break;
            }

            bodyText = bodyText ?? String.Empty;

            bodyText = SiteData.CurrentSite.UpdateContent(bodyText);

            if (SecurityData.AdvancedEditMode)
            {
                AdvContentModel m = new AdvContentModel();
                m.Content  = bodyText;
                m.AreaName = zone;
                switch (zone)
                {
                case TextFieldZone.TextLeft:
                    m.Zone = "l";
                    break;

                case TextFieldZone.TextCenter:
                    m.Zone = "c";
                    break;

                case TextFieldZone.TextRight:
                    m.Zone = "r";
                    break;
                }

                string sTextZone = ControlUtilities.GetManifestResourceStream("Carrotware.CMS.UI.Components._TextZone.cshtml");
                sTextZone = sTextZone.Replace("[[CONTENT]]", m.Content);
                sTextZone = sTextZone.Replace("[[AREA_NAME]]", m.AreaName.ToString());
                sTextZone = sTextZone.Replace("[[zone]]", m.Zone);

                bodyText = sTextZone ?? String.Empty;
            }

            return(new HtmlString(bodyText));
        }
예제 #2
0
		public static HtmlString RenderBody(TextFieldZone zone) {
			string bodyText = String.Empty;

			switch (zone) {
				case TextFieldZone.TextLeft:
					bodyText = CmsPage.ThePage.LeftPageText;
					break;

				case TextFieldZone.TextCenter:
					bodyText = CmsPage.ThePage.PageText;
					break;

				case TextFieldZone.TextRight:
					bodyText = CmsPage.ThePage.RightPageText;
					break;

				default:
					break;
			}

			bodyText = bodyText ?? String.Empty;

			bodyText = SiteData.CurrentSite.UpdateContent(bodyText);

			if (SecurityData.AdvancedEditMode) {
				AdvContentModel m = new AdvContentModel();
				m.Content = bodyText;
				m.AreaName = zone;
				switch (zone) {
					case TextFieldZone.TextLeft:
						m.Zone = "l";
						break;

					case TextFieldZone.TextCenter:
						m.Zone = "c";
						break;

					case TextFieldZone.TextRight:
						m.Zone = "r";
						break;
				}

				string sTextZone = ControlUtilities.GetManifestResourceStream("Carrotware.CMS.UI.Components._TextZone.cshtml");
				sTextZone = sTextZone.Replace("[[CONTENT]]", m.Content);
				sTextZone = sTextZone.Replace("[[AREA_NAME]]", m.AreaName.ToString());
				sTextZone = sTextZone.Replace("[[zone]]", m.Zone);

				bodyText = sTextZone ?? String.Empty;
			}

			return new HtmlString(bodyText);
		}