WidgetTemplate

class OCP\Dashboard\Model\WidgetTemplate
Interface WidgetTemplate
A widget must create an WidgetTemplate object and returns it in the
IDashboardWidget::getWidgetTemplate method.
Source:lib/public/Dashboard/Model/WidgetTemplate.php#44
Implements:JsonSerializable

Properties

Methods

public OCP\Dashboard\Model\WidgetTemplate::getIcon()
Get the icon class of the widget.
Source:lib/public/Dashboard/Model/WidgetTemplate.php#74
Since:15.0.0
Deprecated:20.0.0
Returns:string
public OCP\Dashboard\Model\WidgetTemplate::setIcon($icon)
Set the icon class of the widget.
This class must be defined in one of the CSS file used by the widget.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#91

Parameters:
  • $icon (string)
See:

\OCP\Dashboard\Model\addCss

Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::getCss()
Get CSS files to be included when displaying a widget
Source:lib/public/Dashboard/Model/WidgetTemplate.php#105
Since:15.0.0
Deprecated:20.0.0
Returns:array
public OCP\Dashboard\Model\WidgetTemplate::setCss($css)
path and name of CSS files
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#119

Parameters:
  • $css (array)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::addCss($css)
Add a CSS file to be included when displaying a widget.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#135

Parameters:
  • $css (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::getJs()
Get JS files to be included when loading a widget
Source:lib/public/Dashboard/Model/WidgetTemplate.php#149
Since:15.0.0
Deprecated:20.0.0
Returns:array
public OCP\Dashboard\Model\WidgetTemplate::setJs($js)
Set an array of JS files to be included when loading a widget.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#163

Parameters:
  • $js (array)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::addJs($js)
Add a JS file to be included when loading a widget.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#179

Parameters:
  • $js (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::getContent()
Get the HTML file that contains the content of the widget.
Source:lib/public/Dashboard/Model/WidgetTemplate.php#193
Since:15.0.0
Deprecated:20.0.0
Returns:string
public OCP\Dashboard\Model\WidgetTemplate::setContent($content)
Set the HTML file that contains the content of the widget.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#207

Parameters:
  • $content (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::getInitFunction()
Get the JS function to be called when loading the widget.
Source:lib/public/Dashboard/Model/WidgetTemplate.php#221
Since:15.0.0
Deprecated:20.0.0
Returns:string
public OCP\Dashboard\Model\WidgetTemplate::setInitFunction($function)
JavaScript function to be called when loading the widget on the
dashboard
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#236

Parameters:
  • $function (string)
Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::getSettings()
Get all WidgetSetting defined for the widget.
Source:lib/public/Dashboard/Model/WidgetTemplate.php#252
See:\OCP\Dashboard\Model\WidgetSetting
Since:15.0.0
Deprecated:20.0.0
Returns:\OCP\Dashboard\Model\WidgetSetting[]
public OCP\Dashboard\Model\WidgetTemplate::setSettings($settings)
Define all WidgetSetting for the widget.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#268

Parameters:
Since:

15.0.0

Deprecated:

20.0.0

See:

\OCP\Dashboard\Model\WidgetSetting

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::addSetting($setting)
Add a WidgetSetting.
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#286

Parameters:
See:

\OCP\Dashboard\Model\WidgetSetting

Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetTemplate

public OCP\Dashboard\Model\WidgetTemplate::getSetting($key)
Get a WidgetSetting by its name
Source:

lib/public/Dashboard/Model/WidgetTemplate.php#304

Parameters:
  • $key (string)
See:

\OCP\Dashboard\Model\WidgetSetting::setName

Since:

15.0.0

Deprecated:

20.0.0

Returns:

\OCP\Dashboard\Model\WidgetSetting

public OCP\Dashboard\Model\WidgetTemplate::jsonSerialize()
Source:lib/public/Dashboard/Model/WidgetTemplate.php#319
Since:15.0.0
Deprecated:20.0.0
Returns:array