本文整理汇总了C#中Carrotware.CMS.Core.ContentPage类的典型用法代码示例。如果您正苦于以下问题:C# ContentPage类的具体用法?C# ContentPage怎么用?C# ContentPage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContentPage类属于Carrotware.CMS.Core命名空间,在下文中一共展示了ContentPage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ContentPageExport
public ContentPageExport() {
CarrotCakeVersion = SiteData.CarrotCakeCMSVersion;
ExportDate = DateTime.UtcNow;
ThePage = new ContentPage();
ThePageWidgets = new List<Widget>();
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:7,代码来源:ContentPageExport.cs
示例2: GetContent
public static PagePayload GetContent(ContentPage cp) {
PagePayload page = new PagePayload();
page.ThePage = cp;
page.Load();
return page;
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:7,代码来源:PagePayload.cs
示例3: GetHtml
public override string GetHtml() {
string sFieldValue = string.Empty;
if (this.ContentPage == null) {
this.ContentPage = SiteData.GetCurrentPage();
}
SiteNav navNext = new SiteNav();
if (this.NavigationDirection != NavDirection.Unknown) {
using (ISiteNavHelper navHelper = SiteNavFactory.GetSiteNavHelper()) {
if (NavigationDirection == NavDirection.Prev) {
navNext = navHelper.GetPrevPost(SiteData.CurrentSiteID, this.ContentPage.Root_ContentID, !SecurityData.IsAuthEditor);
}
if (NavigationDirection == NavDirection.Next) {
navNext = navHelper.GetNextPost(SiteData.CurrentSiteID, this.ContentPage.Root_ContentID, !SecurityData.IsAuthEditor);
}
if (navNext != null) {
if (this.UseDefaultText) {
string sField = this.CaptionDataField.ToString();
object objData = ReflectionUtilities.GetPropertyValue(navNext, sField);
if (objData != null) {
sFieldValue = String.Format("{0}", objData);
}
this.NavigateText = sFieldValue;
}
this.NavigateUrl = navNext.FileName;
} else {
this.NavigateUrl = String.Empty;
}
}
} else {
this.NavigateUrl = String.Empty;
}
if (!String.IsNullOrEmpty(this.NavigateUrl)) {
var lnkBuilder = new TagBuilder("a");
lnkBuilder.MergeAttribute("href", this.NavigateUrl);
lnkBuilder.InnerHtml = this.NavigateUrl;
if (!String.IsNullOrEmpty(this.NavigateText)) {
lnkBuilder.InnerHtml = this.NavigateText;
}
var lnkAttribs = (IDictionary<string, object>)HtmlHelper.AnonymousObjectToHtmlAttributes(linkAttributes);
lnkBuilder.MergeAttributes(lnkAttribs);
return lnkBuilder.ToString(TagRenderMode.Normal);
} else {
return String.Empty;
}
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:56,代码来源:ContentPageComponents.cs
示例4: btnSave_Click
protected void btnSave_Click(object sender, EventArgs e)
{
pageContents = new ContentPage(SiteID, ContentPageType.PageType.ContentEntry);
DateTime dtSite = CMSConfigHelper.CalcNearestFiveMinTime(SiteData.CurrentSite.Now);
int iOrder = pageHelper.GetMaxNavOrder(SiteID) + 1;
Guid? parentContentID = ParentPagePicker.SelectedPage;
pageContents.Parent_ContentID = parentContentID;
pageContents.TitleBar = txtTitle.Text;
pageContents.NavMenuText = txtNav.Text;
pageContents.PageHead = txtHead.Text;
pageContents.FileName = txtFileName.Text;
pageContents.MetaDescription = txtDescription.Text;
pageContents.MetaKeyword = txtKey.Text;
pageContents.Heartbeat_UserId = SecurityData.CurrentUserGuid;
pageContents.EditHeartbeat = dtSite.AddMinutes(5);
pageContents.EditUserId = SecurityData.CurrentUserGuid;
pageContents.IsLatestVersion = true;
pageContents.EditDate = SiteData.CurrentSite.Now;
pageContents.NavOrder = iOrder;
pageContents.PageActive = false;
pageContents.ShowInSiteMap = true;
pageContents.ShowInSiteNav = true;
pageContents.ContentType = ContentPageType.PageType.ContentEntry;
pageContents.GoLiveDate = dtSite;
pageContents.RetireDate = dtSite.AddYears(200);
pageContents.SavePageEdit();
pnlAdd.Visible = false;
pnlSaved.Visible = true;
litPageName.Text = pageContents.FileName;
lnkNew.NavigateUrl = pageContents.FileName;
if (pageContents.FileName.ToLowerInvariant().EndsWith(SiteData.DefaultDirectoryFilename)) {
VirtualDirectory.RegisterRoutes(true);
}
Master.ShowSave();
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:48,代码来源:PageAddChild.aspx.cs
示例5: GetEmptyHome
public static ContentPage GetEmptyHome()
{
ContentPage navData = new ContentPage();
navData.ContentID = Guid.Empty;
navData.Root_ContentID = Guid.Empty;
navData.SiteID = SiteData.CurrentSiteID;
navData.TemplateFile = "_EmptyHome";
navData.FileName = SiteData.DefaultDirectoryFilename;
navData.NavMenuText = "NONE";
navData.PageHead = "NONE";
navData.TitleBar = "NONE";
navData.PageActive = false;
navData.PageText = "<p>NO PAGE CONTENT</p>";
navData.EditDate = DateTime.Now.Date.AddDays(-1);
navData.CreateDate = DateTime.Now.Date.AddDays(-10);
navData.GoLiveDate = DateTime.Now.Date.AddDays(1);
navData.RetireDate = DateTime.Now.Date.AddDays(90);
navData.ContentType = ContentPageType.PageType.ContentEntry;
return navData;
}
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:20,代码来源:ContentPageHelper.cs
示例6: GetLatestContentByURL
public ContentPage GetLatestContentByURL(Guid siteID, bool bActiveOnly, string sPage)
{
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, bActiveOnly, sPage);
if (cont != null) {
content = new ContentPage(cont);
}
return content;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:9,代码来源:ContentPageHelper.cs
示例7: FindHome
public ContentPage FindHome(Guid siteID, bool bActiveOnly)
{
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.FindHome(db, siteID, bActiveOnly);
if (cont != null) {
content = new ContentPage(cont);
}
return content;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:9,代码来源:ContentPageHelper.cs
示例8: FindContentByID
public ContentPage FindContentByID(Guid siteID, Guid rootContentID)
{
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.GetLatestContentByID(db, siteID, false, rootContentID);
if (cont != null) {
content = new ContentPage(cont);
}
return content;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:9,代码来源:ContentPageHelper.cs
示例9: FindByPageSlug
public ContentPage FindByPageSlug(Guid siteID, DateTime datePublished, string urlPageSlug)
{
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.cqGetLatestContentBySlug(db, siteID, datePublished, urlPageSlug);
if (cont != null) {
content = new ContentPage(cont);
}
return content;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:9,代码来源:ContentPageHelper.cs
示例10: FindByFilename
public ContentPage FindByFilename(Guid siteID, string urlFileName)
{
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, false, urlFileName);
if (cont != null) {
content = new ContentPage(cont);
}
return content;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:9,代码来源:ContentPageHelper.cs
示例11: GetSamplerView
public static ContentPage GetSamplerView()
{
string sFile1 = String.Empty;
string sFile2 = String.Empty;
try {
Assembly _assembly = Assembly.GetExecutingAssembly();
using (StreamReader oTextStream = new StreamReader(_assembly.GetManifestResourceStream("Carrotware.CMS.Core.SiteContent.Mock.SampleContent1.txt"))) {
sFile1 = oTextStream.ReadToEnd();
}
using (StreamReader oTextStream = new StreamReader(_assembly.GetManifestResourceStream("Carrotware.CMS.Core.SiteContent.Mock.SampleContent2.txt"))) {
sFile2 = oTextStream.ReadToEnd();
}
List<string> imageNames = (from i in _assembly.GetManifestResourceNames()
where i.Contains("SiteContent.Mock.sample")
&& i.EndsWith(".png")
select i).ToList();
foreach (string img in imageNames) {
var imgURL = CMSConfigHelper.GetWebResourceUrl(typeof(ContentPage), img);
sFile1 = sFile1.Replace(img, imgURL);
sFile2 = sFile2.Replace(img, imgURL);
}
} catch { }
ContentPage pageNew = new ContentPage();
pageNew.Root_ContentID = SiteData.CurrentSiteID;
pageNew.ContentID = pageNew.Root_ContentID;
pageNew.SiteID = SiteData.CurrentSiteID;
pageNew.Parent_ContentID = null;
pageNew.PageText = "<h2>Content CENTER</h2>\r\n" + sFile1;
pageNew.LeftPageText = "<h2>Content LEFT</h2>\r\n" + sFile2;
pageNew.RightPageText = "<h2>Content RIGHT</h2>\r\n" + sFile2;
pageNew.IsLatestVersion = true;
pageNew.NavOrder = -1;
pageNew.TitleBar = "Template Preview - TITLE";
pageNew.NavMenuText = "Template PV - NAV"; ;
pageNew.PageHead = "Template Preview - HEAD";
pageNew.PageActive = true;
pageNew.ShowInSiteNav = true;
pageNew.ShowInSiteMap = true;
pageNew.EditUserId = SecurityData.CurrentUserGuid;
pageNew.EditDate = DateTime.Now.Date.AddHours(-8);
pageNew.CreateDate = DateTime.Now.Date.AddHours(-38);
pageNew.GoLiveDate = pageNew.EditDate.AddHours(-5);
pageNew.RetireDate = pageNew.CreateDate.AddYears(5);
pageNew.TemplateFile = SiteData.PreviewTemplateFile;
pageNew.FileName = SiteData.PreviewTemplateFilePage;
pageNew.MetaDescription = "Meta Description";
pageNew.MetaKeyword = "Meta Keyword";
pageNew.ContentType = ContentPageType.PageType.BlogEntry;
pageNew.PageSlug = "sampler-page-view";
List<ContentCategory> lstK = new List<ContentCategory>();
List<ContentTag> lstT = new List<ContentTag>();
for (int i = 0; i < 5; i++) {
ContentCategory k = new ContentCategory {
ContentCategoryID = Guid.NewGuid(),
CategoryText = "Keyword Text " + i.ToString(),
CategorySlug = "keyword-slug-" + i.ToString()
};
ContentTag t = new ContentTag {
ContentTagID = Guid.NewGuid(),
TagText = "Tag Text " + i.ToString(),
TagSlug = "tag-slug-" + i.ToString()
};
lstK.Add(k);
lstT.Add(t);
}
pageNew.ContentCategories = lstK;
pageNew.ContentTags = lstT;
return pageNew;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:85,代码来源:ContentPageHelper.cs
示例12: CreateEmptyHome
private void CreateEmptyHome() {
DateTime dtSite = CMSConfigHelper.CalcNearestFiveMinTime(SiteData.CurrentSite.Now);
ContentPage pageContents = new ContentPage {
SiteID = SiteID,
Root_ContentID = Guid.NewGuid(),
ContentID = Guid.NewGuid(),
EditDate = SiteData.CurrentSite.Now,
CreateUserId = SecurityData.CurrentUserGuid,
CreateDate = SiteData.CurrentSite.Now,
GoLiveDate = dtSite.AddMinutes(-5),
RetireDate = dtSite.AddYears(200),
TitleBar = "Home",
NavMenuText = "Home",
PageHead = "Home",
FileName = "/home",
PageText = SiteData.StarterHomePageSample,
LeftPageText = String.Empty,
RightPageText = String.Empty,
NavOrder = 0,
IsLatestVersion = true,
PageActive = true,
ShowInSiteNav = true,
ShowInSiteMap = true,
BlockIndex = false,
EditUserId = SecurityData.CurrentUserGuid,
ContentType = ContentPageType.PageType.ContentEntry,
TemplateFile = SiteData.DefaultTemplateFilename
};
pageContents.SavePageEdit();
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:32,代码来源:CmsAdminController.cs
示例13: OverrideKey
public void OverrideKey(string sPageName)
{
filePage = null;
using (ContentPageHelper pageHelper = new ContentPageHelper()) {
filePage = pageHelper.FindByFilename(SiteData.CurrentSiteID, sPageName);
}
}
开发者ID:sunsiz,项目名称:CarrotCakeCMS-MVC,代码行数:7,代码来源:CMSConfigHelper.cs
示例14: LoadGuids
private void LoadGuids() {
using (ContentPageHelper pageHelper = new ContentPageHelper()) {
if (!String.IsNullOrEmpty(CurrentEditPage)) {
filePage = pageHelper.FindByFilename(SiteData.CurrentSite.SiteID, CurrentEditPage);
if (filePage != null) {
CurrentPageGuid = filePage.Root_ContentID;
}
} else {
if (CurrentPageGuid != Guid.Empty) {
filePage = pageHelper.FindContentByID(SiteData.CurrentSite.SiteID, CurrentPageGuid);
if (filePage != null) {
CurrentEditPage = filePage.FileName;
}
} else {
filePage = new ContentPage();
}
}
}
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:19,代码来源:CMS.asmx.cs
示例15: FindByFilename
public ContentPage FindByFilename(Guid siteID, string urlFileName) {
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, false, urlFileName);
if (cont != null) {
content = new ContentPage(cont);
}
if (content == null && urlFileName == SiteData.DefaultDirectoryFilename) {
content = FindHome(siteID, false);
}
return content;
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:13,代码来源:ContentPageHelper.cs
示例16: GetLatestContentByURL
public ContentPage GetLatestContentByURL(Guid siteID, bool bActiveOnly, string sPage) {
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.GetLatestContentByURL(db, siteID, bActiveOnly, sPage);
if (cont != null) {
content = new ContentPage(cont);
}
if (content == null && sPage == SiteData.DefaultDirectoryFilename) {
content = FindHome(siteID, bActiveOnly);
}
return content;
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:11,代码来源:ContentPageHelper.cs
示例17: GetVersion
public ContentPage GetVersion(Guid siteID, Guid contentID)
{
ContentPage content = null;
vw_carrot_Content cont = CompiledQueries.cqGetContentByContentID(db, siteID, contentID);
if (cont != null) {
content = new ContentPage(cont);
}
return content;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:9,代码来源:ContentPageHelper.cs
示例18: IsPageLocked
public bool IsPageLocked(ContentPage cp)
{
bool bLock = false;
if (cp.Heartbeat_UserId != null) {
if (cp.Heartbeat_UserId != SecurityData.CurrentUserGuid
&& cp.EditHeartbeat.Value > DateTime.UtcNow.AddMinutes(-2)) {
bLock = true;
}
if (cp.Heartbeat_UserId == SecurityData.CurrentUserGuid
|| cp.Heartbeat_UserId == null) {
bLock = false;
}
}
return bLock;
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS,代码行数:15,代码来源:ContentPageHelper.cs
示例19: SetVals
private void SetVals(ContentPage cp, List<Widget> widgets) {
CarrotCakeVersion = SiteData.CarrotCakeCMSVersion;
ExportDate = DateTime.UtcNow;
Guid siteID = cp.SiteID;
NewRootContentID = Guid.NewGuid();
cp.LoadAttributes();
ThePage = cp;
ThePageWidgets = widgets;
if (ThePage == null) {
ThePage = new ContentPage();
ThePage.Root_ContentID = Guid.NewGuid();
ThePage.ContentID = ThePage.Root_ContentID;
}
if (ThePageWidgets == null) {
ThePageWidgets = new List<Widget>();
}
OriginalRootContentID = ThePage.Root_ContentID;
OriginalSiteID = ThePage.SiteID;
OriginalParentContentID = Guid.Empty;
ParentFileName = "";
if (ThePage.Parent_ContentID != null) {
ContentPage parent = new ContentPage();
using (ContentPageHelper cph = new ContentPageHelper()) {
parent = cph.FindContentByID(siteID, ThePage.Parent_ContentID.Value);
}
ParentFileName = parent.FileName;
OriginalParentContentID = parent.Root_ContentID;
}
ThePage.Root_ContentID = NewRootContentID;
ThePage.ContentID = NewRootContentID;
foreach (var w in ThePageWidgets) {
w.Root_ContentID = NewRootContentID;
w.Root_WidgetID = Guid.NewGuid();
w.WidgetDataID = Guid.NewGuid();
}
Guid userID1 = Guid.Empty;
if (!cp.EditUserId.HasValue) {
userID1 = cp.CreateUserId;
} else {
userID1 = cp.EditUserId.Value;
}
ExtendedUserData u1 = new ExtendedUserData(userID1);
this.TheUser = new SiteExportUser(u1);
Guid userID2 = Guid.Empty;
if (cp.CreditUserId.HasValue) {
userID2 = cp.CreditUserId.Value;
}
ExtendedUserData u2 = new ExtendedUserData(userID2);
if (u2 != null) {
this.CreditUser = new SiteExportUser(u2);
} else {
this.CreditUser = null;
}
}
开发者ID:ithanshui,项目名称:CarrotCakeCMS-MVC,代码行数:68,代码来源:ContentPageExport.cs
示例20: PageAddChild
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);
}
开发者ID:ninianne98,项目名称:CarrotCakeCMS-MVC,代码行数:23,代码来源:CmsAdminController.cs
注:本文中的Carrotware.CMS.Core.ContentPage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论