Contentserv PHP API

CSWhiteboardGuiPlugin extends CSPlugin
in package

The CSWhiteboardGuiPlugin is a plugin to extend the whiteboard editor in CONTENTSERV.

To be included, it must be placed in a plugins/whiteboard/ subfolder with a file name ending with WhiteboardGui.php.

Tags
since

CS14.1

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.
alterSketchAttributeValues()  : array<string|int, mixed>
This method can be used to manipulate already existing properties inside the sketch.
alterSketchInfoProperties()  : array<string|int, mixed>
This method can be used to manipulate already existing properties inside the sketch info window. For that a key-value mapping of the corresponding attribute ids and their formatted values is passed. It can also be used to add new properties by simply appending them to the result mapping.
extendReferenceListPopup()  : void
This method can be used to extend the reference list popups. By using the popup object new entries can be added and apply custom functionality to the list.
extendSketchInfoProperties()  : void
This method can be used to extend the properties shown inside the sketch info window. For example, by using the table object, new input fields can be added, which values are then send along with the save-request and can be handled inside the "onSketchStorage"-method. For this to work the new form elements must have a name attribute specified!
extendSketchInfoToolbar()  : void
This method can be used to extend the toolbar object that is shown inside the sketch info dialog. For example new buttons can be added with new functionality.
extendSketchInfoWindow()  : void
This method can be used to extend the window object that is used to create the sketch info dialog. In some cases it may be necessary to add custom javascript or css code to the window, which can be done by using api methods of the CSGuiWindow object.
extendSketchPopup()  : void
This method can be used to extend the sketch popups in the whiteboard editor. By using the popup object new entries can be added and apply custom functionality to the editor.
filterReferenceListForPage()  : array<string|int, CSWhiteboardMergedItem>
This method can be used to filter or reorder the reference list for a document per page.
getAdditionalSketchAttributeValuesForItem()  : array<string|int, mixed>
This method can be used to show custom values inside a sketch. If preconfigured attributes for a sketch are available, the values returned by this method are appended to the existing values. If no preconfigured attributes are available, only the values returned with this method are shown.
getAlternativePluginFolder()  : array<string|int, mixed>
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.
getReferenceListLabelForItem()  : string
This method can be used to change the item label in the reference list for every item shown.
getSketchImageForItem()  : CSMamFile
This method can be used to change the image shown inside the sketch.
getSketchTitleForItem()  : string
This method can be used to change the sketch title shown at the top of a sketch.
isAvailable()  : bool
This method is called to check, whether the plugin is available.
onSketchInfoStorage()  : void
This method can be used to handle the storage event inside sketch info dialog.
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

alterSketchAttributeValues()

This method can be used to manipulate already existing properties inside the sketch.

public alterSketchAttributeValues(array<string|int, mixed> $aSketchAttributeValues, CSItemApiReference $oReference, CSMamFile $oMamFile) : array<string|int, mixed>

For that a key-value mapping of the corresponding attribute ids and their formatted values is passed. It can also be used to add new properties by simply appending them to the result mapping.

Parameters
$aSketchAttributeValues : array<string|int, mixed>

The attributes that should be shown inside the sketch info.

$oReference : CSItemApiReference

The reference object that where the sketch belongs to.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
array<string|int, mixed>

An array with all attribute to value mappings that should be shown inside the sketch.

alterSketchInfoProperties()

This method can be used to manipulate already existing properties inside the sketch info window. For that a key-value mapping of the corresponding attribute ids and their formatted values is passed. It can also be used to add new properties by simply appending them to the result mapping.

public alterSketchInfoProperties(array<string|int, mixed> $aSketchInfoProperties, CSItemApiReference $oReference, CSMamFile $oMamFile) : array<string|int, mixed>
Parameters
$aSketchInfoProperties : array<string|int, mixed>

The attributes that should be shown inside the sketch info.

$oReference : CSItemApiReference

The reference object that is currently shown in the sketch info dialog.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
array<string|int, mixed>

An array with all attribute to value mappings that should be shown inside the sketch window.

extendReferenceListPopup()

This method can be used to extend the reference list popups. By using the popup object new entries can be added and apply custom functionality to the list.

public extendReferenceListPopup(CSGuiComponent $oPopup, CSItemApiReference $oReference, CSMamFile $oMamFile) : void
Parameters
$oPopup : CSGuiComponent

The popup object that can be extended by using standard API methods.

$oReference : CSItemApiReference

The reference object that is currently shown in the list. If available, this is the planned item, which is the common case. The placed item is passed when no planned reference is set.

$oMamFile : CSMamFile

The document object where the reference belongs to.

Tags
access

public

Return values
void

extendSketchInfoProperties()

This method can be used to extend the properties shown inside the sketch info window. For example, by using the table object, new input fields can be added, which values are then send along with the save-request and can be handled inside the "onSketchStorage"-method. For this to work the new form elements must have a name attribute specified!

public extendSketchInfoProperties(CSGuiTable $oTable, CSItemApiReference $oReference, CSMamFile $oMamFile) : void
Parameters
$oTable : CSGuiTable

The table object that can be used to add new rows to the sketch info dialog.

$oReference : CSItemApiReference

The reference object that is currently shown in the sketch info dialog.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
void

extendSketchInfoToolbar()

This method can be used to extend the toolbar object that is shown inside the sketch info dialog. For example new buttons can be added with new functionality.

public extendSketchInfoToolbar(CSGuiToolbar $oToolbar, CSItemApiReference $oReference, CSMamFile $oMamFile) : void
Parameters
$oToolbar : CSGuiToolbar

The toolbar object that is used to create the toolbar inside the sketch info dialog.

$oReference : CSItemApiReference

The reference object that is currently shown in the sketch info dialog.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
void

extendSketchInfoWindow()

This method can be used to extend the window object that is used to create the sketch info dialog. In some cases it may be necessary to add custom javascript or css code to the window, which can be done by using api methods of the CSGuiWindow object.

public extendSketchInfoWindow(CSGuiWindow $oWindow, CSItemApiReference $oReference, CSMamFile $oMamFile) : void
Parameters
$oWindow : CSGuiWindow

The window object that is used to create the sketch info dialog.

$oReference : CSItemApiReference

The reference object that is currently shown in the sketch info dialog.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
void

extendSketchPopup()

This method can be used to extend the sketch popups in the whiteboard editor. By using the popup object new entries can be added and apply custom functionality to the editor.

public extendSketchPopup(CSGuiComponent $oPopup, CSItemApiReference $oReference, CSMamFile $oMamFile) : void
Parameters
$oPopup : CSGuiComponent

The popup object that can be extended by using standard API methods.

$oReference : CSItemApiReference

The reference object that is currently shown in the sketch info dialog.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
void

filterReferenceListForPage()

This method can be used to filter or reorder the reference list for a document per page.

public filterReferenceListForPage(array<string|int, mixed> $aItems, string $sPage, CSMamFile $oMamFile) : array<string|int, CSWhiteboardMergedItem>
Parameters
$aItems : array<string|int, mixed>

A list of reference items that should be shown in the list for the specified page.

$sPage : string

The page name of the page to which the references belong.

$oMamFile : CSMamFile

The document object to which the references belong.

Tags
access

public

Return values
array<string|int, CSWhiteboardMergedItem>

The filtered list of reference items.

getAdditionalSketchAttributeValuesForItem()

This method can be used to show custom values inside a sketch. If preconfigured attributes for a sketch are available, the values returned by this method are appended to the existing values. If no preconfigured attributes are available, only the values returned with this method are shown.

public getAdditionalSketchAttributeValuesForItem(CSItemApiItem $oItem, CSItemApiReference $oReference, CSMamFile $oMamFile) : array<string|int, mixed>

REMARK: The label and preview image is always shown.

Parameters
$oItem : CSItemApiItem

The item currently shown inside the sketch.

$oReference : CSItemApiReference

The reference object that connects the item to the document.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
array<string|int, mixed>

A list of values to append to the preconfigured attributes.

getAlternativePluginFolder()

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

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

getReferenceListLabelForItem()

This method can be used to change the item label in the reference list for every item shown.

public getReferenceListLabelForItem(CSItemApiItem $oItem, CSItemApiReference $oReference, CSMamFile $oMamFile) : string
Parameters
$oItem : CSItemApiItem

The item that is shown in the list.

$oReference : CSItemApiReference

The reference object that is currently shown in the list. If available, this is the planned item, which is the common case. The placed item is passed when no planned reference is set.

$oMamFile : CSMamFile

The document object to which the reference belongs.

Tags
access

public

Return values
string

The label that should be shown in the list.

getSketchImageForItem()

This method can be used to change the image shown inside the sketch.

public getSketchImageForItem(CSItemApiItem $oItem, CSItemApiReference $oReference, CSMamFile $oMamFile) : CSMamFile
Parameters
$oItem : CSItemApiItem

The item currently shown inside the sketch.

$oReference : CSItemApiReference

The reference object that connects the item to the document.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
CSMamFile

A mamfile object that should used as image for the sketch

getSketchTitleForItem()

This method can be used to change the sketch title shown at the top of a sketch.

public getSketchTitleForItem(CSItemApiItem $oItem, CSItemApiReference $oReference, CSMamFile $oMamFile) : string
Parameters
$oItem : CSItemApiItem

The item currently shown inside the sketch.

$oReference : CSItemApiReference

The reference object that connects the item to the document.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
string

The string to use as sketch title.

isAvailable()

This method is called to check, whether the plugin is available.

public isAvailable() : bool

If further arguments are added to the CSPlugin::getPlugins call, they are added as arguments to this method.

For simpler usage of the plugin concept: This method should be overwritten with the correct signature for a plugin call, if arguments are passed.

Tags
Return values
bool

whether the plugin is available for the given arguments

onSketchInfoStorage()

This method can be used to handle the storage event inside sketch info dialog.

public onSketchInfoStorage(CSItemApiReference $oReference, array<string|int, mixed> $aValues, CSMamFile $oMamFile) : void

In case custom input fields have been added to the dialog, these values can be retrieved from the $aValues-array. This only works for form elements which have a name attribute specified!

Parameters
$oReference : CSItemApiReference

The reference object that is currently shown in the sketch info dialog.

$aValues : array<string|int, mixed>

The values that have been sent with the save request.

$oMamFile : CSMamFile

The document object where the sketch belongs to.

Tags
access

public

Return values
void

resetLoadedPlugins()

reset the internal plugins cache for loaded plugins

public static resetLoadedPlugins() : mixed
Tags
@return

void;

access

public

Return values
mixed

        

Search results