CONTENIDO standard code generator.

package Core
subpackage Content Type

 Methods

__construct()

__construct() 
Inherited
inherited_from \cCodeGeneratorAbstract::__construct()

Generates the code for a specific article (article for a client in a language).

_generate($contype) : string

Parameters

$contype

Returns

stringThe generated code

Generates the code for a specific article (article for a client in a language).

generate(int $idcat, int $idart, int $lang, int $client, bool $layout, bool $save, $contype) : string
Inherited
inherited_from \cCodeGeneratorAbstract::generate()

Parameters

$idcat

int

$idart

int

$lang

int

$client

int

$layout

bool

$save

bool

Flag to persist generated code

$contype

Exceptions

\cInvalidArgumentException if an article with the given idart and idlang can not be loaded

Returns

stringGenerated code or error code '0601' if no template configuration was found for category or article.

Setter for debug property

setDebug(bool $debug) 
Inherited
inherited_from \cCodeGeneratorAbstract::setDebug()

Parameters

$debug

bool

Setter for frontend debug options (see $frontend_debug in __FRONTEND_PATH__/data/config/config.php located in clients frontend directory)

setFrontendDebugOptions(array $debugOptions) 
Inherited
inherited_from \cCodeGeneratorAbstract::setFrontendDebugOptions()

Parameters

$debugOptions

Outputs passed message, if debug is enabled

_debug(string $msg) 
Inherited
inherited_from \cCodeGeneratorAbstract::_debug()

Parameters

$msg

string

Collects basic meta tags an returns them.

_getBasicMetaTags() : array
global array $encoding

Returns

arrayList of assozative meta tag values

Returns the classname for a content type.

_getContentTypeClassName(string $type) : string
Inherited
inherited_from \cCodeGeneratorAbstract::_getContentTypeClassName()

Parameters

$type

string

Content type, e. g. CMS_HTMLHEAD

Returns

stringThe classname e. g. cContentTypeHtmlhead for content type CMS_HTMLHEAD

Returns the full path to the include file name of a content type.

_getContentTypeCodeFilePathName(string $type) : string
Inherited
inherited_from \cCodeGeneratorAbstract::_getContentTypeCodeFilePathName()

Parameters

$type

string

Content type, e. g. CMS_HTMLHEAD

Returns

stringThe full path e. g. {path_to_contenido_includes}/type/code/include.CMS_HTMLHEAD.code.php for content type CMS_HTMLHEAD

Returns the template configuration id, either by configured article or by configured category.

_getTemplateConfigurationId() : int
Inherited
inherited_from \cCodeGeneratorAbstract::_getTemplateConfigurationId()

Returns

intnull

Returns array containing used layout, template and template name

_getTemplateData() : array
Inherited
global array $cfg
inherited_from \cCodeGeneratorAbstract::_getTemplateData()

Returns

arrayAsooziative array like array('idlay' => (int), 'idtpl' => (int), 'name' => (string))

Returns array of all CMS_.

_getUsedCmsTypesData() : array
Inherited

.. vars being used by current article and language

inherited_from \cCodeGeneratorAbstract::_getUsedCmsTypesData()

Returns

arraylike $arr[type][typeid] = value;

Replaces container tag in layout against the parsed container code (module code).

_processCmsContainer(int $containerId) 
Inherited
inherited_from \cCodeGeneratorAbstract::_processCmsContainer()

Parameters

$containerId

int

Container id

Processes replacements of all existing CMS_.

_processCmsTags(array $contentList, bool $saveKeywords) 
Inherited

.. tags within passed code

inherited_from \cCodeGeneratorAbstract::_processCmsTags()

Parameters

$contentList

array

Assoziative list of CMS variables

$saveKeywords

bool

Flag to save collected keywords during replacement process.

Replaces all container/module configuration tags (CMS_VALUE[n] values) against their settings.

_processCmsValueTags(int $containerId, string $containerCfg) : string
Inherited
inherited_from \cCodeGeneratorAbstract::_processCmsValueTags()

Parameters

$containerId

int

Container id

$containerCfg

string

A string being formatted like concatenated query parameter, e. g. param1=value1¶m2=value2...

Returns

stringConcatenated PHP code containing CMS_VALUE variables and their values

Processes and adds or replaces all meta tags for an article.

_processCodeMetaTags() 

Calls also the CEC 'Contenido.Content.CreateMetatags' for user defined meta tags creation.

Processes and adds or replaces title tag for an article.

_processCodeTitleTag() 

Calls also the CEC 'Contenido.Content.CreateTitletag' for user defined title creation.

Extends container code by adding several debug features, if enabled and configured.

_processFrontendDebug(int $containerId, array $module) 
Inherited
inherited_from \cCodeGeneratorAbstract::_processFrontendDebug()

Parameters

$containerId

int

Container id

$module

array

Recordset as assoziative array of related module (container code)

Will be invoked, if code generation wasn't able to find a configured article or category.

_processNoConfigurationError() 

Creates a error message as and writes this into the code cache table.

Resets module related variables

_resetModule() 
Inherited
inherited_from \cCodeGeneratorAbstract::_resetModule()

Saves the generated code (if layout flag is false and save flag is true)

_saveGeneratedCode(string $code, int $idcatart) 
global array $cfgClient

Parameters

$code

string

The generated code

$idcatart

int

Category article id

returns the artlang object

getArtLangObject() 
Inherited
inherited_from \cCodeGeneratorAbstract::getArtLangObject()

 Properties

 

$_client : int
Inherited
inherited_from \cCodeGeneratorAbstract::$$_client
 

$_cssData : string
Inherited
inherited_from \cCodeGeneratorAbstract::$$_cssData
 

$_db : \cDb
Inherited
inherited_from \cCodeGeneratorAbstract::$$_db
 

$_debug : bool
Inherited
inherited_from \cCodeGeneratorAbstract::$$_debug
 

$_feDebugOptions : array
Inherited
inherited_from \cCodeGeneratorAbstract::$$_feDebugOptions
 

$_idart : int
Inherited
inherited_from \cCodeGeneratorAbstract::$$_idart
 

$_idartlang : int
Inherited
inherited_from \cCodeGeneratorAbstract::$$_idartlang
 

$_idcat : int
Inherited
inherited_from \cCodeGeneratorAbstract::$$_idcat
 

$_jsData : string
Inherited
inherited_from \cCodeGeneratorAbstract::$$_jsData
 

$_lang : int
Inherited
inherited_from \cCodeGeneratorAbstract::$$_lang
 

$_layout : bool
Inherited
inherited_from \cCodeGeneratorAbstract::$$_layout
 

$_layoutCode : string
Inherited

Initially with container tags which will be replaced against module outputs.

inherited_from \cCodeGeneratorAbstract::$$_layoutCode
 

$_moduleCode : string
Inherited
inherited_from \cCodeGeneratorAbstract::$$_moduleCode
 

$_modulePrefix : array
Inherited
inherited_from \cCodeGeneratorAbstract::$$_modulePrefix
 

$_moduleSuffix : array
Inherited
inherited_from \cCodeGeneratorAbstract::$$_moduleSuffix
 

$_pageTitle : string
Inherited
inherited_from \cCodeGeneratorAbstract::$$_pageTitle
 

$_save : bool
Inherited
inherited_from \cCodeGeneratorAbstract::$$_save
 

$_tplName : string
Inherited
inherited_from \cCodeGeneratorAbstract::$$_tplName
 

$oArtLang : array
Inherited
inherited_from \cCodeGeneratorAbstract::$$oArtLang