C# Class Piranha.Web.UIHelper

The UI helper provides methods for genering url's and html for the web applications.
Afficher le fichier Open project: PiranhaCMS/Piranha

Private Properties

Свойство Type Description
ChildActive bool
CreateLinkTag string
CreateMetaTag string
GenerateUrl string
GetStartLevel List
RenderBreadcrumb void
RenderLI void
RenderUL void
Url string

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
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

Method Details

APIKey() public méthode

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

APIKey() public méthode

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
Résultat IHtmlString

AbsoluteUrl() public méthode

Generates an absolute url from the virtual path or site url.
public AbsoluteUrl ( string url ) : IHtmlString
url string The url
Résultat IHtmlString

Breadcrumb() public méthode

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

Content() public méthode

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
Résultat IHtmlString

Content() public méthode

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
Résultat IHtmlString

Head() public méthode

Generates the tags appropriate for the html head.
public Head ( ) : IHtmlString
Résultat IHtmlString

Menu() public méthode

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
Résultat IHtmlString

Permalink() public méthode

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
Résultat IHtmlString

Permalink() public méthode

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

SetCurrent() public méthode

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
Résultat void

SetCurrent() public méthode

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
Résultat void

SiteUrl() public méthode

Generates a full site url from the virtual path.
public SiteUrl ( string virtualpath ) : IHtmlString
virtualpath string The virtual path.
Résultat IHtmlString

Thumbnail() public méthode

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
Résultat IHtmlString

Thumbnail() public méthode

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

UIHelper() public méthode

Default constructor. Creates a new UI helper.
public UIHelper ( ) : System
Résultat System

Upload() public méthode

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
Résultat IHtmlString

Upload() public méthode

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
Résultat IHtmlString