contenido\classes\class.cms_filelist.php

Show: PublicProtectedPrivateinherited
Table of Contents
Project: Contenido Content Management System

Description: Class for handling CMS Type File List

Requirements:

Author
Dominik Ziegler, Timo Trautmann  
Con_php_req
5.0  
Copyright
four for business AG  
License
http://www.contenido.org/license/LIZENZ.txt  
Link
http://www.4fb.de  
Link
http://www.contenido.org  
Package
Contenido Content Types  
Since
file available since contenido release 4.8.13 {@internal created 2009-10-01 modified 2010-10-29, Dominik Ziegler - fixed CON-362 (removed whitespace from client setting) $Id$: }}  
Version
1.0.0  

\Cms_FileList

Package: Default
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.

Properties

>VPropertyprivatearray $aCfg = array()
Contenido configuration array
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aCfgClient = array()
Contenido configuration array for current active client
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aDateFields = array()
Array with the date fields.
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aFileExtensions = array()
Array with default file extensions.
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aFileListData = array()
List of fieldnames in frontend (properties) which the file list has and which were also described in the config xml document
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aMetaDataIdents = array()
Array with available meta data identifiers.
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aSettings = array()
Array which contains current file list settings
Default valuearray()Details
Type
array
Access
private  
>VPropertyprivatearray $aTranslations = array("LABEL_FILESIZE" => "Dateigröße", "LABEL_UPLOAD_DATE" => "Hochgeladen am")
static
Placeholders for labels in frontend.

Important: This must be a static array!

Default valuearray("LABEL_FILESIZE" => "Dateigröße", "LABEL_UPLOAD_DATE" => "Hochgeladen am")Details
Type
array
Access
private  
>VPropertyprivateinteger $iClient = 0
Current Contenido client id
Default value0Details
Type
integer
Access
private  
>VPropertyprivateinteger $iId = 0
Current id of content type CMS_FILELIST[3] -> 3
Default value0Details
Type
integer
Access
private  
>VPropertyprivateinteger $iIdArtLang = 0
Idartlang of article, which is currently in edit- or viewmode
Default value0Details
Type
integer
Access
private  
>VPropertyprivateinteger $iLang = 0
Current Contenido language id
Default value0Details
Type
integer
Access
private  
>VPropertyprivateobject $oDb = null
Contenido database object
Default valuenullDetails
Type
object
Access
private  
>VPropertyprivateobject $oSess = null
Contenido session object
Default valuenullDetails
Type
object
Access
private  
>VPropertyprivatestring $sContent = ""
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
Default value""Details
Type
string
Access
private  
>VPropertyprivatestring $sUploadPath = ""
Contenido upload path for current client
Default value""Details
Type
string
Access
private  

Methods

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

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

Parameters
NameTypeDescription
$sContentstring
  • xml document from database containing the settings
$iNumberOfCmsinteger
  • CMS_FILELIST[4] => 4
$iIdArtLanginteger
  • Idartlang of current article
$sEditLinkarray
  • sEditlink for editbuttons, not currently used
$aCfgarray
  • Contenido configuration array
$oDBarray
  • Contenido database object
$sContenidoLangstring
  • Contenido Backend language string
$iClientinteger
  • Contenido client id
$iLanginteger
  • Contenido frontend language id
$aCfgClientarray
  • Contenido Client configuration array
$oSessobject
  • Contenido session object
Details
Access
public  
methodpublicaddModuleTranslations(array $aTranslationStrings) : array
static

Returns all translation strings for mi18n.

Parameters
NameTypeDescription
$aTranslationStringsarray

Array with translation strings

Returns
TypeDescription
arrayTranslation strings
methodprivateapplyFileFilters(array $aFileList) : array

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

Parameters
NameTypeDescription
$aFileListarray

array with files to check

Returns
TypeDescription
arrayarray with filtered files
methodpublicbuildDirectoryList(string $sUploadPath = "") : array

Builds a directory list by a given upload directory path.

Parameters
NameTypeDescription
$sUploadPathstring

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

Returns
TypeDescription
arrayArray with directory information
methodprivateencodeForOutput(string $sCode) : string

In Contenido content type code is evaled by php.

To make this possible, this function prepares code for evaluation

Parameters
NameTypeDescription
$sCodestring

code to escape

Returns
TypeDescription
stringescaped code
Details
Access
private  
methodprivatefillFileListTemplateEntry(array $aFileData, object $oTpl) : void

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

Parameters
NameTypeDescription
$aFileDataarray

Array with information about the file

$oTplobject

Reference of the used template object

Details
Access
private  
methodpublicgetAllWidgetEdit() : string

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

Returns
TypeDescription
stringcode for the backend edit view
methodpublicgetAllWidgetOutput() : string

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

Returns
TypeDescription
stringgenerated code
methodpublicgetAllWidgetView() : string

Dynamic filelist generator.

This method is executed every time the filelist is displayed.

Returns
TypeDescription
stringoutput of the filelist
methodpublicgetDirectoryList(array $aDirs) : string

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

Parameters
NameTypeDescription
$aDirsarray

Array with directory information

Returns
TypeDescription
stringhtml of the directory list
methodprivategetExistingFileSelect() : string

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

Returns
TypeDescription
stringrendered cHTMLSelectElement
methodprivategetExtensionSelect(array $aSelected) : string

Function which generate a select box for the filelist extensions.

Parameters
NameTypeDescription
$aSelectedarray

array with values which are selected

Returns
TypeDescription
stringrendered cHTMLSelectElement
Details
Access
private  
methodpublicgetFileSelect(array $sDirectoryPath = "") : string

Function which generate a select box for the manual files.

Parameters
NameTypeDescription
$sDirectoryPatharray

Path to directory of the files

Returns
TypeDescription
stringrendered cHTMLSelectElement
methodpublicgetMetaDataList() : void

methodprivategetSortOrderSelect(string $sSelected) : string

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

Parameters
NameTypeDescription
$sSelectedstring

value of select box which is selected

Returns
TypeDescription
stringrendered cHTMLSelectElement
Details
Access
private  
methodprivategetSortSelect(string $sSelected) : string

Function which generate a select box for the filelist sort.

Parameters
NameTypeDescription
$sSelectedstring

value of select box which is selected

Returns
TypeDescription
stringrendered cHTMLSelectElement
Details
Access
private  
methodprivategetStyleSelect(string $sSelected) : string

Function which generate a select box for setting filelist style.

Parameters
NameTypeDescription
$sSelectedstring

value of select box which is selected

Returns
TypeDescription
stringrendered cHTMLSelectElement
Details
Access
private  
methodprivateperformFileDateFilters(array $aFileStats) : boolean

Performs all date filters of a file.

Parameters
NameTypeDescription
$aFileStatsarray

Array with file information

Returns
TypeDescription
booleancheck state (true = tests passed, false = tests not passed)
methodprivatereadSettings() : void

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

Details
Access
private  
methodpublicrecursiveCheckForSubdirectories(string $sDirectoryPath, array $aDirectories) : array

Checks recursively for sub directories

Parameters
NameTypeDescription
$sDirectoryPathstring

Path to directory

$aDirectoriesarray

Directory array

Returns
TypeDescription
arrayDirectory array
methodprivatestoreFileList() : void

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

Details
Access
private  
Documentation was generated by phpDocumentor 2.0.0a12.