Abstract content type from which every content type should inherit.

package Core
subpackage Content Type

 Methods

Initialises class attributes with values from cRegistry.

__construct(string $rawSettings, integer $id, array $contentTypes) : void

Parameters

$rawSettings

string

the raw settings in an XML structure or as plaintext

$id

integer

ID of the content type, e.g. 3 if CMS_TEASER[3] is used

$contentTypes

array

array containing the values of all content types

Builds an array with directory information from the given upload path.

buildDirectoryList(string $uploadPath) : array

Parameters

$uploadPath

string

path to upload directory (optional, default: root upload path of client)

Returns

arraywith directory information (keys: name, path, sub)

Generates a directory list from the given directory information (which is typically built by {@link cContentTypeAbstract::buildDirectoryList}).

generateDirectoryList(array $dirs) : string

Parameters

$dirs

array

directory information

Returns

stringHTML code showing a directory list

Generates the code which should be shown if this content type is edited.

generateEditCode() : string

Returns

stringescaped HTML code which should be shown if content type is edited

Generates the code which should be shown if this content type is shown in the frontend.

generateViewCode() : string

Returns

stringescaped HTML code which sould be shown if content type is shown in frontend

Since the content type code is evaled by php, the code has to be encoded.

_encodeForOutput(string $code) : string

Parameters

$code

string

code to encode

Returns

stringencoded code

Checks whether the directory defined by the given directory information is the currently active directory.

_isActiveDirectory(array $dirData) : boolean

Overwrite in subclasses if you use generateDirectoryList!

Parameters

$dirData

array

directory information

Returns

booleanwhether the directory is the currently active directory

Checks whether the given $subDir is a subdirectory of the given $dir.

_isSubdirectory(string $subDir, string $dir) : boolean

Parameters

$subDir

string

the potential subdirectory

$dir

string

the parent directory

Returns

booleanwhether the given $subDir is a subdirectory of $dir

Reads all settings from the $_rawSettings attribute (XML or plaintext) and stores them in the $_settings attribute (associative array or plaintext).

_readSettings() : void

Checks whether the directory defined by the given directory information should be shown expanded.

_shouldDirectoryBeExpanded(array $dirData) : boolean

Overwrite in subclasses if you use getDirectoryList!

Parameters

$dirData

array

directory information

Returns

booleanwhether the directory should be shown expanded

Stores all values from the $_POST array in the $_settings attribute (associative array) and saves them in the database (XML).

_storeSettings() : void

 Properties

 

$_cfg : array
 

$_cfgClient : array
 

$_client : integer
 

$_contentTypes : array
 

$_formFields : array
 

$_id : integer

3 if CMS_TEASER[3] is used.

 

$_idArt : integer
 

$_idArtLang : integer
 

$_idCat : integer
 

$_lang : integer
 

$_prefix : string

'teaser'.

 

$_rawSettings : string
 

$_session : \Contenido_Session
 

$_settings : array
 

$_settingsType : string
 

$_type : string

'CMS_TEASER'.

 

$_uploadPath : string
 

$_useXHTML : boolean

 Constants

 

Constant defining that the settings should be interpreted as plaintext.

SETTINGS_TYPE_PLAINTEXT 
 

Constant defining that the settings should be interpreted as XML.

SETTINGS_TYPE_XML