WidgetSetup¶
-
class
OCP\Dashboard\Model\WidgetSetup¶ - Interface WidgetSetupA widget must create an WidgetSetup object and returns it in theIDashboardWidget::getWidgetSetup method.
Source: lib/public/Dashboard/Model/WidgetSetup.php#45 Implements: JsonSerializable
Constants¶
-
SIZE_TYPE_MIN = min Source: lib/public/Dashboard/Model/WidgetSetup.php#46
-
SIZE_TYPE_MAX = max Source: lib/public/Dashboard/Model/WidgetSetup.php#47
-
SIZE_TYPE_DEFAULT = default Source: lib/public/Dashboard/Model/WidgetSetup.php#48
Properties¶
Methods¶
-
public
OCP\Dashboard\Model\WidgetSetup::getSize($type)¶ - Get the defined size for a specific type (min, max, default)Returns an array:[‘width’ => width,‘height’ => height]
Source: Parameters: - $type (string)
Since: 15.0.0
Deprecated: 20.0.0
Returns: array
-
public
OCP\Dashboard\Model\WidgetSetup::getSizes()¶ - Returns all sizes defined for the widget.
Source: lib/public/Dashboard/Model/WidgetSetup.php#99 Since: 15.0.0 Deprecated: 20.0.0 Returns: array
-
public
OCP\Dashboard\Model\WidgetSetup::addSize($type, $width, $height)¶ - Add a new size to the setup.
Source: Parameters: - $type (string)
- $width (int)
- $height (int)
Since: 15.0.0
Deprecated: 20.0.0
Returns:
-
public
OCP\Dashboard\Model\WidgetSetup::getMenuEntries()¶ - Returns menu entries.
Source: lib/public/Dashboard/Model/WidgetSetup.php#132 Since: 15.0.0 Deprecated: 20.0.0 Returns: array
-
public
OCP\Dashboard\Model\WidgetSetup::addMenuEntry($function, $icon, $text)¶ - Add a menu entry to the widget.$function is the Javascript function to be called when clicking themenu entry.$icon is the css class of the icon.$text is the display name of the menu entry.
Source: Parameters: - $function (string)
- $icon (string)
- $text (string)
Since: 15.0.0
Deprecated: 20.0.0
Returns:
-
public
OCP\Dashboard\Model\WidgetSetup::addDelayedJob($function, $delay)¶ - Add a delayed job to the widget.$function is the Javascript function to be called.$delay is the time in seconds between each call.
Source: Parameters: - $function (string)
- $delay (int)
Since: 15.0.0
Deprecated: 20.0.0
Returns:
-
public
OCP\Dashboard\Model\WidgetSetup::getDelayedJobs()¶ - Get delayed jobs.
Source: lib/public/Dashboard/Model/WidgetSetup.php#194 Since: 15.0.0 Deprecated: 20.0.0 Returns: array
-
public
OCP\Dashboard\Model\WidgetSetup::getPush()¶ - Get the push function, called when an event is send to the front-end
Source: lib/public/Dashboard/Model/WidgetSetup.php#207 Since: 15.0.0 Deprecated: 20.0.0 Returns: string
-
public
OCP\Dashboard\Model\WidgetSetup::setPush($function)¶ - Set the Javascript function to be called when an event is pushed to thefrontend.
Source: Parameters: - $function (string)
Since: 15.0.0
Deprecated: 20.0.0
Returns:
-
public
OCP\Dashboard\Model\WidgetSetup::getDefaultSettings()¶ - Returns the default settings for a widget.
Source: lib/public/Dashboard/Model/WidgetSetup.php#237 Since: 15.0.0 Deprecated: 20.0.0 Returns: array
-
public
OCP\Dashboard\Model\WidgetSetup::setDefaultSettings($settings)¶ - Set the default settings for a widget.This method is used by the Dashboard app, using the settings createdusing WidgetSetting
Source: Parameters: - $settings (array)
See: Since: 15.0.0
Deprecated: 20.0.0
Returns:
-
public
OCP\Dashboard\Model\WidgetSetup::jsonSerialize()¶ Source: lib/public/Dashboard/Model/WidgetSetup.php#268 Since: 15.0.0 Deprecated: 20.0.0 Returns: array