vB_Api_Widget
extends vB_Api
in package
vB_Api_Widget
Tags
Table of Contents
Constants
- CLEAR_CACHE_EVENT = 'widget_clear_cache'
- WIDGETCATEGORY_ABSTRACT = 'Abstract'
- WIDGETCATEGORY_SYSTEM = 'System'
Methods
- __serialize() : array<string|int, mixed>
- __sleep() : array<string|int, mixed>
- __unserialize() : void
- __wakeup() : void
- callNamed() : The
- Call the given api function by name with a named arguments list.
- checkApiState() : mixed
- This method checks whether the API method is enabled.
- clearCache() : mixed
- Clears all previously loaded API objects.
- clearCaches() : mixed
- deleteWidgetInstance() : false|int
- Deletes a widget instance
- deleteWidgetInstances() : false|int
- Deletes multiple widget instances
- doSkipModule() : mixed
- fetchChannelWidgetAdminConfig() : mixed
- Returns the structure which was previously stored in the adminconfig field of widgetinstancetable
- fetchConfig() : array<string|int, mixed>
- Returns the final configuration for a specific widget instance.
- fetchConfigAndIsUserEditable() : mixed
- fetchConfigSchema() : array<string|int, mixed>
- Returns the widget configuration schema for the given widget instance.
- fetchDefaultConfig() : array<string|int, mixed>
- Returns the default configuration for a specific widget instance.
- fetchDefaultConfigWithoutInstance() : mixed
- fetchHierarchicalWidgetInstancesByPageTemplateId() : array<string|int, mixed>
- Returns all widget instances that are associated with the given page template id in a hierarchical array indexed by section number.
- fetchLayoutSectionInfo() : array<string|int, mixed>
- Returns an array of info, including the widget instances, to loop over and display all the layout sections.
- fetchPageManagerForums() : mixed
- fetchPageManagerGroups() : mixed
- fetchSearchConfig() : array<string|int, mixed>
- Returns the final configuration for the search widget instance.
- fetchTabbedSubWidgetConfigs() : mixed
- fetchWidget() : array<string|int, mixed>|false
- Returns the basic widget data for a widget
- fetchWidgetGuidToWidgetidMap() : mixed
- fetchWidgetInstances() : array<string|int, mixed>
- Returns multiple widget instances
- fetchWidgetInstancesByPageTemplateId() : array<string|int, mixed>
- Returns all module instances that are associated with the given page template id. These are the module instances that should shown on that page template. This also includes global module instances (pagetemplateid = -1).
- fetchWidgetInstanceTemplates() : mixed
- fetchWidgets() : array<string|int, mixed>
- Returns the basic widget data for multiple widgets
- getApiClassName() : mixed
- instance() : vB_Api
- Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
- instanceInternal() : vB_Api
- Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
- isSystemWidget() : mixed
- map_vb4_input_to_vb5() : string
- Returns vb5 api method name.
- map_vb5_errors_to_vb4() : mixed
- Alters the error array in any way necessary to interface correctly with vb4.
- map_vb5_output_to_vb4() : mixed
- Alters the output array in any way necessary to interface correctly with vb4.
- renameWidget() : mixed
- Rename custom widget
- saveAdminConfig() : bool
- Saves an admin widget configuration for the given widget instance
- saveChannelConfig() : bool
- Saves a channel widget configuration for the given widget instance
- saveDefaultConfig() : array<string|int, mixed>
- Saves the 'default' config for a widget; updates the widgetdefinitions default field currently only used for customized_copy widgets
- saveForums() : array<string|int, mixed>
- Saves the configuration for the Channel Widget, including creating/saving channels as necessary.
- saveNewWidgetInstance() : bool
- Saves a new widget instance
- saveSearchWidgetConfig() : string
- Saves the configuration for the Search Widget,
- saveWidgetinstanceContainerinstanceid() : array<string|int, mixed>
- Updates information about the module instance, including the containerinstanceid, pagetemplateid, displaysection, and displayorder.
Constants
CLEAR_CACHE_EVENT
public
mixed
CLEAR_CACHE_EVENT
= 'widget_clear_cache'
WIDGETCATEGORY_ABSTRACT
public
mixed
WIDGETCATEGORY_ABSTRACT
= 'Abstract'
WIDGETCATEGORY_SYSTEM
public
mixed
WIDGETCATEGORY_SYSTEM
= 'System'
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
callNamed()
Call the given api function by name with a named arguments list.
public
callNamed() : The
Used primarily to translate REST requests into API calls.
Return values
The —return of the method or an error if the method doesn't exist, or is static, a constructor or destructor, or otherwise shouldn't be callable as and API method. It is also an error if the value of a paramater is not provided and that parameter doesn't have a default value.
checkApiState()
This method checks whether the API method is enabled.
public
checkApiState(mixed $method) : mixed
For extensions check make sure $controller property is already set.
Parameters
- $method : mixed
clearCache()
Clears all previously loaded API objects.
public
static clearCache() : mixed
Intended for use in tests where the loading pattern can cause issues with objects that cache thier own data.
clearCaches()
public
clearCaches() : mixed
deleteWidgetInstance()
Deletes a widget instance
public
deleteWidgetInstance(mixed $widgetInstanceId) : false|int
Parameters
- $widgetInstanceId : mixed
Return values
false|int —False or 0 on failure, 1 on success
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
doSkipModule()
public
doSkipModule(mixed $widgetinstanceid[, mixed $widgetInstanceConfig = [] ][, mixed $usergroups = [] ]) : mixed
Parameters
- $widgetinstanceid : mixed
- $widgetInstanceConfig : mixed = []
- $usergroups : mixed = []
fetchChannelWidgetAdminConfig()
Returns the structure which was previously stored in the adminconfig field of widgetinstancetable
public
fetchChannelWidgetAdminConfig(mixed $channelIds) : mixed
Parameters
- $channelIds : mixed
fetchConfig()
Returns the final configuration for a specific widget instance.
public
fetchConfig(mixed $widgetinstanceid[, mixed $userid = 0 ][, mixed $channelId = 0 ]) : array<string|int, mixed>
Parameters
- $widgetinstanceid : mixed
- $userid : mixed = 0
- $channelId : mixed = 0
Return values
array<string|int, mixed> —An associative array of the widget config items and their values
fetchConfigAndIsUserEditable()
public
fetchConfigAndIsUserEditable([mixed $widgetinstanceid = 0 ][, mixed $widgetid = 0 ][, mixed $guid = '' ][, mixed $userid = 0 ][, mixed $channelId = 0 ][, mixed $withTemplate = false ]) : mixed
Parameters
- $widgetinstanceid : mixed = 0
- $widgetid : mixed = 0
- $guid : mixed = ''
- $userid : mixed = 0
- $channelId : mixed = 0
- $withTemplate : mixed = false
fetchConfigSchema()
Returns the widget configuration schema for the given widget instance.
public
fetchConfigSchema(mixed $widgetid[, mixed $widgetinstanceid = 0 ][, mixed $pagetemplateid = 0 ][, mixed $configtype = 'admin' ][, mixed $userid = 0 ]) : array<string|int, mixed>
If no widget instance ID is given, one is created. If no page template ID is given, one is created (to be able to create the widget instance). If the widget instance ID is given, the returned config fields will contain the current values of the configured widget instance for the config type specified.
Parameters
- $widgetid : mixed
- $widgetinstanceid : mixed = 0
- $pagetemplateid : mixed = 0
- $configtype : mixed = 'admin'
- $userid : mixed = 0
Return values
array<string|int, mixed> —An array containing widgetid, widgetinstanceid, pagetemplateid, and an array of config fields to generate the edit configuration form
fetchDefaultConfig()
Returns the default configuration for a specific widget instance.
public
fetchDefaultConfig(mixed $widgetinstanceid) : array<string|int, mixed>
Parameters
- $widgetinstanceid : mixed
Return values
array<string|int, mixed> —An associative array of the widget config items and their values
fetchDefaultConfigWithoutInstance()
public
fetchDefaultConfigWithoutInstance(mixed $widgetid[, mixed $guid = '' ][, mixed $withTemplate = true ]) : mixed
Parameters
- $widgetid : mixed
- $guid : mixed = ''
- $withTemplate : mixed = true
fetchHierarchicalWidgetInstancesByPageTemplateId()
Returns all widget instances that are associated with the given page template id in a hierarchical array indexed by section number.
public
fetchHierarchicalWidgetInstancesByPageTemplateId(mixed $pagetemplateid[, mixed $channelId = 0 ][, mixed $admincheck = false ]) : array<string|int, mixed>
These are the widget instances that should shown on that page template.
Parameters
- $pagetemplateid : mixed
- $channelId : mixed = 0
- $admincheck : mixed = false
Return values
array<string|int, mixed> —The array of sections with widget instance data, empty on failure
fetchLayoutSectionInfo()
Returns an array of info, including the widget instances, to loop over and display all the layout sections.
public
fetchLayoutSectionInfo(mixed $pagetemplateid[, mixed $channelId = 0 ]) : array<string|int, mixed>
Parameters
- $pagetemplateid : mixed
- $channelId : mixed = 0
Return values
array<string|int, mixed> —The array of sections with widget instance data, empty on failure
fetchPageManagerForums()
public
fetchPageManagerForums() : mixed
fetchPageManagerGroups()
public
fetchPageManagerGroups([mixed $channel = 'groups' ][, mixed $page = 1 ]) : mixed
Parameters
- $channel : mixed = 'groups'
- $page : mixed = 1
fetchSearchConfig()
Returns the final configuration for the search widget instance.
public
fetchSearchConfig(mixed $widgetinstanceid[, mixed $userid = 0 ][, mixed $widgetid = 0 ]) : array<string|int, mixed>
Parameters
- $widgetinstanceid : mixed
- $userid : mixed = 0
- $widgetid : mixed = 0
Return values
array<string|int, mixed> —An associative array of the widget config items and their values
fetchTabbedSubWidgetConfigs()
public
fetchTabbedSubWidgetConfigs(mixed $containerinstanceid) : mixed
Parameters
- $containerinstanceid : mixed
fetchWidget()
Returns the basic widget data for a widget
public
fetchWidget(mixed $widgetid) : array<string|int, mixed>|false
Parameters
- $widgetid : mixed
Return values
array<string|int, mixed>|false —The array of widget data, or false on failure
fetchWidgetGuidToWidgetidMap()
public
fetchWidgetGuidToWidgetidMap() : mixed
fetchWidgetInstances()
Returns multiple widget instances
public
fetchWidgetInstances(array<string|int, mixed> $widgetInstanceIds) : array<string|int, mixed>
Parameters
- $widgetInstanceIds : array<string|int, mixed>
Return values
array<string|int, mixed> —The array of widget instance data, indexed by widgetinstanceid, empty on failure
fetchWidgetInstancesByPageTemplateId()
Returns all module instances that are associated with the given page template id. These are the module instances that should shown on that page template. This also includes global module instances (pagetemplateid = -1).
public
fetchWidgetInstancesByPageTemplateId(mixed $pagetemplateid[, mixed $sectionnumber = -1 ][, mixed $channelId = 0 ][, mixed $admincheck = false ]) : array<string|int, mixed>
Parameters
- $pagetemplateid : mixed
- $sectionnumber : mixed = -1
- $channelId : mixed = 0
- $admincheck : mixed = false
Return values
array<string|int, mixed> —The array of widget instance data, empty on failure
fetchWidgetInstanceTemplates()
public
fetchWidgetInstanceTemplates(mixed $modules) : mixed
Parameters
- $modules : mixed
fetchWidgets()
Returns the basic widget data for multiple widgets
public
fetchWidgets([array<string|int, mixed> $widgetids = array() ][, mixed $removeNonPlaceableWidgets = false ]) : array<string|int, mixed>
Parameters
- $widgetids : array<string|int, mixed> = array()
- $removeNonPlaceableWidgets : mixed = false
Return values
array<string|int, mixed> —The array of widget data, indexed by widgetid, empty on failure
getApiClassName()
public
static getApiClassName(mixed $controller) : mixed
Parameters
- $controller : mixed
instance()
Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
public
static instance(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
- $controller : string
-
-- name of the API controller to load
- $refresh_cache : bool = false
-
-- true if we want to force the cache to update with a new api object primarily intended for testing
Return values
vB_ApiinstanceInternal()
Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
public
static instanceInternal(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
- $controller : string
-
-- name of the API controller to load
- $refresh_cache : bool = false
-
-- true if we want to force the cache to update with a new api object primarily intended for testing
Return values
vB_ApiisSystemWidget()
public
isSystemWidget(mixed $widgetId) : mixed
Parameters
- $widgetId : mixed
map_vb4_input_to_vb5()
Returns vb5 api method name.
public
static map_vb4_input_to_vb5(string $method, array<string|int, mixed> &$request) : string
May alter request array.
Parameters
- $method : string
-
-- vb4 method name
- $request : array<string|int, mixed>
-
-- $_REQUEST array for this api request
Return values
stringmap_vb5_errors_to_vb4()
Alters the error array in any way necessary to interface correctly with vb4.
public
static map_vb5_errors_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
- $method : string
-
-- vb4 method name
- $data : array<string|int, mixed>
-
-- error array from vb5
map_vb5_output_to_vb4()
Alters the output array in any way necessary to interface correctly with vb4.
public
static map_vb5_output_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
- $method : string
-
-- vb4 method name
- $data : array<string|int, mixed>
-
-- output array from vb5
renameWidget()
Rename custom widget
public
renameWidget( $widgetId, mixed $newtitle) : mixed
Parameters
saveAdminConfig()
Saves an admin widget configuration for the given widget instance
public
saveAdminConfig(mixed $widgetid, mixed $pagetemplateid, mixed $widgetinstanceid, mixed $data[, mixed $displaysection = null ][, mixed $displayafterwidgetinstanceid = null ]) : bool
Parameters
- $widgetid : mixed
- $pagetemplateid : mixed
- $widgetinstanceid : mixed
- $data : mixed
- $displaysection : mixed = null
- $displayafterwidgetinstanceid : mixed = null
Return values
bool —Whether or not the widget configuration was saved.
saveChannelConfig()
Saves a channel widget configuration for the given widget instance
public
saveChannelConfig(mixed $widgetinstanceid, mixed $nodeid, mixed $data) : bool
Parameters
- $widgetinstanceid : mixed
- $nodeid : mixed
- $data : mixed
Return values
bool —Whether or not the widget configuration was saved.
saveDefaultConfig()
Saves the 'default' config for a widget; updates the widgetdefinitions default field currently only used for customized_copy widgets
public
saveDefaultConfig(mixed $widgetid, array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $widgetid : mixed
- $data : array<string|int, mixed>
Return values
array<string|int, mixed>saveForums()
Saves the configuration for the Channel Widget, including creating/saving channels as necessary.
public
saveForums(mixed $data) : array<string|int, mixed>
Parameters
- $data : mixed
Return values
array<string|int, mixed> —Array of information to display the channel widget config interface
saveNewWidgetInstance()
Saves a new widget instance
public
saveNewWidgetInstance(mixed $containerinstanceid, mixed $widgetid, mixed $pagetemplateid[, mixed $subWidgetConfig = [] ][, mixed $displaysection = null ][, mixed $displayafterwidgetinstanceid = null ]) : bool
Parameters
- $containerinstanceid : mixed
- $widgetid : mixed
- $pagetemplateid : mixed
- $subWidgetConfig : mixed = []
- $displaysection : mixed = null
- $displayafterwidgetinstanceid : mixed = null
Return values
bool —Whether or not the widget configuration was saved.
saveSearchWidgetConfig()
Saves the configuration for the Search Widget,
public
saveSearchWidgetConfig(mixed $data) : string
Parameters
- $data : mixed
Return values
string —search JSON string
saveWidgetinstanceContainerinstanceid()
Updates information about the module instance, including the containerinstanceid, pagetemplateid, displaysection, and displayorder.
public
saveWidgetinstanceContainerinstanceid(mixed $widgetinstanceid, mixed $containerinstanceid, mixed $pagetemplateid, mixed $displaysection, mixed $displayafterwidgetinstanceid) : array<string|int, mixed>
Parameters
- $widgetinstanceid : mixed
- $containerinstanceid : mixed
- $pagetemplateid : mixed
- $displaysection : mixed
- $displayafterwidgetinstanceid : mixed
Return values
array<string|int, mixed> —Result