IDashboardWidget
Interface IDashboardWidget
This interface is used to create a widget: the widget must implement this interface and be defined in appinfo/info.xml:
<dashboard> <widget>OCA\YourApp\YourWidget</widget> </dashboard>
Multiple widget can be defined in the same appinfo/info.xml.
Tags
Table of Contents
- getDescription() : string
- Should returns some text describing the widget.
- getId() : string
- Should returns the (unique) Id of the widget.
- getName() : string
- Should returns the [display] name of the widget.
- getWidgetSetup() : WidgetSetup
- Must create and return a WidgetSetup containing the general setup of the widget
- getWidgetTemplate() : WidgetTemplate
- Must generate and return a WidgetTemplate that define important stuff about the Widget: icon, content, css or javascript.
- loadWidget() : mixed
- This method is called when a widget is loaded on the dashboard.
- requestWidget() : mixed
- This method s executed when the widget call the net.requestWidget() from the Javascript API.
Methods
getDescription()
Should returns some text describing the widget.
public
getDescription() : string
This description is displayed in the listing of the available widgets.
Tags
Return values
string —getId()
Should returns the (unique) Id of the widget.
public
getId() : string
Tags
Return values
string —getName()
Should returns the [display] name of the widget.
public
getName() : string
Tags
Return values
string —getWidgetSetup()
Must create and return a WidgetSetup containing the general setup of the widget
public
getWidgetSetup() : WidgetSetup
Tags
Return values
WidgetSetup —getWidgetTemplate()
Must generate and return a WidgetTemplate that define important stuff about the Widget: icon, content, css or javascript.
public
getWidgetTemplate() : WidgetTemplate
Tags
Return values
WidgetTemplate —loadWidget()
This method is called when a widget is loaded on the dashboard.
public
loadWidget(IWidgetConfig $settings) : mixed
A widget is 'loaded on the dashboard' when one of these conditions occurs:
- the user is adding the widget on his dashboard,
- the user already added the widget on his dashboard and he is opening the dashboard app.
Parameters
- $settings : IWidgetConfig
Tags
Return values
mixed —requestWidget()
This method s executed when the widget call the net.requestWidget() from the Javascript API.
public
requestWidget(IWidgetRequest $request) : mixed
This is used by the frontend to communicate with the backend.
Parameters
- $request : IWidgetRequest