public SetPage ( |
||
page | ||
리턴 | void |
public ActionResult PageAddChild(Guid id, bool? saved) { //if (saved.HasValue && saved.Value) { // ShowSave(); //} ContentPageModel model = new ContentPageModel(); var pageContentsParent = pageHelper.FindContentByID(this.SiteID, id); var pageContents = new ContentPage(this.SiteID, ContentPageType.PageType.ContentEntry); if (pageContentsParent != null && pageContentsParent.ContentType == ContentPageType.PageType.ContentEntry) { pageContents.Parent_ContentID = id; } else { pageContents.Parent_ContentID = Guid.Empty; } model.SetPage(pageContents); model.VisitPage = false; model.ParentID = id; return View(model); }
public ActionResult BlogPostEdit(Guid id) { ContentPageModel model = new ContentPageModel(); cmsHelper.OverrideKey(id); ContentPage pageContents = cmsHelper.cmsAdminContent; model.SetPage(pageContents); ShowSaved(); return View(model); }
public ActionResult BlogPostEdit(ContentPageModel model) { cmsHelper.OverrideKey(model.ContentPage.Root_ContentID); ContentPage page = model.ContentPage; var pageContents = cmsHelper.cmsAdminContent; pageContents.GoLiveDate = page.GoLiveDate; pageContents.RetireDate = page.RetireDate; pageContents.IsLatestVersion = true; pageContents.Thumbnail = page.Thumbnail; pageContents.TitleBar = page.TitleBar; pageContents.NavMenuText = page.NavMenuText; pageContents.PageHead = page.PageHead; pageContents.MetaDescription = page.MetaDescription; pageContents.MetaKeyword = page.MetaKeyword; pageContents.EditDate = SiteData.CurrentSite.Now; pageContents.NavOrder = page.NavOrder; pageContents.PageActive = page.PageActive; pageContents.ShowInSiteNav = page.ShowInSiteNav; pageContents.ShowInSiteMap = page.ShowInSiteMap; pageContents.BlockIndex = page.BlockIndex; pageContents.CreditUserId = page.CreditUserId; pageContents.EditUserId = SecurityData.CurrentUserGuid; pageContents.Parent_ContentID = null; pageContents.ContentCategories = (from l in SiteData.CurrentSite.GetCategoryList() join cr in model.SelectedCategories on l.ContentCategoryID.ToString().ToLowerInvariant() equals cr.ToLowerInvariant() select l).ToList(); pageContents.ContentTags = (from l in SiteData.CurrentSite.GetTagList() join cr in model.SelectedTags on l.ContentTagID.ToString().ToLowerInvariant() equals cr.ToLowerInvariant() select l).ToList(); model.SetPage(pageContents); Helper.ForceValidation(ModelState, model); if (ModelState.IsValid) { cmsHelper.cmsAdminContent = pageContents; SetSaved(); return RedirectToAction("BlogPostEdit", new { @id = model.ContentPage.Root_ContentID }); } Helper.HandleErrorDict(ModelState); return View(model); }
public ActionResult PageEdit(ContentPageModel model) { cmsHelper.OverrideKey(model.ContentPage.Root_ContentID); ContentPage page = model.ContentPage; var pageContents = cmsHelper.cmsAdminContent; pageContents.GoLiveDate = page.GoLiveDate; pageContents.RetireDate = page.RetireDate; pageContents.IsLatestVersion = true; pageContents.Thumbnail = page.Thumbnail; pageContents.TitleBar = page.TitleBar; pageContents.NavMenuText = page.NavMenuText; pageContents.PageHead = page.PageHead; pageContents.PageSlug = null; pageContents.MetaDescription = page.MetaDescription; pageContents.MetaKeyword = page.MetaKeyword; pageContents.EditDate = SiteData.CurrentSite.Now; pageContents.NavOrder = page.NavOrder; pageContents.PageActive = page.PageActive; pageContents.ShowInSiteNav = page.ShowInSiteNav; pageContents.ShowInSiteMap = page.ShowInSiteMap; pageContents.BlockIndex = page.BlockIndex; pageContents.CreditUserId = page.CreditUserId; pageContents.EditUserId = SecurityData.CurrentUserGuid; model.SetPage(pageContents); Helper.ForceValidation(ModelState, model); if (ModelState.IsValid) { cmsHelper.cmsAdminContent = pageContents; SetSaved(); return RedirectToAction("PageEdit", new { @id = model.ContentPage.Root_ContentID }); } Helper.HandleErrorDict(ModelState); return View(model); }
public ActionResult PageAddChild(Guid id, bool? saved) { //if (saved.HasValue && saved.Value) { // ShowSave(); //} ContentPageModel model = new ContentPageModel(); var pageContents = new ContentPage(this.SiteID, ContentPageType.PageType.ContentEntry); pageContents.Parent_ContentID = id; model.SetPage(pageContents); model.VisitPage = false; model.ParentID = id; return View(model); }
public ActionResult BlogPostAddEdit(Guid? id, Guid? versionid, Guid? importid, string mode) { ContentPageModel model = new ContentPageModel(); model.ImportID = importid; model.VersionID = versionid; model.Mode = (String.IsNullOrEmpty(mode) || mode.Trim().ToLower() != "raw") ? "html" : "raw"; ContentPage pageContents = null; ViewBag.ContentEditMode = model.Mode; if (!id.HasValue && !versionid.HasValue && !importid.HasValue) { if (pageContents == null) { pageContents = new ContentPage(this.SiteID, ContentPageType.PageType.BlogEntry); } pageContents.Root_ContentID = Guid.Empty; } else { if (importid.HasValue) { ContentPageExport cpe = ContentImportExportUtils.GetSerializedContentPageExport(importid.Value); if (cpe != null) { pageContents = cpe.ThePage; pageContents.EditDate = SiteData.CurrentSite.Now; var rp = pageHelper.GetLatestContentByURL(this.SiteID, false, pageContents.FileName); if (rp != null) { pageContents.Root_ContentID = rp.Root_ContentID; pageContents.ContentID = rp.ContentID; } else { pageContents.Root_ContentID = Guid.Empty; pageContents.ContentID = Guid.Empty; } pageContents.Parent_ContentID = null; pageContents.NavOrder = SiteData.BlogSortOrderNumber; } } if (versionid.HasValue) { pageContents = pageHelper.GetVersion(this.SiteID, versionid.Value); } if (id.HasValue && pageContents == null) { pageContents = pageHelper.FindContentByID(this.SiteID, id.Value); } } model.SetPage(pageContents); return View(model); }
public ActionResult BlogPostEdit(Guid id, bool? saved) { ContentPageModel model = new ContentPageModel(); cmsHelper.OverrideKey(id); ContentPage pageContents = cmsHelper.cmsAdminContent; model.SetPage(pageContents); if (saved.HasValue && saved.Value) { ShowSave(); } return View(model); }
public ActionResult PageAddEdit(Guid? id, Guid? versionid, Guid? importid, string mode) { ContentPageModel model = new ContentPageModel(); model.ImportID = importid; model.VersionID = versionid; model.Mode = (String.IsNullOrEmpty(mode) || mode.Trim().ToLower() != "raw") ? "html" : "raw"; ContentPage pageContents = null; ViewBag.ContentEditMode = model.Mode; if (!id.HasValue && !versionid.HasValue && !importid.HasValue) { if (pageContents == null) { pageContents = new ContentPage(this.SiteID, ContentPageType.PageType.ContentEntry); } pageContents.Root_ContentID = Guid.Empty; } else { if (importid.HasValue) { ContentPageExport cpe = ContentImportExportUtils.GetSerializedContentPageExport(importid.Value); if (cpe != null) { pageContents = cpe.ThePage; pageContents.EditDate = SiteData.CurrentSite.Now; pageContents.Parent_ContentID = null; var rp = pageHelper.GetLatestContentByURL(this.SiteID, false, pageContents.FileName); if (rp != null) { pageContents.Root_ContentID = rp.Root_ContentID; pageContents.ContentID = rp.ContentID; pageContents.Parent_ContentID = rp.Parent_ContentID; pageContents.NavOrder = rp.NavOrder; } else { pageContents.Root_ContentID = Guid.Empty; pageContents.ContentID = Guid.Empty; pageContents.NavOrder = pageHelper.GetSitePageCount(this.SiteID, ContentPageType.PageType.ContentEntry); } } } if (versionid.HasValue) { pageContents = pageHelper.GetVersion(this.SiteID, versionid.Value); } if (id.HasValue && pageContents == null) { pageContents = pageHelper.FindContentByID(this.SiteID, id.Value); } } if (pageContents.ContentType != ContentPageType.PageType.ContentEntry) { return RedirectToAction("BlogPostAddEdit", new { @id = pageContents.Root_ContentID, @mode = model.Mode }); } cmsHelper.OverrideKey(pageContents.Root_ContentID); cmsHelper.cmsAdminContent = pageContents; cmsHelper.cmsAdminWidget = pageContents.GetWidgetList(); model.SetPage(pageContents); return View(model); }