C# Класс Piranha.Web.UIHelper

The UI helper provides methods for genering url's and html for the web applications.
Показать файл Открыть проект

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