Contentserv PHP API

CSGuiSelectionListPlugin extends CSGuiComponentPlugin
in package

This is the superclass of all plugins which can be used to extend a CSGuiComponent used in CONTENTSERV.

It contains methods which are called after or before some methods in the plugged CSGuiComponent. As not every component supports to be plugged this plugin can not be used to access every component. It is recommended to use the other plugins like CSGuiWindowPlugin, CSGuiEditorPlugin, CSGuiListPlugin, ... To be included, it must be placed in a gui subfolder with a file name ending with Component.php.

Tags

Table of Contents

__call()  : mixed|string
All method calls which are not defined within the plugin are forwarded to the module Therefore it is possible to get, e.g. the label by calling the getSuiteName() method.
_construct()  : void
The construct method may be used to initialize custom plugin properties it is called immediately after instantiating the plugin all arguments passed to the getPlugins method are also available in this method.
addAlternativePluginFolder()  : void
A path to a specific folder in which should be search for plugins.
addToPopup()  : mixed
construct()  : void
This method is called after the constructor has been called.
extendToolbar()  : void
allows to extend the toolbar of a CSGuiSelectionList
getAlternativePluginFolder()  : array<string|int, mixed>
getClass()  : string
Returns the name of the CSGuiComponent class the plugin matches for
getClassFieldsValue()  : array<string|int, mixed>
Handles the class fields value if a config class is set.
getFields()  : array<string|int, mixed>
getFieldValueArray()  : mixed
getForwardURL()  : mixed
Returns the forwardURL the plugin matches for
getLevel()  : int
The getLevel method may be overwritten in the plugins and defines the order, the plugins are called, where the highest level is called first.
getMetaData()  : CSMetaData
Returns the CSMetaData of the current plugin.
getModule()  : CSModule
Returns the module, if the plugin is defined within a module.
getPlugin()  : CSPlugin|null
Returns a CSPlugin for the given plugin type and plugin class name.
getPluginChooser()  : array<string|int, mixed>
Returns an array all defined CSPlugins for the current plugin type
getPluginData()  : mixed
getPluginDefinitionFile()  : string
Returns the path to the file, the plugin is defined.
getPluginName()  : mixed
getPlugins()  : array<string|int, CSPlugin>
Returns all defined CSPlugins for the current plugin type It should be used to get all matching plugins for a given plugin api.
getPluginsInModule()  : array<string|int, mixed>
Returns all CSPlugins for the current plugin type which are defined within the given module It should be used to get all matching plugins for a given plugin api.
initSelectionList()  : void
allows to modify the selection list after its initialization
isAvailable()  : bool
This method defines if the list plugin is available for the current context.
makeHtml()  : void
This method is called to define rights using the utility methods.
prepareList()  : mixed
resetLoadedPlugins()  : mixed
reset the internal plugins cache for loaded plugins

Methods

__call()

All method calls which are not defined within the plugin are forwarded to the module Therefore it is possible to get, e.g. the label by calling the getSuiteName() method.

public __call(mixed $methodName, mixed $methodArguments) : mixed|string
Parameters
$methodName : mixed
$methodArguments : mixed
Tags
Return values
mixed|string

_construct()

The construct method may be used to initialize custom plugin properties it is called immediately after instantiating the plugin all arguments passed to the getPlugins method are also available in this method.

public _construct() : void
Tags
Return values
void

addAlternativePluginFolder()

A path to a specific folder in which should be search for plugins.

public static addAlternativePluginFolder(mixed $sPluginFolder) : void
Parameters
$sPluginFolder : mixed
Tags
Return values
void

addToPopup()

public addToPopup(mixed $popup, mixed $id, mixed $index, mixed $type, mixed $recordID, mixed $recordClass, mixed $editorDisabled, mixed $multiple) : mixed
Parameters
$popup : mixed
$id : mixed
$index : mixed
$type : mixed
$recordID : mixed
$recordClass : mixed
$editorDisabled : mixed
$multiple : mixed
Tags
Return values
mixed

construct()

This method is called after the constructor has been called.

public construct(CSGuiComponent $oCSGuiComponent) : void

It could be overwritten in the plugin

Parameters
$oCSGuiComponent : CSGuiComponent

the component which should be extended

Tags
Return values
void

extendToolbar()

allows to extend the toolbar of a CSGuiSelectionList

public extendToolbar(object $toolbar, object $list) : void
Parameters
$toolbar : object

the toolbar object to extend

$list : object

an instance of the CSGuiSelectionList the toolbar belongs to

Tags
access

public

Return values
void

getAlternativePluginFolder()

public static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

getClass()

Returns the name of the CSGuiComponent class the plugin matches for

public getClass() : string
Tags
Return values
string

the class name of the CSGuiComponent the plugin is available for

getClassFieldsValue()

Handles the class fields value if a config class is set.

public getClassFieldsValue(array<string|int, mixed> $aFieldsValue, array<string|int, mixed> $aFieldIds, mixed $oItem, array<string|int, mixed> $aData, bool $bIncludeLabel, CSGuiSelectionList $oList) : array<string|int, mixed>
Parameters
$aFieldsValue : array<string|int, mixed>
$aFieldIds : array<string|int, mixed>
$oItem : mixed
$aData : array<string|int, mixed>
$bIncludeLabel : bool
$oList : CSGuiSelectionList
Tags
Return values
array<string|int, mixed>

An array with the fields value.

getFields()

public getFields(mixed $record, mixed $mode, mixed $list) : array<string|int, mixed>
Parameters
$record : mixed
$mode : mixed
$list : mixed
Tags
Return values
array<string|int, mixed>

getFieldValueArray()

public getFieldValueArray(mixed $oRecord[, mixed $iViewMode = CS_SELECTIONLIST_LIST ][, mixed $bIncludeLabel = TRUE ][, mixed $aSelectedFields = array() ][, CSGuiSelectionList $oList = null ]) : mixed
Parameters
$oRecord : mixed
$iViewMode : mixed = CS_SELECTIONLIST_LIST
$bIncludeLabel : mixed = TRUE
$aSelectedFields : mixed = array()
$oList : CSGuiSelectionList = null
Tags
Return values
mixed

getForwardURL()

Returns the forwardURL the plugin matches for

public getForwardURL() : mixed
Tags
Return values
mixed

either a string or an array of strings with the forward parameter the plugin is available for

getLevel()

The getLevel method may be overwritten in the plugins and defines the order, the plugins are called, where the highest level is called first.

public getLevel() : int

The method can also be set for all plugins within a module by overwriting the modules getLevel method.

Tags
Return values
int

the level of the plugin where it is called

getMetaData()

Returns the CSMetaData of the current plugin.

public getMetaData() : CSMetaData
Tags
access

public

Return values
CSMetaData

getModule()

Returns the module, if the plugin is defined within a module.

public getModule() : CSModule

This method can be used in the plugin api and the plugin wherever access to the defining module is required. If it is used in the Api, it should be noticed that this method may return null, if the plugin is directly defined in the projects or admin.local plugins directory.

Tags
Return values
CSModule

the module object, if the plugin defined in a module or null otherwise

getPlugin()

Returns a CSPlugin for the given plugin type and plugin class name.

public static getPlugin(string $pluginApiPath, string $className[, mixed $arguments = NULL ]) : CSPlugin|null

As standard behaviour the module subfolder is guessed from the forward URL parameter. If a plugin should point to something in a special module subfolder, this scope can be added by adding the module name in squared bracket at the end of the $pluginApiPath, e.g. 'core/api/plugins/CSRecordPlugin.php[pms]' to get all CSRecordPlugins defined for pms records.

Parameters
$pluginApiPath : string

The relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).

$className : string

The target plugin class name, which should be loaded.

$arguments : mixed = NULL

one or multiple arguments which should be passed to the isAvailable method.

Tags
Return values
CSPlugin|null

Returns the requested plugin for the given parameter.

getPluginChooser()

Returns an array all defined CSPlugins for the current plugin type

public static getPluginChooser(string $pluginApiPath[, mixed $arguments = NULL ]) : array<string|int, mixed>
Parameters
$pluginApiPath : string

the relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).

$arguments : mixed = NULL

one ore multiple arguments which should be passed to the isAvailable method.

Tags
Return values
array<string|int, mixed>

of CSPlugins in the form [CLASSNAME => LABEL] where the CLASSNAME may be used in the CSPlugin::getPlugin method

getPluginData()

public getPluginData() : mixed
Tags
Return values
mixed

getPluginDefinitionFile()

Returns the path to the file, the plugin is defined.

public getPluginDefinitionFile() : string
Tags
Return values
string

the path to the plugin

getPluginName()

public getPluginName() : mixed
Tags
Return values
mixed

getPlugins()

Returns all defined CSPlugins for the current plugin type It should be used to get all matching plugins for a given plugin api.

public static getPlugins(string $pluginApiPath[, mixed $arguments = NULL ]) : array<string|int, CSPlugin>

As standard behaviour the module subfolder is guessed from the forward URL parameter. If a plugin should point to something in a special module subfolder, this scope can be added by adding the module name in squared bracket at the end of the $pluginApiPath, e.g. 'core/api/plugins/CSRecordPlugin.php[pms]' to get all CSRecordPlugins defined for pms records.

Parameters
$pluginApiPath : string

the relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).

$arguments : mixed = NULL

one ore multiple arguments which should be passed to the isAvailable method.

Tags
Return values
array<string|int, CSPlugin>

array of CSPlugin objects matching the defined plugin criteria

getPluginsInModule()

Returns all CSPlugins for the current plugin type which are defined within the given module It should be used to get all matching plugins for a given plugin api.

public static getPluginsInModule(string $moduleName, string $pluginApiPath[, mixed $sFileNamePattern = '' ][, mixed $arguments = NULL ]) : array<string|int, mixed>
Parameters
$moduleName : string

the module which should be searched for plugins

$pluginApiPath : string

the relative path in filesystem for the requested plugin api.

$sFileNamePattern : mixed = ''
$arguments : mixed = NULL

one ore multiple arguments which should be passed to the isAvailable method.

Tags
Return values
array<string|int, mixed>

of CSPlugin objects matching the defined plugin criterias

initSelectionList()

allows to modify the selection list after its initialization

public initSelectionList(object $list) : void
Parameters
$list : object

an instance of the CSGuiSelectionList

Tags
access

public

Return values
void

isAvailable()

This method defines if the list plugin is available for the current context.

public isAvailable([object $oComponent = null ][, string $sModuleName = null ][, string $sRecordClass = null ][, object $oSourceRecord = NULL ]) : bool

This can be evaluated based on the parameters that are passed to this method.

Parameters
$oComponent : object = null

The GUI component for which this plugin is called. In most cases this is the CSGuiSelectionList-object itself. The only exception is when a user calls a popup on one of the list items. In this case the component object for the popup is passed in this parameter.

$sModuleName : string = null

The name of the module the listed items belong to. WARNING: This is not the class of the item that contains this list in it's configuration!

$sRecordClass : string = null

The record class of the list items. WARNING: This is not the class of the item that contains this list in it's configuration!

$oSourceRecord : object = NULL

The record, that contains the selection list this plugin is called for. Can be null, if a selection list is used without an object context (e.g. in the CS options dialog)

Tags
access

public

Return values
bool

If the return value evaluates to "TRUE" this plugin will be executed for the given context, otherwise not

makeHtml()

This method is called to define rights using the utility methods.

public makeHtml(CSGuiComponent $oCSGuiComponent) : void

It could be overwritten in the plugin

Parameters
$oCSGuiComponent : CSGuiComponent

the component which should be extended

Tags
Return values
void

prepareList()

public prepareList(mixed $html, mixed $list) : mixed
Parameters
$html : mixed
$list : mixed
Tags
Return values
mixed

resetLoadedPlugins()

reset the internal plugins cache for loaded plugins

public static resetLoadedPlugins() : mixed
Tags
@return

void;

access

public

Return values
mixed

        

Search results