本文整理汇总了C#中mojoPortal.Business.SiteSettings类的典型用法代码示例。如果您正苦于以下问题:C# SiteSettings类的具体用法?C# SiteSettings怎么用?C# SiteSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SiteSettings类属于mojoPortal.Business命名空间,在下文中一共展示了SiteSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCountOfState
public static int GetCountOfState(
SiteSettings siteSettings,
PersonalizationScope scope,
PersonalizationStateQuery query)
{
int result = 0;
if (siteSettings != null)
{
Guid userGuid = Guid.Empty;
if ((query.UsernameToMatch != null) && (query.UsernameToMatch.Length > 0))
{
SiteUser siteUser = new SiteUser(siteSettings, query.UsernameToMatch);
if (siteUser.UserId > 0)
{
userGuid = siteUser.UserGuid;
}
}
bool allUsersScope = (scope == PersonalizationScope.Shared);
result = SitePersonalization.GetCountOfState(
siteSettings.SiteId,
query.PathToMatch,
allUsersScope,
userGuid,
query.UserInactiveSinceDate);
}
return result;
}
示例2: BindList
private void BindList()
{
if (siteSettings == null) { siteSettings = CacheHelper.GetCurrentSiteSettings(); }
//why is this null here, its declared
if (chkAllowedRoles == null)
{
chkAllowedRoles = new CheckBoxList();
if (this.Controls.Count == 0) { this.Controls.Add(chkAllowedRoles); }
}
chkAllowedRoles.Items.Clear();
ListItem allItem = new ListItem();
allItem.Text = Resource.RolesAllUsersRole;
allItem.Value = "All Users";
chkAllowedRoles.Items.Add(allItem);
using (IDataReader reader = Role.GetSiteRoles(siteSettings.SiteId))
{
while (reader.Read())
{
ListItem listItem = new ListItem();
listItem.Text = reader["DisplayName"].ToString();
listItem.Value = reader["RoleName"].ToString();
if ((selectedRoles.LastIndexOf(listItem.Value + ";") > -1))
{
listItem.Selected = true;
}
chkAllowedRoles.Items.Add(listItem);
}
}
}
示例3: LoadSettings
private void LoadSettings()
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (WebUser.IsAdminOrContentAdmin || WebUser.IsInRoles(siteSettings.RolesThatCanDeleteFilesInEditor) || SiteUtils.UserIsSiteEditor())
{
canAccess = true;
}
}
示例4: GetFileSystem
public override IFileSystem GetFileSystem(IFileSystemPermission permission)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
//IFileSystemPermission p = GetFileSystemPermission();
if (permission == null) { return null; }
if (string.IsNullOrEmpty(permission.VirtualRoot)) { return null; }
return DiskFileSystem.GetFileSystem(permission);
}
示例5: ProcessRequest
public void ProcessRequest(HttpContext context)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null)
{
return;
}
RenderJsonList(context);
}
示例6: DeleteSiteContent
public override void DeleteSiteContent(int siteId)
{
SiteSettings siteSettings = new SiteSettings(siteId);
CommerceReport.DeleteBySite(siteSettings.SiteGuid);
FileAttachment.DeleteBySite(siteSettings.SiteGuid);
EmailSendLog.DeleteBySite(siteSettings.SiteGuid);
EmailTemplate.DeleteBySite(siteSettings.SiteGuid);
ContentHistory.DeleteBySite(siteSettings.SiteGuid);
ContentWorkflow.DeleteBySite(siteSettings.SiteGuid);
ContentMetaRespository metaRepository = new ContentMetaRespository();
metaRepository.DeleteBySite(siteSettings.SiteGuid);
}
示例7: ProcessRequest
public void ProcessRequest(HttpContext context)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null)
{
//TODO: should we return some xml with an error message?
return;
}
imagebaseUrl = WebUtils.GetSiteRoot() + "/Data/Sites/" + siteSettings.SiteId.ToString(CultureInfo.InvariantCulture) +"/htmltemplateimages/";
RenderXml(context);
}
示例8: LoadSettings
private void LoadSettings(HttpContext context)
{
rpxToken = context.Request.Params.Get("token");
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null) { return; }
//if (siteSettings.SiteRoot.Length > 0)
//{
// siteRoot = siteSettings.SiteRoot;
//}
//else
//{
siteRoot = SiteUtils.GetNavigationSiteRoot();
//}
}
示例9: LoadPersonalizationBlobs
public static void LoadPersonalizationBlobs(
SiteSettings siteSettings,
WebPartManager webPartManager,
string path,
string userName,
ref byte[] sharedDataBlob,
ref byte[] userDataBlob)
{
if (siteSettings != null)
{
if ((userName != null) && (userName.Length > 0))
{
SiteUser siteUser = new SiteUser(siteSettings, userName);
Guid userID = Guid.Empty;
if (siteUser.UserId > 0)
{
userID = siteUser.UserGuid;
}
if (userID != Guid.Empty)
{
userDataBlob = SitePersonalization.GetPersonalizationBlob(
siteSettings.SiteId,
path,
userID);
siteUser.UpdateLastActivityTime();
sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
siteSettings.SiteId,
path);
}
}
else
{
//TODO: tracking/personalization for unauthenticated users?
sharedDataBlob = SitePersonalization.GetPersonalizationBlobAllUsers(
siteSettings.SiteId,
path);
}
}
}
示例10: LoadSettings
private void LoadSettings(HttpContext context)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null) { return; }
pageId = WebUtils.ParseInt32FromQueryString("pageid", true, pageId);
moduleId = WebUtils.ParseInt32FromQueryString("mid", true, moduleId);
if (moduleId == -1) { return; }
if (pageId == -1) { return; }
galleryPage = new PageSettings(siteSettings.SiteId, pageId);
if (galleryPage.PageId == -1) { return; }
galleryModule = new Module(moduleId, pageId);
if (galleryModule.ModuleId == -1) { return; }
if ((!WebUser.IsInRoles(galleryPage.AuthorizedRoles)) && (!WebUser.IsInRoles(galleryModule.ViewRoles))) { return; }
siteRoot = WebUtils.GetSiteRoot();
//thumbnailBaseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString()
// + "/GalleryImages/" + moduleId.ToInvariantString() + "/Thumbnails/";
//fullSizeBaseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString()
// + "/GalleryImages/" + moduleId.ToInvariantString() + "/WebImages/";
string baseUrl;
if (WebConfigSettings.ImageGalleryUseMediaFolder)
{
baseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/media/GalleryImages/" + moduleId.ToInvariantString() + "/";
}
else
{
baseUrl = siteRoot + "/Data/Sites/" + siteSettings.SiteId.ToInvariantString() + "/GalleryImages/" + moduleId.ToInvariantString() + "/";
}
thumbnailBaseUrl = baseUrl + "Thumbnails/";
fullSizeBaseUrl = baseUrl + "WebImages/";
gallery = new Gallery(moduleId);
canRender = true;
}
示例11: LoadAndValidateForumObjects
private bool LoadAndValidateForumObjects()
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if(siteSettings == null)
{
//log.Info("SiteSettings was null");
return false;
}
currentPage = CacheHelper.GetPage(pageId);
if (
(currentPage.PageId != pageId)
|| (currentPage.SiteId != siteSettings.SiteId)
)
{
log.Info("request rejected - pageid did not match");
return false;
}
thread = new ForumThread(threadId, postId);
if (thread.ModuleId != moduleId)
{
log.Info("thread module id did not match");
return false;
}
forum = new Forum(thread.ForumId);
module = GetModule(thread.ModuleId);
if (module == null)
{
log.Info("module not found in page modules");
return false;
}
config = new ForumConfiguration(ModuleSettings.GetModuleSettings(module.ModuleId));
if(thread.PostUserId > -1)
{
postUser = new SiteUser(siteSettings, thread.PostUserId);
}
return UserCanModerate();
}
示例12: Page_Load
// TODO: add link for site mail when authenticated
// set to use top 30 here, link to OnlineMembers.aspx
// for page able list of online members
//
protected void Page_Load(object sender, EventArgs e)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null) { this.Visible = false; return; }
siteRoot = SiteUtils.GetNavigationSiteRoot();
switch (siteSettings.AvatarSystem)
{
case "gravatar":
allowGravatars = true;
disableAvatars = false;
break;
case "internal":
allowGravatars = false;
disableAvatars = false;
break;
case "none":
default:
allowGravatars = false;
disableAvatars = true;
break;
}
toolTipPrefix = Resource.OnlineMemberListProfileLinkPrefix;
isAdmin = WebUser.IsAdmin;
//if (Context.Request.IsAuthenticated)
//{
// isAuthenticated = true;
//}
siteMailEnabled = WebConfigSettings.UseSiteMailFeature;
PopulateControls();
}
示例13: 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);
}
示例14: Render
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
if (HttpContext.Current == null) { return; }
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null) { return; }
if (siteSettings.Slogan.Length == 0) { return; }
if (topMarkup.Length > 0)
{
writer.Write(topMarkup);
}
writer.Write(HttpUtility.HtmlAttributeEncode(siteSettings.Slogan));
//base.Render(writer);
if (bottomMarkup.Length > 0)
{
writer.Write(bottomMarkup);
}
}
示例15: ProcessRequest
public void ProcessRequest(HttpContext context)
{
siteSettings = CacheHelper.GetCurrentSiteSettings();
if (siteSettings == null)
{
return;
}
templateGuid = WebUtils.ParseGuidFromQueryString("g", templateGuid);
if (templateGuid != Guid.Empty) { templateGuidString = templateGuid.ToString(); }
if (templateGuid != Guid.Empty)
{
RenderTemplate(context);
}
else
{
RenderJsonList(context);
}
}