WidgetTemplate implements JsonSerializable
Interface WidgetTemplate
A widget must create an WidgetTemplate object and returns it in the IDashboardWidget::getWidgetTemplate method.
Tags
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- $content : string
- $css : array
- $function : string
- $icon : string
- $js : array
- $settings : \OCP\Dashboard\Model\WidgetSetting[]
- addCss() : WidgetTemplate
- Add a CSS file to be included when displaying a widget.
- addJs() : WidgetTemplate
- Add a JS file to be included when loading a widget.
- addSetting() : WidgetTemplate
- Add a WidgetSetting.
- getContent() : string
- Get the HTML file that contains the content of the widget.
- getCss() : array
- Get CSS files to be included when displaying a widget
- getIcon() : string
- Get the icon class of the widget.
- getInitFunction() : string
- Get the JS function to be called when loading the widget.
- getJs() : array
- Get JS files to be included when loading a widget
- getSetting() : WidgetSetting
- Get a WidgetSetting by its name
- getSettings() : \OCP\Dashboard\Model\WidgetSetting[]
- Get all WidgetSetting defined for the widget.
- jsonSerialize() : array
- setContent() : WidgetTemplate
- Set the HTML file that contains the content of the widget.
- setCss() : WidgetTemplate
- path and name of CSS files
- setIcon() : WidgetTemplate
- Set the icon class of the widget.
- setInitFunction() : WidgetTemplate
- JavaScript function to be called when loading the widget on the dashboard
- setJs() : WidgetTemplate
- Set an array of JS files to be included when loading a widget.
- setSettings() : WidgetTemplate
- Define all WidgetSetting for the widget.
Properties
$content
private
string
$content
= ''
$css
private
array
$css
= []
$function
private
string
$function
= ''
$icon
private
string
$icon
= ''
$js
private
array
$js
= []
$settings
private
\OCP\Dashboard\Model\WidgetSetting[]
$settings
= []
Methods
addCss()
Add a CSS file to be included when displaying a widget.
public
addCss(string $css) : WidgetTemplate
Parameters
- $css : string
Tags
Return values
WidgetTemplate —addJs()
Add a JS file to be included when loading a widget.
public
addJs(string $js) : WidgetTemplate
Parameters
- $js : string
Tags
Return values
WidgetTemplate —addSetting()
Add a WidgetSetting.
public
addSetting(WidgetSetting $setting) : WidgetTemplate
Parameters
- $setting : WidgetSetting
Tags
Return values
WidgetTemplate —getContent()
Get the HTML file that contains the content of the widget.
public
getContent() : string
Tags
Return values
string —getCss()
Get CSS files to be included when displaying a widget
public
getCss() : array
Tags
Return values
array —getIcon()
Get the icon class of the widget.
public
getIcon() : string
Tags
Return values
string —getInitFunction()
Get the JS function to be called when loading the widget.
public
getInitFunction() : string
Tags
Return values
string —getJs()
Get JS files to be included when loading a widget
public
getJs() : array
Tags
Return values
array —getSetting()
Get a WidgetSetting by its name
public
getSetting(string $key) : WidgetSetting
Parameters
- $key : string
Tags
Return values
WidgetSetting —getSettings()
Get all WidgetSetting defined for the widget.
public
getSettings() : \OCP\Dashboard\Model\WidgetSetting[]
Tags
Return values
\OCP\Dashboard\Model\WidgetSetting[] —jsonSerialize()
public
jsonSerialize() : array
Tags
Return values
array —setContent()
Set the HTML file that contains the content of the widget.
public
setContent(string $content) : WidgetTemplate
Parameters
- $content : string
Tags
Return values
WidgetTemplate —setCss()
path and name of CSS files
public
setCss(array $css) : WidgetTemplate
Parameters
- $css : array
Tags
Return values
WidgetTemplate —setIcon()
Set the icon class of the widget.
public
setIcon(string $icon) : WidgetTemplate
This class must be defined in one of the CSS file used by the widget.
Parameters
- $icon : string
Tags
Return values
WidgetTemplate —setInitFunction()
JavaScript function to be called when loading the widget on the dashboard
public
setInitFunction(string $function) : WidgetTemplate
Parameters
- $function : string
Tags
Return values
WidgetTemplate —setJs()
Set an array of JS files to be included when loading a widget.
public
setJs(array $js) : WidgetTemplate
Parameters
- $js : array
Tags
Return values
WidgetTemplate —setSettings()
Define all WidgetSetting for the widget.
public
setSettings(\OCP\Dashboard\Model\WidgetSetting[] $settings) : WidgetTemplate
Parameters
- $settings : \OCP\Dashboard\Model\WidgetSetting[]