class vB5_Frontend_Controller_Ajax extends vB5_Frontend_Controller

Properties

protected $vboptions vboptions * from vB5_Frontend_Controller

Methods

__construct()

No description

sendAsJson($data)

No description

showMsgPage(string $title, string $msg) deprecated

Show a simple and clear message page which contains no widget

toSeoFriendly(string $str)

Replaces special characters in a given string with dashes to make the string SEO friendly Note: This is really restrictive. If it can be helped, leave it to core's vB_String::getUrlIdent.

boolean
handleErrorsForAjax(mixed $result, mixed $return)

Handle errors that are returned by API for use in JSON AJAX responses.

verifyPostRequest()

Checks if this is a POST request

outputPage($html, $exit = true)

Any final processing, and then output the page

parseBbCodeForPreview($rawText, $options = array())

No description

addAttachments(mixed $data)

Adds attachment information so attachments can be created in one call

string
encodeFlashMessage(string $phrase)

Generates a signed message to pass to the following page, so that the message can be displayed briefly to the user (flashed).

index(string $route)

Handles all calls to /ajax/* and routes them to the correct method in this controller, then sends the result as JSON.

actionCall($controller, $method)

Ajax calls to /ajax/call/[controller]/[method] allow calling a presentation controller

actionAdminTemplate(string $type)

Renders a widget or screen layout admin template in the presentation layer and returns it as JSON Ajax calls should go to /ajax/admin-template/widget or /ajax/admin-template/screen-layout

actionFetchWidgetTemplate()

Returns the widget admin template

actionFetchWidgetAdminTemplateList()

Returns an array of widget objects which include some of the widget information available via the widget-fetchWidgets API call and the rendered admin template to display the widget on the page canvas when editing a page template. The widget admin template is rendered here (client side)

actionReplaceSecurityToken()

Replace securitytoken

actionActivateSitebuilder()

Returns the sitebuilder template markup required for using sitebuilder

array
actionGetLayoutsForSitebuilder()

Get layouts and modules for the sitebuilder layout UI.

addRenderedWidgetAdminTemplates(array $widgets, array $css_links)

Renders the admin template for each widget and adds it to the passed widget array.

actionPostComment()

Posts a comment to a conversation reply.

actionFetchComments()

Fetches comments of a conversation reply.

actionFetchHiddenModules()

No description

actionFetchNodePreview()

Fetch node's preview

Details

__construct()

sendAsJson($data)

Parameters

$data

showMsgPage(string $title, string $msg) deprecated

deprecated

Show a simple and clear message page which contains no widget

Parameters

string $title Page title. HTML will be escaped.
string $msg Message to display. HTML is allowed and the caller must make sure it's valid.

protected toSeoFriendly(string $str)

Replaces special characters in a given string with dashes to make the string SEO friendly Note: This is really restrictive. If it can be helped, leave it to core's vB_String::getUrlIdent.

Parameters

string $str The string to be converted

protected boolean handleErrorsForAjax(mixed $result, mixed $return)

Handle errors that are returned by API for use in JSON AJAX responses.

Parameters

mixed $result The result array to populate errors into. It will contain error phrase ids.
mixed $return The returned object by the API call.

Return Value

boolean true errors are found, false, otherwise.

protected verifyPostRequest()

Checks if this is a POST request

protected outputPage($html, $exit = true)

Any final processing, and then output the page

Parameters

$html
$exit

protected parseBbCodeForPreview($rawText, $options = array())

Parameters

$rawText
$options

protected addAttachments(mixed $data)

Adds attachment information so attachments can be created in one call

This will modify the $data array to add data under the keys 'attachments' for added attachments & 'removeattachments' for attachments requested for removal.

Parameters

mixed $data array of node data for insert

protected sendAsJsonAndCloseConnection($data)

Parameters

$data

protected string encodeFlashMessage(string $phrase)

Generates a signed message to pass to the following page, so that the message can be displayed briefly to the user (flashed).

Parameters

string $phrase The phrase key for the message to display

Return Value

string The signed value that should be passed as a query parameter using the format flashmsg=

at line 40
index(string $route)

Handles all calls to /ajax/* and routes them to the correct method in this controller, then sends the result as JSON.

Parameters

string $route Route

at line 94
actionCall($controller, $method)

Ajax calls to /ajax/call/[controller]/[method] allow calling a presentation controller

Parameters

$controller
$method

at line 159
actionAdminTemplate(string $type)

Renders a widget or screen layout admin template in the presentation layer and returns it as JSON Ajax calls should go to /ajax/admin-template/widget or /ajax/admin-template/screen-layout

Parameters

string $type The type of template requested (widget or screen-layout)

at line 294
actionFetchWidgetTemplate()

Returns the widget admin template

Ajax calls should go to /ajax/fetch-widget-template

at line 331
actionFetchWidgetAdminTemplateList()

Returns an array of widget objects which include some of the widget information available via the widget-fetchWidgets API call and the rendered admin template to display the widget on the page canvas when editing a page template. The widget admin template is rendered here (client side)

Ajax calls should go to /ajax/fetch-widget-admin-template-list

at line 365
actionReplaceSecurityToken()

Replace securitytoken

at line 380
actionActivateSitebuilder()

Returns the sitebuilder template markup required for using sitebuilder

at line 474
array actionGetLayoutsForSitebuilder()

Get layouts and modules for the sitebuilder layout UI.

Return Value

array Array of layout and widget info & templates: 'screenlayoutlist' - rendered screenlayouts to insert in DOM 'widgets' - array of widgets with rendered widget admin template 'css_links' - any css links needed to display rendered templates

at line 513
protected addRenderedWidgetAdminTemplates(array $widgets, array $css_links)

Renders the admin template for each widget and adds it to the passed widget array.

Handles recursive 'subModules' as well.

Parameters

array $widgets Reference to an array of widgets (this array is modified)
array $css_links Reference to an array of css links (this array is modified)

at line 535
actionPostComment()

Posts a comment to a conversation reply.

at line 690
actionFetchComments()

Fetches comments of a conversation reply.

at line 800
actionFetchHiddenModules()

at line 844
actionFetchNodePreview()

Fetch node's preview