WidgetSetup implements JsonSerializable
Interface WidgetSetup
A widget must create an WidgetSetup object and returns it in the IDashboardWidget::getWidgetSetup method.
Tags
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- SIZE_TYPE_DEFAULT = 'default'
- SIZE_TYPE_MAX = 'max'
- SIZE_TYPE_MIN = 'min'
- $jobs : array
- $menus : array
- $push : string
- $settings : array
- $sizes : array
- addDelayedJob() : WidgetSetup
- Add a delayed job to the widget.
- addMenuEntry() : WidgetSetup
- Add a menu entry to the widget.
- addSize() : WidgetSetup
- Add a new size to the setup.
- getDefaultSettings() : array
- Returns the default settings for a widget.
- getDelayedJobs() : array
- Get delayed jobs.
- getMenuEntries() : array
- Returns menu entries.
- getPush() : string
- Get the push function, called when an event is send to the front-end
- getSize() : array
- Get the defined size for a specific type (min, max, default) Returns an array: [ 'width' => width, 'height' => height ]
- getSizes() : array
- Returns all sizes defined for the widget.
- jsonSerialize() : array
- setDefaultSettings() : WidgetSetup
- Set the default settings for a widget.
- setPush() : WidgetSetup
- Set the Javascript function to be called when an event is pushed to the frontend.
Constants
SIZE_TYPE_DEFAULT
public
mixed
SIZE_TYPE_DEFAULT
= 'default'
SIZE_TYPE_MAX
public
mixed
SIZE_TYPE_MAX
= 'max'
SIZE_TYPE_MIN
public
mixed
SIZE_TYPE_MIN
= 'min'
Properties
$jobs
private
array
$jobs
= []
$menus
private
array
$menus
= []
$push
private
string
$push
= ''
$settings
private
array
$settings
= []
$sizes
private
array
$sizes
= []
Methods
addDelayedJob()
Add a delayed job to the widget.
public
addDelayedJob(string $function, int $delay) : WidgetSetup
$function is the Javascript function to be called. $delay is the time in seconds between each call.
Parameters
- $function : string
- $delay : int
Tags
Return values
WidgetSetup —addMenuEntry()
Add a menu entry to the widget.
public
addMenuEntry(string $function, string $icon, string $text) : WidgetSetup
$function is the Javascript function to be called when clicking the menu entry. $icon is the css class of the icon. $text is the display name of the menu entry.
Parameters
- $function : string
- $icon : string
- $text : string
Tags
Return values
WidgetSetup —addSize()
Add a new size to the setup.
public
addSize(string $type, int $width, int $height) : WidgetSetup
Parameters
- $type : string
- $width : int
- $height : int
Tags
Return values
WidgetSetup —getDefaultSettings()
Returns the default settings for a widget.
public
getDefaultSettings() : array
Tags
Return values
array —getDelayedJobs()
Get delayed jobs.
public
getDelayedJobs() : array
Tags
Return values
array —getMenuEntries()
Returns menu entries.
public
getMenuEntries() : array
Tags
Return values
array —getPush()
Get the push function, called when an event is send to the front-end
public
getPush() : string
Tags
Return values
string —getSize()
Get the defined size for a specific type (min, max, default) Returns an array: [ 'width' => width, 'height' => height ]
public
getSize(string $type) : array
Parameters
- $type : string
Tags
Return values
array —getSizes()
Returns all sizes defined for the widget.
public
getSizes() : array
Tags
Return values
array —jsonSerialize()
public
jsonSerialize() : array
Tags
Return values
array —setDefaultSettings()
Set the default settings for a widget.
public
setDefaultSettings(array $settings) : WidgetSetup
This method is used by the Dashboard app, using the settings created using WidgetSetting
Parameters
- $settings : array
Tags
Return values
WidgetSetup —setPush()
Set the Javascript function to be called when an event is pushed to the frontend.
public
setPush(string $function) : WidgetSetup
Parameters
- $function : string