Bitrix API

Widget extends Base

Class Widget

Table of Contents

Constants

ERROR_REQUIRED_PARAMETER  = 'MAIN_CONTROLLER_22001'
ERROR_UNKNOWN_ACTION  = 'MAIN_CONTROLLER_22002'
EVENT_ON_AFTER_ACTION  = 'onAfterAction'
EVENT_ON_BEFORE_ACTION  = 'onBeforeAction'
EXCEPTION_UNKNOWN_ACTION  = 22002
SCOPE_AJAX  = 'ajax'
SCOPE_CLI  = 'cli'
SCOPE_REST  = 'rest'

Methods

__construct()  : mixed
Constructor Controller.
addWidgetFromConfigurationFormAction()  : array<string|int, mixed>
Create widget from form params action and save it;
buildFormAction()  : Component|bool
Build create or configuration form.
checkIsCompatibleWithSelectedViewAction()  : array<string|int, mixed>|bool
This action call when try to change to other view type of existing widget.
className()  : string
Returns the fully qualified name of this class.
configureActions()  : array<string|int, mixed>
constructPseudoWidgetAction()  : array<string|int, mixed>|bool
Construct widget for show preview.
convertKeysToCamelCase()  : array<string|int, mixed>|mixed|string
Converts keys of array to camel case notation.
finalizeResponse()  : void
Finalizes response.
forward()  : HttpResponse|mixed
generateActionMethodName()  : string
getActionUri()  : Uri
Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.
getAutoWiredParameters()  : array<string|int, Parameter>
getConfigurationOfActions()  : array<string|int, mixed>|null
getCurrentUser()  : CurrentUser
getDefaultAutoWiredParameters()  : array<string|int, Parameter>
getErrorByCode()  : Error
Getting once error with the necessary code.
getErrors()  : array<string|int, Error>
Getting array of errors.
getFullEventName()  : string
getModuleId()  : string
Returns module id.
getPrimaryAutoWiredParameter()  : Parameter|null
getRequest()  : HttpRequest
getScope()  : string
getSourceParametersList()  : array<string|int, mixed>
getUnsignedParameters()  : mixed
isLocatedUnderPsr4()  : bool
listNameActions()  : array<string|int, mixed>
Returns list of all
loadAction()  : array<string|int, mixed>|false
Load widget params for rendering.
loadByBoardIdAction()  : array<string|int, mixed>
Load widget by board Id.
redirectTo()  : Redirect
Redirect to URL.
removeAction()  : bool
Remove widget from board action.
removePatternAction()  : void
Remove pattern widget.
run()  : HttpResponse|mixed
saveConfigurationFormAction()  : array<string|int, mixed>|bool
Configuration form save handler.
setCurrentUser()  : void
setScope()  : Controller
setSourceParametersList()  : Controller
showConfigurationFormAction()  : Component|bool
Action return configuration form by widget gid, and board gid.
updateAction()  : string
Widget update action.

Constants

ERROR_REQUIRED_PARAMETER

public mixed ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'

ERROR_UNKNOWN_ACTION

public mixed ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'

EVENT_ON_AFTER_ACTION

public mixed EVENT_ON_AFTER_ACTION = 'onAfterAction'

EVENT_ON_BEFORE_ACTION

public mixed EVENT_ON_BEFORE_ACTION = 'onBeforeAction'

EXCEPTION_UNKNOWN_ACTION

public mixed EXCEPTION_UNKNOWN_ACTION = 22002

Methods

__construct()

Constructor Controller.

public __construct([Request|null $request = null ]) : mixed
Parameters
$request : Request|null = null

addWidgetFromConfigurationFormAction()

Create widget from form params action and save it;

public addWidgetFromConfigurationFormAction(array<string|int, mixed> $formParams) : array<string|int, mixed>
Parameters
$formParams : array<string|int, mixed>

Parameters from form.

Return values
array<string|int, mixed>

[widgetId => 'Gid of new created widget'].

buildFormAction()

Build create or configuration form.

public buildFormAction(array<string|int, mixed> $params) : Component|bool
Parameters
$params : array<string|int, mixed>

Parameters to create form.

Return values
Component|bool

checkIsCompatibleWithSelectedViewAction()

This action call when try to change to other view type of existing widget.

public checkIsCompatibleWithSelectedViewAction(array<string|int, mixed> $params) : array<string|int, mixed>|bool

If new view key do not compatible with core view type return false, else true.

Parameters
$params : array<string|int, mixed>

Parameters like [newViewKey => 'linearGraph', oldViewKey => 'column'].

Return values
array<string|int, mixed>|bool

className()

Returns the fully qualified name of this class.

public final static className() : string
Return values
string

configureActions()

public configureActions() : array<string|int, mixed>
Return values
array<string|int, mixed>

constructPseudoWidgetAction()

Construct widget for show preview.

public constructPseudoWidgetAction(array<string|int, mixed> $params) : array<string|int, mixed>|bool
Parameters
$params : array<string|int, mixed>

Form params will be apply in preview widget.

Return values
array<string|int, mixed>|bool

convertKeysToCamelCase()

Converts keys of array to camel case notation.

public convertKeysToCamelCase(mixed $data) : array<string|int, mixed>|mixed|string
Parameters
$data : mixed

Data.

Tags
see
Converter::OUTPUT_JSON_FORMAT
Return values
array<string|int, mixed>|mixed|string

finalizeResponse()

Finalizes response.

public finalizeResponse(Response $response) : void

The method will be invoked when HttpApplication will be ready to send response to client. It's a final place where Controller can interact with response.

Parameters
$response : Response

forward()

public forward(Controller|string $controller, string $actionName[, array<string|int, mixed>|null $parameters = null ]) : HttpResponse|mixed
Parameters
$controller : Controller|string
$actionName : string
$parameters : array<string|int, mixed>|null = null
Tags
throws
SystemException
Return values
HttpResponse|mixed

generateActionMethodName()

public final generateActionMethodName(mixed $action) : string
Parameters
$action : mixed
Return values
string

getActionUri()

Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.

public final getActionUri(string $actionName[, array<string|int, mixed> $params = [] ][, bool $absolute = false ]) : Uri
Parameters
$actionName : string

Action name. It's a relative action name without controller name.

$params : array<string|int, mixed> = []

Parameters for creating uri.

$absolute : bool = false
Return values
Uri

getConfigurationOfActions()

public final getConfigurationOfActions() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getDefaultAutoWiredParameters()

public final getDefaultAutoWiredParameters() : array<string|int, Parameter>
Return values
array<string|int, Parameter>

getErrorByCode()

Getting once error with the necessary code.

public final getErrorByCode(string $code) : Error
Parameters
$code : string

Code of error.

Return values
Error

getErrors()

Getting array of errors.

public final getErrors() : array<string|int, Error>
Return values
array<string|int, Error>

getFullEventName()

public final static getFullEventName(mixed $eventName) : string
Parameters
$eventName : mixed
Return values
string

getModuleId()

Returns module id.

public final getModuleId() : string

Tries to guess module id by file path and function @see getModuleId().

Return values
string

getRequest()

public final getRequest() : HttpRequest
Return values
HttpRequest

getScope()

public final getScope() : string
Return values
string

getSourceParametersList()

public final getSourceParametersList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getUnsignedParameters()

public final getUnsignedParameters() : mixed

isLocatedUnderPsr4()

public final isLocatedUnderPsr4() : bool
Return values
bool

listNameActions()

Returns list of all

public final listNameActions() : array<string|int, mixed>
Return values
array<string|int, mixed>

loadAction()

Load widget params for rendering.

public loadAction(string $widgetId) : array<string|int, mixed>|false
Parameters
$widgetId : string

Widget gId.

Return values
array<string|int, mixed>|false

loadByBoardIdAction()

Load widget by board Id.

public loadByBoardIdAction(string $boardId) : array<string|int, mixed>
Parameters
$boardId : string

Board id.

Return values
array<string|int, mixed>

removeAction()

Remove widget from board action.

public removeAction(array<string|int, mixed> $params) : bool
Parameters
$params : array<string|int, mixed>

Parameters like [boardId => 'some_board_id', widgetId => 'some_widget_gId'].

Return values
bool

removePatternAction()

Remove pattern widget.

public removePatternAction(string $widgetId) : void

Delete only current user pattern widget.

Parameters
$widgetId : string

Widget id.

run()

public final run(mixed $actionName, array<string|int, mixed> $sourceParametersList) : HttpResponse|mixed
Parameters
$actionName : mixed
$sourceParametersList : array<string|int, mixed>
Tags
throws
SystemException
Return values
HttpResponse|mixed

saveConfigurationFormAction()

Configuration form save handler.

public saveConfigurationFormAction(array<string|int, mixed> $formParams) : array<string|int, mixed>|bool
Parameters
$formParams : array<string|int, mixed>

Parameters form form to save widget configurations.

Return values
array<string|int, mixed>|bool

setSourceParametersList()

public final setSourceParametersList(array<string|int, mixed> $sourceParametersList) : Controller
Parameters
$sourceParametersList : array<string|int, mixed>
Return values
Controller

showConfigurationFormAction()

Action return configuration form by widget gid, and board gid.

public showConfigurationFormAction(string $widgetId, string $boardId) : Component|bool
Parameters
$widgetId : string

Widget gId.

$boardId : string

Board key.

Return values
Component|bool

updateAction()

Widget update action.

public updateAction(string $boardKey, string $widgetId, array<string|int, mixed> $params) : string

Call whan save configuration form.

Parameters
$boardKey : string

Board key.

$widgetId : string

Widget gId.

$params : array<string|int, mixed>

Form parameters to apply in update of widget.

Return values
string

Saved widget gId.


        
On this page

Search results