Nextcloud PHP API (stable19)

WidgetSetup implements JsonSerializable

Interface WidgetSetup

A widget must create an WidgetSetup object and returns it in the IDashboardWidget::getWidgetSetup method.

Tags
see
IDashboardWidget::getWidgetSetup
since
15.0.0

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'

Properties

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
since
15.0.0
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
since
15.0.0
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
since
15.0.0
Return values
WidgetSetup

getDefaultSettings()

Returns the default settings for a widget.

public getDefaultSettings() : array
Tags
since
15.0.0
Return values
array

getDelayedJobs()

Get delayed jobs.

public getDelayedJobs() : array
Tags
since
15.0.0
Return values
array

getMenuEntries()

Returns menu entries.

public getMenuEntries() : array
Tags
since
15.0.0
Return values
array

getPush()

Get the push function, called when an event is send to the front-end

public getPush() : string
Tags
since
15.0.0
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
since
15.0.0
Return values
array

getSizes()

Returns all sizes defined for the widget.

public getSizes() : array
Tags
since
15.0.0
Return values
array

jsonSerialize()

public jsonSerialize() : array
Tags
since
15.0.0
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
see
WidgetSetting
since
15.0.0
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
Tags
since
15.0.0
Return values
WidgetSetup

Search results