예제 #1
0
파일: Page.cs 프로젝트: cmcd74/SavvyCMS
        public static Page LoadOrCreatePageCode(System.String pageCodeValue)
        {
            Page page = PageCache.GetByPageCode(pageCodeValue);

            if (page == null || page.IsNewRecord)
            {
                page = new Page()
                {
                    PageCode        = pageCodeValue,
                    TemplateCode    = "special",
                    DateAdded       = DateTime.Now,
                    PublishDate     = DateTime.Now,
                    Title           = Fmt.SplitTitleCase(pageCodeValue),
                    BodyTextHtml    = "Copy to be written for [" + pageCodeValue + "]<br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis te feugifacilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto.",
                    RevisionStatus  = "Live",
                    PageIsALink     = false,
                    ShowInMainNav   = false,
                    ShowInFooterNav = false,
                    SortPosition    = 999
                };
                page.Save();
                PageCache.Rebuild();
            }

            return(page);
        }
예제 #2
0
        //[SiteCustom.SiteOutputCache]
        public ActionResult ByPageCode(string pageCode)
        {
            var page = PageCache.GetByPageCode(pageCode);

            //var page = Models.Page.LoadByPageCode(pageCode);
            if (page == null)
            {
                throw new Beweb.BadUrlException("Page not found with page code of [" + pageCode + "]");
            }
            return(ReturnView(page));
        }
예제 #3
0
        /// <summary>
        /// Forgotten password. This presents a form for user to enter their email address.
        /// If password encryption mode allows it, a password reminder email is sent. Otherwise, a password reset email is sent.
        /// </summary>
        public ActionResult ForgottenPassword()
        {
            var data = new ForgotPasswordViewModel();

            TrackingBreadcrumb.Current.AddBreadcrumb(1, "Forgotten Password");
#if pages
            data.ContentPage = PageCache.GetByPageCode("ForgottenPassword");
            if (data.ContentPage == null)
            {
                throw new Exception("Forgotten Password page not found");
            }
#endif
            return(View(data));
        }