Nextcloud PHP API (stable18)

IWidgetConfig

Interface IWidgetConfig

This object contains the configuration of a widget for a userId

Tags
see
IDashboardWidget::loadWidget
since
15.0.0

Table of Contents

getPosition()  : array
Returns the current position and the current size of the widget as displayed on the user's dashboard
getSettings()  : array
Returns an array with the settings defined by the user for the widget.
getUserId()  : string
Returns the userId
getWidgetId()  : string
Returns the widgetId
isEnabled()  : bool
Returns if the widget is enabled/displayed in this user's dashboard.

Methods

getPosition()

Returns the current position and the current size of the widget as displayed on the user's dashboard

public getPosition() : array

The returned value is an array: [ 'x' => (int) position on the X axis, 'y' => (int) position on the Y axis, 'width' => (int) width of the widget, 'height' => (int) height of the widget ]

Tags
since
15.0.0
Return values
array

getSettings()

Returns an array with the settings defined by the user for the widget.

public getSettings() : array

The returned value is an array, with setting used as keys:

[ 'setting1' => 'any value', 'setting2' => 'other value' ]

Each setting that can be edited by a user should be defined in a WidgetSetting.

Tags
see
WidgetSetting

Those WidgetSetting are in the WidgetTemplate defined during the setup of the widget in the IDashboardWidget.

see
IDashboardWidget::getWidgetTemplate
see
WidgetTemplate

When using this framework, the settings interface is generated by the Dashboard app.

since
15.0.0
Return values
array

getUserId()

Returns the userId

public getUserId() : string
Tags
since
15.0.0
Return values
string

getWidgetId()

Returns the widgetId

public getWidgetId() : string
Tags
since
15.0.0
Return values
string

isEnabled()

Returns if the widget is enabled/displayed in this user's dashboard.

public isEnabled() : bool
Tags
since
15.0.0
Return values
bool

Search results