This class provides all methods for the content type CMS_FILELIST. All properties of the file list are stored as a xml document in the database.

 Methods

Constructor of class inits some important class variables and gets some Contenido global vars, so this class has no need to use ugly and buggy global commands

__construct(string $sContent, integer $iNumberOfCms, integer $iIdArtLang, array $sEditLink, array $aCfg, array $oDB, string $sContenidoLang, integer $iClient, integer $iLang, array $aCfgClient, object $oSess) 

access public

Parameters

$sContent

string
  • xml document from database containing the settings

$iNumberOfCms

integer
  • CMS_FILELIST[4] => 4

$iIdArtLang

integer
  • Idartlang of current article

$sEditLink

array
  • sEditlink for editbuttons, not currently used

$aCfg

array
  • Contenido configuration array

$oDB

array
  • Contenido database object

$sContenidoLang

string
  • Contenido Backend language string

$iClient

integer
  • Contenido client id

$iLang

integer
  • Contenido frontend language id

$aCfgClient

array
  • Contenido Client configuration array

$oSess

object
  • Contenido session object

Returns all translation strings for mi18n.

addModuleTranslations(array $aTranslationStrings) : array

Parameters

$aTranslationStrings

array

Array with translation strings

Returns

arrayTranslation strings

Builds a directory list by a given upload directory path.

buildDirectoryList(string $sUploadPath) : array

Parameters

$sUploadPath

string

Path to directory (per default the root upload path of client)

Returns

arrayArray with directory information

Function is called in editmode of contenido an returns filelist view and editbutton

getAllWidgetEdit() : string

Returns

stringcode for the backend edit view

Function is called in edit- and viewmode in order to generate code for output.

getAllWidgetOutput() : string

Returns

stringgenerated code

Dynamic filelist generator.

getAllWidgetView() : string

This method is executed every time the filelist is displayed.

Returns

stringoutput of the filelist

Returns the directory list of an given directory array (by buildDirectoryList()).

getDirectoryList(array $aDirs) : string

Parameters

$aDirs

array

Array with directory information

Returns

stringhtml of the directory list

Function which generate a select box for the manual files.

getFileSelect(array $sDirectoryPath) : string

Parameters

$sDirectoryPath

array

Path to directory of the files

Returns

stringrendered cHTMLSelectElement

getMetaDataList()

getMetaDataList() 

Checks recursively for sub directories

recursiveCheckForSubdirectories(string $sDirectoryPath, array $aDirectories) : array

Parameters

$sDirectoryPath

string

Path to directory

$aDirectories

array

Directory array

Returns

arrayDirectory array

Executes the file filters which removes all files not matching the filter criterias.

applyFileFilters(array $aFileList) : array

Parameters

$aFileList

array

array with files to check

Returns

arrayarray with filtered files

In Contenido content type code is evaled by php. To make this possible, this function prepares code for evaluation

encodeForOutput(string $sCode) : string

access private

Parameters

$sCode

string

code to escape

Returns

stringescaped code

Method to fill single entry (file) of the file list.

fillFileListTemplateEntry(array $aFileData, object $oTpl) : void

access private

Parameters

$aFileData

array

Array with information about the file

$oTpl

object

Reference of the used template object

Function which generate a select box for existing files in the manual filelist.

getExistingFileSelect() : string

Returns

stringrendered cHTMLSelectElement

Function which generate a select box for the filelist extensions.

getExtensionSelect(array $aSelected) : string

access private

Parameters

$aSelected

array

array with values which are selected

Returns

stringrendered cHTMLSelectElement

Function which generate a select box for the filelist sort order.

getSortOrderSelect(string $sSelected) : string

access private

Parameters

$sSelected

string

value of select box which is selected

Returns

stringrendered cHTMLSelectElement

Function which generate a select box for the filelist sort.

getSortSelect(string $sSelected) : string

access private

Parameters

$sSelected

string

value of select box which is selected

Returns

stringrendered cHTMLSelectElement

Function which generate a select box for setting filelist style.

getStyleSelect(string $sSelected) : string

access private

Parameters

$sSelected

string

value of select box which is selected

Returns

stringrendered cHTMLSelectElement

Performs all date filters of a file.

performFileDateFilters(array $aFileStats) : boolean

Parameters

$aFileStats

array

Array with file information

Returns

booleancheck state (true = tests passed, false = tests not passed)

Function parses XML document which contains file list settings and store properties as array into $aSettings

readSettings() : void

access private

Function gets all submitted values for new file list properties from $_POST array, generates new corresponding config XML Document and stores it as content, using contenido conSaveContentEntry() function

storeFileList() : void

access private

 Properties

 

Contenido configuration array

$aCfg : array

access private
 

Contenido configuration array for current active client

$aCfgClient : array

access private
 

Array with the date fields.

$aDateFields : array

access private
 

Array with default file extensions.

$aFileExtensions : array

access private
 

List of fieldnames in frontend (properties) which the file list has and which were also described in the config xml document

$aFileListData : array

access private
 

Array with available meta data identifiers.

$aMetaDataIdents : array

access private
 

Array which contains current file list settings

$aSettings : array

access private
 

Placeholders for labels in frontend.

$aTranslations : array

Important: This must be a static array!

access private
 

Current Contenido client id

$iClient : integer

access private
 

Current id of content type CMS_FILELIST[3] -> 3

$iId : integer

access private
 

Idartlang of article, which is currently in edit- or viewmode

$iIdArtLang : integer

access private
 

Current Contenido language id

$iLang : integer

access private
 

Contenido database object

$oDb : object

access private
 

Contenido session object

$oSess : object

access private
 

String contains value of stored content in database in this case this is the config xml document which is later parsed and its settings were stored in $aSettings

$sContent : string

access private
 

Contenido upload path for current client

$sUploadPath : string

access private