Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cCodeGeneratorAbstract
  • cCodeGeneratorFactory
  • cCodeGeneratorStandard
  • cContentTypeAbstract
  • cContentTypeAbstractTabbed
  • cContentTypeDate
  • cContentTypeFilelist
  • cContentTypeHead
  • cContentTypeHtml
  • cContentTypeHtmlhead
  • cContentTypeImg
  • cContentTypeImgdescr
  • cContentTypeImgeditor
  • cContentTypeLink
  • cContentTypeLinkdescr
  • cContentTypeLinkeditor
  • cContentTypeLinktarget
  • cContentTypeRaw
  • cContentTypeTeaser
  • cContentTypeText
  • cTypeGenerator
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cCodeGeneratorAbstract

Abstract CONTENIDO code generator class.

Direct known subclasses

cCodeGeneratorStandard
Abstract
Package: Core\ContentType
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Murat Purc <murat@purc.de>
Located at classes/code_generator/class.code.generator.abstract.php
Methods summary
public
# __construct( )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

public
# setFrontendDebugOptions( array $debugOptions )

Setter for frontend debug options.

Setter for frontend debug options.

Parameters

$debugOptions
array
$debugOptions

See

$frontend_debug in __FRONTEND_PATH__/data/config/config.php located in clients frontend directory
public string
# generate( integer $idcat, integer $idart, integer $lang, integer $client, boolean $layout = false, boolean $save = true, boolean $contype = true, boolean $editable = true, integer|null $version = NULL )

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

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

Parameters

$idcat
integer
$idcat
$idart
integer
$idart
$lang
integer
$lang
$client
integer
$client
$layout
boolean
$layout [optional] This params purpose is unclear.
$save
boolean
$save [optional] Flag to persist generated code.
$contype
boolean
$contype [optional] Flag to enable/disable replacement of CMS_TAGS[].
$editable
boolean
$editable [optional]
$version
integer|null
$version [optional]

Returns

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

Throws

cDbException
cException
cInvalidArgumentException
If an article with the given idart and idlang can not be loaded.
abstract public string
# _generate( boolean $contype = true, boolean $editable = true, boolean $version = NULL )

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

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

Parameters

$contype
boolean
$contype [optional] Flag to enable/disable replacement of CMS_TAGS[].
$editable
boolean
$editable [optional]
$version
boolean
$version [optional]

Returns

string
The generated code.
protected integer|null
# _getTemplateConfigurationId( )

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

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

Returns

integer|null

Throws

cInvalidArgumentException
abstract protected
# _processNoConfigurationError( integer $idcatart )

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

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

Parameters

$idcatart
integer
$idcatart Category article id.

Todo

This method is not required as it is only used in the standard code generator.
protected array
# _getTemplateData( )

Returns array containing used layout, template and template name.

Returns array containing used layout, template and template name.

Returns

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

Throws

cDbException
cInvalidArgumentException
protected
# _processCmsTags( array $contentList, boolean $saveKeywords = true, boolean $editable = true )

Processes replacements of all existing CMS_* tags within passed code.

Processes replacements of all existing CMS_* tags within passed code.

Parameters

$contentList
array
$contentList Associative list of CMS variables.
$saveKeywords
boolean
$saveKeywords [optional] Flag to save collected keywords during replacement process.
$editable
boolean
$editable [optional]

Throws

cDbException
cException
abstract protected
# _processCodeTitleTag( )

Processes and adds or replaces title tag for an article.

Processes and adds or replaces title tag for an article.

abstract protected
# _processCodeMetaTags( )

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

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

protected string
# _processCmsValueTags( integer $containerNumber, string $containerCfg )

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

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

Parameters

$containerNumber
integer
$containerNumber Container number
$containerCfg
string
$containerCfg A string being formatted like concatenated query parameter, e.g. param1=value1&param2=value2...

Returns

string
Concatenated PHP code containing CMS_VALUE variables and their values
protected
# _processFrontendDebug( integer $containerNumber, array $module )

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

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

Parameters

$containerNumber
integer
$containerNumber Container number (the id attribute in container tag).
$module
array
$module Recordset as assoziative array of related module (container code).

Throws

cDbException
cInvalidArgumentException
protected
# _processCmsContainer( integer $containerNumber )

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

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

Parameters

$containerNumber
integer
$containerNumber Container number (the id attribute in container tag).
protected array
# _getUsedCmsTypesData( boolean $editable = true, integer|null $version = NULL )

Returns array of all CMS_* vars being used by current article and language

Returns array of all CMS_* vars being used by current article and language

Parameters

$editable
boolean
$editable [optional]
$version
integer|null
$version [optional]

Returns

array
like $arr[type][typeid] = value;

Throws

cDbException
protected
# _resetModule( )

Resets module related variables.

Resets module related variables.

protected string
# _getContentTypeClassName( string $type )

Returns the classname for a content type.

Returns the classname for a content type.

Parameters

$type
string
$type Content type, e.g. CMS_HTMLHEAD.

Returns

string
The classname e.g. cContentTypeHtmlhead for content type CMS_HTMLHEAD.
protected string
# _getContentTypeCodeFilePathName( string $type )

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

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

Parameters

$type
string
$type Content type, e.g. CMS_HTMLHEAD

Returns

string
The full path e.g. {path_to_contenido_includes}/type/code/include.CMS_HTMLHEAD.code.php for content type CMS_HTMLHEAD
protected cApiArticleLanguage
# getArtLangObject( )

Getter for article language.

Getter for article language.

Returns

cApiArticleLanguage
The aggregated article language object.

Todo

deprecate me
Properties summary
protected cDb $_db
#

CONTENIDO database instance.

CONTENIDO database instance.

protected array $_feDebugOptions array()
#

Frontend debug options.

Frontend debug options.

See

$frontend_debug in __FRONTEND_PATH__/data/config/config.php
protected string $_cssData ''
#

Collected CSS data for current template.

Collected CSS data for current template.

protected string $_jsData ''
#

Collected JS data for current template.

Collected JS data for current template.

protected string $_tplName ''
#

Template name.

Template name.

protected integer $_idcat
#

Category id.

Category id.

protected integer $_idart
#

Article id.

Article id.

protected integer $_lang
#

Language id.

Language id.

protected integer $_client
#

Client id.

Client id.

protected boolean $_layout
#

Flag to process layout.

Flag to process layout.

protected boolean $_save
#

Flag to persist generated code.

Flag to persist generated code.

protected integer $_idartlang
#

Article language id.

Article language id.

protected string $_pageTitle
#

Page title. Usually from article language table.

Page title. Usually from article language table.

protected string $_layoutCode ''
#

Layout code. Initially with container tags which will be replaced by module output.

Layout code. Initially with container tags which will be replaced by module output.

protected array $_modulePrefix array()
#

Module output code prefix.

Module output code prefix.

protected string $_moduleCode ''
#

Module output code.

Module output code.

protected array $_moduleSuffix array()
#

Module output code suffix.

Module output code suffix.

protected cApiArticleLanguage $_oArtLang
#

Article language.

Article language.

CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0