ImageCollectionFlexTemplate
extends CSSimpleFlexTemplate
in package
CSFlexTemplatePlugin that shows a set of images referenced to an item
Tags
Table of Contents
- FLEX_ATTRIBUTE_OPTION_HALIGN = 4
- FLEX_ATTRIBUTE_OPTION_HEIGHT = 128
- FLEX_ATTRIBUTE_OPTION_HIDE_UNITS = 64
- FLEX_ATTRIBUTE_OPTION_LABELS = 32
- FLEX_ATTRIBUTE_OPTION_PREFIX = 256
- FLEX_ATTRIBUTE_OPTION_STYLES = 16
- FLEX_ATTRIBUTE_OPTION_SUFFIX = 512
- FLEX_ATTRIBUTE_OPTION_VALIGN = 2
- Attribute Configuration Options
- FLEX_ATTRIBUTE_OPTION_WIDTH = 8
- FLEX_GUI_DATA_SELECTION_FOLDER = 2
- FLEX_GUI_DATA_SELECTION_FOLDER_AND_LEAVES = 0
- Folder Options
- FLEX_GUI_DATA_SELECTION_LEAVES = 1
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT = 30
- Context Selection Types
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN = 31
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN_OR_SELF = 36
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN_REFERENCES = 37
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_DOCUMENT_PRODUCTS = 35
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_REFERENCES = 32
- FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_TABLE_ATTRIBUTE = 34
- FLEX_GUI_DATA_SELECTION_TYPE_FILE_ATTRIBUTE = 21
- FLEX_GUI_DATA_SELECTION_TYPE_FILE_ATTRIBUTE_BY_TAGS = 23
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT = 0
- Product Selection Types
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_ATTRIBUTE = 20
- Attribute Selection Types
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_ATTRIBUTE_BY_TAGS = 22
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_CHILDREN = 1
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_CHILDREN_REFERENCES = 6
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_FAVORITE = 3
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_REFERENCES = 2
- FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_TABLE_ATTRIBUTE = 4
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW = 10
- Product Selection Types
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW_CHILDREN = 11
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW_CHILDREN_REFERENCES = 17
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW_FAVORITE = 13
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW_REFERENCES = 12
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW_SELECTION = 15
- FLEX_GUI_DATA_SELECTION_TYPE_VIEW_TABLE_ATTRIBUTE = 14
- FLEX_GUI_EDITOR_TAB_OUTPUT = 'FLEX_GUI_EDITOR_TAB_OUTPUT'
- FLEX_GUI_EDITOR_TAB_TABLE_DATA = 'FLEX_GUI_EDITOR_TAB_TABLE_DATA'
- Tab Names
- FLEX_GUI_EDITOR_TAB_TABLE_LAYOUT = 'FLEX_GUI_EDITOR_TAB_TABLE_LAYOUT'
- FLEX_GUI_EDITOR_TAB_TABLE_STRUCTURE = 'FLEX_GUI_EDITOR_TAB_TABLE_STRUCTURE'
- FLEX_GUI_EDITOR_TAB_TRANSLATIONS = 'FLEX_GUI_EDITOR_TAB_TRANSLATIONS'
- FLEX_SORT_ASC_NATURAL = 10
- Sort Flags
- FLEX_SORT_ASC_NUMERIC = 11
- FLEX_SORT_ASC_STRING = 12
- FLEX_SORT_DESC_NATURAL = 13
- FLEX_SORT_DESC_NUMERIC = 14
- FLEX_SORT_DESC_STRING = 15
- __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.
- addContent() : void
- This is the most important method to implement when defining your CSFlexTemplate
- addPresetAttributeConfigurations() : mixed
- Allows to query further options about the selected attributes
- addPresetAttributeSelector() : void
- Adds input fields to the preset editor that allows the end user to configure attributes
- addPresetField() : void
- Call this function to add another preset field for this table
- addPresetFields() : void
- Overwrite this method to add your template specific configuration parameter
- addPresetFieldsToEditor() : mixed
- This method can will be used by CSGuiEditors to add your template specific preset fields to the editor
- addPresetFileAttributeSelector() : void
- Adds an input fields to the preset editor that allows the end user to select one or multiple file attributes
- addPresetItemSelector() : void
- Adds input fields to the preset editor that allows the end user to configure items in several ways, like <ul> <li>selecting them directly</li> <li>selecting children of a product</li> <li>selecting referenced products of a product</li> </ul>
- addPresetProductAttributeSelector() : void
- Adds an input fields to the preset editor that allows the end user to select one or multiple product attributes
- addPresetTranslatableField() : void
- Call this function to add another preset field for this table which should be translatable in the GUI
- applyPresetAttributeConfiguration() : mixed
- Allows to apply attribute configurations to a cell
- createDefaultFolders() : void
- Creates the Default Folders for a Template
- createDefaultPreset() : CSFlexPreset
- This method can be overwritten to create a new sample preset for this template
- getAlternativePluginFolder() : array<string|int, mixed>
- getAvailableContextClasses() : array<string|int, string>
- This method allows the template to define for which kind of records the template can be used
- getBaseName() : string
- Returns the short name of the plugin without the FlexTemplate at the end
- getCellContent() : string
- Optional method that allows the template developer to return a specific cell content directly
- getCSSFiles() : array<string|int, string>
- Collects all CSS Files which have the same name as the Template File for the current class and all parents
- getDefaultCSSFile() : string
- Searches a CSS File which has the same name as the Template File Note: You can use the method @see getDefaultCSSFiles to collect the files of the parent templates as well
- 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() : mixed
- 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.
- getPreset() : CSFlexPreset
- Returns the current preset to be used
- getPresetAttribute() : array<string|int, CSPmsField>
- Retrieves the attribute or first of the attributes that previously was added with $this->addPresetAttributeSelector($name) or $this->addPresetProductAttributeSelector($name, $label, $multiple, $section)
- getPresetAttributeConfiguration() : string
- Retrieves one of the attribute configurations
- getPresetAttributePrefix() : string
- This method will return the prefix (The variable name under which the preset was stored) for the plugin.
- getPresetAttributes() : array<string|int, CSItemApiField>
- Retrieves a list of attributes that are configured with the preset in a field that previously was added with $this->addPresetAttributeSelector($name)
- getPresetAttributesAsRowHeader() : array<string|int, CSPmsField>
- Retrieves a list of attributes that was configured with the preset in a field that previously was added with $this->addPresetAttributeSelector($name)
- getPresetItems() : array<string|int, CSItemApiItem>
- Retrieves a list of api items that was configured with the preset in a field that previously was added with $this->addPresetItemSelector($name)
- getPresetTranslatableLanguageShortNames() : array<string|int, mixed>
- Return an array with available languages (ShortName)
- getPresetTranslatableValue() : string
- Provides a preset value for a given parameter that was previously added with @see addPresetTranslatableField
- getPresetValue() : mixed
- Provides a preset value for a given parameter
- getPreviewUrl() : string
- Tries to find a URL for this template by choosing the next best html export url
- getRendererName() : string
- Allows the template plugin to define the renderer which should be used to render the table.
- getTabTitleForGeneral() : string
- getTabTitleForTableData() : string
- getTabTitleForTableLayout() : string
- getTabTitleForTableOutput() : string
- getTabTitleForTableStructure() : string
- getTabTitleForTableTranslations() : string
- isAvailable() : bool
- This method is called to check, whether the plugin is available.
- isAvailableForContext() : bool
- Let the plugin decide, if it should be available for a given context the context may be any kind of object that a consumer of templates might pass with the expectation, that only matching templates should be returned. If no context is given, all templates can be returned
- isConfig() : bool
- Can be called to ask the template plugin is used in a config
- isPreset() : bool
- Can be called to ask the template plugin is used in a preset
- isVirtualTemplate() : bool
- Templates can have be declared virtual to serve only for inheritance purposes The default way to declare a template as virtual is to use the prefix "master" or use an initial underscore in the name
- removePresetField() : void
- Removes an existing field from the Preset Editor
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
- setPreset() : void
- Sets the preset
Constants
FLEX_ATTRIBUTE_OPTION_HALIGN
public
mixed
FLEX_ATTRIBUTE_OPTION_HALIGN
= 4
Tags
FLEX_ATTRIBUTE_OPTION_HEIGHT
public
mixed
FLEX_ATTRIBUTE_OPTION_HEIGHT
= 128
Tags
FLEX_ATTRIBUTE_OPTION_HIDE_UNITS
public
mixed
FLEX_ATTRIBUTE_OPTION_HIDE_UNITS
= 64
Tags
FLEX_ATTRIBUTE_OPTION_LABELS
public
mixed
FLEX_ATTRIBUTE_OPTION_LABELS
= 32
Tags
FLEX_ATTRIBUTE_OPTION_PREFIX
public
mixed
FLEX_ATTRIBUTE_OPTION_PREFIX
= 256
Tags
FLEX_ATTRIBUTE_OPTION_STYLES
public
mixed
FLEX_ATTRIBUTE_OPTION_STYLES
= 16
Tags
FLEX_ATTRIBUTE_OPTION_SUFFIX
public
mixed
FLEX_ATTRIBUTE_OPTION_SUFFIX
= 512
Tags
FLEX_ATTRIBUTE_OPTION_VALIGN
Attribute Configuration Options
public
mixed
FLEX_ATTRIBUTE_OPTION_VALIGN
= 2
Tags
FLEX_ATTRIBUTE_OPTION_WIDTH
public
mixed
FLEX_ATTRIBUTE_OPTION_WIDTH
= 8
Tags
FLEX_GUI_DATA_SELECTION_FOLDER
public
mixed
FLEX_GUI_DATA_SELECTION_FOLDER
= 2
Tags
FLEX_GUI_DATA_SELECTION_FOLDER_AND_LEAVES
Folder Options
public
mixed
FLEX_GUI_DATA_SELECTION_FOLDER_AND_LEAVES
= 0
Tags
FLEX_GUI_DATA_SELECTION_LEAVES
public
mixed
FLEX_GUI_DATA_SELECTION_LEAVES
= 1
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT
Context Selection Types
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT
= 30
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN
= 31
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN_OR_SELF
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN_OR_SELF
= 36
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN_REFERENCES
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_CHILDREN_REFERENCES
= 37
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_DOCUMENT_PRODUCTS
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_DOCUMENT_PRODUCTS
= 35
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_REFERENCES
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_REFERENCES
= 32
Tags
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_TABLE_ATTRIBUTE
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_CONTEXT_TABLE_ATTRIBUTE
= 34
Tags
FLEX_GUI_DATA_SELECTION_TYPE_FILE_ATTRIBUTE
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_FILE_ATTRIBUTE
= 21
Tags
FLEX_GUI_DATA_SELECTION_TYPE_FILE_ATTRIBUTE_BY_TAGS
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_FILE_ATTRIBUTE_BY_TAGS
= 23
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT
Product Selection Types
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT
= 0
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_ATTRIBUTE
Attribute Selection Types
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_ATTRIBUTE
= 20
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_ATTRIBUTE_BY_TAGS
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_ATTRIBUTE_BY_TAGS
= 22
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_CHILDREN
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_CHILDREN
= 1
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_CHILDREN_REFERENCES
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_CHILDREN_REFERENCES
= 6
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_FAVORITE
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_FAVORITE
= 3
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_REFERENCES
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_REFERENCES
= 2
Tags
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_TABLE_ATTRIBUTE
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_PRODUCT_TABLE_ATTRIBUTE
= 4
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW
Product Selection Types
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW
= 10
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_CHILDREN
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_CHILDREN
= 11
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_CHILDREN_REFERENCES
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_CHILDREN_REFERENCES
= 17
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_FAVORITE
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_FAVORITE
= 13
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_REFERENCES
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_REFERENCES
= 12
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_SELECTION
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_SELECTION
= 15
Tags
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_TABLE_ATTRIBUTE
public
mixed
FLEX_GUI_DATA_SELECTION_TYPE_VIEW_TABLE_ATTRIBUTE
= 14
Tags
FLEX_GUI_EDITOR_TAB_OUTPUT
public
mixed
FLEX_GUI_EDITOR_TAB_OUTPUT
= 'FLEX_GUI_EDITOR_TAB_OUTPUT'
Tags
FLEX_GUI_EDITOR_TAB_TABLE_DATA
Tab Names
public
mixed
FLEX_GUI_EDITOR_TAB_TABLE_DATA
= 'FLEX_GUI_EDITOR_TAB_TABLE_DATA'
Tags
FLEX_GUI_EDITOR_TAB_TABLE_LAYOUT
public
mixed
FLEX_GUI_EDITOR_TAB_TABLE_LAYOUT
= 'FLEX_GUI_EDITOR_TAB_TABLE_LAYOUT'
Tags
FLEX_GUI_EDITOR_TAB_TABLE_STRUCTURE
public
mixed
FLEX_GUI_EDITOR_TAB_TABLE_STRUCTURE
= 'FLEX_GUI_EDITOR_TAB_TABLE_STRUCTURE'
Tags
FLEX_GUI_EDITOR_TAB_TRANSLATIONS
public
mixed
FLEX_GUI_EDITOR_TAB_TRANSLATIONS
= 'FLEX_GUI_EDITOR_TAB_TRANSLATIONS'
Tags
FLEX_SORT_ASC_NATURAL
Sort Flags
public
mixed
FLEX_SORT_ASC_NATURAL
= 10
Tags
FLEX_SORT_ASC_NUMERIC
public
mixed
FLEX_SORT_ASC_NUMERIC
= 11
Tags
FLEX_SORT_ASC_STRING
public
mixed
FLEX_SORT_ASC_STRING
= 12
Tags
FLEX_SORT_DESC_NATURAL
public
mixed
FLEX_SORT_DESC_NATURAL
= 13
Tags
FLEX_SORT_DESC_NUMERIC
public
mixed
FLEX_SORT_DESC_NUMERIC
= 14
Tags
FLEX_SORT_DESC_STRING
public
mixed
FLEX_SORT_DESC_STRING
= 15
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()
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 —addContent()
This is the most important method to implement when defining your CSFlexTemplate
public
addContent(CSFlexTableContainer $container, CSFlexPreset $preset) : void
Parameters
- $container : CSFlexTableContainer
-
the table container
- $preset : CSFlexPreset
-
any parameters as CSFlexPreset object
Tags
Return values
void —addPresetAttributeConfigurations()
Allows to query further options about the selected attributes
public
addPresetAttributeConfigurations([mixed $name = 'Attributes' ][, array<string|int, mixed> $options = array() ][, string $tab = NULL ][, mixed $sectionPrefix = NULL ]) : mixed
Parameters
- $name : mixed = 'Attributes'
-
the variable name under which the preset attribute selector was added
- $options : array<string|int, mixed> = array()
-
an array with the possible options
- $tab : string = NULL
-
the tab under which the configuration should be added, default is the layout tab
The $options array must contain the option as key and possible further option specific parameter as value
The option key is one of the various CSFlexTemplatePlugin::FLEX_ATTRIBUTE_OPTION_XXX constants.
A typical $options array would be:
$options = array( self::FLEX_ATTRIBUTE_OPTION_WIDTH => TRUE, self::FLEX_ATTRIBUTE_OPTION_HEIGHT => TRUE, self::FLEX_ATTRIBUTE_OPTION_VALIGN => TRUE, self::FLEX_ATTRIBUTE_OPTION_HALIGN => TRUE, self::FLEX_ATTRIBUTE_OPTION_STYLES => array('bold' => 'Bold', 'italic' => 'Italic'), self::FLEX_ATTRIBUTE_OPTION_LABELS => TRUE, self::FLEX_ATTRIBUTE_OPTION_HIDE_UNITS => TRUE, self::FLEX_ATTRIBUTE_OPTION_PREFIX => TRUE, self::FLEX_ATTRIBUTE_OPTION_SUFFIX => TRUE, );
If no $options are provided some default options are used
- $sectionPrefix : mixed = NULL
Tags
Return values
mixed —addPresetAttributeSelector()
Adds input fields to the preset editor that allows the end user to configure attributes
public
addPresetAttributeSelector([string $name = 'Attributes' ][, string $label = NULL ]) : void
Parameters
- $name : string = 'Attributes'
-
the name under which the attributes should be retrieved later using the method getPresetAttributes($name)
- $label : string = NULL
-
the user interface label
Tags
Return values
void —addPresetField()
Call this function to add another preset field for this table
public
final addPresetField(string $name, string $label[, string $type = 'caption' ][, string $default = '' ][, string $tab = '' ][, array<string|int, mixed> $options = array() ][, mixed $section = '' ]) : void
Parameters
- $name : string
-
the name of the preset under which it can be retrieved later with getPresetValue
- $label : string
-
the visual label of the preset in the preset editor
- $type : string = 'caption'
-
the type like in a CSGuiEditor
- $default : string = ''
-
the default value to use if the preset is applied to a new record
- $tab : string = ''
-
the tab name under which the preset should show up, default is Template Options
- $options : array<string|int, mixed> = array()
-
further options like in a CSGuiEditor
- $section : mixed = ''
Tags
Return values
void —addPresetFields()
Overwrite this method to add your template specific configuration parameter
public
addPresetFields() : void
Tags
Return values
void —addPresetFieldsToEditor()
This method can will be used by CSGuiEditors to add your template specific preset fields to the editor
public
final addPresetFieldsToEditor([CSGuiEditor $editor = NULL ]) : mixed
Parameters
- $editor : CSGuiEditor = NULL
-
the CSGuiEditor or descendant
Tags
Return values
mixed —addPresetFileAttributeSelector()
Adds an input fields to the preset editor that allows the end user to select one or multiple file attributes
public
addPresetFileAttributeSelector([string $name = 'Attributes' ][, string $label = NULL ][, bool $multiple = FALSE ][, string $tab = '' ][, array<string|int, mixed> $options = array() ][, string $section = '' ]) : void
Parameters
- $name : string = 'Attributes'
-
the name under which the attributes should be retrieved later using the method getPresetAttributes($name)
- $label : string = NULL
-
optional label of the attribute selector
- $multiple : bool = FALSE
-
if TRUE the user can select a list of attributes
- $tab : string = ''
-
the tab name, if empty the standard data tab is used
- $options : array<string|int, mixed> = array()
-
additional options according to the @see CSGuiEditor documentation.
- $section : string = ''
-
the section name
Tags
Return values
void —addPresetItemSelector()
Adds input fields to the preset editor that allows the end user to configure items in several ways, like <ul> <li>selecting them directly</li> <li>selecting children of a product</li> <li>selecting referenced products of a product</li> </ul>
public
addPresetItemSelector([string $name = 'Products' ][, string $label = null ][, string $tab = '' ][, string $section = '' ]) : void
Parameters
- $name : string = 'Products'
-
the name under which the items should be retrieved later using the method getPresetItems($name)
- $label : string = null
-
the optional visible param name
- $tab : string = ''
-
the tab name, if empty the default data selection tab will be used
- $section : string = ''
-
the section name, if empty the label will be used
Tags
Return values
void —addPresetProductAttributeSelector()
Adds an input fields to the preset editor that allows the end user to select one or multiple product attributes
public
addPresetProductAttributeSelector([string $name = 'Attributes' ][, string $label = NULL ][, bool $multiple = FALSE ][, mixed $tab = '' ][, mixed $options = array() ][, mixed $section = '' ]) : void
Parameters
- $name : string = 'Attributes'
-
the name under which the attributes should be retrieved later using the method getPresetAttributes($name)
- $label : string = NULL
-
optional label of the attribute selector
- $multiple : bool = FALSE
-
if TRUE the user can select a list of attributes
- $tab : mixed = ''
- $options : mixed = array()
- $section : mixed = ''
Tags
Return values
void —addPresetTranslatableField()
Call this function to add another preset field for this table which should be translatable in the GUI
public
final addPresetTranslatableField(string $sName[, string $sLabel = '' ][, string $mDefault = '' ][, string $sTab = '' ][, array<string|int, mixed> $aOptions = array() ][, string $sSection = '' ]) : void
Parameters
- $sName : string
-
the name of the preset under which it can be retrieved later with getPresetValue
- $sLabel : string = ''
-
the visual label of the preset in the preset editor
- $mDefault : string = ''
-
the default value to use if the preset is applied to a new record
- $sTab : string = ''
-
the tab name under which the preset should show up, default is Template Options
- $aOptions : array<string|int, mixed> = array()
-
further options like in a CSGuiEditor
- $sSection : string = ''
-
the section to add the field on
Tags
Return values
void —applyPresetAttributeConfiguration()
Allows to apply attribute configurations to a cell
public
applyPresetAttributeConfiguration(CSFlexTableCell $cell, string $name, mixed $AttributeID[, array<string|int, mixed> $options = NULL ]) : mixed
Parameters
- $cell : CSFlexTableCell
-
the cell to which the configuration should be applied
- $name : string
-
the variable name under which the preset attribute selector was added
- $AttributeID : mixed
- $options : array<string|int, mixed> = NULL
-
an array with the possible options
The $options array must contain the option as key and possible further option specific parameter as value
The option key is one of the various CSFlexTemplatePlugin::FLEX_ATTRIBUTE_OPTION_XXX constants.
If no $options are provided the following options will be used:
$options = array( self::FLEX_ATTRIBUTE_OPTION_WIDTH => TRUE, self::FLEX_ATTRIBUTE_OPTION_HEIGHT => TRUE, self::FLEX_ATTRIBUTE_OPTION_VALIGN => TRUE, self::FLEX_ATTRIBUTE_OPTION_HALIGN => TRUE, self::FLEX_ATTRIBUTE_OPTION_STYLES => TRUE, self::FLEX_ATTRIBUTE_OPTION_HIDE_UNITS => TRUE, self::FLEX_ATTRIBUTE_OPTION_PREFIX => TRUE, self::FLEX_ATTRIBUTE_OPTION_SUFFIX => TRUE, );
Tags
Return values
mixed —createDefaultFolders()
Creates the Default Folders for a Template
public
createDefaultFolders() : void
Tags
Return values
void —createDefaultPreset()
This method can be overwritten to create a new sample preset for this template
public
createDefaultPreset() : CSFlexPreset
Tags
Return values
CSFlexPreset —the default preset
getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getAvailableContextClasses()
This method allows the template to define for which kind of records the template can be used
public
getAvailableContextClasses() : array<string|int, string>
Tags
Return values
array<string|int, string> —array with the names
getBaseName()
Returns the short name of the plugin without the FlexTemplate at the end
public
getBaseName() : string
Tags
Return values
string —the base name
getCellContent()
Optional method that allows the template developer to return a specific cell content directly
public
getCellContent(string $rowType, int $rowIndex, int $cellIndex, int $contentIndex) : string
In certain scenarios, e.g. when an generic InDesign placeholder directly requests a specific content of a specific cell of specific row, the developer can overwrite this method to provide the content.
If this method remains returning NULL then the framework will automatically render the complete table again through the addContent Method and pick the content block out itself. This of course may take more time.
Note, that this method is not called when the whole table is requested, so make sure to also always overwrite the addContent method.
Parameters
- $rowType : string
-
The type of the row as one of the following constants: ROW_TYPE_DATA for a data row, ROW_TYPE_HEADER for a header row, ROW_TYPE_FOOTER for a footer row
- $rowIndex : int
-
The index of the row in the table starting with 0
- $cellIndex : int
-
The index of the col in the row starting with 0
- $contentIndex : int
-
The index of the content object in the cell starting with 0
Tags
Return values
string —the content of the requested cell content block
getCSSFiles()
Collects all CSS Files which have the same name as the Template File for the current class and all parents
public
getCSSFiles([mixed $base = 'external' ]) : array<string|int, string>
Parameters
- $base : mixed = 'external'
Tags
Return values
array<string|int, string> —the css file links
getDefaultCSSFile()
Searches a CSS File which has the same name as the Template File Note: You can use the method @see getDefaultCSSFiles to collect the files of the parent templates as well
public
getDefaultCSSFile([mixed $base = 'external' ][, mixed $createIfMissing = FALSE ]) : string
Parameters
- $base : mixed = 'external'
- $createIfMissing : mixed = FALSE
Tags
Return values
string —the css file link
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()
public
getPluginName() : mixed
Tags
Return values
mixed —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
getPreset()
Returns the current preset to be used
public
final getPreset() : CSFlexPreset
Tags
Return values
CSFlexPreset —the preset
getPresetAttribute()
Retrieves the attribute or first of the attributes that previously was added with $this->addPresetAttributeSelector($name) or $this->addPresetProductAttributeSelector($name, $label, $multiple, $section)
public
getPresetAttribute([bool $name = 'Attributes' ][, bool $required = FALSE ]) : array<string|int, CSPmsField>
Parameters
- $name : bool = 'Attributes'
-
the variable name under which the preset was stored
- $required : bool = FALSE
-
if TRUE the param must be set
Tags
Return values
array<string|int, CSPmsField> —the selected attributes
getPresetAttributeConfiguration()
Retrieves one of the attribute configurations
public
getPresetAttributeConfiguration(mixed $name, mixed $AttributeID, mixed $option) : string
Parameters
- $name : mixed
-
the name under which the configuration was added
- $AttributeID : mixed
-
the specific AttributeID for which the configuration is needed
- $option : mixed
-
one of the self::FLEX_ATTRIBUTE_OPTION_XXX constants
Tags
Return values
string —the requested value
getPresetAttributePrefix()
This method will return the prefix (The variable name under which the preset was stored) for the plugin.
public
getPresetAttributePrefix([mixed $sPresetAttributePrefix = 'Attributes' ]) : string
It will be overridden if needed in the plugin.
Parameters
- $sPresetAttributePrefix : mixed = 'Attributes'
Tags
Return values
string —preset prefix.
getPresetAttributes()
Retrieves a list of attributes that are configured with the preset in a field that previously was added with $this->addPresetAttributeSelector($name)
public
getPresetAttributes([string $sFieldName = 'Attributes' ][, bool $bRequired = false ]) : array<string|int, CSItemApiField>
Parameters
- $sFieldName : string = 'Attributes'
-
The variable name under which the preset was stored
- $bRequired : bool = false
-
If TRUE the param must be set
Tags
Return values
array<string|int, CSItemApiField> —the selected attributes
getPresetAttributesAsRowHeader()
Retrieves a list of attributes that was configured with the preset in a field that previously was added with $this->addPresetAttributeSelector($name)
public
getPresetAttributesAsRowHeader() : array<string|int, CSPmsField>
Tags
Return values
array<string|int, CSPmsField> —getPresetItems()
Retrieves a list of api items that was configured with the preset in a field that previously was added with $this->addPresetItemSelector($name)
public
getPresetItems([string $sPresetFieldName = 'Products' ][, bool $bIsRequired = false ][, bool $bIgnoreSelection = false ]) : array<string|int, CSItemApiItem>
Parameters
- $sPresetFieldName : string = 'Products'
-
the variable name under which the preset was stored
- $bIsRequired : bool = false
-
if TRUE the param must be set
- $bIgnoreSelection : bool = false
-
if TRUE the sub selection in the user interface is ignored
Tags
Return values
array<string|int, CSItemApiItem> —the selected items
getPresetTranslatableLanguageShortNames()
Return an array with available languages (ShortName)
public
final getPresetTranslatableLanguageShortNames() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getPresetTranslatableValue()
Provides a preset value for a given parameter that was previously added with @see addPresetTranslatableField
public
final getPresetTranslatableValue(string $name[, string $default = NULL ]) : string
Parameters
- $name : string
-
the name of the preset value
- $default : string = NULL
-
the value to use if the parameter evaluates to FALSE
Tags
Return values
string —the value
getPresetValue()
Provides a preset value for a given parameter
public
final getPresetValue(string $name[, string $default = NULL ][, bool $required = FALSE ]) : mixed
Parameters
- $name : string
-
the name of the preset value
- $default : string = NULL
-
the value to use if the parameter evaluates to FALSE
- $required : bool = FALSE
-
if true the value must be set
Tags
Return values
mixed —the value
getPreviewUrl()
Tries to find a URL for this template by choosing the next best html export url
public
getPreviewUrl([string $sBase = 'external' ]) : string
Parameters
- $sBase : string = 'external'
-
the base for the URL like 'external' or 'relative'
Tags
Return values
string —the URL if found
getRendererName()
Allows the template plugin to define the renderer which should be used to render the table.
public
getRendererName(CSFlexPreset $preset) : string
Parameters
- $preset : CSFlexPreset
-
The flex preset that should be used for the current table.
Tags
Return values
string —The name of the renderer. This is the name portion between CSFlex[...]TableRenderer. The first letter is assumed to be capital, all other letters are not touched and used as returned by this method. Keep in mind that this class has to be available in the script scope.
getTabTitleForGeneral()
public
static getTabTitleForGeneral() : string
Tags
Return values
string —the translated tab title of the general tab
getTabTitleForTableData()
public
static getTabTitleForTableData() : string
Tags
Return values
string —the translated tab title of the table data tab
getTabTitleForTableLayout()
public
static getTabTitleForTableLayout() : string
Tags
Return values
string —the translated tab title of the translations tab
getTabTitleForTableOutput()
public
static getTabTitleForTableOutput() : string
Tags
Return values
string —the translated tab title of the translations tab
getTabTitleForTableStructure()
public
static getTabTitleForTableStructure() : string
Tags
Return values
string —the translated tab title of the table structure tab
getTabTitleForTableTranslations()
public
static getTabTitleForTableTranslations() : string
Tags
Return values
string —the translated tab title of the translations tab
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
isAvailableForContext()
Let the plugin decide, if it should be available for a given context the context may be any kind of object that a consumer of templates might pass with the expectation, that only matching templates should be returned. If no context is given, all templates can be returned
public
isAvailableForContext(mixed $context) : bool
Parameters
- $context : mixed
-
the context object
Tags
Return values
bool —TRUE if the plugin should be available for the context
isConfig()
Can be called to ask the template plugin is used in a config
public
isConfig() : bool
Tags
Return values
bool —TRUE if the object is a config
isPreset()
Can be called to ask the template plugin is used in a preset
public
isPreset() : bool
Tags
Return values
bool —TRUE if the object is a preset
isVirtualTemplate()
Templates can have be declared virtual to serve only for inheritance purposes The default way to declare a template as virtual is to use the prefix "master" or use an initial underscore in the name
public
isVirtualTemplate() : bool
Tags
Return values
bool —removePresetField()
Removes an existing field from the Preset Editor
public
final removePresetField(string $name) : void
Parameters
- $name : string
-
the name of the preset field
Tags
Return values
void —resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
Tags
Return values
mixed —setPreset()
Sets the preset
public
setPreset(CSFlexPreset $preset) : void
Parameters
- $preset : CSFlexPreset
