Esempio n. 1
0
		public static PagePayload GetCurrentContent() {
			PagePayload page = new PagePayload();
			page.ThePage = SiteData.GetCurrentPage();

			page.Load();
			return page;
		}
		public ActionResult Default(FormCollection model) {
			_page = PagePayload.GetCurrentContent();

			Object frm = null;

			if (Request.Form["form_type"] != null) {
				string formMode = Request.Form["form_type"].ToString().ToLowerInvariant();

				if (formMode == "searchform") {
					frm = new SiteSearch();
					frm = FormHelper.ParseRequest(frm, Request);
					this.ViewData["CMS_searchform"] = frm;
					if (frm != null) {
						this.TryValidateModel(frm);
					}
				}

				if (formMode == "contactform") {
					frm = new ContactInfo();
					frm = FormHelper.ParseRequest(frm, Request);
					var cmt = (ContactInfo)frm;
					cmt.Root_ContentID = _page.ThePage.Root_ContentID;
					cmt.CreateDate = SiteData.CurrentSite.Now;
					cmt.CommenterIP = Request.ServerVariables["REMOTE_ADDR"];
					this.ViewData[ContactInfo.Key] = frm;
					if (cmt != null) {
						this.TryValidateModel(cmt);
					}
				}
			}

			return DefaultView();
		}
Esempio n. 3
0
		public static PagePayload GetContent(Guid id) {
			PagePayload page = new PagePayload();
			page.ThePage = SiteData.GetPage(id);

			page.Load();
			return page;
		}
Esempio n. 4
0
		public static PagePayload GetContent(SiteNav nav) {
			PagePayload page = new PagePayload();
			page.ThePage = nav.GetContentPage();

			page.Load();
			return page;
		}
Esempio n. 5
0
		public static PagePayload GetContent(ContentPage cp) {
			PagePayload page = new PagePayload();
			page.ThePage = cp;

			page.Load();
			return page;
		}
Esempio n. 6
0
        public static PagePayload GetContent(Guid id)
        {
            PagePayload page = new PagePayload();

            page.ThePage = SiteData.GetPage(id);

            page.Load();
            return(page);
        }
Esempio n. 7
0
        public static PagePayload GetContent(SiteNav nav)
        {
            PagePayload page = new PagePayload();

            page.ThePage = nav.GetContentPage();

            page.Load();
            return(page);
        }
Esempio n. 8
0
        public static PagePayload GetContent(ContentPage cp)
        {
            PagePayload page = new PagePayload();

            page.ThePage = cp;

            page.Load();
            return(page);
        }
Esempio n. 9
0
        public static PagePayload GetCurrentContent()
        {
            PagePayload page = new PagePayload();

            page.ThePage = SiteData.GetCurrentPage();

            page.Load();
            return(page);
        }
		public override void InitHelpers() {
			base.InitHelpers();

			if (this.ViewData.Model != null && this.ViewData.Model is PagePayload) {
				this.CmsPage = (PagePayload)this.ViewData.Model;
			} else {
				if (this.ViewData[PagePayload.ViewDataKey] == null) {
					this.CmsPage = PagePayload.GetCurrentContent();
					this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
				} else {
					this.CmsPage = (PagePayload)this.ViewData[PagePayload.ViewDataKey];
				}
			}
		}
Esempio n. 11
0
        public static PagePayload GetContent(string uri)
        {
            PagePayload page = new PagePayload();

            if (SecurityData.AdvancedEditMode)
            {
                using (CMSConfigHelper cmsHelper = new CMSConfigHelper()) {
                    cmsHelper.OverrideKey(uri);

                    if (cmsHelper.cmsAdminContent == null)
                    {
                        page.ThePage = SiteData.GetPage(uri);

                        if (!page.ThePage.IsPageLocked)
                        {
                            if (page.ThePage.ContentType == ContentPageType.PageType.BlogEntry)
                            {
                                var c = page.ThePage.ContentCategories;
                                var t = page.ThePage.ContentTags;
                            }

                            cmsHelper.cmsAdminContent = page.ThePage;
                        }
                        else
                        {
                            cmsHelper.cmsAdminContent = null;
                        }
                    }
                    else
                    {
                        page.ThePage = cmsHelper.cmsAdminContent;
                        if (page.IsPageLocked)
                        {
                            cmsHelper.cmsAdminContent = null;
                            page.ThePage = SiteData.GetPage(uri);
                        }
                    }
                }
            }
            else
            {
                page.ThePage = SiteData.GetPage(uri);
            }

            page.Load();

            return(page);
        }
        protected string GetTemplateFile(ControllerContext ctrlCtx)
        {
            ControllerBase controller   = ctrlCtx.Controller;
            string         templateFile = String.Empty;

            if (controller is IContentController)
            {
                templateFile = (controller as IContentController).TemplateFile;
            }
            else
            {
                if (controller.ViewData[PagePayload.ViewDataKey] != null)
                {
                    PagePayload page = (PagePayload)controller.ViewData[PagePayload.ViewDataKey];
                    templateFile = page.ThePage.TemplateFile;
                }
            }

            return(templateFile);
        }
Esempio n. 13
0
        public override void InitHelpers()
        {
            base.InitHelpers();

            if (this.ViewData.Model != null && this.ViewData.Model is PagePayload)
            {
                this.CmsPage = (PagePayload)this.ViewData.Model;
            }
            else
            {
                if (this.ViewData[PagePayload.ViewDataKey] == null)
                {
                    this.CmsPage = PagePayload.GetCurrentContent();
                    this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
                }
                else
                {
                    this.CmsPage = (PagePayload)this.ViewData[PagePayload.ViewDataKey];
                }
            }
        }
Esempio n. 14
0
		public static PagePayload GetContent(string uri) {
			PagePayload page = new PagePayload();

			if (SecurityData.AdvancedEditMode) {
				using (CMSConfigHelper cmsHelper = new CMSConfigHelper()) {
					cmsHelper.OverrideKey(uri);

					if (cmsHelper.cmsAdminContent == null) {
						page.ThePage = SiteData.GetPage(uri);

						if (!page.ThePage.IsPageLocked) {
							if (page.ThePage.ContentType == ContentPageType.PageType.BlogEntry) {
								var c = page.ThePage.ContentCategories;
								var t = page.ThePage.ContentTags;
							}

							cmsHelper.cmsAdminContent = page.ThePage;
						} else {
							cmsHelper.cmsAdminContent = null;
						}
					} else {
						page.ThePage = cmsHelper.cmsAdminContent;
						if (page.IsPageLocked) {
							cmsHelper.cmsAdminContent = null;
							page.ThePage = SiteData.GetPage(uri);
						}
					}
				}
			} else {
				page.ThePage = SiteData.GetPage(uri);
			}

			page.Load();

			return page;
		}
Esempio n. 15
0
 public OpenGraph(PagePayload pp)
     : this()
 {
     this.CmsPage = pp;
 }
Esempio n. 16
0
 public void RefreshPayload()
 {
     this.CmsPage = PagePayload.GetCurrentContent();
     this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
 }
Esempio n. 17
0
 public void OverridePage(PagePayload page)
 {
     this.CmsPage = page;
     this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
 }
Esempio n. 18
0
        public static PagePayload GetCurrentContent()
        {
            Guid guidContentID = Guid.Empty;

            PagePayload page = new PagePayload();
            page.ThePage = SiteData.GetCurrentPage();

            page.Load();
            return page;
        }
Esempio n. 19
0
        public static PagePayload GetContent(string uri)
        {
            PagePayload page = new PagePayload();
            page.ThePage = SiteData.GetPage(uri);

            page.Load();
            return page;
        }
Esempio n. 20
0
 public void OverridePage(SiteNav nav)
 {
     this.CmsPage = PagePayload.GetContent(nav);
     this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
 }
		protected void LoadPage() {
			if (_page == null) {
				if (this.ViewData[PagePayload.ViewDataKey] == null) {
					_page = PagePayload.GetCurrentContent();
					this.ViewData[PagePayload.ViewDataKey] = _page;
				} else {
					_page = (PagePayload)this.ViewData[PagePayload.ViewDataKey];
				}
			}

			this.TemplateFile = this.DisplayTemplateFile;
		}
		protected void LoadPage(string Uri) {
			_page = PagePayload.GetContent(Uri);

			this.ViewData[PagePayload.ViewDataKey] = _page;

			this.TemplateFile = this.DisplayTemplateFile;
		}
		public void RefreshPayload() {
			this.CmsPage = PagePayload.GetCurrentContent();
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
		public void OverridePage(PagePayload page) {
			this.CmsPage = page;
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
		protected void LoadPage(string Uri) {
			_page = PagePayload.GetContent(Uri);
			this.ViewData[PagePayload.ViewDataKey] = _page;

			if (_page != null && _page.ThePage.ContentID != Guid.Empty) {
				_page.HandleTemplatePath(this);
			}
		}
		public void OverridePage(SiteNav nav) {
			this.CmsPage = PagePayload.GetContent(nav);
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
		public ActionResult TemplatePreview() {
			PagePayload _page = new PagePayload();
			_page.ThePage = ContentPageHelper.GetSamplerView();
			_page.ThePage.TemplateFile = SiteData.PreviewTemplateFile;

			_page.TheSite = SiteData.CurrentSite;
			_page.TheWidgets = new List<Widget>();

			this.ViewData[PagePayload.ViewDataKey] = _page;

			return View(SiteData.PreviewTemplateFile);
		}
		protected void LoadPage() {
			if (this.ViewData[PagePayload.ViewDataKey] == null) {
				_page = PagePayload.GetCurrentContent();
				this.ViewData[PagePayload.ViewDataKey] = _page;
			} else {
				_page = (PagePayload)this.ViewData[PagePayload.ViewDataKey];
			}

			if (_page != null && _page.ThePage.ContentID != Guid.Empty) {
				_page.HandleTemplatePath(this);
			}
		}