CSCometPlaceholderPlugin
extends CSPlaceholderPlugin
in package
Placeholder Plugin with extra functions for Comet Scenarios
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.
- compareValueTo() : mixed
- Compares whether a placeholders value has changed
- getAlternativePluginFolder() : array<string|int, mixed>
- getCometValue() : The
- getConfiguration() : Itemconfiguration
- Returns the current Itemconfiguration object responsible for this plugin
- getCSTypeParamInfos() : void
- This method is called to manipulate the Itemconfiguration editor by adding addtional CSTypeParamInfos It may be overwritten, if the editor should be manipulated.
- getGuiEditorType() : CSGuiEditorType
- Returns the CSGuiEditorType representing the placeholder in the Itemeditor.
- getHtmlValue() : 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.
- getLoadActionID() : mixed
- getLoadActionScript() : mixed
- getMatchingPreviewFields() : mixed
- getMetaData() : CSMetaData
- Returns the CSMetaData of the current plugin.
- getModule() : CSModule
- Returns the module, if the plugin is defined within a module.
- getPlaceholderType() : mixed
- 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.
- getStoreActionID() : mixed
- getStoreActionScript() : mixed
- getSyncActionID() : mixed
- getSyncActionScript() : mixed
- getValue() : string
- Formats the placeholders value.
- isAvailable() : bool
- This method is called to check, whether the plugin is available.
- isVisibleInEditor() : bool
- Returns whether the placeholder is visible in the editor (editable or readonly)
- prepareItemEditor() : void
- This method is called before any editor field is build, to be able to manipulate the complete editor It may be overwritten, if the editor should be manipulated
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
- setValue() : string
- Stores a placeholders value in the Item The default implementation load all getItemEditorTypes stored in the default implementation format (@see getValue())
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 —compareValueTo()
Compares whether a placeholders value has changed
public
compareValueTo(string $value, Item $item, Itemconfiguration $oConfiguration, int $languageID[, string $medium = 'CSITEM_MEDIUM_HTML' ]) : mixed
Parameters
- $value : string
-
the new value to set to the current Item
- $item : Item
-
the current Item
- $oConfiguration : Itemconfiguration
-
The current configuration.
- $languageID : int
-
the current Language
- $medium : string = 'CSITEM_MEDIUM_HTML'
-
the medium the placeholder should be formatted with
Tags
Return values
mixed —getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getCometValue()
public
getCometValue(mixed $value, mixed $item, mixed $configuration, mixed $languageID, mixed $placeholderContext) : The
Parameters
- $value : mixed
- $item : mixed
- $configuration : mixed
- $languageID : mixed
- $placeholderContext : mixed
Tags
Return values
The —value if used as Text Placeholder, or the MamFileID of the Image for Image Placeholder
getConfiguration()
Returns the current Itemconfiguration object responsible for this plugin
public
getConfiguration() : Itemconfiguration
Tags
Return values
Itemconfiguration —the current configuration
getCSTypeParamInfos()
This method is called to manipulate the Itemconfiguration editor by adding addtional CSTypeParamInfos It may be overwritten, if the editor should be manipulated.
public
getCSTypeParamInfos() : void
Otherwise all defined getItemconfigurationEditorTypes() are added as fields to the Itemconfiguration editor
Tags
Return values
void —getGuiEditorType()
Returns the CSGuiEditorType representing the placeholder in the Itemeditor.
public
getGuiEditorType(CSGuiItemEditor $csGuiItemEditor[, bool $isDisabled = false ]) : CSGuiEditorType
If this method is not overwritten the getItemEditorTypes method is used to detect the shown fields.
Parameters
- $csGuiItemEditor : CSGuiItemEditor
-
the editor which is displayed
- $isDisabled : bool = false
-
whether the CSGuiEditorType should show a disabled field
Tags
Return values
CSGuiEditorType —the representation of this Placeholder
getHtmlValue()
public
getHtmlValue(mixed $value, mixed $item, mixed $configuration, mixed $languageID) : mixed
Parameters
- $value : mixed
- $item : mixed
- $configuration : mixed
- $languageID : mixed
Tags
Return values
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
getLoadActionID()
public
getLoadActionID(mixed $field[, mixed $ClassID = COMET_CLASS_PRODUCT ]) : mixed
Parameters
- $field : mixed
- $ClassID : mixed = COMET_CLASS_PRODUCT
Tags
Return values
mixed —getLoadActionScript()
public
getLoadActionScript(mixed $field[, mixed $ClassID = COMET_CLASS_PRODUCT ]) : mixed
Parameters
- $field : mixed
- $ClassID : mixed = COMET_CLASS_PRODUCT
Tags
Return values
mixed —getMatchingPreviewFields()
public
getMatchingPreviewFields(mixed $selectedField) : mixed
Parameters
- $selectedField : mixed
Tags
Return values
mixed —getMetaData()
Returns the CSMetaData of the current plugin.
public
getMetaData() : CSMetaData
Tags
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
getPlaceholderType()
public
getPlaceholderType() : mixed
Tags
Return values
mixed —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
getStoreActionID()
public
getStoreActionID(mixed $field[, mixed $ClassID = COMET_CLASS_PRODUCT ]) : mixed
Parameters
- $field : mixed
- $ClassID : mixed = COMET_CLASS_PRODUCT
Tags
Return values
mixed —getStoreActionScript()
public
getStoreActionScript(mixed $field[, mixed $ClassID = COMET_CLASS_PRODUCT ]) : mixed
Parameters
- $field : mixed
- $ClassID : mixed = COMET_CLASS_PRODUCT
Tags
Return values
mixed —getSyncActionID()
public
getSyncActionID(mixed $field[, mixed $ClassID = COMET_CLASS_PRODUCT ]) : mixed
Parameters
- $field : mixed
- $ClassID : mixed = COMET_CLASS_PRODUCT
Tags
Return values
mixed —getSyncActionScript()
public
getSyncActionScript(mixed $field[, mixed $ClassID = COMET_CLASS_PRODUCT ]) : mixed
Parameters
- $field : mixed
- $ClassID : mixed = COMET_CLASS_PRODUCT
Tags
Return values
mixed —getValue()
Formats the placeholders value.
public
getValue(mixed $value, Item $item, mixed $configuration, mixed $languageID[, mixed $medium = CSItemMedium::DEFAULT ]) : string
The default implementation formats all getItemEditorTypes in the form
[NAME]: [VALUE] separated by "
" or ", " corresponding to the medium
Parameters
- $value : mixed
-
the current value in the Item
- $item : Item
-
the current Item
- $configuration : mixed
- $languageID : mixed
-
the current Language
- $medium : mixed = CSItemMedium::DEFAULT
-
the medium the placeholder should be formatted with
Tags
Return values
string —the formatted value representation
isAvailable()
This method is called to check, whether the plugin is available.
public
isAvailable([mixed $configuration = null ]) : bool
Parameters
- $configuration : mixed = null
Tags
Return values
bool —whether the plugin is available for the given arguments
isVisibleInEditor()
Returns whether the placeholder is visible in the editor (editable or readonly)
public
isVisibleInEditor() : bool
Tags
Return values
bool —whether it is visible
prepareItemEditor()
This method is called before any editor field is build, to be able to manipulate the complete editor It may be overwritten, if the editor should be manipulated
public
prepareItemEditor(CSGuiItemEditorDialog $editor) : void
Parameters
- $editor : CSGuiItemEditorDialog
-
the current Item editor
Tags
Return values
void —resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
Tags
Return values
mixed —setValue()
Stores a placeholders value in the Item The default implementation load all getItemEditorTypes stored in the default implementation format (@see getValue())
public
setValue(string $newValue, Item $item, Itemconfiguration $oConfiguration, int $languageID[, string $medium = CSItemMedium::DEFAULT ]) : string
Parameters
- $newValue : string
-
the new value to set to the current Item
- $item : Item
-
the current Item
- $oConfiguration : Itemconfiguration
-
The current configuration.
- $languageID : int
-
the current Language
- $medium : string = CSItemMedium::DEFAULT
-
the medium the placeholder should be formatted with
Tags
Return values
string —the formatted value representation
