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
Static

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.

encodeForOutput(string $sCode) : string

To make this possible, this function prepares code for evaluation

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

 

$aCfg : array
access private
 

$aCfgClient : array
access private
 

$aDateFields : array
access private
 

$aFileExtensions : array
access private
 

$aFileListData : array
access private
 

$aMetaDataIdents : array
access private
 

$aSettings : array
access private
 

$aTranslations : array

Important: This must be a static array!

access private
 

$iClient : integer
access private
 

$iId : integer
access private
 

$iIdArtLang : integer
access private
 

$iLang : integer
access private
 

$oDb : object
access private
 

$oSess : object
access private
 

$sContent : string
access private
 

$sUploadPath : string
access private