コード例 #1
0
		public static PagePayload GetCurrentContent() {
			PagePayload page = new PagePayload();
			page.ThePage = SiteData.GetCurrentPage();

			page.Load();
			return page;
		}
コード例 #2
0
		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();
		}
コード例 #3
0
		public static PagePayload GetContent(Guid id) {
			PagePayload page = new PagePayload();
			page.ThePage = SiteData.GetPage(id);

			page.Load();
			return page;
		}
コード例 #4
0
		public static PagePayload GetContent(SiteNav nav) {
			PagePayload page = new PagePayload();
			page.ThePage = nav.GetContentPage();

			page.Load();
			return page;
		}
コード例 #5
0
		public static PagePayload GetContent(ContentPage cp) {
			PagePayload page = new PagePayload();
			page.ThePage = cp;

			page.Load();
			return page;
		}
コード例 #6
0
        public static PagePayload GetContent(Guid id)
        {
            PagePayload page = new PagePayload();

            page.ThePage = SiteData.GetPage(id);

            page.Load();
            return(page);
        }
コード例 #7
0
        public static PagePayload GetContent(SiteNav nav)
        {
            PagePayload page = new PagePayload();

            page.ThePage = nav.GetContentPage();

            page.Load();
            return(page);
        }
コード例 #8
0
        public static PagePayload GetContent(ContentPage cp)
        {
            PagePayload page = new PagePayload();

            page.ThePage = cp;

            page.Load();
            return(page);
        }
コード例 #9
0
        public static PagePayload GetCurrentContent()
        {
            PagePayload page = new PagePayload();

            page.ThePage = SiteData.GetCurrentPage();

            page.Load();
            return(page);
        }
コード例 #10
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];
				}
			}
		}
コード例 #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);
        }
コード例 #12
0
        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);
        }
コード例 #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];
                }
            }
        }
コード例 #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;
		}
コード例 #15
0
ファイル: OpenGraph.cs プロジェクト: sunsiz/CarrotCakeCMS-MVC
 public OpenGraph(PagePayload pp)
     : this()
 {
     this.CmsPage = pp;
 }
コード例 #16
0
 public void RefreshPayload()
 {
     this.CmsPage = PagePayload.GetCurrentContent();
     this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
 }
コード例 #17
0
 public void OverridePage(PagePayload page)
 {
     this.CmsPage = page;
     this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
 }
コード例 #18
0
        public static PagePayload GetCurrentContent()
        {
            Guid guidContentID = Guid.Empty;

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

            page.Load();
            return page;
        }
コード例 #19
0
        public static PagePayload GetContent(string uri)
        {
            PagePayload page = new PagePayload();
            page.ThePage = SiteData.GetPage(uri);

            page.Load();
            return page;
        }
コード例 #20
0
 public void OverridePage(SiteNav nav)
 {
     this.CmsPage = PagePayload.GetContent(nav);
     this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
 }
コード例 #21
0
		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;
		}
コード例 #22
0
		protected void LoadPage(string Uri) {
			_page = PagePayload.GetContent(Uri);

			this.ViewData[PagePayload.ViewDataKey] = _page;

			this.TemplateFile = this.DisplayTemplateFile;
		}
コード例 #23
0
		public void RefreshPayload() {
			this.CmsPage = PagePayload.GetCurrentContent();
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
コード例 #24
0
		public void OverridePage(PagePayload page) {
			this.CmsPage = page;
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
コード例 #25
0
		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);
			}
		}
コード例 #26
0
		public void OverridePage(SiteNav nav) {
			this.CmsPage = PagePayload.GetContent(nav);
			this.ViewData[PagePayload.ViewDataKey] = this.CmsPage;
		}
コード例 #27
0
		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);
		}
コード例 #28
0
		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);
			}
		}