本文整理汇总了C#中Carrotware.CMS.Core.ContentPage.LoadAttributes方法的典型用法代码示例。如果您正苦于以下问题:C# ContentPage.LoadAttributes方法的具体用法?C# ContentPage.LoadAttributes怎么用?C# ContentPage.LoadAttributes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carrotware.CMS.Core.ContentPage
的用法示例。
在下文中一共展示了ContentPage.LoadAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: Page_Init
//protected void Page_Load(object sender, EventArgs e) {
protected void Page_Init(object sender, EventArgs e) {
guidContentID = GetGuidIDFromQuery();
EditorPrefs = UserEditState.cmsUserEditState;
if (EditorPrefs == null) {
EditorPrefs = new UserEditState();
EditorPrefs.Init();
}
string sCurrentPage = SiteData.CurrentScriptName;
string sScrubbedURL = SiteData.AlternateCurrentScriptName;
if (sScrubbedURL.ToLower() != sCurrentPage.ToLower()) {
sCurrentPage = sScrubbedURL;
}
ContentPage pageContents = new ContentPage();
if (guidContentID == Guid.Empty) {
pageContents = pageHelper.FindByFilename(SiteData.CurrentSiteID, sCurrentPage);
} else {
pageContents = pageHelper.FindContentByID(SiteData.CurrentSiteID, guidContentID);
}
PageType = pageContents.ContentType;
EditedPageFileName = pageContents.FileName;
btnEditCoreInfo.Attributes["onclick"] = "cmsShowEditPageInfo();";
if (pageContents.ContentType == ContentPageType.PageType.BlogEntry) {
btnEditCoreInfo.Attributes["onclick"] = "cmsShowEditPostInfo();";
btnSortChildPages.Visible = false;
}
if (cmsHelper.cmsAdminContent != null) {
EditedPageFileName = cmsHelper.cmsAdminContent.FileName;
}
if (cmsHelper.ToolboxPlugins.Any()) {
GeneralUtilities.BindRepeater(rpTools, cmsHelper.ToolboxPlugins);
} else {
rpTools.Visible = false;
}
bLocked = pageHelper.IsPageLocked(pageContents.Root_ContentID, SiteData.CurrentSiteID, SecurityData.CurrentUserGuid);
GeneralUtilities.BindList(ddlTemplate, cmsHelper.Templates);
try { GeneralUtilities.SelectListValue(ddlTemplate, cmsHelper.cmsAdminContent.TemplateFile.ToLower()); } catch { }
if (!bLocked) {
foreach (Control c in plcIncludes.Controls) {
this.Page.Header.Controls.Add(c);
}
//jquerybasic jquerybasic2 = new jquerybasic();
//jquerybasic2.SelectedSkin = jquerybasic.jQueryTheme.NotUsed;
//Page.Header.Controls.AddAt(0, jquerybasic2);
//BasicControlUtils.InsertjQuery(this.Page);
BasicControlUtils.InsertjQueryMain(this.Page);
BasicControlUtils.InsertjQueryUI(this.Page);
guidContentID = pageContents.Root_ContentID;
if (cmsHelper.cmsAdminContent == null) {
pageContents.LoadAttributes();
cmsHelper.cmsAdminContent = pageContents;
} else {
pageContents = cmsHelper.cmsAdminContent;
}
bool bRet = pageHelper.RecordPageLock(pageContents.Root_ContentID, SiteData.CurrentSite.SiteID, SecurityData.CurrentUserGuid);
cmsDivEditing.Visible = false;
BasicControlUtils.MakeXUACompatibleFirst(this.Page);
} else {
pnlCMSEditZone.Visible = false;
rpTools.Visible = false;
btnToolboxSave1.Visible = false;
btnToolboxSave2.Visible = false;
btnToolboxSave3.Visible = false;
btnTemplate.Visible = false;
btnEditCoreInfo.Visible = false;
cmsDivEditing.Visible = true;
if (bLocked && pageContents.Heartbeat_UserId != null) {
MembershipUser usr = SecurityData.GetUserByGuid(pageContents.Heartbeat_UserId.Value);
EditUserName = usr.UserName;
litUser.Text = "Read only mode. User '" + usr.UserName + "' is currently editing the page.<br />" +
" Click <b><a href=\"" + pageContents.FileName + "\">here</a></b> to return to the browse view.<br />";
}
}
}