CSSmartMacroPlugin
extends CSPlugin
in package
Plugin that can be inherited to define a new smart macro
Tags
Table of Contents
- MACRO_FORMAT_HTML = 1
- __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() : mixed
- _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.
- addAttributeDefinition() : mixed
- addAttributeDefinitions() : mixed
- Announce in this method your parameters that you need to process your macro Within this method you can use the methods addAttributeDefinition to add attributes
- getAlternativePluginFolder() : array<string|int, mixed>
- getAttribute() : mixed
- getAttributeDefinitions() : mixed
- getAttributeNames() : mixed
- getAttributes() : mixed
- getCategory() : mixed
- getDescription() : string
- Get the description of the plugin
- 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() : string
- Get the default Plugin Name of the Macro
- getPluginPath() : string
- Get the plugin subdirectory
- 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.
- getPreviewUrl() : mixed
- getTitle() : string
- Get the Title of the Macro as displayed in the Macro Chooser
- isAvailable() : bool
- This method is called to check, whether the plugin is available.
- isEditable() : bool
- Let a Macro Developer define if his macro should be editable in the document
- makeHtmlForEditor() : string
- This method can be overwritten to create an smart document specific html output.
- makeHtmlForPdf() : string
- This method can be overwritten to create an pdf renderer specific html output
- makeHtmlForPdfreactor() : string
- This method can be overwritten to create an pdfreactor specific html output
- makeHtmlForReader() : string
- This method can be overwritten to create an html specific output and it is also used for other renderer's if their render specific method is not overwritten.
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
- setAttribute() : mixed
- setAttributes() : mixed
Constants
MACRO_FORMAT_HTML
public
mixed
MACRO_FORMAT_HTML
= 1
Tags
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()
public
__construct() : mixed
Tags
Return values
mixed —_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 —addAttributeDefinition()
public
addAttributeDefinition(mixed $name[, mixed $label = NULL ][, mixed $type = 'caption' ][, mixed $default = '' ][, mixed $options = array() ]) : mixed
Parameters
- $name : mixed
- $label : mixed = NULL
- $type : mixed = 'caption'
- $default : mixed = ''
- $options : mixed = array()
Tags
Return values
mixed —addAttributeDefinitions()
Announce in this method your parameters that you need to process your macro Within this method you can use the methods addAttributeDefinition to add attributes
public
addAttributeDefinitions() : mixed
Tags
Return values
mixed —getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getAttribute()
public
getAttribute(mixed $sName) : mixed
Parameters
- $sName : mixed
Tags
Return values
mixed —getAttributeDefinitions()
public
getAttributeDefinitions() : mixed
Tags
Return values
mixed —getAttributeNames()
public
getAttributeNames() : mixed
Tags
Return values
mixed —getAttributes()
public
getAttributes() : mixed
Tags
Return values
mixed —getCategory()
public
getCategory() : mixed
Tags
Return values
mixed —getDescription()
Get the description of the plugin
public
getDescription() : string
Tags
Return values
string —the description
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
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()
Get the default Plugin Name of the Macro
public
getPluginName() : string
Tags
Return values
string —the name
getPluginPath()
Get the plugin subdirectory
public
getPluginPath() : string
Tags
Return values
string —the sub path
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
getPreviewUrl()
public
getPreviewUrl([mixed $width = '120' ][, mixed $height = NULL ]) : mixed
Parameters
- $width : mixed = '120'
- $height : mixed = NULL
Tags
Return values
mixed —getTitle()
Get the Title of the Macro as displayed in the Macro Chooser
public
getTitle() : string
Tags
Return values
string —the Title of the Plugin
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
isEditable()
Let a Macro Developer define if his macro should be editable in the document
public
isEditable() : bool
Tags
Return values
bool —TRUE if the Macro should be editable in the document
makeHtmlForEditor()
This method can be overwritten to create an smart document specific html output.
public
makeHtmlForEditor() : string
Tags
Return values
string —makeHtmlForPdf()
This method can be overwritten to create an pdf renderer specific html output
public
makeHtmlForPdf() : string
Tags
Return values
string —the html which will be placed in the pdf
makeHtmlForPdfreactor()
This method can be overwritten to create an pdfreactor specific html output
public
makeHtmlForPdfreactor() : string
Tags
Return values
string —the html which will be placed in the pdf
makeHtmlForReader()
This method can be overwritten to create an html specific output and it is also used for other renderer's if their render specific method is not overwritten.
public
makeHtmlForReader() : string
Tags
Return values
string —resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
Tags
Return values
mixed —setAttribute()
public
setAttribute(mixed $sName, mixed $sValue) : mixed
Parameters
- $sName : mixed
- $sValue : mixed
Tags
Return values
mixed —setAttributes()
public
setAttributes([mixed $attributes = array() ]) : mixed
Parameters
- $attributes : mixed = array()
