Contentserv PHP API

CSFlex
in package

Central API to create Flex Tables

Tags
since

CS15.0

access

public

Table of Contents

FORMAT_HTML  = 'html'
FORMAT_INDD  = 'indd'
createConfig()  : CSFlexConfig
Creates a new empty CSFlexConfig object base on a Preset
createPreset()  : CSFlexPreset
Creates a new empty CSFlexPreset object
createPresetFromConfig()  : CSFlexPreset
Creates a new Preset on the basis of an existing Config
createTemplate()  : mixed
createTemplateFolder()  : array<string|int, mixed>
Creates a new Flex Template based on the standard hello world example
duplicateConfig()  : CSFlexConfig
Creates a new CSFlexConfig object base on another Config
format2mime()  : string
Gives the HTTP MIME-Type for a given format
getAllFormats()  : array<string|int, mixed>
Method that returns all currently available rendering formats
getAvailableFormats()  : array<string|int, mixed>
Returns all supported formats
getAvailableLanguageNames()  : array<string|int, string>
Utility Method that returns an array with LanguageID and LanguageShortName
getAvailablePresetLabelsForContext()  : array<string|int, mixed>
Returns the possible Flex Preset labels for a context
getAvailablePresetNamesForContext()  : array<string|int, mixed>
Returns the possible Flex Preset names for a context
getAvailablePresetsForContext()  : array<string|int, CSFlexPreset>
Returns the possible Flex Presets as array
getConfig()  : CSFlexConfig
Returns the Flex Config for the given ID
getModuleBaseDirectory()  : string
getPreset()  : CSFlexPreset
Returns the Flex Preset for the given ID
getPresets()  : array<string|int, CSFlexPreset>
Returns all Flex presets available for a template
getPreviewZoomLevels()  : array<string|int, string>
Defines the possible zoom levels as used by the flex options or zoom dropdown
getProductIcon()  : string
Retrieves the product icon
getTemplatePlugin()  : CSFlexTemplatePlugin
Returns the plugin for a given Flex Template name
getTemplatePluginNames()  : array<string|int, mixed>
Returns the possible Flex Template names for a context
getTemplatePlugins()  : array<string|int, mixed>
Returns the possible Flex Template plugins as array
getUnsupportedMessage()  : string
Tells the user why the Flex Module is not supported on this server.
isAvailable()  : bool
Tells if the Flex Module is licensed and properly installed
isSupported()  : bool
Tells if the Flex Module is supported for the Servers PHP Version, which must be at least 5.5
makeRenderer()  : CSFlexTableRenderer
Creates a new Renderer for the given format and table container
renderTableContainer()  : string
Renders a table container in a given format with a given preset
storeContextValuesToFlexConfig()  : CSFlexConfig
Stores context values to flex config
updatePresetFromConfig()  : CSFlexPreset
Overwrites an preset by a config based on this preset

Constants

FORMAT_HTML

public mixed FORMAT_HTML = 'html'
Tags

FORMAT_INDD

public mixed FORMAT_INDD = 'indd'
Tags

Methods

createConfig()

Creates a new empty CSFlexConfig object base on a Preset

public static createConfig(int $iPresetId) : CSFlexConfig
Parameters
$iPresetId : int
Tags
Return values
CSFlexConfig

createPresetFromConfig()

Creates a new Preset on the basis of an existing Config

public static createPresetFromConfig(string $sFlexPresetName, int $iFlexConfigId) : CSFlexPreset
Parameters
$sFlexPresetName : string

the name of the new preset

$iFlexConfigId : int

the config id

Tags
Return values
CSFlexPreset

the new CSFlexPreset created

createTemplate()

public static createTemplate(mixed $pluginPrefix, CSFlexPreset $preset) : mixed
Parameters
$pluginPrefix : mixed
$preset : CSFlexPreset
Tags
Return values
mixed

createTemplateFolder()

Creates a new Flex Template based on the standard hello world example

public static createTemplateFolder(mixed $prefix) : array<string|int, mixed>
Parameters
$prefix : mixed
Tags
Return values
array<string|int, mixed>

duplicateConfig()

Creates a new CSFlexConfig object base on another Config

public static duplicateConfig(mixed $ConfigID) : CSFlexConfig

This method can be used to overwrite for example an inherited config

Parameters
$ConfigID : mixed
Tags
Return values
CSFlexConfig

format2mime()

Gives the HTTP MIME-Type for a given format

public static format2mime(string $format) : string
Parameters
$format : string

like html

Tags
access

public

Return values
string

the mime type like text/html

getAllFormats()

Method that returns all currently available rendering formats

public static getAllFormats() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

with name and label of the rendering format

getAvailableFormats()

Returns all supported formats

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

getAvailableLanguageNames()

Utility Method that returns an array with LanguageID and LanguageShortName

public static getAvailableLanguageNames([bool $bIncludeIdsAsKeys = true ][, bool $bFormattedLabel = false ]) : array<string|int, string>
Parameters
$bIncludeIdsAsKeys : bool = true

If the LanguageIds should be in the return array as Keys.

$bFormattedLabel : bool = false

If set to TRUE the values are formatted and enriched with Language FullName

Tags
Return values
array<string|int, string>

the Language Names

getAvailablePresetLabelsForContext()

Returns the possible Flex Preset labels for a context

public static getAvailablePresetLabelsForContext([mixed $mContext = null ][, string $sSortOrder = '' ]) : array<string|int, mixed>
Parameters
$mContext : mixed = null

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

$sSortOrder : string = ''

The SQL sort order for the preset labels. Default sort order: "Name ASC"

Tags
Return values
array<string|int, mixed>

with preset labels as values and preset IDs as keys

getAvailablePresetNamesForContext()

Returns the possible Flex Preset names for a context

public static getAvailablePresetNamesForContext([mixed $mContext = null ][, string $sSortOrder = 'Name ASC' ]) : array<string|int, mixed>
Parameters
$mContext : mixed = null

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

$sSortOrder : string = 'Name ASC'

sort order

Tags
Return values
array<string|int, mixed>

with preset names as values and preset IDs as keys

getAvailablePresetsForContext()

Returns the possible Flex Presets as array

public static getAvailablePresetsForContext([mixed $context = NULL ][, string $sort = 'Name ASC' ]) : array<string|int, CSFlexPreset>
Parameters
$context : mixed = NULL

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

$sort : string = 'Name ASC'

the sort order

Tags
Return values
array<string|int, CSFlexPreset>

array with CSFlexPresetIDs as keys and CSFlexPreset as values

getConfig()

Returns the Flex Config for the given ID

public static getConfig(int $FlexconfigID) : CSFlexConfig
Parameters
$FlexconfigID : int

the ID of the config

Tags
Return values
CSFlexConfig

getModuleBaseDirectory()

public static getModuleBaseDirectory() : string
Tags
access

public

Return values
string

the location of the flex module

getPreset()

Returns the Flex Preset for the given ID

public static getPreset([int $FlexpresetID = NULL ]) : CSFlexPreset
Parameters
$FlexpresetID : int = NULL

the ID of the preset

Tags
Return values
CSFlexPreset

getPresets()

Returns all Flex presets available for a template

public static getPresets([string $template = NULL ][, string $sort = 'Name ASC' ][, mixed $includeDisabled = FALSE ]) : array<string|int, CSFlexPreset>
Parameters
$template : string = NULL

the template name

$sort : string = 'Name ASC'

the sort order

$includeDisabled : mixed = FALSE
Tags
access

public

Return values
array<string|int, CSFlexPreset>

array of CSFlexPreset objects

getPreviewZoomLevels()

Defines the possible zoom levels as used by the flex options or zoom dropdown

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

array with the numeric zoom values as keys and the description as value

getProductIcon()

Retrieves the product icon

public static getProductIcon([string $type = 'table' ]) : string
Parameters
$type : string = 'table'

the subtype

Tags
access

public

Return values
string

getTemplatePlugin()

Returns the plugin for a given Flex Template name

public static getTemplatePlugin(string $template) : CSFlexTemplatePlugin
Parameters
$template : string

the template plugin prefix, like pivot for a PivotFlexTemplate

Tags
Return values
CSFlexTemplatePlugin

the plugin if found

getTemplatePluginNames()

Returns the possible Flex Template names for a context

public static getTemplatePluginNames([mixed $context = NULL ]) : array<string|int, mixed>
Parameters
$context : mixed = NULL

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

Tags
Return values
array<string|int, mixed>

with template names as values and upper case first names as values

getTemplatePlugins()

Returns the possible Flex Template plugins as array

public static getTemplatePlugins([mixed $context = NULL ]) : array<string|int, mixed>
Parameters
$context : mixed = NULL

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

Tags
Return values
array<string|int, mixed>

with plugins as values and prefixes as names

getUnsupportedMessage()

Tells the user why the Flex Module is not supported on this server.

public static getUnsupportedMessage() : string
Tags
Return values
string

isAvailable()

Tells if the Flex Module is licensed and properly installed

public static isAvailable() : bool
Tags
access

public

Return values
bool

TRUE if available

isSupported()

Tells if the Flex Module is supported for the Servers PHP Version, which must be at least 5.5

public static isSupported() : bool
Tags
Return values
bool

renderTableContainer()

Renders a table container in a given format with a given preset

public static renderTableContainer(CSFlexTableContainer $container[, string $format = self::FORMAT_HTML ][, CSFlexPreset $preset = null ]) : string
Parameters
$container : CSFlexTableContainer

the flex table container

$format : string = self::FORMAT_HTML

as one of the CSFlex::FORMAT_* constants

$preset : CSFlexPreset = null

the flex preset or config

Tags
Return values
string

the rendered container in the requested format

storeContextValuesToFlexConfig()

Stores context values to flex config

public static storeContextValuesToFlexConfig(CSFlexConfig $oFlexConfig[, int $iContextID = null ][, string $sContextClass = null ][, int $iContextLanguage = null ][, int $iContextAttributeID = null ][, int $iContextDocumentID = null ][, bool $bDisabled = false ]) : CSFlexConfig
Parameters
$oFlexConfig : CSFlexConfig

Object of Flex configuration

$iContextID : int = null

Id of context item

$sContextClass : string = null

Context class of flex config

$iContextLanguage : int = null

Context language of flex config

$iContextAttributeID : int = null

Context attribute id of flex config

$iContextDocumentID : int = null

Context document id of flex config

$bDisabled : bool = false

Disable or enable flex config.

Tags
Return values
CSFlexConfig

updatePresetFromConfig()

Overwrites an preset by a config based on this preset

public static updatePresetFromConfig(int $ConfigID) : CSFlexPreset
Parameters
$ConfigID : int

the config ID

Tags
throws
BadFunctionCallException

if the config does not exist or has no preset assigned

Return values
CSFlexPreset

the updated preset


        

Search results