TYPO3 API  SVNRelease
Public Member Functions | Public Attributes
tx_impexp Class Reference

List of all members.

Public Member Functions

 init ($dontCompress=0, $mode='')
 setHeaderBasics ()
 setCharset ($charset)
 setMetaData ($title, $description, $notes, $packager_username, $packager_name, $packager_email)
 addThumbnail ($imgFilepath)
 setPageTree ($idH)
 unsetExcludedSections ($idH)
 flatInversePageTree ($idH, $a=array())
 flatInversePageTree_pid ($idH, $a=array(), $pid=-1)
 export_addRecord ($table, $row, $relationLevel=0)
 export_addDBRelations ($relationLevel=0)
 export_addDBRelations_registerRelation ($fI, &$addR, $tokenID='')
 export_addFilesFromRelations ()
 export_addFile ($fI, $recordRef='', $fieldname='')
 flatDBrels ($dbrels)
 flatSoftRefs ($dbrels)
 compileMemoryToFileContent ($type='')
 createXML ()
 doOutputCompress ()
 addFilePart ($data, $compress=FALSE)
 importData ($pid)
 writeRecords_pages ($pid)
 writeRecords_pages_order ($pid)
 writeRecords_records ($pid)
 writeRecords_records_order ($mainPid)
 addSingle ($table, $uid, $pid)
 addToMapId ($substNEWwithIDs)
 getNewTCE ()
 unlinkTempFiles ()
 setRelations ()
 setRelations_db ($itemArray)
 import_addFileNameToBeCopied ($fI)
 setFlexFormRelations ()
 remapListedDBRecords_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2, $path)
 processSoftReferences ()
 processSoftReferences_flexFormCallBack ($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2, $path)
 processSoftReferences_substTokens ($tokenizedContent, $softRefCfgs, $table, $uid)
 processSoftReferences_saveFile ($relFileName, $cfg, $table, $uid)
 processSoftReferences_saveFile_createRelFile ($origDirPrefix, $fileName, $fileID, $table, $uid)
 writeFileVerify ($fileName, $fileID, $bypassMountCheck=FALSE)
 checkOrCreateDir ($dirPrefix)
 verifyFolderAccess ($dirPrefix, $noAlternative=FALSE)
 loadFile ($filename, $all=0)
 getNextFilePart ($fd, $unserialize=0, $name='')
 loadContent ($filecontent)
 getNextContentPart ($filecontent, &$pointer, $unserialize=0, $name='')
 loadInit ()
 fixCharsets ()
 displayContentOverview ()
 traversePageTree ($pT, &$lines, $preCode='')
 traversePageRecords ($pT, &$lines)
 traverseAllRecords ($pT, &$lines)
 singleRecordLines ($table, $uid, &$lines, $preCode, $checkImportInPidRecord=0)
 addRelations ($rels, &$lines, $preCode, $recurCheck=array(), $htmlColorClass='')
 addFiles ($rels, &$lines, $preCode, $htmlColorClass='', $tokenID='')
 checkDokType ($checkTable, $doktype)
 renderControls ($r)
 softrefSelector ($cfg)
 isTableStatic ($table)
 inclRelation ($table)
 isExcluded ($table, $uid)
 includeSoftref ($tokenID)
 checkPID ($pid)
 dontIgnorePid ($table, $uid)
 doesRecordExist ($table, $uid, $fields='')
 getRecordPath ($pid)
 renderSelectBox ($prefix, $value, $optValues)
 compareRecords ($databaseRecord, $importRecord, $table, $inverseDiff=FALSE)
 getRTEoriginalFilename ($string)
 getFileProcObj ()
 callHook ($name, $params)
 error ($msg)
 printErrorLog ()

Public Attributes

 $showStaticRelations = FALSE
 $fileadminFolderName = 'fileadmin'
 $mode = ''
 $update = FALSE
 $doesImport = FALSE
 $display_import_pid_record = ''
 $suggestedInsertUids = array()
 $import_mode = array()
 $global_ignore_pid = FALSE
 $force_all_UIDS = FALSE
 $showDiff = FALSE
 $allowPHPScripts = FALSE
 $enableLogging = FALSE
 $softrefInputValues = array()
 $fileIDMap = array()
 $maxFileSize = 1000000
 $maxRecordSize = 1000000
 $maxExportSize = 10000000
 $relOnlyTables = array()
 $relStaticTables = array()
 $excludeMap = array()
 $softrefCfg = array()
 $extensionDependencies = array()
 $dontCompress = 0
 $includeExtFileResources = 0
 $extFileResourceExtensions = 'html,htm,css'
 $import_mapId = array()
 $import_newId = array()
 $import_newId_pids = array()
 $import_data = array()
 $errorLog = array()
 $cache_getRecordPath = array()
 $checkPID_cache = array()
 $compress = 0
 $dat = array()
 $fileProcObj = ''

Detailed Description

Definition at line 190 of file class.tx_impexp.php.


Member Function Documentation

tx_impexp::addFilePart ( data,
compress = FALSE 
)

Returns a content part for a filename being build.

Parameters:
arrayData to store in part
booleanCompress file?
Returns:
string Content stream.

Definition at line 1109 of file class.tx_impexp.php.

References $compress.

Referenced by compileMemoryToFileContent().

tx_impexp::addFiles ( rels,
&$  lines,
preCode,
htmlColorClass = '',
tokenID = '' 
)

Add file relation entries for a record's rels-array

Parameters:
arrayArray of file IDs
arrayOutput lines array (is passed by reference and modified)
stringPre-HTML code
stringAlternative HTML color class to use.
stringToken ID if this is a softreference (in which case it only makes sense with a single element in the $rels array!)
Returns:
void private
See also:
singleRecordLines()

Definition at line 2827 of file class.tx_impexp.php.

References $fileProcObj, error(), getFileProcObj(), t3lib_iconWorks\getSpriteIcon(), includeSoftref(), t3lib_div\split_fileref(), and verifyFolderAccess().

Referenced by singleRecordLines().

tx_impexp::addRelations ( rels,
&$  lines,
preCode,
recurCheck = array(),
htmlColorClass = '' 
)

Add DB relations entries for a record's rels-array

Parameters:
arrayArray of relations
arrayOutput lines array (is passed by reference and modified)
stringPre-HTML code
arrayRecursivity check stack
stringAlternative HTML color class to use.
Returns:
void private
See also:
singleRecordLines()

Definition at line 2762 of file class.tx_impexp.php.

References $dat, $GLOBALS, doesRecordExist(), error(), getRecordPath(), includeSoftref(), isExcluded(), isTableStatic(), and t3lib_iconWorks\skinImg().

Referenced by singleRecordLines().

tx_impexp::addSingle ( table,
uid,
pid 
)

Adds a single record to the $importData array. Also copies files to tempfolder. However all File/DB-references and flexform field contents are set to blank for now! That is done with setRelations() later

Parameters:
stringTable name (from import memory)
integerRecord UID (from import memory)
integerPage id
Returns:
void
See also:
writeRecords()

Definition at line 1395 of file class.tx_impexp.php.

References $GLOBALS, $pid, doesRecordExist(), error(), and t3lib_div\testInt().

Referenced by writeRecords_pages(), and writeRecords_records().

tx_impexp::addThumbnail ( imgFilepath)

Sets a thumbnail image to the exported file

Parameters:
stringFilename reference, gif, jpg, png. Absolute path.
Returns:
void

Definition at line 348 of file class.tx_impexp.php.

tx_impexp::addToMapId ( substNEWwithIDs)

Registers the substNEWids in memory.

Parameters:
array$substNEWwithIDsfrom tcemain to be merged into internal mapping variable in this object
Returns:
void
See also:
writeRecords()

Definition at line 1468 of file class.tx_impexp.php.

References $value, and error().

Referenced by writeRecords_pages(), and writeRecords_records().

tx_impexp::callHook ( name,
params 
)

Call Hook

Parameters:
string$namename of the hook
array$paramsarray with params
Returns:
void

Definition at line 3296 of file class.tx_impexp.php.

References $GLOBALS, and t3lib_div\callUserFunction().

Referenced by processSoftReferences(), setFlexFormRelations(), setRelations(), writeRecords_pages(), writeRecords_pages_order(), writeRecords_records(), and writeRecords_records_order().

tx_impexp::checkDokType ( checkTable,
doktype 
)

Verifies that a table is allowed on a certain doktype of a page

Parameters:
stringTable name to check
integerdoktype value.
Returns:
boolean True if OK

Definition at line 2945 of file class.tx_impexp.php.

References $PAGES_TYPES, and t3lib_div\trimExplode().

Referenced by singleRecordLines().

tx_impexp::checkOrCreateDir ( dirPrefix)

Returns true if directory exists and if it doesn't it will create directory and return true if that succeeded.

Parameters:
stringDirectory to create. Having a trailing slash. Must be in fileadmin/. Relative to PATH_site
Returns:
boolean True, if directory exists (was created)

Definition at line 2151 of file class.tx_impexp.php.

References error(), t3lib_div\getFileAbsFileName(), and t3lib_div\mkdir().

Referenced by processSoftReferences_saveFile_createRelFile().

tx_impexp::checkPID ( pid)

Checking if a PID is in the webmounts of the user

Parameters:
integerPage ID to check
Returns:
boolean True if OK

Definition at line 3116 of file class.tx_impexp.php.

References $BE_USER, and $pid.

Referenced by export_addRecord().

tx_impexp::compareRecords ( databaseRecord,
importRecord,
table,
inverseDiff = FALSE 
)

Compares two records, the current database record and the one from the import memory. Will return HTML code to show any differences between them!

Parameters:
arrayDatabase record, all fields (new values)
arrayImport memorys record for the same table/uid, all fields (old values)
stringThe table name of the record
booleanInverse the diff view (switch red/green, needed for pre-update difference view)
Returns:
string HTML

Definition at line 3196 of file class.tx_impexp.php.

References $TCA, $value, t3lib_BEfunc\getProcessedValue(), and t3lib_div\makeInstance().

Referenced by singleRecordLines().

tx_impexp::compileMemoryToFileContent ( type = '')

This compiles and returns the data content for an exported file

Parameters:
stringType of output; "xml" gives xml, otherwise serialized array, possibly compressed.
Returns:
string The output file stream

Definition at line 980 of file class.tx_impexp.php.

References $compress, addFilePart(), createXML(), and doOutputCompress().

tx_impexp::createXML ( )

Creates XML string from input array

Returns:
string XML content

Definition at line 1006 of file class.tx_impexp.php.

References t3lib_div\array2xml().

Referenced by compileMemoryToFileContent().

tx_impexp::displayContentOverview ( )

Displays an overview of the header-content.

Returns:
string HTML content

Definition at line 2420 of file class.tx_impexp.php.

References error(), t3lib_div\formatSize(), t3lib_extMgm\isLoaded(), renderControls(), traverseAllRecords(), traversePageRecords(), and traversePageTree().

tx_impexp::doesRecordExist ( table,
uid,
fields = '' 
)

Checks if the record exists

Parameters:
stringTable name
integerUID of record
stringField list to select. Default is "uid,pid"
Returns:
array Result of t3lib_BEfunc::getRecord() which means the record if found, otherwise false

Definition at line 3146 of file class.tx_impexp.php.

References t3lib_BEfunc\getRecord().

Referenced by addRelations(), addSingle(), and singleRecordLines().

tx_impexp::dontIgnorePid ( table,
uid 
)

Checks if the position of an updated record is configured to be corrected. This can be disabled globally and changed for elements individually.

Parameters:
stringTable name
integerUid or record
Returns:
boolean True if the position of the record should be updated to match the one in the import structure

Definition at line 3133 of file class.tx_impexp.php.

Referenced by writeRecords_pages_order(), and writeRecords_records_order().

tx_impexp::doOutputCompress ( )

Returns true if the output should be compressed.

Returns:
boolean True if compression is possible AND requested.

Definition at line 1098 of file class.tx_impexp.php.

Referenced by compileMemoryToFileContent().

tx_impexp::error ( msg)
tx_impexp::export_addDBRelations ( relationLevel = 0)

This analyses the existing added records, finds all database relations to records and adds these records to the export file. This function can be called repeatedly until it returns an empty array. In principle it should not allow to infinite recursivity, but you better set a limit... Call this BEFORE the ext_addFilesFromRelations (so files from added relations are also included of course)

Parameters:
integerRecursion level
Returns:
array overview of relations found and added: Keys [table]:[uid], values array with table and id
See also:
export_addFilesFromRelations()

Definition at line 538 of file class.tx_impexp.php.

References $row, $TCA, $value, error(), export_addDBRelations_registerRelation(), export_addRecord(), t3lib_BEfunc\getRecord(), and includeSoftref().

tx_impexp::export_addDBRelations_registerRelation ( fI,
&$  addR,
tokenID = '' 
)

Helper function for export_addDBRelations()

Parameters:
arrayArray with table/id keys to add
arrayAdd array, passed by reference to be modified
stringSoftref Token ID, if applicable.
Returns:
void
See also:
export_addDBRelations()

Definition at line 640 of file class.tx_impexp.php.

References $TCA, inclRelation(), includeSoftref(), isExcluded(), and isTableStatic().

Referenced by export_addDBRelations().

tx_impexp::export_addFile ( fI,
recordRef = '',
fieldname = '' 
)

Adds a files content to the export memory

Parameters:
arrayFile information with three keys: "filename" = filename without path, "ID_absFile" = absolute filepath to the file (including the filename), "ID" = md5 hash of "ID_absFile". "relFileName" is optional for files attached to records, but mandatory for soft referenced files (since the relFileName determines where such a file should be stored!)
stringIf the file is related to a record, this is the id on the form [table]:[id]. Information purposes only.
stringIf the file is related to a record, this is the field name it was related to. Information purposes only.
Returns:
void

Definition at line 763 of file class.tx_impexp.php.

References $GLOBALS, error(), t3lib_div\formatSize(), t3lib_div\getFileAbsFileName(), getRTEoriginalFilename(), t3lib_div\inList(), t3lib_div\isFirstPartOfStr(), t3lib_div\makeInstance(), and t3lib_div\resolveBackPath().

Referenced by export_addFilesFromRelations().

tx_impexp::export_addFilesFromRelations ( )

This adds all files in relations. Call this method AFTER adding all records including relations.

Returns:
void
See also:
export_addDBRelations()

Definition at line 664 of file class.tx_impexp.php.

References $value, error(), export_addFile(), t3lib_div\getFileAbsFileName(), and includeSoftref().

tx_impexp::export_addRecord ( table,
row,
relationLevel = 0 
)

Adds the record $row from $table. No checking for relations done here. Pure data.

Parameters:
stringTable name
arrayRecord row.
integer(Internal) if the record is added as a relation, this is set to the "level" it was on.
Returns:
void

Definition at line 480 of file class.tx_impexp.php.

References $row, checkPID(), error(), t3lib_div\fixed_lgd_cs(), flatDBrels(), flatSoftRefs(), t3lib_div\formatSize(), t3lib_BEfunc\getRecordTitle(), t3lib_div\makeInstance(), and t3lib_BEfunc\workspaceOL().

Referenced by export_addDBRelations().

tx_impexp::fixCharsets ( )

Fix charset of import memory if different from system charset

Returns:
void
See also:
loadInit()

Definition at line 2365 of file class.tx_impexp.php.

References error().

Referenced by loadInit().

tx_impexp::flatDBrels ( dbrels)

DB relations flattend to 1-dim array. The list will be unique, no table/uid combination will appear twice.

Parameters:
array2-dim Array of database relations organized by table key
Returns:
array 1-dim array where entries are table:uid and keys are array with table/id

Definition at line 890 of file class.tx_impexp.php.

References $dat.

Referenced by export_addRecord().

tx_impexp::flatInversePageTree ( idH,
a = array() 
)

Recursively flattening the idH array (for setPageTree() function)

Parameters:
arrayPage uid hierarchy
arrayAccumulation array of pages (internal, don't set from outside)
Returns:
array Array with uid-uid pairs for all pages in the page tree.
See also:
flatInversePageTree_pid()

Definition at line 420 of file class.tx_impexp.php.

Referenced by setPageTree(), writeRecords_pages(), and writeRecords_records_order().

tx_impexp::flatInversePageTree_pid ( idH,
a = array(),
pid = -1 
)

Recursively flattening the idH array (for setPageTree() function), setting PIDs as values

Parameters:
arrayPage uid hierarchy
arrayAccumulation array of pages (internal, don't set from outside)
integerPID value (internal)
Returns:
array Array with uid-pid pairs for all pages in the page tree.
See also:
flatInversePageTree()

Definition at line 442 of file class.tx_impexp.php.

References $pid.

Referenced by writeRecords_pages_order().

tx_impexp::flatSoftRefs ( dbrels)

Soft References flattend to 1-dim array.

Parameters:
array2-dim Array of database relations organized by table key
Returns:
array 1-dim array where entries are arrays with properties of the soft link found and keys are a unique combination of field, spKey, structure path if applicable and token ID

Definition at line 916 of file class.tx_impexp.php.

References $dat.

Referenced by export_addRecord().

tx_impexp::getFileProcObj ( )

Returns file processing object, initialized only once.

Returns:
object File processor object

Definition at line 3280 of file class.tx_impexp.php.

References $GLOBALS, and t3lib_div\makeInstance().

Referenced by addFiles(), processSoftReferences_saveFile(), processSoftReferences_saveFile_createRelFile(), verifyFolderAccess(), and writeFileVerify().

tx_impexp::getNewTCE ( )
tx_impexp::getNextContentPart ( filecontent,
&$  pointer,
unserialize = 0,
name = '' 
)

Returns the next content part from the $filecontent

Parameters:
stringFile content string
integerFile pointer (where to read from)
booleanIf set, the returned content is unserialized into an array, otherwise you get the raw string
stringFor error messages this indicates the section of the problem.
Returns:
string Data string

Definition at line 2324 of file class.tx_impexp.php.

References error().

Referenced by loadContent().

tx_impexp::getNextFilePart ( fd,
unserialize = 0,
name = '' 
)

Returns the next content part form the fileresource (t3d), $fd

Parameters:
pointerFile pointer
booleanIf set, the returned content is unserialized into an array, otherwise you get the raw string
stringFor error messages this indicates the section of the problem.
Returns:
string Data string private
See also:
loadFile()

Definition at line 2277 of file class.tx_impexp.php.

References error().

Referenced by loadFile().

tx_impexp::getRecordPath ( pid)

Returns the page title path of a PID value. Results are cached internally

Parameters:
integerRecord PID to check
Returns:
string The path for the input PID

Definition at line 3156 of file class.tx_impexp.php.

References $GLOBALS, $pid, and t3lib_BEfunc\getRecordPath().

Referenced by addRelations(), and singleRecordLines().

tx_impexp::getRTEoriginalFilename ( string)

Creates the original file name for a copy-RTE image (magic type)

Parameters:
stringRTE copy filename, eg. "RTEmagicC_user_pm_icon_01.gif.gif"
Returns:
string RTE original filename, eg. "RTEmagicP_user_pm_icon_01.gif". IF the input filename was NOT prefixed RTEmagicC_ as RTE images would be, nothing is returned!

Definition at line 3263 of file class.tx_impexp.php.

References t3lib_div\isFirstPartOfStr().

Referenced by export_addFile(), and processSoftReferences_saveFile().

tx_impexp::import_addFileNameToBeCopied ( fI)

Writes the file from import array to temp dir and returns the filename of it.

Parameters:
arrayFile information with three keys: "filename" = filename without path, "ID_absFile" = absolute filepath to the file (including the filename), "ID" = md5 hash of "ID_absFile"
Returns:
string Absolute filename of the temporary filename of the file. In ->alternativeFileName the original name is set.

Definition at line 1625 of file class.tx_impexp.php.

References error(), t3lib_div\tempnam(), and t3lib_div\writeFile().

Referenced by remapListedDBRecords_flexFormCallBack(), and setRelations().

tx_impexp::importData ( pid)

Imports the internal data array to $pid.

Parameters:
integerPage ID in which to import the content
Returns:
void ...

Definition at line 1142 of file class.tx_impexp.php.

References $pid, processSoftReferences(), setFlexFormRelations(), setRelations(), unlinkTempFiles(), writeRecords_pages(), and writeRecords_records().

tx_impexp::inclRelation ( table)

Returns true if the input table name is to be included as relation

Parameters:
stringTable name
Returns:
boolean True, if table is marked static

Definition at line 3079 of file class.tx_impexp.php.

References $GLOBALS, and $TCA.

Referenced by export_addDBRelations_registerRelation().

tx_impexp::includeSoftref ( tokenID)

Returns true if soft reference should be included in exported file.

Parameters:
stringToken ID for soft reference
Returns:
boolean True if softreference media should be included

Definition at line 3106 of file class.tx_impexp.php.

References t3lib_div\inList().

Referenced by addFiles(), addRelations(), export_addDBRelations(), export_addDBRelations_registerRelation(), and export_addFilesFromRelations().

tx_impexp::init ( dontCompress = 0,
mode = '' 
)

Init the object, both import and export

Parameters:
booleanIf set, compression in t3d files is disabled
stringMode of usage, either "import" or "export"
Returns:
void

Definition at line 259 of file class.tx_impexp.php.

References $dontCompress, and $mode.

tx_impexp::isExcluded ( table,
uid 
)

Returns true if the element should be excluded as static record.

Parameters:
stringTable name
integerUID value
Returns:
boolean True, if table is marked static

Definition at line 3094 of file class.tx_impexp.php.

References $TCA.

Referenced by addRelations(), export_addDBRelations_registerRelation(), and setRelations_db().

tx_impexp::isTableStatic ( table)

Returns true if the input table name is to be regarded as a static relation (that is, not exported etc).

Parameters:
stringTable name
Returns:
boolean True, if table is marked static

Definition at line 3065 of file class.tx_impexp.php.

References $TCA.

Referenced by addRelations(), export_addDBRelations_registerRelation(), and setRelations_db().

tx_impexp::loadContent ( filecontent)

Loads T3D file content into the $this->dat array (This function can be used to test the output strings from ->compileMemoryToFileContent())

Parameters:
stringFile content
Returns:
void

Definition at line 2306 of file class.tx_impexp.php.

References getNextContentPart(), and loadInit().

tx_impexp::loadFile ( filename,
all = 0 
)

Loads the header section/all of the $filename into memory

Parameters:
stringFilename, absolute
booleanIf set, all information is loaded (header, records and files). Otherwise the default is to read only the header information
Returns:
boolean True if the operation went well

Definition at line 2234 of file class.tx_impexp.php.

References error(), getNextFilePart(), loadInit(), and t3lib_div\xml2array().

tx_impexp::loadInit ( )

Setting up the object based on the recently loaded ->dat array

Returns:
void

Definition at line 2349 of file class.tx_impexp.php.

References fixCharsets().

Referenced by loadContent(), and loadFile().

tx_impexp::printErrorLog ( )

Returns a table with the error-messages.

Returns:
string HTML print of error log

Definition at line 3331 of file class.tx_impexp.php.

References t3lib_utility_Debug\viewArray().

tx_impexp::processSoftReferences ( )
tx_impexp::processSoftReferences_flexFormCallBack ( pParams,
dsConf,
dataValue,
dataValue_ext1,
dataValue_ext2,
path 
)

Callback function for traversing the FlexForm structure in relation to remapping softreference relations

Parameters:
arraySet of parameters in numeric array: table, uid, field
arrayTCA config for field (from Data Structure of course)
stringField value (from FlexForm XML)
stringNot used
stringNot used
stringPath of where the data structure where the element is found
Returns:
array Array where the "value" key carries the value.
See also:
setFlexFormRelations()

Definition at line 1871 of file class.tx_impexp.php.

References processSoftReferences_substTokens().

tx_impexp::processSoftReferences_saveFile ( relFileName,
cfg,
table,
uid 
)

Process a soft reference file

Parameters:
stringOld Relative filename
arraysoft reference configuration array
stringTable for which the processing occurs
stringUID of record from table
Returns:
string New relative filename (value to insert instead of the softref token)

Definition at line 1974 of file class.tx_impexp.php.

References $fileProcObj, error(), t3lib_div\getFileAbsFileName(), getFileProcObj(), getRTEoriginalFilename(), t3lib_div\isFirstPartOfStr(), processSoftReferences_saveFile_createRelFile(), and writeFileVerify().

Referenced by processSoftReferences_substTokens().

tx_impexp::processSoftReferences_saveFile_createRelFile ( origDirPrefix,
fileName,
fileID,
table,
uid 
)

Create file in directory and return the new (unique) filename

Parameters:
stringDirectory prefix, relative, with trailing slash
stringFilename (without path)
stringFile ID from import memory
stringTable for which the processing occurs
stringUID of record from table
Returns:
string New relative filename, if any

Definition at line 2035 of file class.tx_impexp.php.

References $fileProcObj, checkOrCreateDir(), error(), t3lib_div\getFileAbsFileName(), getFileProcObj(), t3lib_div\isFirstPartOfStr(), t3lib_div\mkdir(), t3lib_div\resolveBackPath(), verifyFolderAccess(), t3lib_div\writeFile(), and writeFileVerify().

Referenced by processSoftReferences_saveFile().

tx_impexp::processSoftReferences_substTokens ( tokenizedContent,
softRefCfgs,
table,
uid 
)

Substition of softreference tokens

Parameters:
stringContent of field with soft reference tokens in.
arraySoft reference configurations
stringTable for which the processing occurs
stringUID of record from table
Returns:
string The input content with tokens substituted according to entries in softRefCfgs

Definition at line 1910 of file class.tx_impexp.php.

References t3lib_BEfunc\getRecord(), processSoftReferences_saveFile(), t3lib_div\testInt(), and t3lib_BEfunc\wsMapId().

Referenced by processSoftReferences(), and processSoftReferences_flexFormCallBack().

tx_impexp::remapListedDBRecords_flexFormCallBack ( pParams,
dsConf,
dataValue,
dataValue_ext1,
dataValue_ext2,
path 
)

Callback function for traversing the FlexForm structure in relation to remapping database relations

Parameters:
arraySet of parameters in numeric array: table, uid, field
arrayTCA config for field (from Data Structure of course)
stringField value (from FlexForm XML)
stringNot used
stringNot used
stringPath of where the data structure of the element is found
Returns:
array Array where the "value" key carries the value.
See also:
setFlexFormRelations()

Definition at line 1728 of file class.tx_impexp.php.

References import_addFileNameToBeCopied(), and setRelations_db().

tx_impexp::renderControls ( r)

Render input controls for import or export

Parameters:
arrayConfiguration for element
booleanSet if export situation
Returns:
string HTML

Definition at line 2961 of file class.tx_impexp.php.

References softrefSelector().

Referenced by displayContentOverview().

tx_impexp::renderSelectBox ( prefix,
value,
optValues 
)

Makes a selector-box from optValues

Parameters:
stringForm element name
stringCurrent value
arrayOptions to display (key/value pairs)
Returns:
string HTML select element

Definition at line 3173 of file class.tx_impexp.php.

References $value.

Referenced by singleRecordLines(), and softrefSelector().

tx_impexp::setCharset ( charset)

Set charset

Parameters:
stringCharset for the content in the export. During import the character set will be converted if the target system uses another charset.
Returns:
void

Definition at line 314 of file class.tx_impexp.php.

tx_impexp::setFlexFormRelations ( )

After all DB relations has been set in the end of the import (see setRelations()) then it is time to correct all relations inside of FlexForm fields. The reason for doing this after is that the setting of relations may affect (quite often!) which data structure is used for the flexforms field!

Returns:
void
See also:
setRelations()

Definition at line 1649 of file class.tx_impexp.php.

References $dat, $TCA, callHook(), error(), t3lib_BEfunc\getFlexFormDS(), getNewTCE(), t3lib_BEfunc\getRecord(), t3lib_div\loadTCA(), t3lib_div\makeInstance(), t3lib_BEfunc\wsMapId(), and t3lib_div\xml2array().

Referenced by importData().

tx_impexp::setHeaderBasics ( )

Set header basics

Returns:
void

Definition at line 290 of file class.tx_impexp.php.

References $value.

tx_impexp::setMetaData ( title,
description,
notes,
packager_username,
packager_name,
packager_email 
)

Sets meta data

Parameters:
stringTitle of the export
stringDescription of the export
stringNotes about the contents
stringBackend Username of the packager (the guy making the export)
stringReal name of the packager
stringEmail of the packager
Returns:
void

Definition at line 329 of file class.tx_impexp.php.

References $GLOBALS.

tx_impexp::setPageTree ( idH)

Sets the page-tree array in the export header and returns the array in a flattened version

Parameters:
arrayHierarchy of ids, the page tree: array([uid] => array("uid" => [uid], "subrow" => array(.....)), [uid] => ....)
Returns:
array The hierarchical page tree converted to a one-dimensional list of pages

Definition at line 386 of file class.tx_impexp.php.

References flatInversePageTree(), and unsetExcludedSections().

tx_impexp::setRelations ( )

At the end of the import process all file and DB relations should be set properly (that is relations to imported records are all re-created so imported records are correctly related again) Relations in flexform fields are processed in setFlexFormRelations() after this function

Returns:
void
See also:
setFlexFormRelations()

Definition at line 1539 of file class.tx_impexp.php.

References $dat, $TCA, callHook(), error(), getNewTCE(), import_addFileNameToBeCopied(), setRelations_db(), and t3lib_BEfunc\wsMapId().

Referenced by importData().

tx_impexp::setRelations_db ( itemArray)

Maps relations for database

Parameters:
arrayArray of item sets (table/uid) from a dbAnalysis object
Returns:
array Array with values [table]_[uid]. These values have the regular tcemain-input group/select type which means they will automatically be processed into a uid-list or MM relations.

Definition at line 1598 of file class.tx_impexp.php.

References error(), isExcluded(), and isTableStatic().

Referenced by remapListedDBRecords_flexFormCallBack(), and setRelations().

tx_impexp::singleRecordLines ( table,
uid,
&$  lines,
preCode,
checkImportInPidRecord = 0 
)

Add entries for a single record

Parameters:
stringTable name
integerRecord uid
arrayOutput lines array (is passed by reference and modified)
stringPre-HTML code
booleanIf you want import validation, you can set this so it checks if the import can take place on the specified page.
Returns:
void

Definition at line 2604 of file class.tx_impexp.php.

References $BE_USER, $GLOBALS, $TCA, addFiles(), addRelations(), checkDokType(), compareRecords(), doesRecordExist(), error(), t3lib_div\fixed_lgd_cs(), getRecordPath(), t3lib_iconWorks\getSpriteIcon(), t3lib_div\inList(), renderSelectBox(), t3lib_BEfunc\viewOnClick(), and t3lib_BEfunc\workspaceOL().

Referenced by traverseAllRecords(), traversePageRecords(), and traversePageTree().

tx_impexp::softrefSelector ( cfg)

Selectorbox with export options for soft references

Parameters:
arraysoftref configuration array. An export box is shown only if a substitution scheme is found for the soft reference.
Returns:
string Selector box HTML

Definition at line 2989 of file class.tx_impexp.php.

References $value, and renderSelectBox().

Referenced by renderControls().

tx_impexp::traverseAllRecords ( pT,
&$  lines 
)

Go through ALL records (if the pages are displayed first, those will not be amoung these!)

Parameters:
arrayPage tree array with uid/subrow (from ->dat[header][pagetree]
arrayOutput lines array (is passed by reference and modified)
Returns:
void

Definition at line 2584 of file class.tx_impexp.php.

References $value, and singleRecordLines().

Referenced by displayContentOverview().

tx_impexp::traversePageRecords ( pT,
&$  lines 
)

Go through remaining pages (not in tree)

Parameters:
arrayPage tree array with uid/subrow (from ->dat[header][pagetree]
arrayOutput lines array (is passed by reference and modified)
Returns:
void

Definition at line 2560 of file class.tx_impexp.php.

References $value, and singleRecordLines().

Referenced by displayContentOverview().

tx_impexp::traversePageTree ( pT,
&$  lines,
preCode = '' 
)

Go through page tree for display

Parameters:
arrayPage tree array with uid/subrow (from ->dat[header][pagetree]
arrayOutput lines array (is passed by reference and modified)
stringPre-HTML code
Returns:
void

Definition at line 2528 of file class.tx_impexp.php.

References $value, and singleRecordLines().

Referenced by displayContentOverview().

tx_impexp::unlinkTempFiles ( )

Cleaning up all the temporary files stored in typo3temp/ folder

Returns:
void

Definition at line 1501 of file class.tx_impexp.php.

References error(), t3lib_div\isFirstPartOfStr(), and t3lib_div\unlink_tempfile().

Referenced by importData().

tx_impexp::unsetExcludedSections ( idH)

Removes entries in the page tree which are found in ->excludeMap[]

Parameters:
arrayPage uid hierarchy
Returns:
array Modified input array private
See also:
setPageTree()

Definition at line 399 of file class.tx_impexp.php.

Referenced by setPageTree().

tx_impexp::verifyFolderAccess ( dirPrefix,
noAlternative = FALSE 
)

Verifies that the input path (relative to PATH_site) is found in the backend users filemounts. If it doesn't it will try to find another relative filemount for the user and return an alternative path prefix for the file.

Parameters:
stringPath relative to PATH_site
booleanIf set, Do not look for alternative path! Just return false
Returns:
string If a path is available that will be returned, otherwise false.

Definition at line 2184 of file class.tx_impexp.php.

References $fileProcObj, getFileProcObj(), and t3lib_div\isFirstPartOfStr().

Referenced by addFiles(), and processSoftReferences_saveFile_createRelFile().

tx_impexp::writeFileVerify ( fileName,
fileID,
bypassMountCheck = FALSE 
)

Writes a file from the import memory having $fileID to file name $fileName which must be an absolute path inside PATH_site

Parameters:
stringAbsolute filename inside PATH_site to write to
stringFile ID from import memory
booleanBypasses the checking against filemounts - only for RTE files!
Returns:
boolean Returns true if it went well. Notice that the content of the file is read again, and md5 from import memory is validated.

Definition at line 2124 of file class.tx_impexp.php.

References $fileProcObj, $GLOBALS, error(), t3lib_div\getFileAbsFileName(), getFileProcObj(), t3lib_div\split_fileref(), and t3lib_div\writeFile().

Referenced by processSoftReferences_saveFile(), and processSoftReferences_saveFile_createRelFile().

tx_impexp::writeRecords_pages ( pid)

Writing pagetree/pages to database:

Parameters:
integerPID in which to import. If the operation is an update operation, the root of the page tree inside will be moved to this PID unless it is the same as the root page from the import
Returns:
void
See also:
writeRecords_records()

Definition at line 1184 of file class.tx_impexp.php.

References $pid, addSingle(), addToMapId(), callHook(), flatInversePageTree(), getNewTCE(), and writeRecords_pages_order().

Referenced by importData().

tx_impexp::writeRecords_pages_order ( pid)

Organize all updated pages in page tree so they are related like in the import file Only used for updates and when $this->dat['header']['pagetree'] is an array.

Parameters:
integerPage id in which to import
Returns:
void private
See also:
writeRecords_pages(), writeRecords_records_order()

Definition at line 1245 of file class.tx_impexp.php.

References callHook(), dontIgnorePid(), flatInversePageTree_pid(), and getNewTCE().

Referenced by writeRecords_pages().

tx_impexp::writeRecords_records ( pid)

Write all database records except pages (writtein in writeRecords_pages())

Parameters:
integerPage id in which to import
Returns:
void
See also:
writeRecords_pages()

Definition at line 1288 of file class.tx_impexp.php.

References $pid, $TCA, addSingle(), addToMapId(), callHook(), error(), getNewTCE(), and writeRecords_records_order().

Referenced by importData().

tx_impexp::writeRecords_records_order ( mainPid)

Organize all updated record to their new positions. Only used for updates

Parameters:
integerMain PID into which we import.
Returns:
void private
See also:
writeRecords_records(), writeRecords_pages_order()

Definition at line 1342 of file class.tx_impexp.php.

References $pid, callHook(), dontIgnorePid(), flatInversePageTree(), getNewTCE(), and t3lib_div\testInt().

Referenced by writeRecords_records().


Member Data Documentation

tx_impexp::$allowPHPScripts = FALSE

Definition at line 207 of file class.tx_impexp.php.

tx_impexp::$cache_getRecordPath = array()

Definition at line 231 of file class.tx_impexp.php.

tx_impexp::$checkPID_cache = array()

Definition at line 232 of file class.tx_impexp.php.

tx_impexp::$compress = 0

Definition at line 234 of file class.tx_impexp.php.

Referenced by addFilePart(), and compileMemoryToFileContent().

tx_impexp::$dat = array()
tx_impexp::$display_import_pid_record = ''

Definition at line 201 of file class.tx_impexp.php.

tx_impexp::$doesImport = FALSE

Definition at line 198 of file class.tx_impexp.php.

tx_impexp::$dontCompress = 0

Definition at line 221 of file class.tx_impexp.php.

Referenced by init().

tx_impexp::$enableLogging = FALSE

Definition at line 208 of file class.tx_impexp.php.

tx_impexp::$errorLog = array()

Definition at line 230 of file class.tx_impexp.php.

tx_impexp::$excludeMap = array()

Definition at line 218 of file class.tx_impexp.php.

tx_impexp::$extensionDependencies = array()

Definition at line 220 of file class.tx_impexp.php.

tx_impexp::$extFileResourceExtensions = 'html,htm,css'

Definition at line 223 of file class.tx_impexp.php.

tx_impexp::$fileadminFolderName = 'fileadmin'

Definition at line 194 of file class.tx_impexp.php.

tx_impexp::$fileIDMap = array()

Definition at line 210 of file class.tx_impexp.php.

tx_impexp::$fileProcObj = ''
tx_impexp::$force_all_UIDS = FALSE

Definition at line 205 of file class.tx_impexp.php.

tx_impexp::$global_ignore_pid = FALSE

Definition at line 204 of file class.tx_impexp.php.

tx_impexp::$import_data = array()

Definition at line 229 of file class.tx_impexp.php.

tx_impexp::$import_mapId = array()

Definition at line 226 of file class.tx_impexp.php.

tx_impexp::$import_mode = array()

Definition at line 203 of file class.tx_impexp.php.

tx_impexp::$import_newId = array()

Definition at line 227 of file class.tx_impexp.php.

tx_impexp::$import_newId_pids = array()

Definition at line 228 of file class.tx_impexp.php.

tx_impexp::$includeExtFileResources = 0

Definition at line 222 of file class.tx_impexp.php.

tx_impexp::$maxExportSize = 10000000

Definition at line 215 of file class.tx_impexp.php.

tx_impexp::$maxFileSize = 1000000

Definition at line 213 of file class.tx_impexp.php.

tx_impexp::$maxRecordSize = 1000000

Definition at line 214 of file class.tx_impexp.php.

tx_impexp::$mode = ''

Definition at line 196 of file class.tx_impexp.php.

Referenced by init().

tx_impexp::$relOnlyTables = array()

Definition at line 216 of file class.tx_impexp.php.

tx_impexp::$relStaticTables = array()

Definition at line 217 of file class.tx_impexp.php.

tx_impexp::$showDiff = FALSE

Definition at line 206 of file class.tx_impexp.php.

tx_impexp::$showStaticRelations = FALSE

Definition at line 193 of file class.tx_impexp.php.

tx_impexp::$softrefCfg = array()

Definition at line 219 of file class.tx_impexp.php.

tx_impexp::$softrefInputValues = array()

Definition at line 209 of file class.tx_impexp.php.

tx_impexp::$suggestedInsertUids = array()

Definition at line 202 of file class.tx_impexp.php.

tx_impexp::$update = FALSE

Definition at line 197 of file class.tx_impexp.php.


The documentation for this class was generated from the following file: