C# Class OurUmbraco.Our.Utils

显示文件 Open project: umbraco/OurUmbraco

Public Methods

Method Description
CleanInvalidXmlChars ( string text ) : string
GetAllTags ( string group ) : string
GetGravatar ( string email, int size, string memberName, bool getRawUrl = false ) : string
GetLocalAvatar ( string imgPath, int minSize, string memberName, bool getRawUrl = false ) : string
GetMember ( int id ) : umbraco.cms.businesslogic.member.Member
GetMemberAvatar ( IPublishedContent member, int avatarSize, bool getRawUrl = false ) : string
GetMemberAvatarImage ( IPublishedContent member ) : Image
GetProjectCompatibleVersions ( ) : IEnumerable>.Dictionary

Returns a dictionary of project id => any version that has been flagged as being compatible

GetProjectCompatibleVersions ( int projectId ) : IEnumerable
GetProjectContributors ( int projectId ) : List
GetProjectFileDownloadCount ( int fileId ) : int
GetProjectMemberVotes ( int projectId ) : int
GetProjectTotalDownload ( ) : int>.Dictionary

Returns a dictionary of project id => total downloads

GetProjectTotalDownloadCount ( int projectId ) : int
GetProjectTotalVotes ( ) : int>.Dictionary

Returns a dictionary of project id => total karma

GetProjectTotalVotes ( int projectId ) : int
GetProjectsMemberHasDownloaded ( int memberId ) : IEnumerable
GetProjectsMemberHasVotedUp ( int memberId ) : IEnumerable
GetReleaseDownloadCount ( int projectId ) : int
GetScreenshotPath ( string screenshot ) : string
HasMemberDownloadedPackage ( int memberId, int projectId ) : bool
IsAdmin ( int id ) : bool
IsHq ( int id ) : bool
IsProjectContributor ( int memberId, int projectId ) : bool
Sanitize ( string html ) : string

sanitize any potentially dangerous tags from the provided raw HTML input using a whitelist based approach, leaving the "safe" HTML tags

StripHTML ( string inputString ) : string

Private Methods

Method Description
MemberAvatarPath ( IPublishedContent member ) : string

Method Details

CleanInvalidXmlChars() public static method

public static CleanInvalidXmlChars ( string text ) : string
text string
return string

GetAllTags() public static method

public static GetAllTags ( string group ) : string
group string
return string

GetGravatar() public static method

public static GetGravatar ( string email, int size, string memberName, bool getRawUrl = false ) : string
email string
size int
memberName string
getRawUrl bool
return string

GetLocalAvatar() public static method

public static GetLocalAvatar ( string imgPath, int minSize, string memberName, bool getRawUrl = false ) : string
imgPath string
minSize int
memberName string
getRawUrl bool
return string

GetMember() public static method

public static GetMember ( int id ) : umbraco.cms.businesslogic.member.Member
id int
return umbraco.cms.businesslogic.member.Member

GetMemberAvatar() public static method

public static GetMemberAvatar ( IPublishedContent member, int avatarSize, bool getRawUrl = false ) : string
member IPublishedContent
avatarSize int
getRawUrl bool
return string

GetMemberAvatarImage() public static method

public static GetMemberAvatarImage ( IPublishedContent member ) : Image
member IPublishedContent
return Image

GetProjectCompatibleVersions() public static method

Returns a dictionary of project id => any version that has been flagged as being compatible
public static GetProjectCompatibleVersions ( ) : IEnumerable>.Dictionary
return IEnumerable>.Dictionary

GetProjectCompatibleVersions() public static method

public static GetProjectCompatibleVersions ( int projectId ) : IEnumerable
projectId int
return IEnumerable

GetProjectContributors() public static method

public static GetProjectContributors ( int projectId ) : List
projectId int
return List

GetProjectFileDownloadCount() public static method

public static GetProjectFileDownloadCount ( int fileId ) : int
fileId int
return int

GetProjectMemberVotes() public static method

public static GetProjectMemberVotes ( int projectId ) : int
projectId int
return int

GetProjectTotalDownload() public static method

Returns a dictionary of project id => total downloads
public static GetProjectTotalDownload ( ) : int>.Dictionary
return int>.Dictionary

GetProjectTotalDownloadCount() public static method

public static GetProjectTotalDownloadCount ( int projectId ) : int
projectId int
return int

GetProjectTotalVotes() public static method

Returns a dictionary of project id => total karma
public static GetProjectTotalVotes ( ) : int>.Dictionary
return int>.Dictionary

GetProjectTotalVotes() public static method

public static GetProjectTotalVotes ( int projectId ) : int
projectId int
return int

GetProjectsMemberHasDownloaded() public static method

public static GetProjectsMemberHasDownloaded ( int memberId ) : IEnumerable
memberId int
return IEnumerable

GetProjectsMemberHasVotedUp() public static method

public static GetProjectsMemberHasVotedUp ( int memberId ) : IEnumerable
memberId int
return IEnumerable

GetReleaseDownloadCount() public static method

public static GetReleaseDownloadCount ( int projectId ) : int
projectId int
return int

GetScreenshotPath() public static method

public static GetScreenshotPath ( string screenshot ) : string
screenshot string
return string

HasMemberDownloadedPackage() public static method

public static HasMemberDownloadedPackage ( int memberId, int projectId ) : bool
memberId int
projectId int
return bool

IsAdmin() public static method

public static IsAdmin ( int id ) : bool
id int
return bool

IsHq() public static method

public static IsHq ( int id ) : bool
id int
return bool

IsProjectContributor() public static method

public static IsProjectContributor ( int memberId, int projectId ) : bool
memberId int
projectId int
return bool

Sanitize() public static method

sanitize any potentially dangerous tags from the provided raw HTML input using a whitelist based approach, leaving the "safe" HTML tags
public static Sanitize ( string html ) : string
html string
return string

StripHTML() public static method

public static StripHTML ( string inputString ) : string
inputString string
return string