C# 클래스 Piranha.Web.UIHelper

The UI helper provides methods for genering url's and html for the web applications.
파일 보기 프로젝트 열기: PiranhaCMS/Piranha

Private Properties

프로퍼티 타입 설명
ChildActive bool
CreateLinkTag string
CreateMetaTag string
GenerateUrl string
GetStartLevel List
RenderBreadcrumb void
RenderLI void
RenderUL void
Url string

공개 메소드들

메소드 설명
APIKey ( System.Guid apiKey ) : IHtmlString

Gets an encrypted API-key valid for 30 minutes.

APIKey ( string apiKey = "" ) : IHtmlString

Gets an ecrypted API-key valid for 30 minutes. If no API-key is provided the key for the currently logged in user is used.

AbsoluteUrl ( string url ) : IHtmlString

Generates an absolute url from the virtual path or site url.

Breadcrumb ( int StartLevel = 1, string RootNode = "" ) : IHtmlString

Renders the current breadcrumb.

Content ( System.Guid id, int width, int height ) : IHtmlString

Gets the URL to the content with the given id.

Content ( string id, int width, int height ) : IHtmlString

Gets the URL to the content with the given id.

Head ( ) : IHtmlString

Generates the tags appropriate for the html head.

Menu ( int StartLevel = 1, int StopLevel = Int32.MaxValue, int Levels, string RootNode = "", string CssClass = "menu", bool RenderParent = false ) : IHtmlString

Return the site structure as an ul/li list with the current page selected.

Permalink ( System.Guid permalinkid, string prefix = "" ) : IHtmlString

Generates the url to the given permalink.

Permalink ( string permalink = "", string prefix = "" ) : IHtmlString

Generates the url to the given permalink.

SetCurrent ( Page page ) : void

Sets the current page to the given value. This can be useful when using the UI helper in passive mode and the routing never sets the current page.

SetCurrent ( Post post ) : void

Sets the current post to the given value. This can be useful when using the UI helper in passive mode and the routing never sets the current post.

SiteUrl ( string virtualpath ) : IHtmlString

Generates a full site url from the virtual path.

Thumbnail ( System.Guid id, int size ) : IHtmlString

Generates an image tag for the specified thumbnail.

Thumbnail ( string id, int size ) : IHtmlString

Generates an image tag for the specified thumbnail.

UIHelper ( ) : System

Default constructor. Creates a new UI helper.

Upload ( System.Guid id, int width, int height ) : IHtmlString

Gets the url to the uploaded content with the given id.

Upload ( string id, int width, int height ) : IHtmlString

Gets the url to the uploaded content with the given id.

비공개 메소드들

메소드 설명
ChildActive ( Sitemap page, System.Guid id ) : bool

Checks if the given sitemap is active or has an active child

CreateLinkTag ( string rel, string type, string href, string title = "" ) : string

Generates the appropriate html string for a link tag. Properly escapes attribute values.

CreateMetaTag ( string name, string content ) : string

Generates the appropriate html string for a meta tag. Properly escapes attribute values.

GenerateUrl ( ISitemap page ) : string

Generate the correct URL for the given sitemap node

GetStartLevel ( List sm, System.Guid id, int start, bool includedParent = false ) : List

Gets the current start level for the sitemap.

RenderBreadcrumb ( Page curr, List sm, StringBuilder str ) : void

Renders the breadcrumb from the given sitemap.

RenderLI ( Page curr, Sitemap page, StringBuilder str, int stoplevel ) : void

Renders an LI element for the given sitemap node.

RenderUL ( Page curr, List sm, StringBuilder str, int stoplevel, string cssclass = "" ) : void

Renders an UL list for the given sitemap elements

Url ( string virtualpath ) : string

메소드 상세

APIKey() 공개 메소드

Gets an encrypted API-key valid for 30 minutes.
public APIKey ( System.Guid apiKey ) : IHtmlString
apiKey System.Guid The API-key
리턴 IHtmlString

APIKey() 공개 메소드

Gets an ecrypted API-key valid for 30 minutes. If no API-key is provided the key for the currently logged in user is used.
public APIKey ( string apiKey = "" ) : IHtmlString
apiKey string
리턴 IHtmlString

AbsoluteUrl() 공개 메소드

Generates an absolute url from the virtual path or site url.
public AbsoluteUrl ( string url ) : IHtmlString
url string The url
리턴 IHtmlString

Breadcrumb() 공개 메소드

Renders the current breadcrumb.
public Breadcrumb ( int StartLevel = 1, string RootNode = "" ) : IHtmlString
StartLevel int Optional start level
RootNode string Optional root node
리턴 IHtmlString

Content() 공개 메소드

Gets the URL to the content with the given id.
public Content ( System.Guid id, int width, int height ) : IHtmlString
id System.Guid The content id
width int Optional width
height int Optional height
리턴 IHtmlString

Content() 공개 메소드

Gets the URL to the content with the given id.
public Content ( string id, int width, int height ) : IHtmlString
id string The content id
width int Optional width
height int Optional height
리턴 IHtmlString

Head() 공개 메소드

Generates the tags appropriate for the html head.
public Head ( ) : IHtmlString
리턴 IHtmlString

Menu() 공개 메소드

Return the site structure as an ul/li list with the current page selected.
public Menu ( int StartLevel = 1, int StopLevel = Int32.MaxValue, int Levels, string RootNode = "", string CssClass = "menu", bool RenderParent = false ) : IHtmlString
StartLevel int The start level of the menu
StopLevel int The stop level of the menu
Levels int The number of levels. Use this if you don't know the start level
RootNode string
CssClass string
RenderParent bool
리턴 IHtmlString

Permalink() 공개 메소드

Generates the url to the given permalink.
public Permalink ( System.Guid permalinkid, string prefix = "" ) : IHtmlString
permalinkid System.Guid The id of the permalink
prefix string Optional culture prefix
리턴 IHtmlString

Permalink() 공개 메소드

Generates the url to the given permalink.
public Permalink ( string permalink = "", string prefix = "" ) : IHtmlString
permalink string The permalink
prefix string Optional culture prefix
리턴 IHtmlString

SetCurrent() 공개 메소드

Sets the current page to the given value. This can be useful when using the UI helper in passive mode and the routing never sets the current page.
public SetCurrent ( Page page ) : void
page Page The page
리턴 void

SetCurrent() 공개 메소드

Sets the current post to the given value. This can be useful when using the UI helper in passive mode and the routing never sets the current post.
public SetCurrent ( Post post ) : void
post Post
리턴 void

SiteUrl() 공개 메소드

Generates a full site url from the virtual path.
public SiteUrl ( string virtualpath ) : IHtmlString
virtualpath string The virtual path.
리턴 IHtmlString

Thumbnail() 공개 메소드

Generates an image tag for the specified thumbnail.
public Thumbnail ( System.Guid id, int size ) : IHtmlString
id System.Guid The content, page or post id.
size int Optional size
리턴 IHtmlString

Thumbnail() 공개 메소드

Generates an image tag for the specified thumbnail.
public Thumbnail ( string id, int size ) : IHtmlString
id string The content id
size int Optional size
리턴 IHtmlString

UIHelper() 공개 메소드

Default constructor. Creates a new UI helper.
public UIHelper ( ) : System
리턴 System

Upload() 공개 메소드

Gets the url to the uploaded content with the given id.
public Upload ( System.Guid id, int width, int height ) : IHtmlString
id System.Guid The upload id
width int Optional width
height int Optional height
리턴 IHtmlString

Upload() 공개 메소드

Gets the url to the uploaded content with the given id.
public Upload ( string id, int width, int height ) : IHtmlString
id string The upload id
width int Optional width
height int Optional height
리턴 IHtmlString