UI helpers
This service is available via Telligent.Evolution.Extensibility.Apis.Get<Telligent.Evolution.Extensibility.Api.Version1.IUI>()
and is defined in Telligent.Evolution.Platform.dll
Methods
string AgoDate(DateTime date, UiAgoDateOptions options = null);
Renders an automatically updating ago date
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
date | DateTime | Date | Required | ||
options | UiAgoDateOptions | Options | Optional |
Return Type
string
string Bookmark(string contentUrl, Guid oauthClientId, UiBookmarkOptions options = null);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentUrl | string | Content Url | Required | ||
oauthClientId | Guid | Oauth Client Id | Required | ||
options | UiBookmarkOptions | Bookmark options | Optional |
Return Type
string
string Bookmark(Guid contentId, Guid contentTypeId, UiBookmarkOptions options = null);
Renders the ability to add/remove a bookmark for this content.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content type Id | Required | ||
options | UiBookmarkOptions | Bookmark options | Optional |
Return Type
string
bool CanBeViewed(string url);
Determines whether a file can be viewed
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required |
Return Type
bool
bool CanFormatHtmlAsText(string html);
Identifies if HTML can be convered to text without data loss.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
html | string | HTML | Required |
Return Type
bool
string ConvertContent(Guid contentId, Guid contentTypeId, UiConvertContentOptions options = null);
Renders a link to initiate content conversion
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content Type Id | Required | ||
options | UiConvertContentOptions | Options | Optional |
Return Type
string
string FormatHtmlAsText(string html);
Formats HTML as text
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
html | string | HTML | Required |
Return Type
string
string FormatTextAsHtml(string text, UiFormatTextAsHtmlOptions options = null);
Formats text as HTML
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Formatted text | Required | ||
options | UiFormatTextAsHtmlOptions | Format options | Optional |
Return Type
string
string ForumVotes(string type, int id, UiForumVotesOptions options = null);
Renders a vote count for a thread or reply with a link to pop up a list of voters
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
type | string | Vote type: thread, reply, threadquality | Required | ||
id | int | Id | Required | ||
options | UiForumVotesOptions | Options | Optional |
Return Type
string
int GetCurrentPageIndex(UiCurrentPageIndexOptions options = null);
Returns the currently-requested paging index
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | UiCurrentPageIndexOptions | Value of PageIndexQueryStringKey | Optional |
Return Type
int
string GetFileTypeImageUrl(string url, UiGetFileTypeImageOptions options = null);
Gets a file type image URL for a URL or filename
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required | ||
options | UiGetFileTypeImageOptions | File type image options | Optional |
Return Type
string
int GetLastPageIndex(int pageSize, int totalItems);
Gets the last page index
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
pageSize | int | Page size | Required | ||
totalItems | int | Total items count | Required |
Return Type
int
string GetMediaType(string url, UiGetMediaTypeOptions options = null);
Gets media type of a file
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required | ||
options | UiGetMediaTypeOptions | Get media type options | Optional |
Return Type
string
string GetMimeType(string url);
Returns the Mime Type of a file
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required |
Return Type
string
string GetPagedContentPagedEvent(UiPagedContentPagedEventOptions options = null);
Name of client-side message published after a widget's content has been paged via ajax
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | UiPagedContentPagedEventOptions | Paged content paged event options | Optional |
Return Type
string
string GetPagedContentPagingEvent(UiPagedContentPagingEventOptions options = null);
Name of client-side message published upon the initiation of a widget's ajax paging
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | UiPagedContentPagingEventOptions | Paged content paging event options | Optional |
Return Type
string
string GetPagedContentWrapperElementId(UiPagedContentWrapperElementIdOptions options = null);
Container ID for a widget's Paged Content
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
options | UiPagedContentWrapperElementIdOptions | Paged content wrapper element Id options | Optional |
Return Type
string
string GetPageIndexQueryStringKey();
Unique widget-instance-specific key used to identify requested page indexes in the query string
Return Type
string
string GetPreviewHtml(string url, UiGetPreviewHtmlOptions options = null);
Renders preview HtML for a file
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required | ||
options | UiGetPreviewHtmlOptions | Preview Html options | Optional |
Return Type
string
string GetPreviewImageUrl(string url);
Returns a URL of an image that can be used as a preview of file represented by the provided URL
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required |
Return Type
string
string GetResizedImageHtml(string url, int maxWidth, int maxHeight, UiGetResizedImageHtmlOptions options = null);
Renders an image as HTML configured to be resized to the given maximum width and height. Unrecognized name/value pairs passed into the dictionary parameter are rendered on the ouput IMG tag.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required | ||
maxWidth | int | Max width | Required | ||
maxHeight | int | Max height | Required | ||
options | UiGetResizedImageHtmlOptions | Resized image options | Optional |
Return Type
string
string GetResizedImageUrl(string url, int maxWidth, int maxHeight, UiGetResizedImageUrlOptions options = null);
Returns the URL of the provided image resized to the given maximum width and height if the file can be physically resized. If not, the original URL is returned.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required | ||
maxWidth | int | Max width | Required | ||
maxHeight | int | Max height | Required | ||
options | UiGetResizedImageUrlOptions | Resized image options | Optional |
Return Type
string
string GetViewHtml(string url, UiGetViewHtmlOptions options = null);
Renders View HTML for a file
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
url | string | Target Url | Required | ||
options | UiGetViewHtmlOptions | View Html options | Optional |
Return Type
string
string Like(string contentUrl, Guid oauthClientId, UiLikeOptions options = null);
Renders a 'Like' count, toggle, and/or message for a given content item. Additional un-specified optional parameters are combined into a single query-string encoded data attribute on the resulting placeholder span.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentUrl | string | Content Url | Required | ||
oauthClientId | Guid | Oauth Client Id | Required | ||
options | UiLikeOptions | Like Options | Optional |
Return Type
string
string Like(Guid contentId, Guid contentTypeId, UiLikeOptions options = null);
Renders a 'Like' count, toggle, and/or message for a given content item. Additional un-specified optional parameters are combined into a single query-string encoded data attribute on the resulting placeholder span.
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content type Id | Required | ||
options | UiLikeOptions | Like options | Optional |
Return Type
string
string MakeCssClassName(string text);
Converts a pascal or camel-cased string to hyphen-cased
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
text | string | Converted text | Required |
Return Type
string
string Merge(string original, string modified);
Produces a diff text
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
original | string | Original text | Required | ||
modified | string | Modified text | Required |
Return Type
string
string Moderate(Guid contentId, Guid contentTypeId, UiModerateOptions options = null);
Render's a 'Moderation' control
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content type Id | Required | ||
options | UiModerateOptions | Moderate options | Optional |
Return Type
string
string Page(int currentPage, int pageSize, int totalItems, UiPagerOptions options = null);
Renders a 'Pager' control
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
currentPage | int | Current page | Required | ||
pageSize | int | Page size | Required | ||
totalItems | int | Total items count | Required | ||
options | UiPagerOptions | Pager options | Optional |
Return Type
string
string Poll(Guid pollId, UiPollOptions options = null);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
pollId | Guid | Poll Id | Required | ||
options | UiPollOptions | Poll options | Optional |
Return Type
string
string Rate(string contentUrl, Guid oauthClientId, UiRateOptions options = null);
Renders a 'Rating' control
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentUrl | string | Content Url | Required | ||
oauthClientId | Guid | Oauth Client Id | Required | ||
options | UiRateOptions | Rate options | Optional |
Return Type
string
string Rate(Guid contentId, Guid contentTypeId, UiRateOptions options = null);
Renders a 'Rating' control
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content type Id | Required | ||
options | UiRateOptions | Options | Optional |
Return Type
string
string Render(string html, UiRenderOptions options = null);
Processes generic HTML rendering events to allow plugins to adjust the content
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
html | string | Html | Required | ||
options | UiRenderOptions | Type of rendered target type | Optional |
Return Type
string
string ScheduledFile(string progressKey, UiScheduleFileOptions options = null);
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
progressKey | string | Progress Key | Required | ||
options | UiScheduleFileOptions | Options | Optional |
Return Type
string
string Tag(string contentUrl, Guid oauthClientId, UiTagOptions options = null);
Render's a 'Tag' control
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentUrl | string | Content Url | Required | ||
oauthClientId | Guid | Oauth Client Id | Required | ||
options | UiTagOptions | Tag options | Optional |
Return Type
string
string Tag(Guid contentId, Guid contentTypeId, UiTagOptions options = null);
Render's a 'Tag' control
Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
contentId | Guid | Content Id | Required | ||
contentTypeId | Guid | Content type Id | Required | ||
options | UiTagOptions | Options | Optional |
Return Type
string