vB_Library_Widget
extends vB_Library
in package
vB_Library_Widget
Tags
Table of Contents
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- cleanFilterNodes() : mixed
- clearCache() : mixed
- deleteWidgetInstances() : false|int
- Deletes multiple widget instances
- fetchAdminConfig() : array<string|int, mixed>|false
- Returns the admin configuration for a specific widget instance.
- filterNodes() : array<string|int, mixed>
- Takes an array of integer nodeids, current page nodeid, and the "ChannelIncludeExclude" type module config value, and filters the nodeids.
- getContentInstance() : mixed
- getWidgetInstance() : array<string|int, mixed>
- Returns stored widget instance data for the given widget instance ID
- instance() : static
- Returns singleton instance of self.
- monitorWords() : mixed
- Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
Methods
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__sleep()
public
__sleep() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $serialized) : void
Parameters
- $serialized : array<string|int, mixed>
__wakeup()
public
__wakeup() : void
cleanFilterNodes()
public
cleanFilterNodes(mixed $filterNodes[, mixed $currentChannel = null ]) : mixed
Parameters
- $filterNodes : mixed
- $currentChannel : mixed = null
clearCache()
public
static clearCache() : mixed
deleteWidgetInstances()
Deletes multiple widget instances
public
deleteWidgetInstances(array<string|int, mixed> $widgetInstanceIds[, mixed $updateParents = false ]) : false|int
Parameters
- $widgetInstanceIds : array<string|int, mixed>
- $updateParents : mixed = false
Return values
false|int —False or 0 on failure, number of rows deleted on success
fetchAdminConfig()
Returns the admin configuration for a specific widget instance.
public
fetchAdminConfig(mixed $widgetinstanceid) : array<string|int, mixed>|false
Parameters
- $widgetinstanceid : mixed
Return values
array<string|int, mixed>|false —An associative array of the widget config items and their values False if there is no admin config for this widget
filterNodes()
Takes an array of integer nodeids, current page nodeid, and the "ChannelIncludeExclude" type module config value, and filters the nodeids.
public
filterNodes(array<string|int, mixed> $nodeids, array<string|int, mixed> $filterNodes[, int $currentNodeid = null ]) : array<string|int, mixed>
Warning 1: the keys of the nodeids array will NOT be preserved. Warning 2: This function does NOT check any view permissions on the nodeids.
Parameters
- $nodeids : array<string|int, mixed>
-
Array of nodeids that will be filtered. Keys will NOT be preserved.
- $filterNodes : array<string|int, mixed>
-
Value of "ChannelIncludeExclude" type config, typically sent in from templates e.g. via widgetConfig.module_filter_nodes . array('include'|'exclude' => array( 'all'|'current'|nodeid, nodeid2, ... ))
- $currentNodeid : int = null
-
Current page's nodeid, typically sent in from templates via page.nodeid .
Return values
array<string|int, mixed> —A subset of $nodeids that has been filtered using $filterNodes
getContentInstance()
public
static getContentInstance(mixed $contenttypeid) : mixed
Parameters
- $contenttypeid : mixed
getWidgetInstance()
Returns stored widget instance data for the given widget instance ID
public
getWidgetInstance(mixed $widgetinstanceid) : array<string|int, mixed>
Parameters
- $widgetinstanceid : mixed
Return values
array<string|int, mixed> —Array of widget instance data
instance()
Returns singleton instance of self.
public
static instance(mixed $class) : static
Parameters
- $class : mixed
Return values
static —- Reference to singleton instance of the requested library class
monitorWords()
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
public
monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ][, mixed $currentuserid = 0 ]) : mixed
Parameters
- $text : mixed
- $type : mixed
- $nodeid : mixed
- $userid : mixed = null
- $insertNotifications : mixed = true
- $currentuserid : mixed = 0