本文整理汇总了C#中mojoPortal.Business.Module类的典型用法代码示例。如果您正苦于以下问题:C# Module类的具体用法?C# Module怎么用?C# Module使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Module类属于mojoPortal.Business命名空间,在下文中一共展示了Module类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InstallContent
public void InstallContent(Module module, string configInfo)
{
foreach (var node in mysettings)
{
ModuleSettings.UpdateModuleSetting(module.ModuleGuid, module.ModuleId, node.Key, node.Value);
}
}
开发者ID:vzrus,项目名称:YAF-and-MojoPortal-Add-Ons,代码行数:7,代码来源:YafActiveDiscussionsContentInstaller.cs
示例2: LoadSettings
private void LoadSettings()
{
moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
config = new BlogConfiguration(moduleSettings);
blogModule = GetModule(moduleId, Blog.FeatureGuid);
postList.ModuleId = moduleId;
postList.PageId = pageId;
postList.DisplayMode = "ByMonth";
postList.IsEditable = UserCanEditModule(moduleId, Blog.FeatureGuid);
postList.Config = config;
postList.SiteRoot = SiteRoot;
postList.ImageSiteRoot = ImageSiteRoot;
if (config.InstanceCssClass.Length > 0) { pnlOuterWrap.SetOrAppendCss(config.InstanceCssClass); }
LoadSideContent(config.ShowLeftContent, config.ShowRightContent);
LoadAltContent(BlogConfiguration.ShowTopContent, BlogConfiguration.ShowBottomContent);
if ((CurrentPage != null) && (CurrentPage.BodyCssClass.Length > 0))
{
AddClassToBody(CurrentPage.BodyCssClass);
}
AddClassToBody("blogviewarchive");
if (BlogConfiguration.UseNoIndexFollowMetaOnLists)
{
SiteUtils.AddNoIndexFollowMeta(Page);
}
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:32,代码来源:ViewArchive.aspx.cs
示例3: InstallContent
public void InstallContent(Module module, string configInfo)
{
if (string.IsNullOrEmpty(configInfo)) { return; }
XmlDocument xml = new XmlDocument();
using (StreamReader stream = File.OpenText(HostingEnvironment.MapPath(configInfo)))
{
xml.LoadXml(stream.ReadToEnd());
}
foreach (XmlNode node in xml.DocumentElement.ChildNodes)
{
if (node.Name == "moduleSetting")
{
XmlAttributeCollection settingAttributes = node.Attributes;
if ((settingAttributes["settingKey"] != null) && (settingAttributes["settingKey"].Value.Length > 0))
{
string key = settingAttributes["settingKey"].Value;
string val = string.Empty;
if (settingAttributes["settingValue"] != null)
{
val = settingAttributes["settingValue"].Value;
}
ModuleSettings.UpdateModuleSetting(module.ModuleGuid, module.ModuleId, key, val);
}
}
}
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:31,代码来源:FlickrGalleryContentInstaller.cs
示例4: btnCreateNewContent_Click
protected void btnCreateNewContent_Click(object sender, EventArgs e)
{
Page.Validate("contentcatalog");
if (!Page.IsValid) { return; }
int moduleDefID = int.Parse(ddModuleType.SelectedItem.Value, CultureInfo.InvariantCulture);
ModuleDefinition moduleDefinition = new ModuleDefinition(moduleDefID);
Module module = new Module();
module.ModuleTitle = this.txtModuleTitle.Text;
module.ModuleDefId = moduleDefID;
module.FeatureGuid = moduleDefinition.FeatureGuid;
module.Icon = moduleDefinition.Icon;
module.SiteId = siteSettings.SiteId;
module.SiteGuid = siteSettings.SiteGuid;
module.CreatedByUserId = SiteUtils.GetCurrentSiteUser().UserId;
module.CacheTime = moduleDefinition.DefaultCacheTime;
module.ShowTitle = WebConfigSettings.ShowModuleTitlesByDefault;
module.HeadElement = WebConfigSettings.ModuleTitleTag;
module.Save();
WebUtils.SetupRedirect(this, SiteRoot
+ "/Admin/ContentManagerPreview.aspx?mid="
+ module.ModuleId.ToInvariantString()
);
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:25,代码来源:ContentCatalog.aspx.cs
示例5: btnSave_Click
void btnSave_Click(object sender, EventArgs e)
{
Module m = new Module(moduleId);
string newPath = basePath + txtFolderName.Text;
try
{
if (!Directory.Exists(Server.MapPath(newPath)))
{
lblError.Text = FolderGalleryResources.FolderGalleryFolderNotExistsMessage;
return;
}
}
catch (HttpException)
{
//thrown at Server.MapPath if the path is not a valid virtual path
txtFolderName.Text = string.Empty;
lblError.Text = FolderGalleryResources.FolderGalleryFolderNotExistsMessage;
return;
}
ModuleSettings.UpdateModuleSetting(
m.ModuleGuid,
m.ModuleId,
"FolderGalleryRootFolder",
newPath);
WebUtils.SetupRedirect(this, SiteUtils.GetCurrentPageUrl());
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:30,代码来源:Edit.aspx.cs
示例6: LoadSettings
private void LoadSettings()
{
moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
module = GetModule(moduleId, Forum.FeatureGuid);
settings = ModuleSettings.GetModuleSettings(moduleId);
config = new ForumConfiguration(settings);
forumList.Config = config;
forumList.ModuleId = moduleId;
forumList.PageId = pageId;
forumList.SiteRoot = SiteRoot;
forumList.ImageSiteRoot = ImageSiteRoot;
//forumList.IsEditable = IsEditable;
forumListAlt.Config = config;
forumListAlt.ModuleId = moduleId;
forumListAlt.PageId = pageId;
forumListAlt.SiteRoot = SiteRoot;
forumListAlt.ImageSiteRoot = ImageSiteRoot;
//forumListAlt.IsEditable = IsEditable;
if (displaySettings.UseAltForumList)
{
forumList.Visible = false;
forumListAlt.Visible = true;
}
AddClassToBody("editforumsubscriptions");
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:30,代码来源:EditSubscriptions.aspx.cs
示例7: DeleteContent
public override void DeleteContent(int moduleId, Guid moduleGuid)
{
if (GalleryConfiguration.DeleteImagesWhenModuleIsDeleted)
{
Module m = new Module(moduleId);
DeleteImages(m.SiteId, moduleId);
}
Gallery.DeleteByModule(moduleId);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:10,代码来源:GalleryContentDeleteHandler.cs
示例8: LoadSettings
private void LoadSettings()
{
pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
itemId = WebUtils.ParseInt32FromQueryString("ItemID", itemId);
commentGuid = WebUtils.ParseGuidFromQueryString("c", commentGuid);
if (commentGuid == Guid.Empty) { return; }
blog = new Blog(itemId);
module = GetModule(moduleId, Blog.FeatureGuid);
commentRepository = new CommentRepository();
if (blog.ModuleId != module.ModuleId)
{
blog = null;
module = null;
return;
}
comment = commentRepository.Fetch(commentGuid);
if ((comment.ContentGuid != blog.BlogGuid)||(comment.ModuleGuid != module.ModuleGuid))
{
blog = null;
module = null;
return;
}
moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
config = new BlogConfiguration(moduleSettings);
currentUser = SiteUtils.GetCurrentSiteUser();
userCanEdit = UserCanEditComment();
commentEditor.SiteGuid = CurrentSite.SiteGuid;
commentEditor.SiteId = CurrentSite.SiteId;
commentEditor.SiteRoot = SiteRoot;
commentEditor.CommentsClosed = false;
//commentEditor.CommentUrl = Request.RawUrl;
commentEditor.ContentGuid = blog.BlogGuid;
//commentEditor.DefaultCommentTitle = defaultCommentTitle;
commentEditor.FeatureGuid = Blog.FeatureGuid;
commentEditor.ModuleGuid = module.ModuleGuid;
//commentEditor.NotificationAddresses = notificationAddresses;
//commentEditor.NotificationTemplateName = notificationTemplateName;
commentEditor.RequireCaptcha = false;
commentEditor.UserCanModerate = userCanEdit;
//commentEditor.Visible = !commentsClosed;
commentEditor.CurrentUser = currentUser;
commentEditor.UserComment = comment;
commentEditor.ShowRememberMe = false;
//commentEditor.IncludeIpAddressInNotification = includeIpAddressInNotification;
//commentEditor.ContainerControl = this;
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:55,代码来源:CommentDialog.aspx.cs
示例9: InstallContent
public void InstallContent(Module module, string configInfo)
{
if (string.IsNullOrEmpty(configInfo)) { return; }
string basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/FolderGalleries/";
if(!Directory.Exists(HostingEnvironment.MapPath(basePath)))
{
Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
}
IOHelper.CopyFolderContents(HostingEnvironment.MapPath(configInfo), HostingEnvironment.MapPath(basePath));
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:13,代码来源:FolderGalleryContentInstaller.cs
示例10: LoadSettings
private void LoadSettings()
{
module = GetModule(moduleId, Link.FeatureGuid);
moduleSettings = ModuleSettings.GetModuleSettings(moduleId);
config = new ListConfiguration(moduleSettings);
theList.Config = config;
theList.PageId = pageId;
theList.ModuleId = moduleId;
theList.IsEditable = UserCanEditModule(moduleId, Link.FeatureGuid);
theList.SiteRoot = SiteRoot;
theList.ImageSiteRoot = ImageSiteRoot;
AddClassToBody("listviewlist");
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:15,代码来源:ViewList.aspx.cs
示例11: GetHtmlModule
private Module GetHtmlModule()
{
if (CurrentSite == null) { return null; }
Module m = GetModule(moduleId, HtmlContent.FeatureGuid);
if (m != null) { return m; }
// these extra checks allow for editing an html instance from modulewrapper
m = new Module(moduleId);
if (
(m.FeatureGuid != HtmlContent.FeatureGuid)
|| (m.SiteId != CurrentSite.SiteId)
|| (m.ModuleId == -1)
|| ((!WebUser.IsInRoles(m.AuthorizedEditRoles)) && (!UserIsAdmin) && (!UserIsContentAdmin) && (!UserIsSiteEditor))
)
{ m = null; }
return m;
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:19,代码来源:HtmlEditService.aspx.cs
示例12: InstallContent
public void InstallContent(Module module, string configInfo)
{
if (string.IsNullOrEmpty(configInfo)) { return; }
string basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/";
if (!Directory.Exists(HostingEnvironment.MapPath(basePath)))
{
Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
}
basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/GalleryImages/";
if (!Directory.Exists(HostingEnvironment.MapPath(basePath)))
{
Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
}
basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/GalleryImages/" + module.ModuleId.ToInvariantString() + "/";
if (!Directory.Exists(HostingEnvironment.MapPath(basePath)))
{
Directory.CreateDirectory(HostingEnvironment.MapPath(basePath));
}
IOHelper.CopyFolderContents(HostingEnvironment.MapPath(configInfo), HostingEnvironment.MapPath(basePath));
basePath = "~/Data/Sites/" + module.SiteId.ToInvariantString() + "/media/GalleryImages/" + module.ModuleId.ToInvariantString() + "/FullSizeImages/";
string[] files = Directory.GetFiles(HostingEnvironment.MapPath(basePath));
foreach (string file in files)
{
GalleryImage img = new GalleryImage();
img.ModuleGuid = module.ModuleGuid;
img.ModuleId = module.ModuleId;
img.ImageFile = Path.GetFileName(file);
img.ThumbnailFile = img.ImageFile;
img.WebImageFile = img.ImageFile;
img.Save();
}
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:41,代码来源:ImageGalleryContentInstaller.cs
示例13: PopulateControls
private void PopulateControls()
{
//Title = SiteUtils.FormatPageTitle(siteSettings, calendarEvent.Title);
//if (!UserCanEditModule(moduleId, CalendarEvent.FeatureGuid))
//{
// this.lnkNewEvent.Visible = false;
//}
if (moduleId > -1)
{
Module module = new Module(moduleId);
//this.litDate.Text = module.ModuleTitle + " " + this.theDate.ToShortDateString();
heading.Text = module.ModuleTitle + " " + this.theDate.ToShortDateString();
Title = SiteUtils.FormatPageTitle(siteSettings, heading.Text);
if (UserCanEditModule(moduleId, CalendarEvent.FeatureGuid))
{
heading.LiteralExtraMarkup = "<a href='" + SiteRoot + "/EventCalendar/EditEvent.aspx?"
+ "mid=" + moduleId.ToInvariantString()
+ "&date=" + Server.UrlEncode(this.theDate.ToString("s"))
+ "&pageid=" + CurrentPage.PageId.ToInvariantString() + "' class='ModuleEditLink'>" + EventCalResources.EventCalendarAddEventLabel + "</a>";
}
//lnkNewEvent.HRef = SiteRoot + "/EventCalendar/EditEvent.aspx?"
// + "mid=" + moduleId.ToInvariantString()
// + "&date=" + Server.UrlEncode(this.theDate.ToString("s"))
// + "&pageid=" + CurrentPage.PageId.ToInvariantString();
//lnkNewEvent.InnerHtml = Resources.EventCalResources.EventCalendarAddEventLabel;
DataSet ds = CalendarEvent.GetEvents(this.moduleId, theDate, theDate);
// DataView dv = ds.Tables[0].DefaultView;
// dv.Sort = "StartTime ASC ";
this.rptEvents.DataSource = ds;
this.rptEvents.DataBind();
}
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:41,代码来源:DayView.aspx.cs
示例14: InstallContent
public void InstallContent(Module module, string configInfo)
{
HtmlContent htmlContent = new HtmlContent();
htmlContent.ModuleId = module.ModuleId;
if (configInfo.StartsWith("~/"))
{
if (File.Exists(HostingEnvironment.MapPath(configInfo)))
{
htmlContent.Body = File.ReadAllText(HostingEnvironment.MapPath(configInfo), Encoding.UTF8);
}
}
else
{
htmlContent.Body = ResourceHelper.GetMessageTemplate(CultureInfo.CurrentUICulture, configInfo);
}
htmlContent.ModuleGuid = module.ModuleGuid;
SiteSettings siteSettings = new SiteSettings(module.SiteId);
SiteUser adminUser = null;
if (siteSettings.UseEmailForLogin)
{
adminUser = new SiteUser(siteSettings, "[email protected]");
if (adminUser.UserId == -1) { adminUser = null; }
}
else
{
adminUser = new SiteUser(siteSettings, "admin");
if (adminUser.UserId == -1) { adminUser = null; }
}
if (adminUser != null)
{
htmlContent.UserGuid = adminUser.UserGuid;
htmlContent.LastModUserGuid = adminUser.UserGuid;
}
HtmlRepository repository = new HtmlRepository();
repository.Save(htmlContent);
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:40,代码来源:HtmlContentInstaller.cs
示例15: LoadParams
private void LoadParams()
{
pageId = WebUtils.ParseInt32FromQueryString("pageid", pageId);
moduleId = WebUtils.ParseInt32FromQueryString("mid", moduleId);
categoryId = WebUtils.ParseInt32FromQueryString("cat", categoryId);
blogModule = GetModule(moduleId, Blog.FeatureGuid);
// an experiment with ASP.NET routing
//if (Page.RouteData.Values["category"] != null)
//{
// categoryId = Convert.ToInt32(Page.RouteData.Values["category"]);
//}
//if (Page.RouteData.Values["pageid"] != null)
//{
// pageId = Convert.ToInt32(Page.RouteData.Values["pageid"]);
//}
//if (Page.RouteData.Values["moduleid"] != null)
//{
// moduleId = Convert.ToInt32(Page.RouteData.Values["moduleid"]);
//}
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:24,代码来源:ViewCategory.aspx.cs
示例16: Initialize
private void Initialize()
{
if (HttpContext.Current == null) { return; }
siteModule = GetParentAsSiteModelControl(this);
bool useTextLinksForFeatureSettings = true;
mojoBasePage basePage = Page as mojoBasePage;
if (basePage != null)
{
useTextLinksForFeatureSettings = basePage.UseTextLinksForFeatureSettings;
}
if (siteModule != null)
{
module = siteModule.ModuleConfiguration;
CanEdit = siteModule.IsEditable;
enableWorkflow = siteModule.EnableWorkflow;
forbidModuleSettings = siteModule.ForbidModuleSettings;
}
if (module != null)
{
headingTag = module.HeadElement;
if (module.ShowTitle)
{
litModuleTitle.Text = Page.Server.HtmlEncode(module.ModuleTitle);
}
else
{
useHeading = false;
}
if (CanEdit)
{
if (!disabledModuleSettingsLink)
{
lnkModuleSettings.Visible = true;
lnkModuleSettings.Text = Resource.SettingsLink;
lnkModuleSettings.ToolTip = Resource.ModuleEditSettings;
if (!useTextLinksForFeatureSettings)
{
lnkModuleSettings.ImageUrl = Page.ResolveUrl("~/Data/SiteImages/" + WebConfigSettings.EditPropertiesImage);
}
else
{
// if its a text link make it small like the edit link
lnkModuleSettings.CssClass = "ModuleEditLink";
}
siteRoot = SiteUtils.GetNavigationSiteRoot();
lnkModuleSettings.NavigateUrl = siteRoot
+ "/Admin/ModuleSettings.aspx?mid=" + module.ModuleId.ToInvariantString()
+ "&pageid=" + module.PageId.ToInvariantString();
if ((enableWorkflow) && (siteModule != null) && (siteModule is IWorkflow))
{
SetupWorkflowControls();
}
}
}
if (
((CanEdit) || (ShowEditLinkOverride))
&& ((EditText != null) && (editUrl.Length > 0)))
{
lnkModuleEdit.Text = EditText;
if (this.ToolTip.Length > 0)
{
lnkModuleEdit.ToolTip = this.ToolTip;
}
else
{
lnkModuleEdit.ToolTip = EditText;
}
lnkModuleEdit.NavigateUrl = EditUrl
+ (EditUrl.Contains("?") ? "&" : "?")
+ "mid=" + module.ModuleId.ToInvariantString()
+ "&pageid=" + module.PageId.ToInvariantString();
if (!useTextLinksForFeatureSettings)
{
lnkModuleEdit.ImageUrl = Page.ResolveUrl("~/Data/SiteImages/" + WebConfigSettings.EditContentImage);
}
}
}
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:97,代码来源:ModuleTitleControl.cs
示例17: btnFreeCheckout_Click
void btnFreeCheckout_Click(object sender, EventArgs e)
{
if (cart.OrderTotal > 0)
{
WebUtils.SetupRedirect(this, Request.RawUrl);
return;
}
cart.LastUserActivity = DateTime.UtcNow;
cart.OrderInfo.CompletedFromIP = SiteUtils.GetIP4Address();
cart.OrderInfo.Completed = DateTime.UtcNow;
StoreHelper.EnsureUserForOrder(cart);
cart.Save();
Order order = Order.CreateOrder(
store,
cart,
string.Empty,
string.Empty,
string.Empty,
siteSettings.GetCurrency().Code,
"NoCharge",
OrderStatus.OrderStatusFulfillableGuid);
StoreHelper.ClearCartCookie(cart.StoreGuid);
// send confirmation email
try
{
StoreHelper.ConfirmOrder(store, order);
Module m = new Module(store.ModuleId);
Order.EnsureSalesReportData(m.ModuleGuid, pageId, moduleId);
}
catch (Exception ex)
{
log.Error("error sending confirmation email", ex);
}
// redirect to order details
string redirectUrl = SiteRoot +
"/WebStore/OrderDetail.aspx?pageid="
+ pageId.ToInvariantString()
+ "&mid=" + moduleId.ToInvariantString()
+ "&orderid=" + order.OrderGuid.ToString();
WebUtils.SetupRedirect(this, redirectUrl);
}
开发者ID:joedavis01,项目名称:mojoportal,代码行数:47,代码来源:Checkout.aspx.cs
示例18: LoadSettings
private void LoadSettings()
{
module = new Module(moduleId);
workInProgress = ContentWorkflow.GetWorkInProgress(module.ModuleGuid);
AddClassToBody("administration");
AddClassToBody("wfadmin");
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:8,代码来源:RejectContent.aspx.cs
示例19: CreatePage
public static void CreatePage(SiteSettings siteSettings, ContentPage contentPage, PageSettings parentPage)
{
PageSettings pageSettings = new PageSettings();
pageSettings.PageGuid = Guid.NewGuid();
if (parentPage != null)
{
pageSettings.ParentGuid = parentPage.PageGuid;
pageSettings.ParentId = parentPage.PageId;
}
pageSettings.SiteId = siteSettings.SiteId;
pageSettings.SiteGuid = siteSettings.SiteGuid;
pageSettings.AuthorizedRoles = contentPage.VisibleToRoles;
pageSettings.EditRoles = contentPage.EditRoles;
pageSettings.DraftEditOnlyRoles = contentPage.DraftEditRoles;
pageSettings.CreateChildPageRoles = contentPage.CreateChildPageRoles;
pageSettings.MenuImage = contentPage.MenuImage;
pageSettings.PageMetaKeyWords = contentPage.PageMetaKeyWords;
pageSettings.PageMetaDescription = contentPage.PageMetaDescription;
CultureInfo uiCulture = Thread.CurrentThread.CurrentUICulture;
if (WebConfigSettings.UseCultureOverride)
{
uiCulture = SiteUtils.GetDefaultUICulture(siteSettings.SiteId);
}
if (contentPage.ResourceFile.Length > 0)
{
pageSettings.PageName = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Name, uiCulture, false);
if (contentPage.Title.Length > 0)
{
pageSettings.PageTitle = ResourceHelper.GetResourceString(contentPage.ResourceFile, contentPage.Title, uiCulture, false);
}
}
else
{
pageSettings.PageName = contentPage.Name;
pageSettings.PageTitle = contentPage.Title;
}
pageSettings.PageOrder = contentPage.PageOrder;
pageSettings.Url = contentPage.Url;
pageSettings.RequireSsl = contentPage.RequireSsl;
pageSettings.ShowBreadcrumbs = contentPage.ShowBreadcrumbs;
pageSettings.BodyCssClass = contentPage.BodyCssClass;
pageSettings.MenuCssClass = contentPage.MenuCssClass;
pageSettings.IncludeInMenu = contentPage.IncludeInMenu;
pageSettings.IsClickable = contentPage.IsClickable;
pageSettings.IncludeInSiteMap = contentPage.IncludeInSiteMap;
pageSettings.IncludeInChildSiteMap = contentPage.IncludeInChildPagesSiteMap;
pageSettings.AllowBrowserCache = contentPage.AllowBrowserCaching;
pageSettings.ShowChildPageBreadcrumbs = contentPage.ShowChildPageBreadcrumbs;
pageSettings.ShowHomeCrumb = contentPage.ShowHomeCrumb;
pageSettings.ShowChildPageMenu = contentPage.ShowChildPagesSiteMap;
pageSettings.HideAfterLogin = contentPage.HideFromAuthenticated;
pageSettings.EnableComments = contentPage.EnableComments;
pageSettings.Save();
if (!FriendlyUrl.Exists(siteSettings.SiteId, pageSettings.Url))
{
if (!WebPageInfo.IsPhysicalWebPage(pageSettings.Url))
{
FriendlyUrl friendlyUrl = new FriendlyUrl();
friendlyUrl.SiteId = siteSettings.SiteId;
friendlyUrl.SiteGuid = siteSettings.SiteGuid;
friendlyUrl.PageGuid = pageSettings.PageGuid;
friendlyUrl.Url = pageSettings.Url.Replace("~/", string.Empty);
friendlyUrl.RealUrl = "~/Default.aspx?pageid=" + pageSettings.PageId.ToInvariantString();
friendlyUrl.Save();
}
}
foreach (ContentPageItem pageItem in contentPage.PageItems)
{
// tni-20130624: moduleGuidxxxx handling
Guid moduleGuid2Use = Guid.Empty;
bool updateModule = false;
Module findModule = null;
if (pageItem.ModuleGuidToPublish != Guid.Empty)
{
Module existingModule = new Module(pageItem.ModuleGuidToPublish);
if (existingModule.ModuleGuid == pageItem.ModuleGuidToPublish && existingModule.SiteId == siteSettings.SiteId)
{
Module.Publish(pageSettings.PageGuid, existingModule.ModuleGuid, existingModule.ModuleId, pageSettings.PageId,
pageItem.Location, pageItem.SortOrder, DateTime.UtcNow, DateTime.MinValue);
// tni: I assume there's nothing else to do now so let's go to the next content...
continue;
}
}
else if (pageItem.ModuleGuid != Guid.Empty)
{
findModule = new Module(pageItem.ModuleGuid);
if (findModule.ModuleGuid == Guid.Empty)
//.........这里部分代码省略.........
开发者ID:joedavis01,项目名称:mojoportal,代码行数:101,代码来源:mojoSetup.cs
示例20: DeleteBtn_Click
private void DeleteBtn_Click(Object sender, ImageClickEventArgs e)
{
if (sender == null) return;
string pane = ((ImageButton)sender).CommandArgument;
ListBox listbox = (ListBox) this.MPContent.FindControl(pane);
if (listbox.SelectedIndex != -1)
{
int mid = Int32.Parse(listbox.SelectedItem.Value);
Module m = new Module(mid);
if (WebConfigSettings.LogIpAddressForContentDeletions)
{
string userName = string.Empty;
SiteUser currentUser = SiteUtils.GetCurrentSiteUser();
if (currentUser != null)
{
userName = currentUser.Name;
}
log.Info("user " + userName + " removed module " + m.ModuleTitle + " from page " + CurrentPage.PageName + " from ip address " + SiteUtils.GetIP4Address());
}
Module.DeleteModuleInstance(mid, pageID);
mojoPortal.SearchIndex.IndexHelper.RebuildPageIndexAsync(new PageSettings(siteSettings.SiteId, pageID));
}
globalContentCount = Module.GetGlobalCount(siteSettings.SiteId, -1, pageID);
//lnkContentLookup.Visible = ((globalContentCount > 0) && !WebConfigSettings.DisableGlobalContent);
lnkGlobalContent.Visible = ((globalContentCount > 0) && !WebConfigSettings.DisableGlobalContent);
CurrentPage.RefreshModules();
BindPanes();
upLayout.Update();
}
开发者ID:saiesh86,项目名称:TravelBlog,代码行数:39,代码来源:PageLayout.aspx.cs
注:本文中的mojoPortal.Business.Module类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论