TYPO3 Core libraries, t3lib/

This is the API documentation for the t3lib/ directory contents.
Many of these classes are possible to use in your own applications with TYPO3.
In any case you should read the notices for the files / classes first.
For practical uses of these APIs you should look for the document "TYPO3 Core API" (new with TYPO3 3.6.0) since this will point you to the functions which you might find useful.

Here is a few highlights from this library:
For writing extensions, the file class.t3lib_extMgm.php contains various API functions for adding modules, tables, fields, and other configuration options, mostly from ext_tables.php and ext_localconf.php files.
General purpose functions for usage in both frontend and backend (often functions not specific to TYPO3) can be found in class.t3lib_div.php - please look into this class!
For backend programming (modules etc) the file class.t3lib_befunc.php contains functions - notice, they cannot be used from the frontend!

 

Files: 43
Total filesizes: 1.3 Mbytes
Functions and classes: 989

class.t3lib_admin.php

class.t3lib_arraybrowser.php

class.t3lib_basicfilefunc.php

class.t3lib_bedisplaylog.php

class.t3lib_befunc.php

class.t3lib_beuserauth.php

class.t3lib_browsetree.php

class.t3lib_clipboard.php

class.t3lib_cs.php

class.t3lib_db.php

class.t3lib_diff.php

class.t3lib_div.php

class.t3lib_extmgm.php

class.t3lib_extobjbase.php

class.t3lib_foldertree.php

class.t3lib_formmail.php

class.t3lib_iconworks.php

class.t3lib_loaddbgroup.php

class.t3lib_loadmodules.php

class.t3lib_matchcondition.php

class.t3lib_page.php

class.t3lib_pagetree.php

class.t3lib_parsehtml.php

class.t3lib_parsehtml_proc.php

class.t3lib_positionmap.php

class.t3lib_readmail.php

class.t3lib_recordlist.php

class.t3lib_scbase.php

class.t3lib_sqlengine.php

class.t3lib_stdgraphic.php

class.t3lib_superadmin.php

class.t3lib_syntaxhl.php

class.t3lib_tceforms.php

class.t3lib_timetrack.php

class.t3lib_transferdata.php

class.t3lib_treeview.php

class.t3lib_tsfebeuserauth.php

class.t3lib_tsparser.php

class.t3lib_tstemplate.php

class.t3lib_userauth.php

class.t3lib_userauthgroup.php

class.t3lib_xml.php

thumbs.php

class.t3lib_admin.php

This class holds functions used by the TYPO3 backend to check the integrity of the database (The DBint module, 'lowlevel' extension)

Depends on: Depends on loaddbgroup from t3lib/

class t3lib_admin

@todo: Need to really extend this class when the tcemain library has been updated and the whole API is better defined. There are some known bugs in this library. Further it would be nice with a facility to not only analyze but also clean up!

@package: TYPO3

@subpackage: t3lib

function genTree($theID, $depthData)

function lostRecords($pid_list)

function fixLostRecord($table,$uid)

function countRecords($pid_list)

function getGroupFields($mode)

function getFileFields($uploadfolder)

function getDBFields($theSearchTable)

function selectNonEmptyRecordsWithFkeys($fkey_arrays)

function testFileRefs ()

function testDBRefs($theArray)

function whereIsRecordReferenced($searchTable,$id)

function whereIsFileReferenced($uploadfolder,$filename)

class.t3lib_arraybrowser.php

Class for displaying an array as a tree
See the extension 'lowlevel' /config (Backend module 'Tools > Configuration')

class t3lib_arrayBrowser

@package: TYPO3

@subpackage: t3lib

function tree($arr, $depth_in, $depthData)

function getSearchKeys($keyArr, $depth_in, $searchString, $keyArray)

function fixed_lgd($string,$chars)

function depthKeys($arr,$settings)

class.t3lib_basicfilefunc.php

Contains functions for management, validation etc of files in TYPO3, using the concepts of web- and ftp-space. Please see the comment for the init() function

class t3lib_basicFileFunctions

@package: TYPO3

@subpackage: t3lib

Checking functions

function init($mounts, $f_ext)

function getTotalFileInfo($wholePath)

function is_allowed($iconkey,$type)

function checkIfFullAccess($theDest)

function is_webpath($path)

function checkIfAllowed($ext, $theDest, $filename='')

function checkFileNameLen($fileName)

function is_directory($theDir)

function isPathValid($theFile)

function getUniqueName($theFile, $theDest, $dontCheckForUnique=0)

function checkPathAgainstMounts($thePath)

function blindPath($thePath)

function findTempFolder()

Cleaning functions

function cleanDirectoryName($theDir)

function rmDoubleSlash($string)

function slashPath($path)

function cleanFileName($fileName)

function formatSize($sizeInBytes)

class.t3lib_bedisplaylog.php

This class holds some functions used to display the sys_log table-content.
Used in the status-scripts and the log-module.

class t3lib_BEDisplayLog

@package: TYPO3

@subpackage: t3lib

function initArray()

function getTimeLabel($code)

function getUserLabel($code)

function getTypeLabel($code)

function getActionLabel($code)

function getDetails($code,$text,$data,$sys_log_uid=0)

function reset()

function getErrorFormatting($sign)

function formatDetailsForList($row)

function stripPath($inArr)

class.t3lib_befunc.php

Standard functions available for the TYPO3 backend.
Don't instantiate - call functions with "t3lib_BEfunc::" prefixed the function name.

class t3lib_BEfunc

@package: TYPO3

@subpackage: t3lib

SQL-related, selecting records, searching

function deleteClause($table)

function getRecord($table,$uid,$fields='*',$where='')

function getRecordRaw($table,$where='',$fields='*')

function getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='')

function searchQuery($searchWords,$fields,$table='')

function listQuery($field,$value)

function splitTable_Uid($str)

function getSQLselectableList ($in_list,$tablename,$default_tablename)

function BEenableFields($table,$inv=0)

SQL-related, DEPRECIATED functions
(use t3lib_DB functions instead)

function mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')

function DBcompileInsert($table,$fields_values)

function DBcompileUpdate($table,$where,$fields_values)

Page tree, TCA related

function BEgetRootLine ($uid,$clause='')

function getRecordPath($uid,$clause,$titleLimit)

function getExcludeFields()

function readPageAccess($id,$perms_clause)

function getTCAtypes($table,$rec,$useFieldNameAsKey=0)

function getTCAtypeValue($table,$rec)

function getSpecConfParts($str)

function getSpecConfParametersFromArray($pArr)

function getFlexFormDS($conf,$row,$table)

Caching related

function storeHash($hash,$data,$ident)

function getHash($hash,$expTime)

TypoScript related

function getPagesTSconfig($id,$rootLine='',$returnPartArray=0)

function updatePagesTSconfig($id,$pageTS,$TSconfPrefix,$impParams='')

function implodeTSParams($p,$k='')

Users / Groups related

function getUserNames($fields='username,usergroup,usergroup_cached_list,uid',$where='')

function getGroupNames($fields='title,uid', $where='')

function getListGroupNames($fields='title,uid')

function blindUserNames($usernames,$groupArray,$excludeBlindedFlag=0)

function blindGroupNames($groups,$groupArray,$excludeBlindedFlag=0)

Output related

function daysUntil($tstamp)

function date($tstamp)

function datetime($value)

function time($value)

function calcAge ($seconds,$labels)

function dateTimeAge($tstamp,$prefix=1,$date='')

function titleAttrib($content='',$hsc=0)

function titleAltAttrib($content)

function thumbCode($row,$table,$field,$backPath,$thumbScript='',$uploaddir='',$abs=0,$tparams='',$size='')

function getThumbNail($thumbScript,$theFile,$tparams='',$size='')

function titleAttribForPages($row,$perms_clause='',$includeAttrib=1)

function getRecordIconAltText($row,$table='pages')

function getLabelFromItemlist($table,$col,$key)

function getItemLabel($table,$col,$printAllWrap='')

function getRecordTitle($table,$row,$prep=0)

function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0)

function getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0)

function getFileIcon($ext)

function getCommonSelectFields($table,$prefix)

function makeConfigForm($configArray,$defaults,$dataPrefix)

Backend Modules API functions

function helpTextIcon($table,$field,$BACK_PATH,$force=0)

function helpText($table,$field,$BACK_PATH)

function editOnClick($params,$backPath='',$requestUri='')

function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='')

function getModTSconfig($id,$TSref)

function getFuncMenu($id,$elementName,$currentValue,$menuItems,$script='',$addparams='')

function getFuncCheck($id,$elementName,$currentValue,$script='',$addparams='',$tagParams='')

function getFuncInput($id,$elementName,$currentValue,$size=10,$script="",$addparams="")

function unsetMenuItems($modTSconfig,$itemArray,$TSref)

function getSetUpdateSignal($set='')

function getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')

Core

function lockRecords($table='',$uid=0,$pid=0)

function isRecordLocked($table,$uid)

function exec_foreign_table_where_query($fieldValue,$field='',$TSconfig=array(),$prefix='')

function getTCEFORM_TSconfig($table,$row)

function getTSconfig_pidValue($table,$uid,$pid)

function getPidForModTSconfig($table,$uid,$pid)

function getTSCpid($table,$uid,$pid)

function firstDomainRecord($rootLine)

function getDomainStartPage($domain, $path='')

function RTEsetup($RTEprop,$table,$field,$type='')

function isModuleSetInTBE_MODULES($modName)

Miscellaneous

function typo3PrintError ($header,$text,$js='',$head=1)

function getPathType_web_nonweb($path)

function ADMCMD_previewCmds($pageinfo)

function processParams($params)

function getListOfBackendModules($name,$perms_clause,$backPath='',$script='index.php')

class.t3lib_beuserauth.php

TYPO3 user authentication, backend
Could technically have been the same class as t3lib_userauthgroup since these two are always used together and only together.
t3lib_userauthgroup contains most of the functions used for checking permissions, authenticating users, setting up the user etc. This class is most interesting in terms of an API for user from outside.
This class contains the configuration of the database fields used plus some functions for the authentication process of backend users.

class t3lib_beUserAuth extends t3lib_userAuthGroup

@package: TYPO3

@subpackage: t3lib

function trackBeUser($flag)

function checkLockToIP()

function backendCheckLogin()

function backendSetUC()

function overrideUC()

function resetUC()

function emailAtLogin()

function veriCode()

class.t3lib_browsetree.php

Extension class for the t3lib_treeView class, specially made for browsing pages

class t3lib_browseTree extends t3lib_treeView

@package: TYPO3

@subpackage: t3lib

function init($clause='')

function getTitleAttrib($row)

function wrapIcon($icon,$row)

class.t3lib_clipboard.php

TYPO3 clipboard for records and files

class t3lib_clipboard

@package: TYPO3

@subpackage: t3lib

function initializeClipboard()

function lockToNormal()

function setCmd($cmd)

function setCurrentPad($padIdent)

function endClipboard()

function cleanUpCBC($CBarr,$table,$removeDeselected=0)

function isElements()

function printClipboard()

function printContentFromTab($pad)

function padTitleWrap($str,$pad)

function linkItemText($str,$rec,$table='')

function isSelected($table,$uid)

function getSelectedRecord($table='',$uid='')

function selUrlDB($table,$uid,$copy=0,$deselect=0,$baseArray=array())

function selUrlFile($path,$copy=0,$deselect=0,$baseArray=array())

function pasteUrl($table,$uid,$setRedirect=1)

function deleteUrl($setRedirect=1,$file=0)

function editUrl()

function removeUrl($table,$uid)

function cleanCurrent()

function elFromTable($matchTable='',$pad='')

function confirmMsg($table,$rec,$type,$clElements)

function removeElement($el)

function saveClipboard()

function currentMode()

function clLabel($key,$Akey='labels')

FOR USE IN tce_db.php:

function makePasteCmdArray($ref,$CMD)

function makeDeleteCmdArray($CMD)

FOR USE IN tce_file.php:

function makePasteCmdArray_file($ref,$FILE)

function makeDeleteCmdArray_file($FILE)

class.t3lib_cs.php

Class for conversion between charsets.

class t3lib_cs

@package: TYPO3

@subpackage: t3lib

function parse_charset($charset)

function conv($str,$fromCS,$toCS,$useEntityForNoChar=0)

function utf8_encode($str,$charset)

function utf8_decode($str,$charset,$useEntityForNoChar=0)

function utf8_to_entities($str)

function entities_to_utf8($str,$alsoStdHtmlEnt=0)

function utf8_to_numberarray($str,$convEntities=0,$retChar=0)

function initCharset($charset)

function UnumberToChar($cbyte)

function utf8CharToUnumber($str,$hex=0)

function utf8_strtrunc($str,$len)

function utf_strlen($str)

function utf_substr($str,$start,$len=0)

function utf_strpos($haystack,$needle,$offset=0)

function utf_strrpos($haystack,$needle,$offset=0)

class.t3lib_db.php

TYPO3 "database wrapper" class (new in 3.6.0)
This class contains
- abstraction functions for executing INSERT/UPDATE/DELETE/SELECT queries ("Query execution"; These are REQUIRED for all future connectivity to the database, thus ensuring DBAL compliance!)
- functions for building SQL queries (INSERT/UPDATE/DELETE/SELECT) ("Query building"); These are transitional functions for building SQL queries in a more automated way. Use these to build queries instead of doing it manually in your code!
- mysql() wrapper functions; These are transitional functions. By a simple search/replace you should be able to substitute all mysql*() calls with $GLOBALS['TYPO3_DB']->sql*() and your application will work out of the box. YOU CANNOT (legally) use any mysql functions not found as wrapper functions in this class!
See the Project Coding Guidelines (doc_core_cgl) for more instructions on best-practise

This class is not in itself a complete database abstraction layer but can be extended to be a DBAL (by extensions, see "dbal" for example)
ALL connectivity to the database in TYPO3 must be done through this class!
The points of this class are:
- To direct all database calls through this class so it becomes possible to implement DBAL with extensions.
- To keep it very easy to use for developers used to MySQL in PHP - and preserve as much performance as possible when TYPO3 is used with MySQL directly...
- To create an interface for DBAL implemented by extensions; (Eg. making possible escaping characters, clob/blob handling, reserved words handling)
- Benchmarking the DB bottleneck queries will become much easier; Will make it easier to find optimization possibilities.

USE:
In all TYPO3 scripts the global variable $TYPO3_DB is an instance of this class. Use that.
Eg. $GLOBALS['TYPO3_DB']->sql_fetch_assoc()

class t3lib_DB

@package: TYPO3

@subpackage: t3lib

Query execution
These functions are the RECOMMENDED DBAL functions for use in your applications
Using these functions will allow the DBAL to use alternative ways of accessing data (contrary to if a query is returned!)
They compile a query AND execute it immediately and then return the result
This principle heightens our ability to create various forms of DBAL of the functions.
Generally: We want to return a result pointer/object, never queries.
Also, having the table name together with the actual query execution allows us to direct the request to other databases.

function exec_INSERTquery($table,$fields_values)

function exec_UPDATEquery($table,$where,$fields_values)

function exec_DELETEquery($table,$where)

function exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy='',$orderBy='',$limit='')

function exec_SELECT_mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')

function exec_SELECT_queryArray($queryParts)

Query building

function INSERTquery($table,$fields_values)

function UPDATEquery($table,$where,$fields_values)

function DELETEquery($table,$where)

function SELECTquery($select_fields,$from_table,$where_clause,$groupBy='',$orderBy='',$limit='')

function listQuery($field, $value, $table)

function searchQuery($searchWords,$fields,$table)

Various helper functions
Functions recommended to be used for
- escaping values,
- cleaning lists of values,
- stripping of excess ORDER BY/GROUP BY keywords

function quoteStr($str, $table)

function cleanIntArray($arr)

function cleanIntList($list)

function stripOrderBy($str)

function stripGroupBy($str)

function splitGroupOrderLimit($str)

MySQL wrapper functions
(For use in your applications)

function sql($db,$query)

function sql_query($query)

function sql_error()

function sql_num_rows($res)

function sql_fetch_assoc($res)

function sql_fetch_row($res)

function sql_free_result($res)

function sql_insert_id()

function sql_affected_rows()

function sql_data_seek($res,$seek)

function sql_field_type($res,$pointer)

function sql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password)

function sql_select_db($TYPO3_db)

SQL admin functions
(For use in the Install Tool and Extension Manager)

function admin_get_dbs()

function admin_get_tables()

function admin_get_fields($tableName)

function admin_get_keys($tableName)

function admin_query($query)

Debugging

function debug($func)

class.t3lib_diff.php

This class has functions which generates a difference output of a content string
Currently works only with LINUX/UNIX

class t3lib_diff

@package: TYPO3

@subpackage: t3lib

function makeDiffDisplay($str1,$str2)

function getDiff($str1,$str2)

function addClearBuffer($clearBuffer,$last=0)

function explodeStringIntoWords($str)

function tagSpace($str,$rev=0)

class.t3lib_div.php

The legendary "t3lib_div" class - Miscellaneous functions for general purpose.
Most of the functions does not relate specifically to TYPO3
However a section of functions requires certain TYPO3 features available
See comments in the source.
You are encouraged to use this library in your own scripts!

USE:
The class is intended to be used without creating an instance of it.
So: Don't instantiate - call functions with "t3lib_div::" prefixed the function name.
So use t3lib_div::[method-name] to refer to the functions, eg. 't3lib_div::milliseconds()'

class t3lib_div

@package: TYPO3

@subpackage: t3lib

GET/POST Variables
Background:
Input GET/POST variables in PHP may have their quotes escaped with "\" or not depending on configuration.
TYPO3 has always converted quotes to BE escaped if the configuration told that they would not be so.
But the clean solution is that quotes are never escaped and that is what the functions below offers.
Eventually TYPO3 should provide this in the global space as well.
In the transitional phase (or forever..?) we need to encourage EVERY to read and write GET/POST vars through the API functions below.

function _GP($var)

function _GET($var='')

function _POST($var='')

function _GETset($inputGet,$key='')

function GPvar($var,$strip=0)

function setGPvars($list,$strip=0)

function GParrayMerged($var)

IMAGE FUNCTIONS

function gif_compress($theFile, $type)

function png_to_gif_by_imagemagick($theFile)

function read_png_gif($theFile,$output_png=0)

STRING FUNCTIONS

function fixed_lgd($string,$chars,$preStr='...')

function fixed_lgd_pre($string,$chars)

function breakTextForEmail($str,$implChar="\n",$charWidth=76)

function breakLinesForEmail($str,$implChar="\n",$charWidth=76)

function cmpIP($baseIP, $list)

function inList($in_list,$item)

function rmFromList($element,$list)

function intInRange($theInt,$min,$max=2000000000,$zeroValue=0)

function intval_positive($theInt)

function int_from_ver($verNumberStr)

function md5int($str)

function uniqueList($in_list)

function split_fileref($fileref)

function dirname($path)

function modifyHTMLColor($color,$R,$G,$B)

function modifyHTMLColorAll($color,$all)

function rm_endcomma($string)

function danish_strtoupper($string)

function convUmlauts($str)

function shortMD5($input, $len=10)

function testInt($var)

function isFirstPartOfStr($str,$partStr)

function formatSize($sizeInBytes,$labels='')

function convertMicrotime($microtime)

function splitCalc($string,$operators)

function calcPriority($string)

function calcParenthesis($string)

function htmlspecialchars_decode($value)

function deHSCentities($str)

function slashJS($string,$extended=0,$char="'")

function rawUrlEncodeJS($str)

function rawUrlEncodeFP($str)

function validEmail($email)

function formatForTextarea($content)

ARRAY FUNCTIONS

function inArray($in_array,$item)

function intExplode($delim, $string)

function revExplode($delim, $string, $count=0)

function trimExplode($delim, $string, $onlyNonEmptyValues=0)

function uniqueArray($valueArray)

function removeArrayEntryByValue($array,$cmpValue)

function implodeArrayForUrl($name,$theArray,$str='',$skipBlank=0,$rawurlencodeParamName=0)

function compileSelectedGetVarsFromArray($varList,$getArray,$GPvarAlt=1)

function addSlashesOnArray(&$theArray)

function stripSlashesOnArray(&$theArray)

function slashArray($arr,$cmd)

function array_merge_recursive_overrule ($arr0,$arr1,$notAddKeys=0)

function array_merge($arr1,$arr2)

function csvValues($row,$delim=',',$quote='"')

HTML/XML PROCESSING

function get_tag_attributes($tag)

function split_tag_attributes($tag)

function implodeParams($arr,$xhtmlSafe=FALSE,$dontOmitBlankAttribs=FALSE)

function wrapJS($string, $linebreak=TRUE)

function xml2tree($string,$depth=999)

function array2xml($array,$NSprefix='',$level=0,$docTag='phparray',$spaceInd=0, $options=array(),$parentTagName='')

function xml2array($string,$NSprefix='')

function xmlRecompileFromStructValArray($vals)

function xmlGetHeaderAttribs($xmlData)

FILES FUNCTIONS

function getURL($url)

function writeFile($file,$content)

function get_dirs($path)

function getFilesInDir($path,$extensionList='',$prependPath=0,$order='')

function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99)

function removePrefixPathFromList($fileArr,$prefixToRemove)

function fixWindowsFilePath($theFile)

function resolveBackPath($pathStr)

function locationHeaderUrl($path)

DEBUG helper FUNCTIONS

function debug_ordvalue($string,$characters=100)

function view_array($array_in)

function print_array($array_in)

function debug($var="",$brOrHeader=0)

SYSTEM INFORMATION

function getThisUrl()

function linkThisScript($getParams=array())

function linkThisUrl($url,$getParams=array())

function getIndpEnv($getEnvName)

function milliseconds()

function clientInfo($useragent='')

TYPO3 SPECIFIC FUNCTIONS

function getFileAbsFileName($filename,$onlyRelative=1,$relToTYPO3_mainDir=0)

function validPathStr($theFile)

@todo: Possible improvement: Should it rawurldecode the string first to check if any of these characters is encoded ?

function isAbsPath($path)

function isAllowedAbsPath($path)

function verifyFilenameAgainstDenyPattern($filename)

function upload_copy_move($source,$destination)

function upload_to_tempfile($uploadedFileName)

function unlink_tempfile($uploadedTempFileName)

function tempnam($filePrefix)

function stdAuthCode($uid_or_record,$fields='')

function loadTCA($table)

function resolveSheetDefInDS($dataStructArray,$sheet='sDEF')

function resolveAllSheetsInDS($dataStructArray)

function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)

function makeInstanceService($serviceType, $serviceSubType='', $excludeServiceKeys='')

function makeInstanceClassName($className)

function plainMailEncoded($email,$subject,$message,$headers='',$enc='',$charset='ISO-8859-1',$dontEncodeSubject=0)

function quoted_printable($string,$maxlen=76)

function substUrlsInPlainText($message,$urlmode='76',$index_script_url='')

function makeRedirectUrl($inUrl,$l=0,$index_script_url='')

function freetypeDpiComp($font_size)

function devLog($msg, $extKey, $severity=0, $dataVar=FALSE)

class.t3lib_extmgm.php

Extension Management functions

This class is never instantiated, rather the methods inside is called as functions like
t3lib_extMgm::isLoaded('my_extension');

class t3lib_extMgm

@package: TYPO3

@subpackage: t3lib

PATHS and other evaluation

function isLoaded($key,$exitOnError=0)

function extPath($key,$script='')

function extRelPath($key)

function siteRelPath($key)

function getCN($key)

Adding BACKEND features
(related to core features)

function addTCAcolumns($table,$columnArray,$addTofeInterface=0)

function addToAllTCAtypes($table,$str,$specificTypesList='',$beforeList='')

function allowTableOnStandardPages($table)

function addModule($main,$sub='',$position='',$path='')

function insertModuleFunction($modname,$className,$classPath,$title,$MM_key='function')

function addPageTSConfig($content)

function addUserTSConfig($content)

function addLLrefForTCAdescr($tca_descr_key,$file_ref)

Adding SERVICES features

function addService($extKey, $serviceType, $serviceKey, $info)

function findService($serviceType, $serviceSubType='', $excludeServiceKeys='')

function deactivateService($serviceType, $serviceKey)

Adding FRONTEND features
(related specifically to "cms" extension)

function addPlugin($itemArray,$type='list_type')

function addPiFlexFormValue($piKeyToMatch,$value)

function addToInsertRecords($table,$content_table='tt_content',$content_field='records')

function addPItoST43($key,$classFile='',$prefix='',$type='list_type',$cached=0)

function addStaticFile($extKey,$path,$title)

function addTypoScriptSetup($content)

function addTypoScriptConstants($content)

function addTypoScript($key,$type,$content,$afterStaticUid=0)

INTERNAL EXTENSION MANAGEMENT:

function typo3_loadExtensions()

function _makeIncludeHeader($key,$file)

function isCacheFilesAvailable($cacheFilePrefix)

function isLocalconfWritable()

function cannotCacheFilesWritable($cacheFilePrefix)

function currentCacheFiles()

function writeCacheFiles($extensions,$cacheFilePrefix)

class.t3lib_extobjbase.php

Parent class for 'Extension Objects' in backend modules.
Used for 'submodules' to other modules. Also called 'Function menu modules' in t3lib_extMgm. And now its even called 'Extension Objects'. Or 'Module functions'. Wish we had just one name. Or a name at all...(?) Thank God its not so advanced when it works...
In other words this class is used for backend modules which is not true backend modules appearing in the menu but rather adds themselves as a new entry in the function menu which typically exists for a backend module (like Web>Functions, Web>Info or Tools etc...)
The magic that binds this together is stored in the global variable $TBE_MODULES_EXT where extensions wanting to connect a module based on this class to an existing backend module store configuration which consists of the classname, script-path and a label (title/name)
For more information about this, please see the large example comment for the class t3lib_SCbase. This will show the principle of a 'level-1' connection.
The more advanced example - having two layers as it is done by the 'func_wizards' extension with the 'web_info' module - can be seen in the comment above.

class t3lib_extobjbase

@package: TYPO3

@subpackage: t3lib

function init(&$pObj,$conf)

function handleExternalFunctionValue()

function incLocalLang()

function checkExtObj()

function extObjContent()

function modMenu()

class.t3lib_foldertree.php

Extension class for the t3lib_treeView class, specially made for browsing folders in the File module

class t3lib_folderTree extends t3lib_treeView

@package: TYPO3

@subpackage: t3lib

function t3lib_folderTree()

function wrapIcon($icon,$row)

function getId($v)

function getJumpToParm($v)

function getTitleStr($row,$titleLen=30)

function getBrowsableTree()

function getFolderTree($files_path, $depth=999, $depthData='')

function getCount($files_path)

function initializePositionSaving()

class.t3lib_formmail.php

Formmail class, used by the TYPO3 "cms" extension (default frontend) to send email forms.

class t3lib_formmail extends t3lib_htmlmail

@package: TYPO3

@subpackage: t3lib

function start($V,$base64=1)

function addAttachment($file, $filename)

class.t3lib_iconworks.php

Icon generation, backend
This library has functions that returns - and if necessary creates - the icon for an element in TYPO3

Expects global vars:
- $BACK_PATH
- PATH_typo3
- $TCA, $PAGES_TYPES


Notes:
These functions are strongly related to the interface of TYPO3.
The class is included in eg. init.php
ALL functions called without making a class instance, eg. "t3lib_iconWorks::getIconImage()"

class t3lib_iconWorks

@package: TYPO3

@subpackage: t3lib

function getIconImage($table,$row=array(),$backPath,$params='',$shaded=FALSE)

function getIcon($table,$row=array(),$shaded=FALSE)

function skinImg($backPath,$src,$wHattribs='',$outputMode=0)

Other functions

function makeIcon($iconfile,$mode, $user, $protectSection,$absFile,$iconFileName_stateTagged)

function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)

function imagecreatefrom($file)

function imagemake($im, $path)

class.t3lib_loaddbgroup.php

Load database groups (relations)
Used to process the relations created by the TCA element types "group" and "select" for database records. Manages MM-relations as well.

class t3lib_loadDBGroup

@package: TYPO3

@subpackage: t3lib

function start ($itemlist,$tablelist, $MMtable='',$MMuid=0)

function readList($itemlist)

function readMM($tableName,$uid)

function writeMM($tableName,$uid,$prependTableName=0)

function getValueArray($prependTableName='')

function convertPosNeg($valueArray,$fTable,$nfTable)

function getFromDB()

function readyForInterface()

class.t3lib_loadmodules.php

Load Backend Interface modules

Typically instantiated like this:
$this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
$this->loadModules->load($TBE_MODULES);

class t3lib_loadModules

@package: TYPO3

@subpackage: t3lib

function load($modulesArray,$BE_USER='')

function checkExtensionModule($name)

function checkMod($name, $fullpath)

function checkModAccess($name,$MCONF)

function parseModulesArray ($arr)

function cleanName ($str)

function getRelativePath($baseDir,$destDir)

class.t3lib_matchcondition.php

Matching TypoScript conditions

Used with the TypoScript parser.
Matches browserinfo, IPnumbers for use with templates

class t3lib_matchCondition

@package: TYPO3

@subpackage: t3lib

function match($string)

function testNumber($test,$value)

function matchWild($haystack,$needle)

function whichDevice($useragent)

function browserInfo($useragent)

function getGlobal($var,$inArr='')

function getGP_ENV_TSFE($var)

class.t3lib_page.php

Page functions, a lot of sql/pages-related functions
Mainly used in the frontend but also in some cases in the backend.
It's important to set the right $where_hid_del in the object so that the functions operate properly

class t3lib_pageSelect

@package: TYPO3

@subpackage: t3lib

function init($show_hidden)

Selecting page records

function getPage($uid)

function getPage_noCheck($uid)

function getFirstWebPage($uid)

function getPageIdFromAlias($alias)

function getPageOverlay($pageInput,$lUid=-1)

Page related: Menu, Domain record, Root line

function getMenu($uid,$fields='*',$sortField='sorting',$addWhere='')

function getDomainStartPage($domain, $path='',$request_uri='')

function getRootLine($uid, $MP='')

function getPathFromRootline($rl,$len=20)

function getExtURL($pagerow,$disable=0)

Selecting records in general

function checkRecord($table,$uid,$checkPage=0)

function getRawRecord($table,$uid,$fields='*')

function getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='')

Caching and standard clauses

function getHash($hash,$expTime=0)

function storeHash($hash,$data,$ident)

function deleteClause($table)

function enableFields($table,$show_hidden=-1,$ignore_array=array())

class.t3lib_pagetree.php

Class for generating a page tree.

class t3lib_pageTree extends t3lib_treeView

@package: TYPO3

@subpackage: t3lib

function init($clause='')

function expandNext($id)

function PMicon($row,$a,$c,$nextCount,$exp)

function initializePositionSaving()

class.t3lib_parsehtml.php

Functions for parsing HTML.
You are encouraged to use this class in your own applications

class t3lib_parsehtml

@package: TYPO3

@subpackage: t3lib

function getSubpart($content, $marker)

function substituteSubpart($content,$marker,$subpartContent,$recursive=1,$keepMarker=0)

function splitIntoBlock($tag,$content,$eliminateExtraEndTags=0)

function splitTags($tag,$content)

function getAllParts($parts,$tag_parts=1,$include_tag=1)

function removeFirstAndLastTag($str)

function getFirstTag($str)

function getFirstTagName($str,$preserveCase=FALSE)

function checkTagTypeCounts($content,$blockTags='a,b,blockquote,body,div,em,font,form,h1,h2,h3,h4,h5,h6,i,li,map,ol,option,p,pre,select,span,strong,table,td,textarea,tr,u,ul', $soloTags='br,hr,img,input,area')

function HTMLcleaner($content, $tags=array(),$keepAll=0,$hSC=0,$addConfig=array())

function get_tag_attributes($tag,$deHSC=0)

function split_tag_attributes($tag)

function bidir_htmlspecialchars($value,$dir)

function prefixResourcePath($main_prefix,$content,$alternatives=array())

function prefixRelPath($prefix,$srcVal)

function cleanFontTags($value,$keepFace=0,$keepSize=0,$keepColor=0)

function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<')

function unprotectTags($content,$tagList='')

function stripTagsExcept($value,$tagList)

function caseShift($str,$flag,$cacheKey='')

function compileTagAttribs($tagAttrib,$meta=array(), $xhtmlClean=0)

function get_tag_attributes_classic($tag,$deHSC=0)

function HTMLparserConfig($TSconfig,$keepTags=array())

function XHTML_clean($content)

function processTag($value,$conf,$endTag,$protected=0)

function processContent($value,$dir,$conf)

class.t3lib_parsehtml_proc.php

Class for parsing HTML for the Rich Text Editor. (also called transformations)

class t3lib_parsehtml_proc extends t3lib_parsehtml

@package: TYPO3

@subpackage: t3lib

function init($elRef='',$recPid=0)

function setRelPath($path)

function evalWriteFile($pArr,$currentRecord)

Main function

function RTE_transform($value,$specConf,$direction='rte',$thisConfig=array())

Specific RTE TRANSFORMATION functions

function TS_images_db($value)

function TS_images_rte($value)

function TS_reglinks($value,$direction)

function TS_links_db($value)

function TS_links_rte($value)

function TS_preserve_db($value)

function TS_preserve_rte($value)

function TS_transform_db($value,$css=FALSE)

function TS_transform_rte($value,$css=0)

function TS_strip_db($value)

Generic RTE transformation, analysis and helper functions

function getURL($url)

function HTMLcleaner_db($content,$tagList='')

function getKeepTags($direction='rte',$tagList='')

function divideIntoLines($value,$count=5,$returnArray=FALSE)

function setDivTags($value,$dT='p')

function internalizeFontTags($value)

function siteUrl()

function rteImageStorageDir()

function removeTables($value,$breakChar='<br />')

function defaultTStagMapping($code,$direction='rte')

function getWHFromAttribs($attribArray)

function urlInfoForLinkTags($url)

function TS_AtagToAbs($value,$dontSetRTEKEEP=FALSE)

class.t3lib_positionmap.php

Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
Used for pages / tt_content element wizards of various kinds.

class t3lib_positionMap

@package: TYPO3

@subpackage: t3lib

Page position map:

function positionTree($id,$pageinfo,$perms_clause,$R_URI)

function JSimgFunc($prefix='')

function boldTitle($t_code,$dat,$id)

function onClickEvent($pid,$newPagePID)

function insertlabel()

function linkPageTitle($str,$rec)

function checkNewPageInPid($pid)

function getModConfig($pid)

function insertQuadLines($codes,$allBlank=0)

Content element positioning:

function printContentElementColumns($pid,$moveUid,$colPosList,$showHidden,$R_URI)

function printRecordMap($lines,$colPosArray)

function wrapColumnHeader($str,$vv)

function insertPositionIcon($row,$vv,$kk,$moveUid,$pid)

function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0)

function wrapRecordHeader($str,$row)

function getRecordHeader($row)

function wrapRecordTitle($str,$row)

class.t3lib_readmail.php

Functions used to read email content
The class is still just a bunch of miscellaneous functions used to read content out of emails

class t3lib_readmail

@package: TYPO3

@subpackage: t3lib

FUNCTIONS for the Dmailer

function find_MIDfromReturnPath($to)

function find_XTypo3MID($content)

General

function getMessage($mailParts)

function getTextContent($content)

function getMailBoundaryParts($boundary,$content)

function getCType($str)

function analyseReturnError($c)

function decodeHeaderString($str)

function extractNameEmail($str)

function getContentTypeData($contentTypeStr)

function makeUnixDate($dateStr)

function getGMToffset($GMT)

function extractMailHeader($content,$limit=0)

function fullParse($content)

class.t3lib_recordlist.php

This class is the base for listing of database records and files in the modules Web>List and File>Filelist

class t3lib_recordList

@package: TYPO3

@subpackage: t3lib

function addElement($h,$icon,$data,$tdParams='',$lMargin='',$altLine='')

function writeTop()

function writeBottom()

function fwd_rwd_nav($table='')

function fwd_rwd_HTML($type,$pointer,$table='')

function listURL()

function CBfunctions()

class.t3lib_scbase.php

Parent class for 'ScriptClasses' in backend modules.
See example comment above.

class t3lib_SCbase

@package: TYPO3

@subpackage: t3lib

function init()

function menuConfig()

function mergeExternalItems($modName,$menuKey,$menuArr)

function handleExternalFunctionValue($MM_key='function')

function getExternalItemConfig($modName,$menuKey,$value='')

function checkExtObj()

function checkSubExtObj()

function extObjHeader()

function extObjContent()

class.t3lib_sqlengine.php

PHP SQL engine / server

class t3lib_sqlengine

@package: TYPO3

@subpackage: t3lib

function init($config, &$pObj)

function resetStatusVars()

function processAccordingToConfig(&$value,$fInfo)

SQL queries
This is the SQL access functions used when this class is instantiated as a SQL handler with DBAL. Override these in derived classes.

function exec_INSERTquery($table,$fields_values)

function exec_UPDATEquery($table,$where,$fields_values)

function exec_DELETEquery($table,$where)

function exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit)

function sql_query($query)

function sql_error()

function sql_insert_id()

function sql_affected_rows()

function quoteStr($str)

SQL admin functions
(For use in the Install Tool and Extension Manager)

function admin_get_tables()

function admin_get_fields($tableName)

function admin_get_keys($tableName)

function admin_query($query)

Data Source I/O

function readDataSource($table)

@todo: Table locking tools?

function saveDataSource($table)

@todo: Table locking tools?

SQL engine functions

function selectFromData($table,$where)

function select_evalSingle($table,$config,&$itemKeys)

function getResultSet($keys, $table, $fieldList)

SQL Parsing, full queries

function parseSQL($parseString)

function parseSELECT($parseString)

function parseUPDATE($parseString)

function parseINSERT($parseString)

function parseDELETE($parseString)

function parseEXPLAIN($parseString)

function parseCREATETABLE($parseString)

function parseALTERTABLE($parseString)

function parseDROPTABLE($parseString)

SQL Parsing, helper functions for parts of queries

function parseFieldList(&$parseString, $stopRegex='')

function parseFromTables(&$parseString, $stopRegex='')

function parseWhereClause(&$parseString, $stopRegex='')

function parseFieldDef(&$parseString, $stopRegex='')

Parsing: Helper functions

function nextPart(&$parseString,$regex,$trimAll=FALSE)

function getValue(&$parseString,$comparator='')

function getValueInQuotes(&$parseString,$quote)

function parseStripslashes($str)

function compileAddslashes($str)

function parseError($msg,$restQuery)

function trimSQL($str)

Compiling queries

function compileSQL($components)

function compileSELECT($components)

function compileUPDATE($components)

function compileINSERT($components)

function compileDELETE($components)

function compileCREATETABLE($components)

function compileALTERTABLE($components)

Compiling queries, helper functions for parts of queries

function compileFieldList($selectFields)

function compileFromTables($tablesArray)

function compileWhereClause($clauseArray)

function compileFieldCfg($fieldCfg)

Debugging

function debug_parseSQLpart($part,$str)

function debug_parseSQLpartCompare($str,$newStr,$caseInsensitive=FALSE)

function debug_testSQL($SQLquery)

function debug_printResultSet($array)

class t3lib_sqlengine_resultobj

@package: TYPO3

@subpackage: t3lib

function sql_num_rows()

function sql_fetch_assoc()

function sql_fetch_row()

function sql_data_seek($pointer)

function sql_field_type()

class.t3lib_stdgraphic.php

Class contains a bunch of cool functions for manipulating graphics with GDlib/Freetype and ImageMagick
VERY OFTEN used with gifbuilder that extends this class and provides a TypoScript API to using these functions

class t3lib_stdGraphic

@package: TYPO3

@subpackage: t3lib

function init()

Layering images / "IMAGE" GIFBUILDER object

function maskImageOntoImage(&$im,$conf,$workArea)

function copyImageOntoImage(&$im,$conf,$workArea)

function copyGifOntoGif(&$im,$cpImg,$conf,$workArea)

function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)

Text / "TEXT" GIFBUILDER object

function makeText(&$im,$conf,$workArea)

function txtPosition($conf,$workArea,$BB)

function calcBBox($conf)

function addToMap($cords,$conf)

function calcTextCordsForMap($cords,$offset, $conf)

function SpacedImageTTFText(&$im, $fontSize, $angle, $x, $y, $Fcolor, $fontFile, $text, $spacing, $wordSpacing)

function fontResize($conf)

Other GIFBUILDER objects related to TEXT

function makeOutline(&$im,$conf,$workArea,$txtConf)

function circleOffset($distance, $iterations)

function makeEmboss(&$im,$conf,$workArea,$txtConf)

function makeShadow(&$im,$conf,$workArea,$txtConf)

Other GIFBUILDER objects

function makeBox(&$im,$conf,$workArea)

function makeEffect(&$im, $conf)

function IMparams($setup)

function adjust(&$im, $conf)

function crop(&$im,$conf)

function scale(&$im,$conf)

function setWorkArea($workArea)

Adjustment functions

function autolevels(&$im)

function outputLevels(&$im,$low,$high,$swap='')

function inputLevels(&$im,$low,$high,$swap='')

function reduceColors(&$im,$limit, $cols)

GIFBUILDER Helper functions

function prependAbsolutePath($fontFile)

function v5_sharpen($factor)

function v5_blur($factor)

function randomName()

function applyOffset($cords,$OFFSET)

function convertColor($string)

function recodeString($string)

function singleChars($theText)

function objPosition($conf,$workArea,$BB)

Scaling, Dimensions of images

function imageMagickConvert($imagefile,$newExt='',$w='',$h='',$params='',$frame='',$options='',$mustCreate=0)

function getImageDimensions($imagefile)

function getImageScale($info,$w,$h,$options)

function file_exists_typo3temp_file($output,$orig='')

ImageMagick API functions

function imageMagickIdentify($imagefile)

function imageMagickExec($input,$output,$params)

function combineExec($input,$overlay,$mask,$output)

function wrapFileName($inputName)

Various IO functions

function checkFile($file)

function applyImageMagickToPHPGif(&$im, $command)

function gif_or_jpg($type,$w,$h)

function output($file)

function destroy()

function imgTag ($imgInfo)

function ImageGif($destImg, $theImage)

function imageCreateFromGif($sourceImg)

class.t3lib_superadmin.php

Super Admin class has functions for the administration of multiple TYPO3 sites in folders
See 'misc/superadmin.php' for details on how to use!

$Id: t3lib_api.html,v 1.2 2004/03/22 16:37:55 typo3 Exp $
Revised for TYPO3 3.6 February/2004 by Kasper Skaarhoj
XHTML Compliant

function debug($p1,$p2='')

class t3lib_superadmin

@package: TYPO3

@subpackage: t3lib

Initialize stuff

function t3lib_superadmin()

function init($parentDirs)

Main functions

function defaultSet()

function make()

Output preparation

function setMenuItem($code,$label)

function error($str)

function headerParentDir($str)

function headerSiteDir($str)

Collection information

function initProcess()

function processSiteDir($path,$dir)

function includeLocalconf($localconf)

function connectToDatabase($siteInfo)

function getDBInfo($key)

Content: Installation Overview

function makeTable()

Content: Local extensions

function localExtensions()

function getExtensionInfo($path,$extKey,$k)

function getAllFilesAndFoldersInPath($fileArr,$extPath,$extList='',$regDirs=0)

function findMostRecent($fileArr,$extPath)

function removePrefixPathFromList($fileArr,$extPath)

Content: Other

function singleSite($exp)

function loginLog($DB)

function log_getDetails($text,$data)

function rmCachedFiles($exp)

function menuContent($exp)

function makeAdminLogin()

function changeAdminPasswordsForm()

function setNewPasswords()

class.t3lib_syntaxhl.php

Syntax Highlighting class.

class t3lib_syntaxhl

@package: TYPO3

@subpackage: t3lib

Markup of Data Structure, <T3DataStructure>

function highLight_DS($str)

function highLight_DS_markUpRecursively($struct,$parent='',$app='')

Markup of Data Structure, <T3FlexForms>

function highLight_FF($str)

function highLight_FF_markUpRecursively($struct,$parent='',$app='')

Various

function getAllTags($str)

function splitXMLbyTags($tagList,$str)

class.t3lib_tceforms.php

'TCEforms' - Class for creating the backend editing forms.

class t3lib_TCEforms

@package: TYPO3

@subpackage: t3lib

function t3lib_TCEforms()

function initDefaultBEmode()

Rendering the forms, fields etc

function getSoloField($table,$row,$theFieldToReturn)

function getMainFields($table,$row,$depth=0)

function getListedFields($table,$row,$list)

function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')

function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)

function getSingleField_SW($table,$field,$row,&$PA)

Rendering of each TCEform field type

function getSingleField_typeInput($table,$field,$row,&$PA)

function getSingleField_typeText($table,$field,$row,&$PA)

function getSingleField_typeCheck($table,$field,$row,&$PA)

function getSingleField_typeRadio($table,$field,$row,&$PA)

function getSingleField_typeSelect($table,$field,$row,&$PA)

function getSingleField_typeGroup($table,$field,$row,&$PA)

function getSingleField_typeNone($table,$field,$row,&$PA)

function getSingleField_typeFlex($table,$field,$row,&$PA)

function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)

function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)

function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())

function getSingleField_typeUnknown($table,$field,$row,&$PA)

function getSingleField_typeUser($table,$field,$row,&$PA)

"Configuration" fetching/processing functions

function getRTypeNum($table,$row)

function rearrange($fields)

function getExcludeElements($table,$row,$typeNum)

function getFieldsToAdd($table,$row,$typeNum)

function mergeFieldsWithAddedFields($fields,$fieldsToAdd)

function setTSconfig($table,$row,$field='')

function getSpecConfForField($table,$row,$field)

function getSpecConfFromString($extraString)

Form element helper functions

function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')

function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)

function getIcon($icon)

function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)

function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')

function elName($itemName)

function noTitle($str,$wrapParts=array())

function blur()

function getSingleHiddenField($table,$field,$row)

function formWidth($size=48,$textarea=0)

function formWidthText($size=48,$wrap='')

function formElStyle($type)

function insertDefStyle($type)

Item-array manipulation functions (check/select/radio)

function initItemArray($fieldValue)

function addItems($items,$iArray)

function procItems($items,$iArray,$config,$table,$row,$field)

function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)

function addSelectOptionsToItemArray_makeModuleData($value)

function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)

Template functions

function setFancyDesign()

function setNewBEDesign()

function intoTemplate($inArr,$altTemplate='')

function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)

function wrapLabels($str)

function wrapTotal($c,$rec,$table)

function replaceTableWrap($arr,$rec,$table)

function wrapBorder(&$out_array,&$out_pointer)

function rplColorScheme($inTemplate)

function getDivider()

function printPalette($palArr)

function helpTextIcon($table,$field,$force=0)

function helpText($table,$field)

function setColorScheme($scheme)

function resetSchemes()

function storeSchemes()

function restoreSchemes()

JavaScript related functions

function JStop($formname='forms[0]')

function JSbottom($formname='forms[0]')

function dbFileCon($formObj='document.forms[0]')

function printNeededJSFunctions()

function printNeededJSFunctions_top()

Various helper functions

function getDefaultRecord($table,$pid=0)

function getRecordPath($table,$rec)

function readPerms()

function sL($str)

function getLL($str)

function isPalettesCollapsed($table,$palette)

function isDisplayCondition($displayCond,$row)

function getTSCpid($table,$uid,$pid)

function doLoadTableDescr($table)

function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)

class t3lib_TCEforms_FE extends t3lib_TCEforms

function wrapLabels($str)

function printPalette($palArr)

class.t3lib_timetrack.php

Frontend Timetracking functions

Is used to register how much time is used with operations in TypoScript
Used by index_ts

class t3lib_timeTrack

@package: TYPO3

@subpackage: t3lib

Logging parsing times in the scripts

function start()

function push($tslabel, $value='')

function pull($content='')

function setTSlogMessage($content,$num=0)

function setTSselectQuery($query,$msg)

function incStackPointer()

function decStackPointer()

function mtime()

function convertMicrotime($microtime)

Printing the parsing time information (for Admin Panel)

function printTSlog()

function fixContent(&$arr, $content, $depthData='', $first=0, $vKey='')

function fixCLen($c,$v)

function fw($str)

function createHierarchyArray(&$arr,$pointer,$uniqueId)

function debug_typo3PrintError($header,$text,$js)

class.t3lib_transferdata.php

Class for getting and transforming data for display in backend forms (TCEforms)

class t3lib_transferData

@package: TYPO3

@subpackage: t3lib

Getting record content, ready for display in TCEforms

function fetchRecord($table,$idList,$operation)

function renderRecord($table, $id, $pid, $row)

function renderRecord_SW($data,$fieldConfig,$TSconfig,$table,$row,$field)

function renderRecord_groupProc($data,$fieldConfig,$TSconfig,$table,$row,$field)

function renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field)

function renderRecord_flexProc($data,$fieldConfig,$TSconfig,$table,$row,$field)

function renderRecord_typesProc($totalRecordContent,$types_fieldConfig,$tscPID,$table,$pid)

FlexForm processing functions

function renderRecord_flexProc_procInData($dataPart,$dataStructArray,$pParams)

function renderRecord_flexProc_procInData_travDS(&$dataValues,$DSelements,$pParams)

Selector box processing functions

function selectAddSpecial($dataAcc, $elements, $specialKey)

function selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row)

function getDataIdList($elements, $fieldConfig, $row)

function procesItemArray($selItems,$config,$fieldTSConfig,$table,$row,$field)

function addItems($items,$iArray)

function procItems($items,$itemsProcFuncTSconfig,$config,$table,$row,$field)

Helper functions

function lockRecord($table, $id, $pid=0)

function regItem($table, $id, $field, $content)

function sL($in)

class.t3lib_treeview.php

Base class for creating a browsable array/page/folder tree in HTML

class t3lib_treeView

@package: TYPO3

@subpackage: t3lib

function init($clause='', $orderByFields='')

function setTreeName($treeName='')

function addField($field,$noCheck=0)

function reset()

output

function getBrowsableTree()

function printTree($treeArr='')

rendering parts

function PMicon($row,$a,$c,$nextCount,$exp)

function PM_ATagWrap($icon,$cmd,$bMark='')

function wrapTitle($title,$row,$bank=0)

function wrapIcon($icon,$row)

function addTagAttributes($icon,$attr)

function wrapStop($str,$row)

tree handling

function expandNext($id)

function initializePositionSaving()

function savePosition()

Functions that might be overwritten by extended classes

function getRootIcon($rec)

function getIcon($row)

function getTitleStr($row,$titleLen=30)

function getTitleAttrib($row)

function getId($row)

function getJumpToParm($row)

tree data buidling

function getTree($uid, $depth=999, $depthData='',$blankLineCode='')

Data handling
Works with records and arrays

function getCount($uid)

function getRootRecord($uid)

function getRecord($uid)

function getDataInit($parentId)

function getDataCount(&$res)

function getDataNext(&$res)

function getDataFree(&$res)

function setDataFromArray(&$dataArr,$traverse=FALSE,$pid=0)

function setDataFromTreeArray(&$treeArr, &$treeLookupArr)

class.t3lib_tsfebeuserauth.php

TYPO3 backend user authentication in the TSFE frontend.
This includes mainly functions related to the Admin Panel

class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth

@package: TYPO3

@subpackage: t3lib

function extInitFeAdmin()

function extPrintFeAdminDialog()

Creating sections of the Admin Panel

function extGetCategory_preview($out='')

function extGetCategory_cache($out='')

function extGetCategory_publish($out='')

function extGetCategory_edit($out='')

function extGetCategory_tsdebug($out='')

function extGetCategory_info($out='')

Admin Panel Layout Helper functions

function extGetHead($pre)

function extItemLink($pre,$str)

function extGetItem($pre,$element)

function extFw($str)

function ext_makeToolBar()

TSFE BE user Access Functions

function checkBackendAccessSettingsFromInitPhp()

function extPageReadAccess($pageRec)

function extAdmModuleEnabled($key)

function extSaveFeAdminConfig()

function extGetFeAdminValue($pre,$val='')

function extIsAdmMenuOpen($pre)

TSFE BE user Access Functions

function extGetTreeList($id,$depth,$begin=0,$perms_clause)

function extGetNumberOfCachedPages($page_id)

Localization handling

function extGetLL($key)

Frontend Editing

function extIsEditAction()

function extIsFormShown()

function extEditAction()

class.t3lib_tsparser.php

The TypoScript parser

class t3lib_TSparser

@package: TYPO3

@subpackage: t3lib

function parse($string,$matchObj='')

function nextDivider()

function parseSub(&$setup)

function rollParseSub($string,&$setup)

function getVal($string,$setup)

function setVal($string,&$setup,$value,$wipeOut=0)

function error($err,$num=2)

function checkIncludeLines($string)

function checkIncludeLines_array($array)

Syntax highlighting

function doSyntaxHighlight($string,$lineNum='',$highlightBlockMode=0)

function regHighLight($code,$pointer,$strlen=-1)

function syntaxHighlight_print($lineNumDat,$highlightBlockMode)

class.t3lib_tstemplate.php

Template object that is responsible for generating the TypoScript template based on template records.

class t3lib_TStemplate

@package: TYPO3

@subpackage: t3lib

function init()

function getCurrentPageData()

function matching($cc)

function start($theRootLine)

Fetching TypoScript code text for the Template Hierarchy

function runThroughTemplates($theRootLine,$start_template_uid=0)

function processTemplate($row, $idList,$pid,$templateID='',$templateParent='')

function includeStaticTypoScriptSources($idList,$templateID,$pid,$row)

function addExtensionStatics($idList,$templateID,$pid,$row)

function prependStaticExtra($subrow)

Parsing TypoScript code text from Template Records into PHP array

function generateConfig()

function procesIncludes()

function mergeConstantsFromPageTSconfig($constArray)

@todo: Apply caching to the parsed Page TSconfig. This is done in the other similar functions for both frontend and backend. However, since this functions works for BOTH frontend and backend we will have to either write our own local caching function or (more likely) detect if we are in FE or BE and use caching functions accordingly. Not having caching affects mostly the backend modules inside the "Template" module since the overhead in the frontend is only seen when TypoScript templates are parsed anyways (after which point they are cached anyways...)

function flattenSetup($setupArray, $prefix, $resourceFlag)

function substituteConstants($all)

Various API functions, used from elsewhere in the frontend classes

function splitConfArray($conf,$splitCount)

function getFileName($fileFromSetup)

function extractFromResources($res,$file)

function checkFile($name,$menuArr)

function printTitle($title,$no_title=0,$titleFirst=0)

function fileContent($fName)

function wrap($content,$wrap)

function linkData($page,$oTarget,$no_cache,$script,$overrideArray='',$addParams='',$typeOverride='')

function removeQueryString($url)

function sortedKeyList($setupArr)

class.t3lib_userauth.php

Authentication of users in TYPO3

This class is used to authenticate a login user.
The class is used by both the frontend and backend. In both cases this class is a parent class to beuserauth and feuserauth

See Inside TYPO3 for more information about the API of the class and internal variables.

class t3lib_userAuth

@package: TYPO3

@subpackage: t3lib

function start()

function check_authentication()

function redirect()

function logoff()

function gc()

function user_where_clause()

function ipLockClause()

function writeUC($variable='')

function writelog($type,$action,$error,$details_nr,$details,$data,$tablename,$recuid,$recpid)

function checkLogFailures()

function unpack_uc($theUC='')

function pushModuleData($module,$data,$noSave=0)

function getModuleData($module,$type='')

function getSessionData($key)

function setAndSaveSessionData($key,$data)

function setBeUserByUid($uid)

function setBeUserByName($name)

class.t3lib_userauthgroup.php

Extension to class.t3lib_userauth.php; Authentication of users in TYPO3 Backend

Actually this class is extended again by t3lib_beuserauth which is the actual backend user class that will be instantiated.
In fact the two classes t3lib_beuserauth and this class could just as well be one, single class since t3lib_userauthgroup is not - to my knowledge - used separately elsewhere. But for historical reasons they are two separate classes.

class t3lib_userAuthGroup extends t3lib_userAuth

@package: TYPO3

@subpackage: t3lib

Permission checking functions:

function isAdmin()

function isMemberOfGroup($groupId)

function doesUserHaveAccess($row,$perms)

function isInWebMount($id,$readPerms='',$exitOnError=0)

function modAccess($conf,$exitOnError)

function getPagePermsClause($perms)

function calcPerms($row)

function isRTE()

function check ($type,$value)

function isPSet($lCP,$table,$type='')

function mayMakeShortcut()

Miscellaneous functions

function getTSConfig($objectString,$config='')

function getTSConfigVal($objectString)

function getTSConfigProp($objectString)

function inList($in_list,$item)

function returnWebmounts()

function returnFilemounts()

Authentication methods

function fetchGroupData()

function fetchGroups($grList,$idList='')

function setCachedList($cList)

function addFileMount($title, $altTitle, $path, $webspace, $type)

function addTScomment($str)

Logging

function writelog($type,$action,$error,$details_nr,$details,$data,$tablename='',$recuid='',$recpid='',$event_pid=-1,$NEWid='')

function checkLogFailures($email, $secondsBack=3600, $max=3)

class.t3lib_xml.php

XML class, Used to create XML output from input rows.
Doesn't contain a lot of advanced features - pretty straight forward, practical stuff
You are encouraged to use this class in your own applications.

class t3lib_xml

@package: TYPO3

@subpackage: t3lib

function t3lib_xml($topLevelName)

function setRecFields($table,$list)

function getResult()

function WAPHeader()

function renderHeader()

function renderFooter()

function newLevel($name,$beginEndFlag=0,$params=array())

function output($content)

function indent($b)

function renderRecords($table,$res)

function addRecord($table,$row)

function getRowInXML($table,$row)

function utf8($content)

function substNewline($string)

function fieldWrap($field,$value)

function WAPback()

function addLine($str)

thumbs.php

Class for generating a thumbnail from the input parameters given to the script

Input GET var, &file: relative or absolute reference to an imagefile. WILL be validated against PATH_site / lockRootPath
Input GET var, &size: integer-values defining size of thumbnail, format '[int]' or '[int]x[int]'

Relative paths MUST BE the first two characters ONLY: eg: '../dir/file.gif', otherwise it is expect to be absolute

class SC_t3lib_thumbs

@package: TYPO3

@subpackage: t3lib

function init()

function main()

OTHER FUNCTIONS:

function errorGif($l1,$l2,$l3)

function fontGif($font)

function wrapFileName($inputName)

Detailed descriptions:

class.t3lib_admin.php

This class holds functions used by the TYPO3 backend to check the integrity of the database (The DBint module, 'lowlevel' extension)

Depends on: Depends on loaddbgroup from t3lib/

Filesize: 19.2 K
Func/Classes: 13
Tags: @todo Need to really extend this class when the tcemain library has been updated and the whole API is better defined. There are some known bugs in this library. Further it would be nice with a facility to not only analyze but also clean up!
@see SC_mod_tools_dbint_index::func_relations(), SC_mod_tools_dbint_index::func_records()
@author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_admin

This class holds functions used by the TYPO3 backend to check the integrity of the database (The DBint module, 'lowlevel' extension)

Depends on: Depends on loaddbgroup from t3lib/

Returns: [type] ...
  @todo Need to really extend this class when the tcemain library has been updated and the whole API is better defined. There are some known bugs in this library. Further it would be nice with a facility to not only analyze but also clean up!
  @see SC_mod_tools_dbint_index::func_relations(), SC_mod_tools_dbint_index::func_records()
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function genTree($theID, $depthData)

Generates a list of Page-uid's that corresponds to the tables in the tree. This list should ideally include all records in the pages-table.

$theID integer a pid (page-record id) from which to start making the tree
$depthData string HTML-code (image-tags) used when this function calls itself recursively.
Returns: integer Number of $GLOBALS['TYPO3_DB']->sql_num_rows (most recent query)

function lostRecords($pid_list)

Fills $this->lRecords with the records from all tc-tables that are not attached to a PID in the pid-list.

$pid_list string list of pid's (page-record uid's). This list is probably made by genTree()
Returns: void

function fixLostRecord($table,$uid)

Fixes lost record from $table with uid $uid by setting the PID to zero. If there is a disabled column for the record that will be set as well.

$table string Database tablename
$uid integer The uid of the record which will have the PID value set to 0 (zero)
Returns: boolean True if done.

function countRecords($pid_list)

Counts records from $TCA-tables that ARE attached to an existing page.

$pid_list string list of pid's (page-record uid's). This list is probably made by genTree()
Returns: array an array with the number of records from all $TCA-tables that are attached to a PID in the pid-list.

function getGroupFields($mode)

Finding relations in database based on type 'group' (files or database-uid's in a list)

$mode string $mode = file, $mode = db, $mode = '' (all...)
Returns: array An array with all fields listed that somehow are references to other records (foreign-keys) or files

function getFileFields($uploadfolder)

Finds all fields that hold filenames from uploadfolder

$uploadfolder string Path to uploadfolder
Returns: array An array with all fields listed that have references to files in the $uploadfolder

function getDBFields($theSearchTable)

Returns an array with arrays of table/field pairs which are allowed to hold references to the input table name - according to $TCA

$theSearchTable string Table name
Returns: array

function selectNonEmptyRecordsWithFkeys($fkey_arrays)

This selects non-empty-records from the tables/fields in the fkey_array generated by getGroupFields()

$fkey_arrays array Array with tables/fields generated by getGroupFields()
Returns: void
  @see getGroupFields()

function testFileRefs ()

Depends on selectNonEmpty.... to be executed first!!

Returns: array Report over files; keys are "moreReferences", "noReferences", "noFile", "error"

function testDBRefs($theArray)

Depends on selectNonEmpty.... to be executed first!!

$theArray array Table with key/value pairs being table names and arrays with uid numbers
Returns: string HTML Error message

function whereIsRecordReferenced($searchTable,$id)

Finding all references to record based on table/uid

$searchTable string Table name
$id integer Uid of database record
Returns: array Array with other arrays containing information about where references was found

function whereIsFileReferenced($uploadfolder,$filename)

Finding all references to file based on uploadfolder / filename

$uploadfolder string Upload folder where file is found
$filename string Filename to search for
Returns: array Array with other arrays containing information about where references was found

class.t3lib_arraybrowser.php

Class for displaying an array as a tree
See the extension 'lowlevel' /config (Backend module 'Tools > Configuration')

Filesize: 7.2 K
Func/Classes: 5
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see SC_mod_tools_config_index::main()

class t3lib_arrayBrowser

Class for displaying an array as a tree
See the extension 'lowlevel' /config (Backend module 'Tools > Configuration')

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see SC_mod_tools_config_index::main()

function tree($arr, $depth_in, $depthData)

Make browsable tree
Before calling this function you may want to set some of the internal vars like depthKeys, regexMode and fixedLgd. For examples see SC_mod_tools_config_index::main()

$arr array The array to display
$depth_in string Key-position id. Build up during recursive calls - [key1].[key2].[key3] - an so on.
$depthData string Depth-data - basically a prefix for the icons. For calling this function from outside, let it stay blank.
Returns: string HTML for the tree
  @see SC_mod_tools_config_index::main()

function getSearchKeys($keyArr, $depth_in, $searchString, $keyArray)

Creates an array with "depthKeys" which will expand the array to show the search results

$keyArr array The array to search for the value
$depth_in string Depth string - blank for first call (will build up during recursive calling creating an id of the position: [key1].[key2].[key3]
$searchString string The string to search for
$keyArray array Key array, for first call pass empty array
Returns: array

function fixed_lgd($string,$chars)

Fixed length function

$string string String to process
$chars integer Max number of chars
Returns: string Processed string

function depthKeys($arr,$settings)

Function modifying the depthKey array

$arr array Array with instructions to open/close nodes.
$settings array Input depth_key array
Returns: array Output depth_key array with entries added/removed based on $arr
  @see SC_mod_tools_config_index::main()

class.t3lib_basicfilefunc.php

Contains functions for management, validation etc of files in TYPO3, using the concepts of web- and ftp-space. Please see the comment for the init() function

Filesize: 17.2 K
Func/Classes: 19
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_basicFileFunctions::init()

class t3lib_basicFileFunctions

Contains functions for management, validation etc of files in TYPO3, using the concepts of web- and ftp-space. Please see the comment for the init() function

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_basicFileFunctions::init()

function init($mounts, $f_ext)

Constructor
This function should be called to initialise the internal arrays $this->mounts and $this->f_ext

A typical example of the array $mounts is this:
$mounts[xx][path] = (..a mounted path..)
the 'xx'-keys is just numerical from zero. There are also a [name] and [type] value that just denotes the mountname and type. Not used for athentication here.
$this->mounts is traversed in the function checkPathAgainstMounts($thePath), and it is checked that $thePath is actually below one of the mount-paths
The mountpaths are with a trailing '/'. $thePath must be with a trailing '/' also!
As you can see, $this->mounts is very critical! This is the array that decides where the user will be allowed to copy files!!
Typically the global var $WEBMOUNTS would be passed along as $mounts

A typical example of the array $f_ext is this:
$f_ext['webspace']['allow']='';
$f_ext['webspace']['deny']='php3,php';
$f_ext['ftpspace']['allow']='*';
$f_ext['ftpspace']['deny']='';
The control of fileextensions goes in two catagories. Webspace and Ftpspace. Webspace is folders accessible from a webbrowser (below TYPO3_DOCUMENT_ROOT) and ftpspace is everything else.
The control is done like this: If an extension matches 'allow' then the check returns true. If not and an extension matches 'deny' then the check return false. If no match at all, returns true.
You list extensions comma-separated. If the value is a '*' every extension is allowed
The list is case-insensitive when used in this class (see init())
Typically TYPO3_CONF_VARS['BE']['fileExtensions'] would be passed along as $f_ext.

Example:
$basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);

$mounts array Contains the paths of the file mounts for the current BE user. Normally $GLOBALS['FILEMOUNTS'] is passed. This variable is set during backend user initialization; $FILEMOUNTS = $BE_USER->returnFilemounts(); (see typo3/init.php)
$f_ext array Array with information about allowed and denied file extensions. Typically passed: $TYPO3_CONF_VARS['BE']['fileExtensions']
Returns: void
  @see typo3/init.php, t3lib_userAuthGroup::returnFilemounts()

function getTotalFileInfo($wholePath)

Returns an array with a whole lot of fileinformation.

$wholePath string Filepath to existing file. Should probably be absolute. Filefunctions are performed on this value.
Returns: array Information about the file in the filepath

function is_allowed($iconkey,$type)

Checks if a $iconkey (fileextension) is allowed according to $this->f_ext.

$iconkey string The extension to check, eg. "php" or "html" etc.
$type string Either "webspage" or "ftpspace" - points to a key in $this->f_ext
Returns: boolean True if file extension is allowed.

function checkIfFullAccess($theDest)

Returns true if you can operate of ANY file ('*') in the space $theDest is in ('webspace' / 'ftpspace')

$theDest string Absolute path
Returns: boolean

function is_webpath($path)

Checks if $this->webPath (should be TYPO3_DOCUMENT_ROOT) is in the first part of $path
Returns true also if $this->init is not set or if $path is empty...

$path string Absolute path to check
Returns: boolean

function checkIfAllowed($ext, $theDest, $filename='')

If the filename is given, check it against the TYPO3_CONF_VARS[BE][fileDenyPattern] +
Checks if the $ext fileextension is allowed in the path $theDest (this is based on whether $theDest is below the $this->webPath)

$ext string File extension, eg. "php" or "html"
$theDest string Absolute path for which to test
$filename='' string Filename to check against TYPO3_CONF_VARS[BE][fileDenyPattern]
Returns: boolean True if extension/filename is allowed

function checkFileNameLen($fileName)

Returns true if the input filename string is shorter than $this->maxInputNameLen.

$fileName string Filename, eg "somefile.html"
Returns: boolean

function is_directory($theDir)

Cleans $theDir for slashes in the end of the string and returns the new path, if it exists on the server.

$theDir string Directory path to check
Returns: string Returns the cleaned up directory name if OK, otherwise false.

function isPathValid($theFile)

Wrapper for t3lib_div::validPathStr()

$theFile string Filepath to evaluate
Returns: boolean True, if no '//', '..' or '\' is in the $theFile
  @see t3lib_div::validPathStr()

function getUniqueName($theFile, $theDest, $dontCheckForUnique=0)

Returns the destination path/filename of a unique filename/foldername in that path.
If $theFile exists in $theDest (directory) the file have numbers appended up to $this->maxNumber. Hereafter a unique string will be appended.
This function is used by fx. TCEmain when files are attached to records and needs to be uniquely named in the uploads/* folders

$theFile string The input filename to check
$theDest string The directory for which to return a unique filename for $theFile. $theDest MUST be a valid directory. Should be absolute.
$dontCheckForUnique=0 boolean If set the filename is returned with the path prepended without checking whether it already existed!
Returns: string The destination absolute filepath (not just the name!) of a unique filename/foldername in that path.
  @see t3lib_TCEmain::checkValue()

function checkPathAgainstMounts($thePath)

Checks if $thePath is a path under one of the paths in $this->mounts
See comment in the header of this class.

$thePath string $thePath MUST HAVE a trailing '/' in order to match correctly with the mounts
Returns: string The key to the first mount found, otherwise nothing is returned.
  @see init()

function blindPath($thePath)

Removes filemount part of a path, thus blinding the position.
Takes a path, $thePath, and removes the part of the path which equals the filemount.

$thePath string $thePath is a path which MUST be found within one of the internally set filemounts, $this->mounts
Returns: string The processed input path

function findTempFolder()

Find temporary folder
Finds the first $this->tempFN ('_temp_' usually) -folder in the internal array of filemounts, $this->mounts

Returns: string Returns the path if found, otherwise nothing if error.

function cleanDirectoryName($theDir)

Removes all dots, slashes and spaces after a path...

$theDir string Input string
Returns: string Output string

function rmDoubleSlash($string)

Converts any double slashes (//) to a single slash (/)

$string string Input value
Returns: string Returns the converted string

function slashPath($path)

Returns a string which has a slash '/' appended if it doesn't already have that slash

$path string Input string
Returns: string Output string with a slash in the end (if not already there)

function cleanFileName($fileName)

Returns a string where any character not matching [.a-zA-Z0-9_-] is substituted by '_'

$fileName string Input string, typically the body of a filename
Returns: string Output string with any characters not matching [.a-zA-Z0-9_-] is substituted by '_'

function formatSize($sizeInBytes)

Formats an integer, $sizeInBytes, to Mb or Kb or just bytes

$sizeInBytes integer Bytes to be formated
Returns: string Formatted with M,K or &nbsp;&nbsp; appended.

class.t3lib_bedisplaylog.php

This class holds some functions used to display the sys_log table-content.
Used in the status-scripts and the log-module.

Filesize: 7.6 K
Func/Classes: 11
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see tx_belog_webinfo, SC_mod_tools_log_index

class t3lib_BEDisplayLog

This class holds some functions used to display the sys_log table-content.
Used in the status-scripts and the log-module.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see tx_belog_webinfo, SC_mod_tools_log_index

function initArray()

Initialize the log table array with header labels.

Returns: array

function getTimeLabel($code)

Get time label for log listing

$code integer Timestamp to display
Returns: string If the timestamp was also shown last time, then "." is returned. Otherwise the new timestamp formatted with ->doc->formatTime()

function getUserLabel($code)

Get user name label for log listing

$code integer be_user uid
Returns: string If username is different from last username then the username, otherwise "."

function getTypeLabel($code)

Get type label for log listing

$code string Key for the type label in locallang
Returns: string If labe is different from last type label then the label is returned, otherwise "."

function getActionLabel($code)

Get action label for log listing

$code string Key for the action label in locallang
Returns: string If labe is different from last action label then the label is returned, otherwise "."

function getDetails($code,$text,$data,$sys_log_uid=0)

Get details for the log entry

$code string Suffix to "msg_" to get label from locallang.
$text string Details text
$data array Data array
$sys_log_uid=0 integer sys_log uid number
Returns: string Text string
  @see formatDetailsForList()

function reset()

Reset all internal "last..." variables to blank string.

Returns: void

function getErrorFormatting($sign)

Formats input string in red-colored font tags

$sign string Input value
Returns: string Input wrapped in red font-tag and bold
  @obsolete

function formatDetailsForList($row)

Formatting details text for the sys_log row inputted

$row array sys_log row
Returns: string Details string

function stripPath($inArr)

For all entries in the $inArray (expected to be filepaths) the basename is extracted and set as value (if $this->stripPath is set)
This is done for log-entries from the FILE modules

$inArr array Array of file paths
Returns: array
  @see formatDetailsForList()

class.t3lib_befunc.php

Standard functions available for the TYPO3 backend.
Don't instantiate - call functions with "t3lib_BEfunc::" prefixed the function name.

Filesize: 100 K
Func/Classes: 79
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_BEfunc

Standard functions available for the TYPO3 backend.
Don't instantiate - call functions with "t3lib_BEfunc::" prefixed the function name.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function deleteClause($table)

Returns the WHERE clause " AND NOT [tablename].[deleted-field]" if a deleted-field is configured in $TCA for the tablename, $table
This function should ALWAYS be called in the backend for selection on tables which are configured in TCA since it will ensure consistent selection of records, even if they are marked deleted (in which case the system must always treat them as non-existent!)
In the frontend a function, ->enableFields(), is known to filter hidden-field, start- and endtime and fe_groups as well. But that is a job of the frontend, not the backend. If you need filtering on those fields as well in the backend you can use ->BEenableFields() though.

Usage: 80

$table string Table name present in $TCA
Returns: string WHERE clause for filtering out deleted records, eg " AND NOT tablename.deleted"

function getRecord($table,$uid,$fields='*',$where='')

Gets record with uid=$uid from $table
You can set $field to a list of fields (default is '*')
Additional WHERE clauses can be added by $where (fx. ' AND blabla=1')
Will automatically check if records has been deleted and if so, not return anything.
$table must be found in $TCA

Usage: 168

$table string Table name present in $TCA
$uid integer UID of record
$fields='*' string List of fields to select
$where='' string Additional WHERE clause, eg. " AND blablabla=0"
Returns: array Returns the row if found, otherwise nothing

function getRecordRaw($table,$where='',$fields='*')

Returns the first record found from $table with $where as WHERE clause
This function does NOT check if a record has the deleted flag set.
$table does NOT need to be configured in $TCA
The query used is simply this:
$query='SELECT '.$fields.' FROM '.$table.' WHERE '.$where;

Usage: 5 (ext: sys_todos)

$table string Table name (not necessarily in TCA)
$where='' string WHERE clause
$fields='*' string $fields is a list of fields to select, default is '*'
Returns: array First row found, if any

function getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='')

Returns records from table, $theTable, where a field ($theField) equals the value, $theValue
The records are returned in an array
If no records were selected, the function returns nothing

Usage: 8

$theTable string Table name present in $TCA
$theField string Field to select on
$theValue string Value that $theField must match
$whereClause='' string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
$groupBy='' string Optional GROUP BY field(s), if none, supply blank string.
$orderBy='' string Optional ORDER BY field(s), if none, supply blank string.
$limit='' string Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns: mixed Multidimensional array with selected records (if any is selected)

function searchQuery($searchWords,$fields,$table='')

Returns a WHERE clause which will make an AND search for the words in the $searchWords array in any of the fields in array $fields.

Usage: 1 (class t3lib_fullsearch)

$searchWords array Array of search words
$fields array Array of fields
$table='' string Table in which we are searching (for DBAL detection of quoteStr() method)
Returns: string WHERE clause for search
  @depreciated Use $GLOBALS['TYPO3_DB']->searchQuery() directly!

function listQuery($field,$value)

Returns a WHERE clause that can find a value ($value) in a list field ($field)
For instance a record in the database might contain a list of numbers, "34,234,5" (with no spaces between). This query would be able to select that record based on the value "34", "234" or "5" regardless of their positioni in the list (left, middle or right).
Is nice to look up list-relations to records or files in TYPO3 database tables.

Usage: 3

$field string Table field name
$value string Value to find in list
Returns: string WHERE clause for a query
  @depreciated Use $GLOBALS['TYPO3_DB']->listQuery() directly!

function splitTable_Uid($str)

Makes an backwards explode on the $str and returns an array with ($table,$uid).
Example: tt_content_45 => array('tt_content',45)

Usage: 1

$str string [tablename]_[uid] string to explode
Returns: array

function getSQLselectableList ($in_list,$tablename,$default_tablename)

Returns a list of pure integers based on $in_list being a list of records with table-names prepended.
Ex: $in_list = "pages_4,tt_content_12,45" would result in a return value of "4,45" if $tablename is "pages" and $default_tablename is 'pages' as well.

Usage: 1 (t3lib_userauthgroup)

$in_list string Input list
$tablename string Table name from which ids is returned
$default_tablename string $default_tablename denotes what table the number '45' is from (if nothing is prepended on the value)
Returns: string List of ids

function BEenableFields($table,$inv=0)

Backend implementation of enableFields()
Notice that "fe_groups" is not selected for - only disabled, starttime and endtime.
Notice that deleted-fields are NOT filtered - you must ALSO call deleteClause in addition.
$GLOBALS["SIM_EXEC_TIME"] is used for date.

Usage: 5

$table string $table is the table from which to return enableFields WHERE clause. Table name must have a 'ctrl' section in $TCA.
$inv=0 boolean $inv means that the query will select all records NOT VISIBLE records (inverted selection)
Returns: string WHERE clause part

function mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')

Returns a SELECT query, selecting fields ($select) from two/three tables joined
$local_table and $mm_table is mandatory. $foreign_table is optional.
The JOIN is done with [$local_table].uid <--> [$mm_table].uid_local / [$mm_table].uid_foreign <--> [$foreign_table].uid
The function is very useful for selecting MM-relations between tables adhering to the MM-format used by TCE (TYPO3 Core Engine). See the section on $TCA in Inside TYPO3 for more details.
DEPRECIATED - Use $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query() instead since that will return the result pointer while this returns the query. Using this function may make your application less fitted for DBAL later.

$select string Field list for SELECT
$local_table string Tablename, local table
$mm_table string Tablename, relation table
$foreign_table string Tablename, foreign table
$whereClause='' string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
$groupBy='' string Optional GROUP BY field(s), if none, supply blank string.
$orderBy='' string Optional ORDER BY field(s), if none, supply blank string.
$limit='' string Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns: string Full SQL query
  @depreciated
  @see t3lib_DB::exec_SELECT_mm_query()

function DBcompileInsert($table,$fields_values)

Creates an INSERT SQL-statement for $table from the array with field/value pairs $fields_values.
DEPRECIATED - $GLOBALS['TYPO3_DB']->INSERTquery() directly instead! But better yet, use $GLOBALS['TYPO3_DB']->exec_INSERTquery()

$table string Table name
$fields_values array Field values as key=>value pairs.
Returns: string Full SQL query for INSERT
  @depreciated

function DBcompileUpdate($table,$where,$fields_values)

Creates an UPDATE SQL-statement for $table where $where-clause (typ. 'uid=...') from the array with field/value pairs $fields_values.
DEPRECIATED - $GLOBALS['TYPO3_DB']->UPDATEquery() directly instead! But better yet, use $GLOBALS['TYPO3_DB']->exec_UPDATEquery()

$table string Database tablename
$where string WHERE clause, eg. "uid=1"
$fields_values array Field values as key=>value pairs.
Returns: string Full SQL query for UPDATE
  @depreciated

function BEgetRootLine ($uid,$clause='')

Returns what is called the 'RootLine'. That is an array with information about the page records from a page id ($uid) and back to the root.
By default deleted pages are filtered.
This RootLine will follow the tree all the way to the root. This is opposite to another kind of root line known from the frontend where the rootline stops when a root-template is found.

Usage: 13

$uid integer Page id for which to create the root line.
$clause='' string $clause can be used to select other criteria. It would typically be where-clauses that stops the proces if we meet a page, the user has no reading access to.
Returns: array Root line array, all the way to the page tree root (or as far as $clause allows!)

function getRecordPath($uid,$clause,$titleLimit)

Returns the path (visually) of a page $uid, fx. "/First page/Second page/Another subpage"
Each part of the path will be limited to $titleLimit characters
Deleted pages are filtered out.

Usage: 23

$uid integer Page uid for which to create record path
$clause string $clause is additional where clauses, eg. "
$titleLimit integer Title limit
Returns: string Path of record

function getExcludeFields()

Returns an array with the exclude-fields as defined in TCA
Used for listing the exclude-fields in be_groups forms

Usage: 2 (t3lib_tceforms + t3lib_transferdata)

Returns: array Array of arrays with excludeFields (fieldname, table:fieldname) from all TCA entries

function readPageAccess($id,$perms_clause)

Returns a page record (of page with $id) with an extra field "_thePath" set to the record path IF the WHERE clause, $perms_clause, selects the record.
If $id is zero a pseudo root-page with "_thePath" set is returned IF the current BE_USER is admin.
In any case ->isInWebMount must return true for the user (regardless of $perms_clause)

Usage: 21

$id integer Page uid for which to check read-access
$perms_clause string $perms_clause is typically a value generated with $BE_USER->getPagePermsClause(1);
Returns: array Returns page record if OK, otherwise false.

function getTCAtypes($table,$rec,$useFieldNameAsKey=0)

Returns the "types" configuration parsed into an array for the record, $rec, from table, $table

Usage: 6

$table string Table name (present in TCA)
$rec array Record from $table
$useFieldNameAsKey=0 boolean If $useFieldNameAsKey is set, then the fieldname is associative keys in the return array, otherwise just numeric keys.
Returns: array

function getTCAtypeValue($table,$rec)

Returns the "type" value of $rec from $table which can be used to look up the correct "types" rendering section in $TCA
If no "type" field is configured in the "ctrl"-section of the $TCA for the table, zero is used.
If zero is not an index in the "types" section of $TCA for the table, then the $fieldValue returned will default to 1 (no matter if that is an index or not)

Usage: 7

$table string Table name present in TCA
$rec array Record from $table
Returns: string Field value
  @see getTCAtypes()

function getSpecConfParts($str)

Parses a part of the field lists in the "types"-section of $TCA arrays, namely the "special configuration" at index 3 (position 4)
Elements are splitted by ":" and within those parts, parameters are splitted by "|".
Everything is returned in an array and you should rather see it visually than listen to me anymore now... Check out example in Inside TYPO3

Usage: 3

$str string Content from the "types" configuration of TCA (the special configuration) - see description of function
Returns: array

function getSpecConfParametersFromArray($pArr)

Takes an array of "[key]=[value]" strings and returns an array with the keys set as keys pointing to the value.
Better see it in action! Find example in Inside TYPO3

Usage: 6

$pArr array Array of "[key]=[value]" strings to convert.
Returns: array

function getFlexFormDS($conf,$row,$table)

Finds the Data Structure for a FlexForm field

$conf array Field config array
$row array Record data
$table string The table name
Returns: mixed If array, the data structure was found and returned as an array. Otherwise (string) it is an error message.
  @see t3lib_TCEforms::getSingleField_typeFlex()

function storeHash($hash,$data,$ident)

Stores the string value $data in the 'cache_hash' table with the hash key, $hash, and visual/symbolic identification, $ident
IDENTICAL to the function by same name found in t3lib_page:

Usage: 2

$hash string Hash key, 32 bytes hex
$data string $data must be serialized before function call
$ident string Visual/symbolic identification (informational only)
Returns: void

function getHash($hash,$expTime)

Retrieves the string content stored with hash key, $hash, in cache_hash
IDENTICAL to the function by same name found in t3lib_page:

Usage: 2

$hash string Hash key, 32 bytes hex
$expTime integer $expTime represents the expire time in seconds. For instance a value of 3600 would allow cached content within the last hour, otherwise nothing is returned.
Returns: string

function getPagesTSconfig($id,$rootLine='',$returnPartArray=0)

Returns the Page TSconfig for page with id, $id
Requires class "t3lib_TSparser"

Usage: 26 (spec. in ext info_pagetsconfig)

$id integer Page uid for which to create Page TSconfig
$rootLine='' array If $rootLine is an array, that is used as rootline, otherwise rootline is just calculated
$returnPartArray=0 boolean If $returnPartArray is set, then the array with accumulated Page TSconfig is returned non-parsed. Otherwise the output will be parsed by the TypoScript parser.
Returns: array Page TSconfig
  @see t3lib_TSparser

function updatePagesTSconfig($id,$pageTS,$TSconfPrefix,$impParams='')

Updates Page TSconfig for a page with $id
The function seems to take $pageTS as an array with properties and compare the values with those that already exists for the "object string", $TSconfPrefix, for the page, then sets those values which were not present.
$impParams can be supplied as already known Page TSconfig, otherwise it's calculated.

THIS DOES NOT CHECK ANY PERMISSIONS. SHOULD IT?
More documentation is needed.

Usage: 1 (ext. direct_mail)

$id integer Page id
$pageTS array Page TS array to write
$TSconfPrefix string Prefix for object paths
$impParams='' array [Description needed.]
Returns: void
  @internal
  @see implodeTSParams(), getPagesTSconfig()

function implodeTSParams($p,$k='')

Implodes a multi dimensional TypoScript array, $p, into a one-dimentional array (return value)

Usage: 3

$p array TypoScript structure
$k='' string Prefix string
Returns: array Imploded TypoScript objectstring/values

function getUserNames($fields='username,usergroup,usergroup_cached_list,uid',$where='')

Returns an array with be_users records of all user NOT DELETED sorted by their username
Keys in the array is the be_users uid

Usage: 14 (spec. ext. "beuser" and module "web_perm")

$fields='username,usergroup,usergroup_cached_list,uid' string Optional $fields list (default: username,usergroup,usergroup_cached_list,uid) can be used to set the selected fields
$where='' string Optional $where clause (fx. "AND username='pete'") can be used to limit query
Returns: array

function getGroupNames($fields='title,uid', $where='')

Returns an array with be_groups records (title, uid) of all groups NOT DELETED sorted by their title

Usage: 8 (spec. ext. "beuser" and module "web_perm")

$fields='title,uid' string Field list
$where='' string WHERE clause
Returns: array

function getListGroupNames($fields='title,uid')

Returns an array with be_groups records (like ->getGroupNames) but:
- if the current BE_USER is admin, then all groups are returned, otherwise only groups that the current user is member of (usergroup_cached_list) will be returned.

Usage: 2 (module "web_perm" and ext. taskcenter)

$fields='title,uid' string Field list; $fields specify the fields selected (default: title,uid)
Returns: array

function blindUserNames($usernames,$groupArray,$excludeBlindedFlag=0)

Returns the array $usernames with the names of all users NOT IN $groupArray changed to the uid (hides the usernames!).
If $excludeBlindedFlag is set, then these records are unset from the array $usernames
Takes $usernames (array made by t3lib_BEfunc::getUserNames()) and a $groupArray (array with the groups a certain user is member of) as input

Usage: 8

$usernames array User names
$groupArray array Group names
$excludeBlindedFlag=0 boolean If $excludeBlindedFlag is set, then these records are unset from the array $usernames
Returns: array User names, blinded

function blindGroupNames($groups,$groupArray,$excludeBlindedFlag=0)

Corresponds to blindUserNames but works for groups instead

Usage: 2 (module web_perm)

$groups array Group names
$groupArray array Group names (reference)
$excludeBlindedFlag=0 boolean If $excludeBlindedFlag is set, then these records are unset from the array $usernames
Returns: array

function daysUntil($tstamp)

Returns the difference in days between input $tstamp and $EXEC_TIME

Usage: 2 (class t3lib_BEfunc)

$tstamp integer Time stamp, seconds
Returns: integer

function date($tstamp)

Returns $tstamp formatted as "ddmmyy" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy'])

Usage: 11

$tstamp integer Time stamp, seconds
Returns: string Formatted time

function datetime($value)

Returns $tstamp formatted as "ddmmyy hhmm" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy'] AND $TYPO3_CONF_VARS['SYS']['hhmm'])

Usage: 28

$value integer Time stamp, seconds
Returns: string Formatted time

function time($value)

Returns $value (in seconds) formatted as hh:mm:ss
For instance $value = 3600 + 60*2 + 3 should return "01:02:03"

Usage: 1 (class t3lib_BEfunc)

$value integer Time stamp, seconds
Returns: string Formatted time

function calcAge ($seconds,$labels)

Returns the "age" of the number of $seconds inputted.

Usage: 15

$seconds integer $seconds could be the difference of a certain timestamp and time()
$labels string $labels should be something like ' min| hrs| days| yrs'. This value is typically delivered by this function call: $GLOBALS["LANG"]->sL("LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears")
Returns: string Formatted time

function dateTimeAge($tstamp,$prefix=1,$date='')

Returns a formatted timestamp if $tstamp is set.
The date/datetime will be followed by the age in parenthesis.

Usage: 3

$tstamp integer Time stamp, seconds
$prefix=1 integer 1/-1 depending on polarity of age.
$date='' string $date=="date" will yield "dd:mm:yy" formatting, otherwise "dd:mm:yy hh:mm"
Returns: string

function titleAttrib($content='',$hsc=0)

Returns either title='' or alt='' attribute. This depends on the client browser and whether it supports title='' or not (which is the default)
If no $content is given only the attribute name is returned.
The returned attribute with content will have a leading space char.
Warning: Be careful to submit empty $content var - that will return just the attribute name!

Usage: 203

$content='' string String to set as title-attribute. If no $content is given only the attribute name is returned.
$hsc=0 boolean If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...)
Returns: string
  @depreciated The idea made sense with older browsers, but now all browsers should support the "title" attribute - so just hardcode the title attribute instead!

function titleAltAttrib($content)

Returns alt="" and title="" attributes with the value of $content.

$content string Value for 'alt' and 'title' attributes (will be htmlspecialchars()'ed before output)
Returns: string

function thumbCode($row,$table,$field,$backPath,$thumbScript='',$uploaddir='',$abs=0,$tparams='',$size='')

Returns a linked image-tag for thumbnail(s) from a database row with a list of image files in a field
All $TYPO3_CONF_VARS['GFX']['imagefile_ext'] extension are made to thumbnails + ttf file (renders font-example)
Thumbsnails are linked to the show_item.php script which will display further details.

Usage: 7

$row array $row is the database row from the table, $table.
$table string Table name for $row (present in TCA)
$field string $field is pointing to the field with the list of image files
$backPath string Back path prefix for image tag src="" field
$thumbScript='' string Optional: $thumbScript os by default 'thumbs.php' if you don't set it otherwise
$uploaddir='' string Optional: $uploaddir is the directory relative to PATH_site where the image files from the $field value is found (Is by default set to the entry in $TCA for that field! so you don't have to!)
$abs=0 boolean If set, uploaddir is NOT prepended with "../"
$tparams='' string Optional: $tparams is additional attributes for the image tags
$size='' integer Optional: $size is [w]x[h] of the thumbnail. 56 is default.
Returns: string Thumbnail image tag.

function getThumbNail($thumbScript,$theFile,$tparams='',$size='')

Returns single image tag to thumbnail

Usage: 3

$thumbScript string $thumbScript must point to "thumbs.php" relative to the script position
$theFile string $theFile must be the proper reference to the file thumbs.php should show
$tparams='' string $tparams are additional attributes for the image tag
$size='' integer $size is the size of the thumbnail send along to "thumbs.php"
Returns: string Image tag

function titleAttribForPages($row,$perms_clause='',$includeAttrib=1)

Returns title-attribute information for a page-record informing about id, alias, doktype, hidden, starttime, endtime, fe_group etc.

Usage: 8

$row array Input must be a page row ($row) with the proper fields set (be sure - send the full range of fields for the table)
$perms_clause='' string $perms_clause is used to get the record path of the shortcut page, if any (and doktype==4)
$includeAttrib=1 boolean If $includeAttrib is set, then the 'title=""' attribute is wrapped about the return value, which is in any case htmlspecialchar()'ed already
Returns: string

function getRecordIconAltText($row,$table='pages')

Returns title-attribute information for ANY record (from a table defined in TCA of course)
The included information depends on features of the table, but if hidden, starttime, endtime and fe_group fields are configured for, information about the record status in regard to these features are is included.
"pages" table can be used as well and will return the result of ->titleAttribForPages() for that page.

Usage: 10

$row array Table row; $row is a row from the table, $table
$table='pages' string Table name
Returns: string

function getLabelFromItemlist($table,$col,$key)

Returns the label of the first found entry in an "items" array from $TCA (tablename=$table/fieldname=$col) where the value is $key

Usage: 9

$table string Table name, present in $TCA
$col string Field name, present in $TCA
$key string items-array value to match
Returns: string Label for item entry

function getItemLabel($table,$col,$printAllWrap='')

Returns the label-value for fieldname $col in table, $table
If $printAllWrap is set (to a "wrap") then it's wrapped around the $col value IF THE COLUMN $col DID NOT EXIST in TCA!, eg. $printAllWrap='<b>|</b>' and the fieldname was 'not_found_field' then the return value would be '<b>not_found_field</b>'

Usage: 17

$table string Table name, present in $TCA
$col string Field name
$printAllWrap='' string Wrap value - set function description
Returns: string

function getRecordTitle($table,$row,$prep=0)

Returns the "title"-value in record, $row, from table, $table
The field(s) from which the value is taken is determined by the "ctrl"-entries 'label', 'label_alt' and 'label_alt_force'

Usage: 26

$table string Table name, present in TCA
$row array Row from table
$prep=0 boolean If set, result is prepared for output: The output is cropped to a limited lenght (depending on BE_USER->uc['titleLen']) and if no value is found for the title, '<em>[No title]</em>' is returned (localized). Further, the output is htmlspecialchars()'ed
Returns: string

function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0)

Returns a human readable output of a value from a record
For instance a database record relation would be looked up to display the title-value of that record. A checkbox with a "1" value would be "Yes", etc.
$table/$col is tablename and fieldname
REMEMBER to pass the output through htmlspecialchars() if you output it to the browser! (To protect it from XSS attacks and be XHTML compliant)

Usage: 24

$table string Table name, present in TCA
$col string Field name, present in TCA
$value string $value is the value of that field from a selected record
$fixed_lgd_chars=0 integer $fixed_lgd_chars is the max amount of characters the value may occupy
$defaultPassthrough=0 boolean $defaultPassthrough flag means that values for columns that has no conversion will just be pass through directly (otherwise cropped to 200 chars or returned as "N/A")
Returns: string

function getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0)

Same as ->getProcessedValue() but will go easy on fields like "tstamp" and "pid" which are not configured in TCA - they will be formatted by this function instead.

Usage: 2

$table string Table name, present in TCA
$fN string Field name
$fV string Field value
$fixed_lgd_chars=0 integer $fixed_lgd_chars is the max amount of characters the value may occupy
Returns: string
  @see getProcessedValue()

function getFileIcon($ext)

Returns file icon name (from $FILEICONS) for the fileextension $ext

Usage: 10

$ext string File extension, lowercase
Returns: string File icon filename

function getCommonSelectFields($table,$prefix)

Returns fields for a table, $table, which would typically be interesting to select
This includes uid, the fields defined for title, icon-field.
Returned as a list ready for query ($prefix can be set to eg. "pages." if you are selecting from the pages table and want the table name prefixed)

Usage: 3

$table string Table name, present in TCA
$prefix string Table prefix
Returns: string List of fields.

function makeConfigForm($configArray,$defaults,$dataPrefix)

Makes a form for configuration of some values based on configuration found in the array $configArray, with default values from $defaults and a data-prefix $dataPrefix
<form>-tags must be supplied separately
Needs more documentation and examples, in particular syntax for configuration array. See Inside TYPO3. That's were you can expect to find example, if anywhere.

Usage: 1 (ext. direct_mail)

$configArray array Field configuration code.
$defaults array Defaults
$dataPrefix string Prefix for formfields
Returns: string HTML for a form.

function helpTextIcon($table,$field,$BACK_PATH,$force=0)

Returns help-text icon if configured for.
TCA_DESCR must be loaded prior to this function and $BE_USER must have 'edit_showFieldHelp' set to 'icon', otherwise nothing is returned

Usage: 6

$table string Table name
$field string Field name
$BACK_PATH string Back path
$force=0 boolean Force display of icon nomatter BE_USER setting for help
Returns: string HTML content for a help icon/text

function helpText($table,$field,$BACK_PATH)

Returns CSH help text (description), if configured for.
TCA_DESCR must be loaded prior to this function and $BE_USER must have "edit_showFieldHelp" set to "text", otherwise nothing is returned
Will automatically call t3lib_BEfunc::helpTextIcon() to get the icon for the text.

Usage: 10

$table string Table name
$field string Field name
$BACK_PATH string Back path
Returns: string HTML content for help text

function editOnClick($params,$backPath='',$requestUri='')

Returns a JavaScript string (for an onClick handler) which will load the alt_doc.php script that shows the form for editing of the record(s) you have send as params.
REMEMBER to always htmlspecialchar() content in href-properties to ampersands get converted to entities (XHTML requirement and XSS precaution)

Usage: 35

$params string $params is parameters sent along to alt_doc.php. This requires a much more details description which you must seek in Inside TYPO3s documentation of the alt_doc.php API. And example could be '&edit[pages][123]=edit' which will show edit form for page record 123.
$backPath='' string $backPath must point back to the TYPO3_mainDir directory (where alt_doc.php is)
$requestUri='' string $requestUri is an optional returnUrl you can set - automatically set to REQUEST_URI.
Returns: string

function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='')

Returns a JavaScript string for viewing the page id, $id

Usage: 8

$id integer $id is page id
$backPath='' string $backpath must point back to TYPO3_mainDir (where the site is assumed to be one level above)
$rootLine='' array If root line is supplied the function will look for the first found domain record and use that URL instead (if found)
$anchor='' string $anchor is optional anchor to the URL
$altUrl='' string $altUrl is an alternative URL which - if set - will make all other parameters ignored: The function will just return the window.open command wrapped around this URL!
Returns: string

function getModTSconfig($id,$TSref)

Returns the merged User/Page TSconfig for page id, $id.
Please read details about module programming elsewhere!

Usage: 15

$id integer Page uid
$TSref string $TSref is an object string which determines the path of the TSconfig to return.
Returns: array

function getFuncMenu($id,$elementName,$currentValue,$menuItems,$script='',$addparams='')

Returns a selector box "function menu" for a module
Requires the JS function jumpToUrl() to be available
See Inside TYPO3 for details about how to use / make Function menus

Usage: 50

$id string $id is the "&id=" parameter value to be sent to the module
$elementName string $elementName it the form elements name, probably something like "SET[...]"
$currentValue string $currentValue is the value to be selected currently.
$menuItems array $menuItems is an array with the menu items for the selector box
$script='' string $script is the script to send the &id to, if empty it's automatically found
$addparams='' string $addParams is additional parameters to pass to the script.
Returns: string HTML code for selector box

function getFuncCheck($id,$elementName,$currentValue,$script='',$addparams='',$tagParams='')

Checkbox function menu.
Works like ->getFuncMenu() but takes no $menuItem array since this is a simple checkbox.

Usage: 34

$id string $id is the "&id=" parameter value to be sent to the module
$elementName string $elementName it the form elements name, probably something like "SET[...]"
$currentValue string $currentValue is the value to be selected currently.
$script='' string $script is the script to send the &id to, if empty it's automatically found
$addparams='' string $addParams is additional parameters to pass to the script.
$tagParams='' string Additional attributes for the checkbox input tag
Returns: string HTML code for checkbox
  @see getFuncMenu()

function getFuncInput($id,$elementName,$currentValue,$size=10,$script="",$addparams="")

Input field function menu
Works like ->getFuncMenu() / ->getFuncCheck() but displays a input field instead which updates the script "onchange"

Usage: 1

$id string $id is the "&id=" parameter value to be sent to the module
$elementName string $elementName it the form elements name, probably something like "SET[...]"
$currentValue string $currentValue is the value to be selected currently.
$size=10 integer Relative size of input field, max is 48
$script="" string $script is the script to send the &id to, if empty it's automatically found
$addparams="" string $addParams is additional parameters to pass to the script.
Returns: string HTML code for input text field.
  @see getFuncMenu()

function unsetMenuItems($modTSconfig,$itemArray,$TSref)

Removes menu items from $itemArray if they are configured to be removed by TSconfig for the module ($modTSconfig)
See Inside TYPO3 about how to program modules and use this API.

Usage: 4

$modTSconfig array Module TS config array
$itemArray array Array of items from which to remove items.
$TSref string $TSref points to the "object string" in $modTSconfig
Returns: array The modified $itemArray is returned.

function getSetUpdateSignal($set='')

Call to update the page tree frame (or something else..?) after
t3lib_BEfunc::getSetUpdateSignal('updatePageTree') -> will set the page tree to be updated.
t3lib_BEfunc::getSetUpdateSignal() -> will return some JavaScript that does the update (called in the typo3/template.php file, end() function)

Usage: 11

$set='' string Whether to set or clear the update signal. When setting, this value contains strings telling WHAT to set. At this point it seems that the value "updatePageTree" is the only one it makes sense to set.
Returns: string HTML code (<script> section)

function getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')

Returns an array which is most backend modules becomes MOD_SETTINGS containing values from function menus etc. determining the function of the module.
This is kind of session variable management framework for the backend users.
If a key from MOD_MENU is set in the CHANGED_SETTINGS array (eg. a value is passed to the script from the outside), this value is put into the settings-array
Ultimately, see Inside TYPO3 for how to use this function in relation to your modules.
Usage: 23

$MOD_MENU array MOD_MENU is an array that defines the options in menus.
$CHANGED_SETTINGS array CHANGED_SETTINGS represents the array used when passing values to the script from the menus.
$modName string modName is the name of this module. Used to get the correct module data.
$type='' string If type is 'ses' then the data is stored as session-lasting data. This means that it'll be wiped out the next time the user logs in.
$dontValidateList='' string dontValidateList can be used to list variables that should not be checked if their value is found in the MOD_MENU array. Used for dynamically generated menus.
$setDefaultList='' string List of default values from $MOD_MENU to set in the output array (only if the values from MOD_MENU are not arrays)
Returns: array The array $settings, which holds a key for each MOD_MENU key and the values of each key will be within the range of values for each menuitem

function lockRecords($table='',$uid=0,$pid=0)

Unlock or Lock a record from $table with $uid
If $table and $uid is not set, then all locking for the current BE_USER is removed!

Usage: 5

$table='' string Table name
$uid=0 integer Record uid
$pid=0 integer Record pid
Returns: void
  @internal
  @see t3lib_transferData::lockRecord(), alt_doc.php, db_layout.php, db_list.php, wizard_rte.php

function isRecordLocked($table,$uid)

Returns information about whether the record from table, $table, with uid, $uid is currently locked (edited by another user - which should issue a warning).
Notice: Locking is not strictly carried out since locking is abandoned when other backend scripts are activated - which means that a user CAN have a record "open" without having it locked. So this just serves as a warning that counts well in 90% of the cases, which should be sufficient.

Usage: 5

$table string Table name
$uid integer Record uid
Returns: array
  @internal
  @see class.db_layout.inc, alt_db_navframe.php, alt_doc.php, db_layout.php

function exec_foreign_table_where_query($fieldValue,$field='',$TSconfig=array(),$prefix='')

Returns select statement for MM relations (as used by TCEFORMs etc)

Usage: 3

$fieldValue array Configuration array for the field, taken from $TCA
$field='' string Field name
$TSconfig=array() array TSconfig array from which to get further configuration settings for the field name
$prefix='' string Prefix string for the key "*foreign_table_where" from $fieldValue array
Returns: string Part of query
  @internal
  @see t3lib_transferData::renderRecord(), t3lib_TCEforms::foreignTable()

function getTCEFORM_TSconfig($table,$row)

Returns TSConfig for the TCEFORM object in Page TSconfig.
Used in TCEFORMs

Usage: 4

$table string Table name present in TCA
$row array Row from table
Returns: array
  @see t3lib_transferData::renderRecord(), t3lib_TCEforms::setTSconfig(), SC_wizard_list::main(), SC_wizard_add::main()

function getTSconfig_pidValue($table,$uid,$pid)

Find the real PID of the record (with $uid from $table). This MAY be impossible if the pid is set as a reference to the former record or a page (if two records are created at one time).

Usage: 2

$table string Table name
$uid integer Record uid
$pid integer Record pid
Returns: integer
  @internal
  @see t3lib_TCEmain::copyRecord(), getTSCpid()

function getPidForModTSconfig($table,$uid,$pid)

Return $uid if $table is pages and $uid is integer - otherwise the $pid

Usage: 1

$table string Table name
$uid integer Record uid
$pid integer Record pid
Returns: integer
  @internal
  @see t3lib_TCEforms::getTSCpid()

function getTSCpid($table,$uid,$pid)

Returns the REAL pid of the record, if possible. If both $uid and $pid is strings, then pid=-1 is returned as an error indication.

Usage: 8

$table string Table name
$uid integer Record uid
$pid integer Record pid
Returns: integer
  @internal
  @see t3lib_TCEmain::setHistory(), t3lib_TCEmain::process_datamap()

function firstDomainRecord($rootLine)

Returns first found domain record "domainName" (without trailing slash) if found in the input $rootLine

Usage: 2

$rootLine array Root line array
Returns: string Domain name, if found.

function getDomainStartPage($domain, $path='')

Returns the sys_domain record for $domain, optionally with $path appended.

Usage: 2

$domain string Domain name
$path='' string Appended path
Returns: array Domain record, if found

function RTEsetup($RTEprop,$table,$field,$type='')

Returns overlayered RTE setup from an array with TSconfig. Used in TCEforms and TCEmain

Usage: 8

$RTEprop array The properties of Page TSconfig in the key "RTE."
$table string Table name
$field string Field name
$type='' string Type value of the current record (like from CType of tt_content)
Returns: array Array with the configuration for the RTE
  @internal

function isModuleSetInTBE_MODULES($modName)

Returns true if $modName is set and is found as a main- or submodule in $TBE_MODULES array

Usage: 1

$modName string Module name
Returns: boolean

function typo3PrintError ($header,$text,$js='',$head=1)

Print error message with header, text etc.

Usage: 19

$header string Header string
$text string Content string
$js='' boolean Will return an alert() with the content of header and text.
$head=1 boolean Print header.
Returns: void

function getPathType_web_nonweb($path)

Returns "web" if the $path (absolute) is within the DOCUMENT ROOT - and thereby qualifies as a "web" folder.

Usage: 4

$path string Path to evaluate
Returns: boolean

function ADMCMD_previewCmds($pageinfo)

Creates ADMCMD parameters for the "viewpage" extension / "cms" frontend

Usage: 1

$pageinfo array Page record
Returns: string Query-parameters
  @internal

function processParams($params)

Returns an array with key=>values based on input text $params
$params is exploded by line-breaks and each line is supposed to be on the syntax [key] = [some value]
These pairs will be parsed into an array an returned.

Usage: 1

$params string String of parameters on multiple lines to parse into key-value pairs (see function description)
Returns: array

function getListOfBackendModules($name,$perms_clause,$backPath='',$script='index.php')

Returns "list of backend modules". Most likely this will be obsolete soon / removed. Don't use.

Usage: 3

$name array Module names in array. Must be "addslashes()"ed
$perms_clause string Perms clause for SQL query
$backPath='' string Backpath
$script='index.php' string The URL/script to jump to (used in A tag)
Returns: array Two keys, rows and list
  @internal
  @depreciated
  @obsolete

class.t3lib_beuserauth.php

TYPO3 user authentication, backend
Could technically have been the same class as t3lib_userauthgroup since these two are always used together and only together.
t3lib_userauthgroup contains most of the functions used for checking permissions, authenticating users, setting up the user etc. This class is most interesting in terms of an API for user from outside.
This class contains the configuration of the database fields used plus some functions for the authentication process of backend users.

Filesize: 12.6 K
Func/Classes: 9
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_beUserAuth extends t3lib_userAuthGroup

TYPO3 user authentication, backend
Could technically have been the same class as t3lib_userauthgroup since these two are always used together and only together.
t3lib_userauthgroup contains most of the functions used for checking permissions, authenticating users, setting up the user etc. This class is most interesting in terms of an API for user from outside.
This class contains the configuration of the database fields used plus some functions for the authentication process of backend users.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function trackBeUser($flag)

If flag is set and the extensions 'beuser_tracking' is loaded, this will insert a table row with the REQUEST_URI of current script - thus tracking the scripts the backend users uses...
This function works ONLY with the "beuser_tracking" extension and is depreciated since it does nothing useful.

$flag boolean Activate insertion of the URL.
Returns: void

function checkLockToIP()

If TYPO3_CONF_VARS['BE']['enabledBeUserIPLock'] is enabled and an IP-list is found in the User TSconfig objString "options.lockToIP", then make an IP comparison with REMOTE_ADDR and return the outcome (true/false)

Returns: boolean True, if IP address validates OK (or no check is done at all)

function backendCheckLogin()

Check if user is logged in and if so, call ->fetchGroupData() to load group information and access lists of all kind, further check IP, set the ->uc array and send login-notification email if required.
If no user is logged in the default behaviour is to exit with an error message, but this will happen ONLY if the constant TYPO3_PROCEED_IF_NO_USER is set true.
This function is called right after ->start() in fx. init.php

Returns: void

function backendSetUC()

Initialize the internal ->uc array for the backend user
Will make the overrides if necessary, and write the UC back to the be_users record if changes has happend

Returns: void
  @internal

function overrideUC()

Override: Call this function every time the uc is updated.
That is 1) by reverting to default values, 2) in the setup-module, 3) userTS changes (userauthgroup)

Returns: void
  @internal

function resetUC()

Clears the user[uc] and ->uc to blank strings. Then calls ->backendSetUC() to fill it again with reset contents

Returns: void
  @internal

function emailAtLogin()

Will send an email notification to warning_email_address/the login users email address when a login session is just started.
Depends on various parameters whether mails are send and to whom.

Returns: void

function veriCode()

VeriCode returns 10 first chars of a md5 hash of the session cookie AND the encryptionKey from TYPO3_CONF_VARS.
This code is used as an alternative verification when the JavaScript interface executes cmd's to tce_db.php from eg. MSIE 5.0 because the proper referer is not passed with this browser...

Returns: string

class.t3lib_browsetree.php

Extension class for the t3lib_treeView class, specially made for browsing pages

Filesize: 4.3 K
Func/Classes: 4
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@coauthor René Fritz <r.fritz@colorcube.de>
@see t3lib_treeView, t3lib_pageTree
@package TYPO3
@subpackage t3lib

class t3lib_browseTree extends t3lib_treeView

Extension class for the t3lib_treeView class, specially made for browsing pages

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @coauthor René Fritz <r.fritz@colorcube.de>
  @see t3lib_treeView, t3lib_pageTree
  @package TYPO3
  @subpackage t3lib

function init($clause='')

Initialize, setting what is necessary for browsing pages.
Using the current user.

$clause='' string Additional clause for selecting pages.
Returns: void

function getTitleAttrib($row)

Creates title attribute content for pages.
Uses API function in t3lib_BEfunc which will retrieve lots of useful information for pages.

$row array The table row.
Returns: string

function wrapIcon($icon,$row)

Wrapping the image tag, $icon, for the row, $row (except for mount points)

$icon string The image tag for the icon
$row array The row for the current element
Returns: string The processed icon input value.

class.t3lib_clipboard.php

TYPO3 clipboard for records and files

Filesize: 32 K
Func/Classes: 31
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_clipboard

TYPO3 clipboard for records and files

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function initializeClipboard()

Initialize the clipboard from the be_user session

Returns: void

function lockToNormal()

Call this method after initialization if you want to lock the clipboard to operate on the normal pad only. Trying to switch pad through ->setCmd will not work
This is used by the clickmenu since it only allows operation on single elements at a time (that is the "normal" pad)

Returns: void

function setCmd($cmd)

The array $cmd may hold various keys which notes some action to take.
Normally perform only one action at a time.
In scripts like db_list.php / file_list.php the GET-var CB is used to control the clipboard.

Selecting / Deselecting elements
Array $cmd['el'] has keys = element-ident, value = element value (see description of clipData array in header)
Selecting elements for 'copy' should be done by simultaneously setting setCopyMode.

$cmd array Array of actions, see function description
Returns: void

function setCurrentPad($padIdent)

Setting the current pad on clipboard

$padIdent string Key in the array $this->clipData
Returns: void

function endClipboard()

Call this after initialization and setCmd in order to save the clipboard to the user session.
The function will check if the internal flag ->changed has been set and if so, save the clipboard. Else not.

Returns: void

function cleanUpCBC($CBarr,$table,$removeDeselected=0)

Cleans up an incoming element array $CBarr (Array selecting/deselecting elements)

$CBarr array Element array from outside ("key" => "selected/deselected")
$table string $table is the 'table which is allowed'. Must be set.
$removeDeselected=0 boolean $removeDeselected can be set in order to remove entries which are marked for deselection.
Returns: array Processed input $CBarr

function isElements()

Reports if the current pad has elements (does not check file/DB type OR if file/DBrecord exists or not. Only counting array)

Returns: boolean True if elements exist.

function printClipboard()

Prints the clipboard

Returns: string HTML output

function printContentFromTab($pad)

Print the content on a pad. Called from ->printClipboard()

$pad string Pad reference
Returns: array Array with table rows for the clipboard.

function padTitleWrap($str,$pad)

Wraps title of pad in bold-tags and maybe the number of elements if any.

$str string String (already htmlspecialchars()'ed)
$pad string Pad reference
Returns: string HTML output (htmlspecialchar'ed content inside of tags.)

function linkItemText($str,$rec,$table='')

Wraps the title of the items listed in link-tags. The items will link to the page/folder where they originate from

$str string Title of element - must be htmlspecialchar'ed on beforehand.
$rec mixed If array, a record is expected. If string, its a path
$table='' string Table name
Returns: string

function isSelected($table,$uid)

Verifies if the item $table/$uid is on the current pad.
If the pad is "normal", the mode value is returned if the element existed. Thus you'll know if the item was copy or cut moded...

$table string Table name, (_FILE for files...)
$uid integer Element uid (path for files)
Returns: string

function getSelectedRecord($table='',$uid='')

Returns item record $table,$uid if selected on current clipboard
If table and uid is blank, the first element is returned.
Makes sense only for DB records - not files!

$table='' string Table name
$uid='' integer Element uid
Returns: array Element record with extra field _RECORD_TITLE set to the title of the record...

function selUrlDB($table,$uid,$copy=0,$deselect=0,$baseArray=array())

Returns the select-url for database elements

$table string Table name
$uid integer Uid of record
$copy=0 boolean If set, copymode will be enabled
$deselect=0 boolean If set, the link will deselect, otherwise select.
$baseArray=array() array The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included.
Returns: string URL linking to the current script but with the CB array set to select the element with table/uid

function selUrlFile($path,$copy=0,$deselect=0,$baseArray=array())

Returns the select-url for files

$path string Filepath
$copy=0 boolean If set, copymode will be enabled
$deselect=0 boolean If set, the link will deselect, otherwise select.
$baseArray=array() array The base array of GET vars to be sent in addition. Notice that current GET vars WILL automatically be included.
Returns: string URL linking to the current script but with the CB array set to select the path

function pasteUrl($table,$uid,$setRedirect=1)

pasteUrl of the element (database and file)
For the meaning of $table and $uid, please read from ->makePasteCmdArray!!!
The URL will point to tce_file or tce_db depending in $table

$table string Tablename (_FILE for files)
$uid mixed "destination": can be positive or negative indicating how the paste is done (paste into / paste after)
$setRedirect=1 boolean If set, then the redirect URL will point back to the current script, but with CB reset.
Returns: string

function deleteUrl($setRedirect=1,$file=0)

deleteUrl for current pad

$setRedirect=1 boolean If set, then the redirect URL will point back to the current script, but with CB reset.
$file=0 boolean If set, then the URL will link to the tce_file.php script in the typo3/ dir.
Returns: string

function editUrl()

editUrl of all current elements
ONLY database
Links to alt_doc.php

Returns: string The URL to alt_doc.php with parameters.

function removeUrl($table,$uid)

Returns the remove-url (file and db)
for file $table='_FILE' and $uid = shortmd5 hash of path

$table string Tablename
$uid string uid integer/shortmd5 hash
Returns: string URL

function cleanCurrent()

This traverses the elements on the current clipboard pane
and unsets elements which does not exist anymore or are disabled.

Returns: void

function elFromTable($matchTable='',$pad='')

Counts the number of elements from the table $matchTable. If $matchTable is blank, all tables (except '_FILE' of course) is counted.

$matchTable='' string Table to match/count for.
$pad='' string $pad can optionally be used to set another pad than the current.
Returns: array Array with keys from the CB.

function confirmMsg($table,$rec,$type,$clElements)

Returns confirm JavaScript message

$table string Table name
$rec mixed For records its an array, for files its a string (path)
$type string Type-code
$clElements array Array of selected elements
Returns: string JavaScript "confirm" message

function removeElement($el)

Removes element on clipboard

$el string Key of element in ->clipData array
Returns: void

function saveClipboard()

Saves the clipboard, no questions asked.
Use ->endClipboard normally (as it checks if changes has been done so saving is necessary)

Returns: void

function currentMode()

Returns the current mode, 'copy' or 'cut'

Returns: string "copy" or "cut"

function clLabel($key,$Akey='labels')

Clipboard label - getting from "EXT:lang/locallang_core.php:"

$key string Label Key
$Akey='labels' string Alternative key to "labels"
Returns: string

function makePasteCmdArray($ref,$CMD)

Applies the proper paste configuration in the $cmd array send to tce_db.php.
$ref is the target, see description below.
The current pad is pasted

$ref: [tablename]:[paste-uid].
tablename is the name of the table from which elements *on the current clipboard* is pasted with the 'pid' paste-uid.
No tablename means that all items on the clipboard (non-files) are pasted. This requires paste-uid to be positive though.
so 'tt_content:-3' means 'paste tt_content elements on the clipboard to AFTER tt_content:3 record
'tt_content:30' means 'paste tt_content elements on the clipboard into page with id 30
':30' means 'paste ALL database elements on the clipboard into page with id 30
':-30' not valid.

$ref string [tablename]:[paste-uid], see description
$CMD array Command-array
Returns: array Modified Command-array

function makeDeleteCmdArray($CMD)

Delete record entries in CMD array

$CMD array Command-array
Returns: array Modified Command-array

function makePasteCmdArray_file($ref,$FILE)

Applies the proper paste configuration in the $file array send to tce_file.php.
The current pad is pasted

$ref string Reference to element (splitted by "|")
$FILE array Command-array
Returns: array Modified Command-array

function makeDeleteCmdArray_file($FILE)

Delete files in CMD array

$FILE array Command-array
Returns: array Modified Command-array

class.t3lib_cs.php

Class for conversion between charsets.

Filesize: 25 K
Func/Classes: 16
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@author Martin Kutschker <martin.t.kutschker@blackbox.net>
@package TYPO3
@subpackage t3lib

class t3lib_cs

Class for conversion between charsets.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>
  @package TYPO3
  @subpackage t3lib

function parse_charset($charset)

Normalize - changes input character set to lowercase letters.

$charset string Input charset
Returns: string Normalized charset
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>

function conv($str,$fromCS,$toCS,$useEntityForNoChar=0)

Convert from one charset to another charset.

$str string Input string
$fromCS string From charset (the current charset of the string)
$toCS string To charset (the output charset wanted)
$useEntityForNoChar=0 boolean If set, then characters that are not available in the destination character set will be encoded as numeric entities
Returns: string Converted string

function utf8_encode($str,$charset)

Converts $str from $charset to UTF-8

$str string String in local charset to convert to UTF-8
$charset string Charset, lowercase. Must be found in csconvtbl/ folder.
Returns: string Output string, converted to UTF-8

function utf8_decode($str,$charset,$useEntityForNoChar=0)

Converts $str from UTF-8 to $charset

$str string String in UTF-8 to convert to local charset
$charset string Charset, lowercase. Must be found in csconvtbl/ folder.
$useEntityForNoChar=0 boolean If set, then characters that are not available in the destination character set will be encoded as numeric entities
Returns: string Output string, converted to local charset

function utf8_to_entities($str)

Converts all chars > 127 to numeric entities.

$str string Input string
Returns: string Output string

function entities_to_utf8($str,$alsoStdHtmlEnt=0)

Converts numeric entities (UNICODE, eg. decimal (&#1234;) or hexadecimal (&#x1b;)) to UTF-8 multibyte chars

$str string Input string, UTF-8
$alsoStdHtmlEnt=0 boolean If set, then all string-HTML entities (like &amp; or &pound; will be converted as well)
Returns: string Output string

function utf8_to_numberarray($str,$convEntities=0,$retChar=0)

Converts all chars in the input UTF-8 string into integer numbers returned in an array

$str string Input string, UTF-8
$convEntities=0 boolean If set, then all HTML entities (like &amp; or &pound; or &#123; or &#x3f5d;) will be detected as characters.
$retChar=0 boolean If set, then instead of integer numbers the real UTF-8 char is returned.
Returns: array Output array with the char numbers

function initCharset($charset)

This will initialize a charset for use if it's defined in the PATH_t3lib.'csconvtbl/' folder
This function is automatically called by the conversion functions

PLEASE SEE: http://www.unicode.org/Public/MAPPINGS/

$charset string The charset to be initialized. Use lowercase charset always (the charset must match exactly with a filename in csconvtbl/ folder ([charset].tbl)
Returns: integer Returns '1' if already loaded. Returns FALSE if charset conversion table was not found. Returns '2' if the charset conversion table was found and parsed.

function UnumberToChar($cbyte)

Converts a UNICODE number to a UTF-8 multibyte character
Algorithm based on script found at From: http://czyborra.com/utf/

The binary representation of the character's integer value is thus simply spread across the bytes and the number of high bits set in the lead byte announces the number of bytes in the multibyte sequence:

bytes | bits | representation
1 | 7 | 0vvvvvvv
2 | 11 | 110vvvvv 10vvvvvv
3 | 16 | 1110vvvv 10vvvvvv 10vvvvvv
4 | 21 | 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv
5 | 26 | 111110vv 10vvvvvv 10vvvvvv 10vvvvvv 10vvvvvv
6 | 31 | 1111110v 10vvvvvv 10vvvvvv 10vvvvvv 10vvvvvv 10vvvvvv

$cbyte integer UNICODE integer
Returns: string UTF-8 multibyte character string
  @see utf8CharToUnumber()

function utf8CharToUnumber($str,$hex=0)

Converts a UTF-8 Multibyte character to a UNICODE number

$str string UTF-8 multibyte character string
$hex=0 boolean If set, then a hex. number is returned.
Returns: integer UNICODE integer
  @see UnumberToChar()

function utf8_strtrunc($str,$len)

Truncates a string in UTF-8 short at a given byte length

$str string UTF-8 multibyte character string
$len integer the byte length
Returns: string the shortened string
  @see strcut()
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>

function utf_strlen($str)

$str [type] $str: ...
Returns: [type] ...
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>

function utf_substr($str,$start,$len=0)

$str [type] $str: ...
$start [type] $start: ...
$len=0 [type] $len: ...
Returns: [type] ...
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>

function utf_strpos($haystack,$needle,$offset=0)

$haystack [type] $haystack: ...
$needle [type] $needle: ...
$offset=0 [type] $offset: ...
Returns: [type] ...
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>

function utf_strrpos($haystack,$needle,$offset=0)

$haystack [type] $haystack: ...
$needle [type] $needle: ...
$offset=0 [type] $offset: ...
Returns: [type] ...
  @author Martin Kutschker <martin.t.kutschker@blackbox.net>

class.t3lib_db.php

TYPO3 "database wrapper" class (new in 3.6.0)
This class contains
- abstraction functions for executing INSERT/UPDATE/DELETE/SELECT queries ("Query execution"; These are REQUIRED for all future connectivity to the database, thus ensuring DBAL compliance!)
- functions for building SQL queries (INSERT/UPDATE/DELETE/SELECT) ("Query building"); These are transitional functions for building SQL queries in a more automated way. Use these to build queries instead of doing it manually in your code!
- mysql() wrapper functions; These are transitional functions. By a simple search/replace you should be able to substitute all mysql*() calls with $GLOBALS['TYPO3_DB']->sql*() and your application will work out of the box. YOU CANNOT (legally) use any mysql functions not found as wrapper functions in this class!
See the Project Coding Guidelines (doc_core_cgl) for more instructions on best-practise

This class is not in itself a complete database abstraction layer but can be extended to be a DBAL (by extensions, see "dbal" for example)
ALL connectivity to the database in TYPO3 must be done through this class!
The points of this class are:
- To direct all database calls through this class so it becomes possible to implement DBAL with extensions.
- To keep it very easy to use for developers used to MySQL in PHP - and preserve as much performance as possible when TYPO3 is used with MySQL directly...
- To create an interface for DBAL implemented by extensions; (Eg. making possible escaping characters, clob/blob handling, reserved words handling)
- Benchmarking the DB bottleneck queries will become much easier; Will make it easier to find optimization possibilities.

USE:
In all TYPO3 scripts the global variable $TYPO3_DB is an instance of this class. Use that.
Eg. $GLOBALS['TYPO3_DB']->sql_fetch_assoc()

Filesize: 31 K
Func/Classes: 38
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_DB

TYPO3 "database wrapper" class (new in 3.6.0)
This class contains
- abstraction functions for executing INSERT/UPDATE/DELETE/SELECT queries ("Query execution"; These are REQUIRED for all future connectivity to the database, thus ensuring DBAL compliance!)
- functions for building SQL queries (INSERT/UPDATE/DELETE/SELECT) ("Query building"); These are transitional functions for building SQL queries in a more automated way. Use these to build queries instead of doing it manually in your code!
- mysql() wrapper functions; These are transitional functions. By a simple search/replace you should be able to substitute all mysql*() calls with $GLOBALS['TYPO3_DB']->sql*() and your application will work out of the box. YOU CANNOT (legally) use any mysql functions not found as wrapper functions in this class!
See the Project Coding Guidelines (doc_core_cgl) for more instructions on best-practise

This class is not in itself a complete database abstraction layer but can be extended to be a DBAL (by extensions, see "dbal" for example)
ALL connectivity to the database in TYPO3 must be done through this class!
The points of this class are:
- To direct all database calls through this class so it becomes possible to implement DBAL with extensions.
- To keep it very easy to use for developers used to MySQL in PHP - and preserve as much performance as possible when TYPO3 is used with MySQL directly...
- To create an interface for DBAL implemented by extensions; (Eg. making possible escaping characters, clob/blob handling, reserved words handling)
- Benchmarking the DB bottleneck queries will become much easier; Will make it easier to find optimization possibilities.

USE:
In all TYPO3 scripts the global variable $TYPO3_DB is an instance of this class. Use that.
Eg. $GLOBALS['TYPO3_DB']->sql_fetch_assoc()

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function exec_INSERTquery($table,$fields_values)

Creates and executes an INSERT SQL-statement for $table from the array with field/value pairs $fields_values.
Using this function specifically allows us to handle BLOB and CLOB fields depending on DB
Usage count/core: 47

$table string Table name
$fields_values array Field values as key=>value pairs. Values will be escaped internally. Typically you would fill an array like "$insertFields" with 'fieldname'=>'value' and pass it to this function as argument.
Returns: pointer MySQL result pointer / DBAL object

function exec_UPDATEquery($table,$where,$fields_values)

Creates and executes an UPDATE SQL-statement for $table where $where-clause (typ. 'uid=...') from the array with field/value pairs $fields_values.
Using this function specifically allow us to handle BLOB and CLOB fields depending on DB
Usage count/core: 50

$table string Database tablename
$where string WHERE clause, eg. "uid=1". NOTICE: You must escape values in this argument with $this->quoteStr() yourself!
$fields_values array Field values as key=>value pairs. Values will be escaped internally. Typically you would fill an array like "$updateFields" with 'fieldname'=>'value' and pass it to this function as argument.
Returns: pointer MySQL result pointer / DBAL object

function exec_DELETEquery($table,$where)

Creates and executes a DELETE SQL-statement for $table where $where-clause
Usage count/core: 40

$table string Database tablename
$where string WHERE clause, eg. "uid=1". NOTICE: You must escape values in this argument with $this->quoteStr() yourself!
Returns: pointer MySQL result pointer / DBAL object

function exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy='',$orderBy='',$limit='')

Creates and executes a SELECT SQL-statement
Using this function specifically allow us to handle the LIMIT feature independently of DB.
Usage count/core: 340

$select_fields string List of fields to select from the table. This is what comes right after "SELECT ...". Required value.
$from_table string Table(s) from which to select. This is what comes right after "FROM ...". Required value.
$where_clause string Optional additional WHERE clauses put in the end of the query. NOTICE: You must escape values in this argument with $this->quoteStr() yourself! DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
$groupBy='' string Optional GROUP BY field(s), if none, supply blank string.
$orderBy='' string Optional ORDER BY field(s), if none, supply blank string.
$limit='' string Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns: pointer MySQL result pointer / DBAL object

function exec_SELECT_mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')

Creates and executes a SELECT query, selecting fields ($select) from two/three tables joined
$local_table and $mm_table is mandatory. $foreign_table is optional.
The JOIN is done with [$local_table].uid <--> [$mm_table].uid_local / [$mm_table].uid_foreign <--> [$foreign_table].uid
The function is very useful for selecting MM-relations between tables adhering to the MM-format used by TCE (TYPO3 Core Engine). See the section on $TCA in Inside TYPO3 for more details.

Usage: 12 (spec. ext. sys_action, sys_messages, sys_todos)

$select string Field list for SELECT
$local_table string Tablename, local table
$mm_table string Tablename, relation table
$foreign_table string Tablename, foreign table
$whereClause='' string Optional additional WHERE clauses put in the end of the query. NOTICE: You must escape values in this argument with $this->quoteStr() yourself! DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
$groupBy='' string Optional GROUP BY field(s), if none, supply blank string.
$orderBy='' string Optional ORDER BY field(s), if none, supply blank string.
$limit='' string Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns: pointer MySQL result pointer / DBAL object
  @see exec_SELECTquery()

function exec_SELECT_queryArray($queryParts)

Executes a select based on input query parts array

Usage: 9

$queryParts array Query parts array
Returns: pointer MySQL select result pointer / DBAL object
  @see exec_SELECTquery()

function INSERTquery($table,$fields_values)

Creates an INSERT SQL-statement for $table from the array with field/value pairs $fields_values.
Usage count/core: 4

$table string See exec_INSERTquery()
$fields_values array See exec_INSERTquery()
Returns: string Full SQL query for INSERT (unless $fields_values does not contain any elements in which case it will be false)
  @depreciated use exec_INSERTquery() instead if possible!

function UPDATEquery($table,$where,$fields_values)

Creates an UPDATE SQL-statement for $table where $where-clause (typ. 'uid=...') from the array with field/value pairs $fields_values.
Usage count/core: 6

$table string See exec_UPDATEquery()
$where string See exec_UPDATEquery()
$fields_values array See exec_UPDATEquery()
Returns: string Full SQL query for UPDATE (unless $fields_values does not contain any elements in which case it will be false)
  @depreciated use exec_UPDATEquery() instead if possible!

function DELETEquery($table,$where)

Creates a DELETE SQL-statement for $table where $where-clause
Usage count/core: 3

$table string See exec_DELETEquery()
$where string See exec_DELETEquery()
Returns: string Full SQL query for DELETE
  @depreciated use exec_DELETEquery() instead if possible!

function SELECTquery($select_fields,$from_table,$where_clause,$groupBy='',$orderBy='',$limit='')

Creates a SELECT SQL-statement
Usage count/core: 11

$select_fields string See exec_SELECTquery()
$from_table string See exec_SELECTquery()
$where_clause string See exec_SELECTquery()
$groupBy='' string See exec_SELECTquery()
$orderBy='' string See exec_SELECTquery()
$limit='' string See exec_SELECTquery()
Returns: string Full SQL query for SELECT
  @depreciated use exec_SELECTquery() instead if possible!

function listQuery($field, $value, $table)

Returns a WHERE clause that can find a value ($value) in a list field ($field)
For instance a record in the database might contain a list of numbers, "34,234,5" (with no spaces between). This query would be able to select that record based on the value "34", "234" or "5" regardless of their positioni in the list (left, middle or right).
Is nice to look up list-relations to records or files in TYPO3 database tables.

$field string Field name
$value string Value to find in list
$table string Table in which we are searching (for DBAL detection of quoteStr() method)
Returns: string WHERE clause for a query

function searchQuery($searchWords,$fields,$table)

Returns a WHERE clause which will make an AND search for the words in the $searchWords array in any of the fields in array $fields.

$searchWords array Array of search words
$fields array Array of fields
$table string Table in which we are searching (for DBAL detection of quoteStr() method)
Returns: string WHERE clause for search

function quoteStr($str, $table)

Substitution for PHP function "addslashes()"
Use this function instead of the PHP addslashes() function when you build queries - this will prepare your code for DBAL.
Usage count/core: 105

$str string Input string
$table string Table name for which to quote string. Just enter the table that the field-value is selected from (and any DBAL will look up which handler to use and then how to quote the string!).
Returns: string Output string; Quotes (" / ') and \ will be backslashed (or otherwise based on DBAL handler)

function cleanIntArray($arr)

Will convert all values in the one-dimentional array to integers.
Useful when you want to make sure an array contains only integers before imploding them in a select-list.
Usage count/core: 7

$arr array Array with values
Returns: array The input array with all values passed through intval()
  @see cleanIntList()

function cleanIntList($list)

Will force all entries in the input comma list to integers
Useful when you want to make sure a commalist of supposed integers really contain only integers; You want to know that when you don't trust content that could go into an SQL statement.
Usage count/core: 6

$list string List of comma-separated values which should be integers
Returns: string The input list but with every value passed through intval()
  @see cleanIntArray()

function stripOrderBy($str)

Removes the prefix "ORDER BY" from the input string.
This function is used when you call the exec_SELECTquery() function and want to pass the ORDER BY parameter by can't guarantee that "ORDER BY" is not prefixed.
Generally; This function provides a work-around to the situation where you cannot pass only the fields by which to order the result.
Usage count/core: 11

$str string eg. "ORDER BY title, uid"
Returns: string eg. "title, uid"
  @see exec_SELECTquery(), stripGroupBy()

function stripGroupBy($str)

Removes the prefix "GROUP BY" from the input string.
This function is used when you call the SELECTquery() function and want to pass the GROUP BY parameter by can't guarantee that "GROUP BY" is not prefixed.
Generally; This function provides a work-around to the situation where you cannot pass only the fields by which to order the result.
Usage count/core: 1

$str string eg. "GROUP BY title, uid"
Returns: string eg. "title, uid"
  @see exec_SELECTquery(), stripOrderBy()

function splitGroupOrderLimit($str)

Takes the last part of a query, eg. "... uid=123 GROUP BY title ORDER BY title LIMIT 5,2" and splits each part into a table (WHERE, GROUPBY, ORDERBY, LIMIT)
Work-around function for use where you know some userdefined end to an SQL clause is supplied and you need to separate these factors.
Usage count/core: 13

$str string Input string
Returns: array

function sql($db,$query)

Executes query
mysql() wrapper function
DEPRECIATED - use exec_* functions from this class instead!
Usage count/core: 9

$db string Database name
$query string Query to execute
Returns: pointer Result pointer / DBAL object

function sql_query($query)

Executes query
mysql_query() wrapper function
Usage count/core: 1

$query string Query to execute
Returns: pointer Result pointer / DBAL object

function sql_error()

Returns the error status on the last sql() execution
mysql_error() wrapper function
Usage count/core: 32

Returns: string MySQL error string.

function sql_num_rows($res)

Returns the number of selected rows.
mysql_num_rows() wrapper function
Usage count/core: 85

$res pointer MySQL result pointer (of SELECT query) / DBAL object
Returns: integer Number of resulting rows.

function sql_fetch_assoc($res)

Returns an associative array that corresponds to the fetched row, or FALSE if there are no more rows.
mysql_fetch_assoc() wrapper function
Usage count/core: 307

$res pointer MySQL result pointer (of SELECT query) / DBAL object
Returns: array Associative array of result row.

function sql_fetch_row($res)

Returns an array that corresponds to the fetched row, or FALSE if there are no more rows.
The array contains the values in numerical indices.
mysql_fetch_row() wrapper function
Usage count/core: 56

$res pointer MySQL result pointer (of SELECT query) / DBAL object
Returns: array Array with result rows.

function sql_free_result($res)

Free result memory
mysql_free_result() wrapper function
Usage count/core: 3

$res pointer MySQL result pointer to free / DBAL object
Returns: boolean Returns TRUE on success or FALSE on failure.

function sql_insert_id()

Get the ID generated from the previous INSERT operation
mysql_insert_id() wrapper function
Usage count/core: 13

Returns: integer The uid of the last inserted record.

function sql_affected_rows()

Returns the number of rows affected by the last INSERT, UPDATE or DELETE query
mysql_affected_rows() wrapper function
Usage count/core: 1

Returns: integer Number of rows affected by last query

function sql_data_seek($res,$seek)

Move internal result pointer
mysql_data_seek() wrapper function
Usage count/core: 3

$res pointer MySQL result pointer (of SELECT query) / DBAL object
$seek integer Seek result number.
Returns: boolean Returns TRUE on success or FALSE on failure.

function sql_field_type($res,$pointer)

Get the type of the specified field in a result
mysql_field_type() wrapper function
Usage count/core: 2

$res pointer MySQL result pointer (of SELECT query) / DBAL object
$pointer integer Field index.
Returns: string Returns the name of the specified field index

function sql_pconnect($TYPO3_db_host, $TYPO3_db_username, $TYPO3_db_password)

Open a (persistent) connection to a MySQL server
mysql_pconnect() wrapper function
Usage count/core: 12

$TYPO3_db_host string Database host IP/domain
$TYPO3_db_username string Username to connect with.
$TYPO3_db_password string Password to connect with.
Returns: pointer Returns a positive MySQL persistent link identifier on success, or FALSE on error.

function sql_select_db($TYPO3_db)

Select a MySQL database
mysql_select_db() wrapper function
Usage count/core: 8

$TYPO3_db string Database to connect to.
Returns: boolean Returns TRUE on success or FALSE on failure.

function admin_get_dbs()

Listing databases from current MySQL connection. NOTICE: It WILL try to select those databases and thus break selection of current database.
This doesn't really make sense to transfer to a DBAL layer - this detection is also PRE-DBAL in many ways since it is only used as a service function in the 1-2-3 process of the Install Tool. In any case a lookup should be done in the _DEFAULT handler DBMS then.
Use in Install Tool only!
Usage count/core: 1

Returns: array Each entry represents a database name

function admin_get_tables()

Returns the list of tables from the default database, TYPO3_db (quering the DBMS)
In a DBAL this method should 1) look up all tables from the DBMS of the _DEFAULT handler and then 2) add all tables *configured* to be managed by other handlers
Usage count/core: 2

Returns: array Tables in an array (tablename is in both key and value)

function admin_get_fields($tableName)

Returns information about each field in the $table (quering the DBMS)
In a DBAL this should look up the right handler for the table and return compatible information
This function is important not only for the Install Tool but probably for DBALs as well since they might need to look up table specific information in order to construct correct queries. In such cases this information should probably be cached for quick delivery

$tableName string Table name
Returns: array Field information in an associative array with fieldname => field row

function admin_get_keys($tableName)

Returns information about each index key in the $table (quering the DBMS)
In a DBAL this should look up the right handler for the table and return compatible information

$tableName string Table name
Returns: array Key information in a numeric array

function admin_query($query)

mysql() wrapper function, used by the Install Tool and EM for all queries regarding management of the database!
Usage count/core: 10

$query string Query to execute
Returns: pointer Result pointer

function debug($func)

Debug function: Outputs error if any

$func string Function calling debug()
Returns: void

class.t3lib_diff.php

This class has functions which generates a difference output of a content string
Currently works only with LINUX/UNIX

Filesize: 7.6 K
Func/Classes: 6
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_diff

This class has functions which generates a difference output of a content string
Currently works only with LINUX/UNIX

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function makeDiffDisplay($str1,$str2)

This will produce a color-marked-up diff output in HTML from the input strings.

$str1 string String 1
$str2 string String 2
Returns: string Formatted output.

function getDiff($str1,$str2)

Produce a diff (with the "diff" application on unix) between two strings
The function will write the two input strings to temporary files, then execute the diff program, delete the temp files and return the result.

$str1 string String 1
$str2 string String 2
Returns: array The result from the exec() function call.

function addClearBuffer($clearBuffer,$last=0)

Will bring down the length of strings to < 150 chars if they were longer than 200 chars. This done by preserving the 70 first and last chars and concatenate those strings with "..." and a number indicating the string length

$clearBuffer string The input string.
$last=0 boolean If set, it indicates that the string should just end with ... (thus no "complete" ending)
Returns: string Processed string.

function explodeStringIntoWords($str)

Explodes the input string into words.
This is done by splitting first by lines, then by space char. Each word will be in stored as a value in an array. Lines will be indicated by two subsequent empty values.

$str string The string input
Returns: array Array with words.

function tagSpace($str,$rev=0)

Adds a space character before and after HTML tags (more precisely any found < or >)

$str string String to process
$rev=0 boolean If set, the < > searched for will be &lt; and &gt;
Returns: string Processed string

class.t3lib_div.php

The legendary "t3lib_div" class - Miscellaneous functions for general purpose.
Most of the functions does not relate specifically to TYPO3
However a section of functions requires certain TYPO3 features available
See comments in the source.
You are encouraged to use this library in your own scripts!

USE:
The class is intended to be used without creating an instance of it.
So: Don't instantiate - call functions with "t3lib_div::" prefixed the function name.
So use t3lib_div::[method-name] to refer to the functions, eg. 't3lib_div::milliseconds()'

Filesize: 113 K
Func/Classes: 109
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_div

The legendary "t3lib_div" class - Miscellaneous functions for general purpose.
Most of the functions does not relate specifically to TYPO3
However a section of functions requires certain TYPO3 features available
See comments in the source.
You are encouraged to use this library in your own scripts!

USE:
The class is intended to be used without creating an instance of it.
So: Don't instantiate - call functions with "t3lib_div::" prefixed the function name.
So use t3lib_div::[method-name] to refer to the functions, eg. 't3lib_div::milliseconds()'

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function _GP($var)

Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order)
Strips slashes from all output, both strings and arrays.
This function substitutes t3lib_div::GPvar()
To enhancement security in your scripts, please consider using t3lib_div::_GET or t3lib_div::_POST if you already know by which method your data is arriving to the scripts!

$var string GET/POST var to return
Returns: mixed POST var named $var and if not set, the GET var of the same name.
  @see GPvar()

function _GET($var='')

Returns the global GET array (or value from) normalized to contain un-escaped values.
ALWAYS use this API function to acquire the GET variables!

$var='' string Optional pointer to value in GET array (basically name of GET var)
Returns: mixed If $var is set it returns the value of $HTTP_GET_VARS[$var]. If $var is blank or zero, returns $HTTP_GET_VARS itself. In any case *slashes are stipped from the output!*
  @see _POST(), _GP(), _GETset()

function _POST($var='')

Returns the global POST array (or value from) normalized to contain un-escaped values.
ALWAYS use this API function to acquire the POST variables!

$var='' string Optional pointer to value in POST array (basically name of POST var)
Returns: mixed If $var is set it returns the value of $HTTP_POST_VARS[$var]. If $var is blank or zero, returns $HTTP_POST_VARS itself. In any case *slashes are stipped from the output!*
  @see _GET(), _GP()

function _GETset($inputGet,$key='')

Writes input value to $HTTP_GET_VARS / $_GET

$inputGet array Array to write to $HTTP_GET_VARS / $_GET. Values should NOT be escaped at input time (but will be escaped before writing according to TYPO3 standards).
$key='' string Alternative key; If set, this will not set the WHOLE GET array, but only the key in it specified by this value!
Returns: void

function GPvar($var,$strip=0)

GET/POST variable
Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order)
Strips slashes of string-outputs, but not arrays UNLESS $strip is set. If $strip is set all output will have escaped characters unescaped.

Usage: 686

$var string GET/POST var to return
$strip=0 boolean If set, values are stripped of return values that are *arrays!* - string/integer values returned are always strip-slashed()
Returns: mixed POST var named $var and if not set, the GET var of the same name.
  @depreciated Use t3lib_div::_GP instead (ALWAYS delivers a value with un-escaped values!)
  @see _GP()

function setGPvars($list,$strip=0)

Sets global variables from HTTP_POST_VARS or HTTP_GET_VARS

Usage: 9

$list string List of GET/POST var keys to set globally
$strip=0 boolean If set, values are passed through stripslashes()
Returns: void
  @depreciated

function GParrayMerged($var)

Returns the GET/POST global arrays merged with POST taking precedence.

Usage: 1

$var string Key (variable name) from GET or POST vars
Returns: array Returns the GET vars merged recursively onto the POST vars.
  @depreciated

function gif_compress($theFile, $type)

Compressing a GIF file if not already LZW compressed
This function is a workaround for the fact that ImageMagick and/or GD does not compress GIF-files to their minimun size (that is RLE or no compression used)

The function takes a file-reference, $theFile, and saves it again through GD or ImageMagick in order to compress the file
GIF:
If $type is not set, the compression is done with ImageMagick (provided that $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] is pointing to the path of a lzw-enabled version of 'convert') else with GD (should be RLE-enabled!)
If $type is set to either 'IM' or 'GD' the compression is done with ImageMagick and GD respectively
PNG:
No changes.

$theFile is expected to be a valid GIF-file!
The function returns a code for the operation.

Usage: 11

$theFile string Filepath
$type string See description of function
Returns: string Returns "GD" if GD was used, otherwise "IM" if ImageMagick was used. If nothing done at all, it returns empty string.
  @internal

function png_to_gif_by_imagemagick($theFile)

Converts a png file to gif

This converts a png file to gif IF the FLAG $GLOBALS['TYPO3_CONF_VARS']['FE']['png_to_gif'] is set true.

Usage: 5

$theFile string $theFile the filename with path
Returns: string new filename
  @internal

function read_png_gif($theFile,$output_png=0)

Returns filename of the png/gif version of the input file (which can be png or gif).
If input file type does not match the wanted output type a conversion is made and temp-filename returned.
Usage: 1

$theFile string Filepath of image file
$output_png=0 boolean If set, then input file is converted to PNG, otherwise to GIF
Returns: string If the new image file exists, it's filepath is returned
  @internal

function fixed_lgd($string,$chars,$preStr='...')

Truncate string
Returns a new string of max. $chars length.
If the string is longer, it will be truncated and appended with '...'.

Usage: 119

$string string $string string to truncate
$chars integer $chars must be an integer of at least 4
$preStr='...' string String to append to the the output if it is truncated, default is '...'
Returns: string new string
  @see fixed_lgd_pre()

function fixed_lgd_pre($string,$chars)

Truncate string
Returns a new string of max. $chars length.
If the string is longer, it will be truncated and prepended with '...'.
This works like fixed_lgd, but is truncated in the start of the string instead of the end

Usage: 19

$string string $string string to truncate
$chars integer $chars must be an integer of at least 4
Returns: string new string
  @see fixed_lgd()

function breakTextForEmail($str,$implChar="\n",$charWidth=76)

Breaks up the text for emails

Usage: 1

$str string The string to break up
$implChar="\n" string The string to implode the broken lines with (default/typically \n)
$charWidth=76 integer The line length
Returns: string

function breakLinesForEmail($str,$implChar="\n",$charWidth=76)

Breaks up a single line of text for emails

Usage: 3

$str string The string to break up
$implChar="\n" string The string to implode the broken lines with (default/typically \n)
$charWidth=76 integer The line length
Returns: string
  @see breakTextForEmail()

function cmpIP($baseIP, $list)

Match IP number with list of numbers with wildcard

Usage: 8

$baseIP string $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR
$list string $list is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192.168.*.* equals 192.168)
Returns: boolean True if an IP-mask from $list matches $baseIP

function inList($in_list,$item)

Check for item in list

Check if an item exists in a comma-separated list of items.

Usage: 166

$in_list string $in_list comma-separated list of items (string)
$item string $item item to check for
Returns: boolean true if $item is in $in_list

function rmFromList($element,$list)

Removes an item from a comma-separated list of items.

Usage: 1

$element string $element element to remove
$list string $list comma-separated list of items (string)
Returns: string new comma-separated list of items

function intInRange($theInt,$min,$max=2000000000,$zeroValue=0)

Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is 'false' then the $zeroValue is applied.

Usage: 226

$theInt integer Input value
$min integer Lower limit
$max=2000000000 integer Higher limit
$zeroValue=0 integer Default value if input is false.
Returns: integer The input value forced into the boundaries of $min and $max

function intval_positive($theInt)

Returns the $integer if greater than zero, otherwise returns zero.

Usage: 1

$theInt integer Integer string to process
Returns: integer

function int_from_ver($verNumberStr)

Returns an integer from a three part version number, eg '4.12.3' -> 4012003

Usage: 2

$verNumberStr string Version number on format x.x.x
Returns: integer Integer version of version number (where each part can count to 999)

function md5int($str)

Makes a positive integer hash out of the first 7 chars from the md5 hash of the input

Usage: 0

$str string String to md5-hash
Returns: integer Returns 28bit integer-hash

function uniqueList($in_list)

Takes a comma-separated list and removes all duplicates

Usage: 16

$in_list string $in_list is a comma-separated list of values.
Returns: string Returns the list without any duplicates of values, space around values are trimmed

function split_fileref($fileref)

Splits a reference to a file in 5 parts

Usage: 43

$fileref string Filename/filepath to be analysed
Returns: array Contains keys [path], [file], [filebody], [fileext], [realFileext]

function dirname($path)

Returns the directory part of a path without trailing slash
If there is no dir-part, then an empty string is returned.
Behaviour:

'/dir1/dir2/script.php' => '/dir1/dir2'
'/dir1/' => '/dir1'
'dir1/script.php' => 'dir1'
'd/script.php' => 'd'
'/script.php' => ''
'' => ''
Usage: 5

$path string Directory name / path
Returns: string Processed input value. See function description.

function modifyHTMLColor($color,$R,$G,$B)

Modifies a HTML Hex color by adding/subtracting $R,$G and $B integers

Usage: 37

$color string A hexadecimal color code, #xxxxxx
$R integer Offset value 0-255
$G integer Offset value 0-255
$B integer Offset value 0-255
Returns: string A hexadecimal color code, #xxxxxx, modified according to input vars
  @see modifyHTMLColorAll()

function modifyHTMLColorAll($color,$all)

Modifies a HTML Hex color by adding/subtracting $all integer from all R/G/B channels

Usage: 4

$color string A hexadecimal color code, #xxxxxx
$all integer Offset value 0-255 for all three channels.
Returns: string A hexadecimal color code, #xxxxxx, modified according to input vars
  @see modifyHTMLColor()

function rm_endcomma($string)

Removes comma (if present) in the end of string

Usage: 4

$string string String from which the comma in the end (if any) will be removed.
Returns: string

function danish_strtoupper($string)

strtoupper which converts danish (and other characters) characters as well
(Depreciated, use PHP function with locale settings instead or for HTML output, wrap your content in <span class="uppercase">...</span>)
Usage: 4

$string string String to process
Returns: string

function convUmlauts($str)

Change umlaut characters to plain ASCII with normally two character target
Only known characters will be converted, so don't expect a result for any character.
Works only for western europe single-byte charsets!

ä => ae, Ö => Oe

$str string String to convert.
Returns: string

function shortMD5($input, $len=10)

Returns the first 10 positions of the MD5-hash (changed from 6 to 10 recently)

Usage: 43

$input string Input string to be md5-hashed
$len=10 integer The string-length of the output
Returns: string Substring of the resulting md5-hash, being $len chars long (from beginning)

function testInt($var)

Tests if the input is an integer.

Usage: 74

$var mixed Any input variable to test.
Returns: boolean Returns true if string is an integer

function isFirstPartOfStr($str,$partStr)

Returns true if the first part of $str matches the string $partStr

Usage: 58

$str string Full string to check
$partStr string Reference string which must be found as the "first part" of the full string
Returns: boolean True if $partStr was found to be equal to the first part of $str

function formatSize($sizeInBytes,$labels='')

Formats the input integer $sizeInBytes as bytes/kilobytes/megabytes (-/K/M)

Usage: 54

$sizeInBytes integer Number of bytes to format.
$labels='' string Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
Returns: string Formatted representation of the byte number, for output.

function convertMicrotime($microtime)

Returns microtime input to milliseconds

Usage: 2

$microtime string Microtime
Returns: integer Microtime input string converted to an integer (milliseconds)

function splitCalc($string,$operators)

This splits a string by the chars in $operators (typical /+-*) and returns an array with them in
Usage: 2

$string string Input string, eg "123 + 456 / 789 - 4"
$operators string Operators to split by, typically "/+-*"
Returns: array Array with operators and operands separated.
  @see tslib_cObj::calc(), tslib_gifBuilder::calcOffset()

function calcPriority($string)

Calculates the input by +,-,*,/,%,^ with priority to + and -
Usage: 1

$string string Input string, eg "123 + 456 / 789 - 4"
Returns: integer Calculated value. Or error string.
  @see calcParenthesis()

function calcParenthesis($string)

Calculates the input with parenthesis levels
Usage: 2

$string string Input string, eg "(123 + 456) / 789 - 4"
Returns: integer Calculated value. Or error string.
  @see calcPriority(), tslib_cObj::stdWrap()

function htmlspecialchars_decode($value)

Inverse version of htmlspecialchars()

Usage: 2

$value string Value where &gt;, &lt;, &quot; and &amp; should be converted to regular chars.
Returns: string Converted result.

function deHSCentities($str)

Re-converts HTML entities if they have been converted by htmlspecialchars()

$str string String which contains eg. "&amp;amp;" which should stay "&amp;". Or "&amp;#1234;" to "&#1234;". Or "&amp;#x1b;" to "&#x1b;"
Returns: string Converted result.

function slashJS($string,$extended=0,$char="'")

This function is used to escape any ' -characters when transferring text to JavaScript!
Usage: 6

$string string String to escape
$extended=0 boolean If set, also backslashes are escaped.
$char="'" string The character to escape, default is ' (single-quote)
Returns: string Processed input string

function rawUrlEncodeJS($str)

Version of rawurlencode() where all spaces (%20) are re-converted to space-characters.
Usefull when passing text to JavaScript where you simply url-encode it to get around problems with syntax-errors, linebreaks etc.

Usage: 8

$str string String to raw-url-encode with spaces preserved
Returns: string Rawurlencoded result of input string, but with all %20 (space chars) converted to real spaces.

function rawUrlEncodeFP($str)

rawurlencode which preserves "/" chars
Usefull when filepaths should keep the "/" chars, but have all other special chars encoded.

$str string Input string
Returns: string Output string

function validEmail($email)

Checking syntax of input email address

Usage: 4

$email string Input string to evaluate
Returns: boolean Returns true if the $email address (input string) is valid; Has a "@", domain name with at least one period and only allowed a-z characters.

function formatForTextarea($content)

Formats a string for output between <textarea>-tags
All content outputted in a textarea form should be passed through this function
Not only is the content htmlspecialchar'ed on output but there is also a single newline added in the top. The newline is necessary because browsers will ignore the first newline after <textarea> if that is the first character. Therefore better set it!

Usage: 30

$content string Input string to be formatted.
Returns: string Formatted for <textarea>-tags

function inArray($in_array,$item)

Check if an item exists in an array
Please note that the order of parameters is reverse compared to the php4-function in_array()!!!

Usage: 3

$in_array array $in_array one-dimensional array of items
$item string $item item to check for
Returns: boolean true if $item is in the one-dimensional array $in_array
  @internal

function intExplode($delim, $string)

Explodes a $string delimited by $delim and passes each item in the array through intval().
Corresponds to explode(), but with conversion to integers for all values.

Usage: 86

$delim string Delimiter string to explode with
$string string The string to explode
Returns: array Exploded values, all converted to integers

function revExplode($delim, $string, $count=0)

Reverse explode which explodes the string counting from behind.
Thus t3lib_div::revExplode(':','my:words:here',2) will return array('my:words','here')

Usage: 6

$delim string Delimiter string to explode with
$string string The string to explode
$count=0 integer Number of array entries
Returns: array Exploded values

function trimExplode($delim, $string, $onlyNonEmptyValues=0)

Explodes a string and trims all values for whitespace in the ends.
If $onlyNonEmptyValues is set, then all blank ('') values are removed.

Usage: 239

$delim string Delimiter string to explode with
$string string The string to explode
$onlyNonEmptyValues=0 boolean If set, all empty values (='') will NOT be set in output
Returns: array Exploded values

function uniqueArray($valueArray)

Takes a one-dimensional array and returns an array where the values are unique
The keys in the array are substituted with some md5-hashes
If the value is trim(empty), the value is ignored.
Values are trimmed
(Depreciated, use PHP function array_unique instead)
Usage: 2

$valueArray array Array of values to make unique
Returns: array
  @depreciated

function removeArrayEntryByValue($array,$cmpValue)

Removes the value $cmpValue from the $array if found there. Returns the modified array

Usage: 2

$array array Array containing the values
$cmpValue string Value to search for and if found remove array entry where found.
Returns: array Output array with entries removed if search string is found

function implodeArrayForUrl($name,$theArray,$str='',$skipBlank=0,$rawurlencodeParamName=0)

Implodes a multidim-array into GET-parameters (eg. &param[key][key2]=value2&param[key][key3]=value3)

Usage: 24

$name string Name prefix for entries. Set to blank if you wish none.
$theArray array The (multidim) array to implode
$str='' boolean If set, all values that are blank (='') will NOT be imploded
$skipBlank=0 boolean If set, parameters which were blank strings would be removed.
$rawurlencodeParamName=0 boolean If set, the param name itselt (for example "param[key][key2]") would be rawurlencoded as well.
Returns: string Imploded result, fx. &param[key][key2]=value2&param[key][key3]=value3

function compileSelectedGetVarsFromArray($varList,$getArray,$GPvarAlt=1)

Returns an array with selected keys from incoming data.
(Better read source code if you want to find out...)
Usage: 3

$varList string List of variable/key names
$getArray array Array from where to get values based on the keys in $varList
$GPvarAlt=1 boolean If set, then t3lib_div::_GP() is used to fetch the value if not found (isset) in the $getArray
Returns: array Output array with selected variables.

function addSlashesOnArray(&$theArray)

AddSlash array
This function traverses a multidimentional array and adds slashes to the values.
NOTE that the input array is and argument by reference.!!
Twin-function to stripSlashesOnArray

Usage: 6

&$theArray array Multidimensional input array, (REFERENCE!)
Returns: array

function stripSlashesOnArray(&$theArray)

StripSlash array
This function traverses a multidimentional array and strips slashes to the values.
NOTE that the input array is and argument by reference.!!
Twin-function to addSlashesOnArray

Usage: 7

&$theArray array Multidimensional input array, (REFERENCE!)
Returns: array

function slashArray($arr,$cmd)

Either slashes ($cmd=add) or strips ($cmd=strip) array $arr depending on $cmd

Usage: 6

$arr array Multidimensional input array
$cmd string "add" or "strip", depending on usage you wish.
Returns: array

function array_merge_recursive_overrule ($arr0,$arr1,$notAddKeys=0)

Merges two arrays recursively, overruling similar the values in the first array ($arr0) with the values of the second array ($arr1)
In case of identical keys, ie. keeping the values of the second.

Usage: 26

$arr0 array First array
$arr1 array Second array, overruling the first array
$notAddKeys=0 boolean If set, keys that are NOT found in $arr0 (first array) will not be set. Thus only existing value can/will be overruled from second array.
Returns: array Resulting array where $arr1 values has overruled $arr0 values

function array_merge($arr1,$arr2)

An array_merge function where the keys are NOT renumbered as they happen to be with the real php-array_merge function

Usage: 27

$arr1 array First array
$arr2 array Second array
Returns: array Merged result.

function csvValues($row,$delim=',',$quote='"')

Takes a row and returns a CSV string of the values with $delim (default is ,) and $quote (default is ") as separator chars.

Usage: 5

$row array Input array of values
$delim=',' string Delimited, default is comman
$quote='"' string Quote-character to wrap around the values.
Returns: string A single line of CSV

function get_tag_attributes($tag)

$tag is either a whole tag (eg '<TAG OPTION ATTRIB=VALUE>') or the parameterlist (ex ' OPTION ATTRIB=VALUE>')
Returns an array with all attributes as keys. Attributes are only lowercase a-z
If a attribute is empty (I call it 'an option'), then the value for the key is empty. You can check if it existed with isset()

Usage: 9

$tag string HTML-tag string (or attributes only)
Returns: array Array with the attribute values.

function split_tag_attributes($tag)

Returns an array with the 'components' from an attribute list from an HTML tag. The result is normally analyzed by get_tag_attributes
Removes tag-name if found

Usage: 1

$tag string HTML-tag string (or attributes only)
Returns: array Array with the attribute values.
  @internal

function implodeParams($arr,$xhtmlSafe=FALSE,$dontOmitBlankAttribs=FALSE)

Implodes attributes in the array $arr for an attribute list in eg. and HTML tag (with quotes)

Usage: 10

$arr array Array with attribute key/value pairs, eg. "bgcolor"=>"red", "border"=>0
$xhtmlSafe=FALSE boolean If set the resulting attribute list will have a) all attributes in lowercase (and duplicates weeded out, first entry taking precedence) and b) all values htmlspecialchar()'ed. It is recommended to use this switch!
$dontOmitBlankAttribs=FALSE boolean If true, don't check if values are blank. Default is to omit attributes with blank values.
Returns: string Imploded attributes, eg. 'bgcolor="red" border="0"'

function wrapJS($string, $linebreak=TRUE)

Wraps JavaScript code XHTML ready with <script>-tags
Automatic re-identing of the JS code is done by using the first line as ident reference.
This is nice for identing JS code with PHP code on the same level.

$string string JavaScript code
$linebreak=TRUE boolean Wrap script element in linebreaks? Default is TRUE.
Returns: string The wrapped JS code, ready to put into a XHTML page
  @author Ingmar Schlecht <ingmars@web.de>
  @author René Fritz <r.fritz@colorcube.de>

function xml2tree($string,$depth=999)

Parses XML input into a PHP array with associative keys

$string string XML data input
$depth=999 integer Number of element levels to resolve the XML into an array. Any further structure will be set as XML.
Returns: mixed The array with the parsed structure unless the XML parser returns with an error in which case the error message string is returned.
  @author bisqwit at iki dot fi dot not dot for dot ads dot invalid / http://dk.php.net/xml_parse_into_struct + kasper@typo3.com

function array2xml($array,$NSprefix='',$level=0,$docTag='phparray',$spaceInd=0, $options=array(),$parentTagName='')

Converts a PHP array into an XML string.
The XML output is optimized for readability since associative keys are used as tagnames.
This also means that only alphanumeric characters are allowed in the tag names AND only keys NOT starting with numbers (so watch your usage of keys!). However there are options you can set to avoid this problem.
Numeric keys are stored with the default tagname "numIndex" but can be overridden to other formats)
The function handles input values from the PHP array in a binary-safe way; All characters below 32 (except 9,10,13) will trigger the content to be converted to a base64-string
The PHP variable type of the data is IS preserved as long as the types are strings, arrays, integers and booleans. Strings are the default type unless the "type" attribute is set.
The output XML has been tested with the PHP XML-parser and parses OK under all tested circumstances.
However using MSIE to read the XML output didn't always go well: One reason could be that the character encoding is not observed in the PHP data. The other reason may be if the tag-names are invalid in the eyes of MSIE. Also using the namespace feature will make MSIE break parsing. There might be more reasons...

$array array The input PHP array with any kind of data; text, binary, integers. Not objects though.
$NSprefix='' string tag-prefix, eg. a namespace prefix like "T3:"
$level=0 integer Current recursion level. Don't change, stay at zero!
$docTag='phparray' string Alternative document tag. Default is "phparray".
$spaceInd=0 integer If set, the number of spaces corresponding to this number is used for indenting, otherwise a single chr(9) (TAB) is used
$options=array() array Options for the compilation. Key "useNindex" => 0/1 (boolean: whether to use "n0, n1, n2" for num. indexes); Key "useIndexTagForNum" => "[tag for numerical indexes]"; Key "useIndexTagForAssoc" => "[tag for associative indexes"; Key "parentTagMap" => array('parentTag' => 'thisLevelTag')
$parentTagName='' string Parent tag name. Don't touch.
Returns: string An XML string made from the input content in the array.
  @see xml2array()

function xml2array($string,$NSprefix='')

Converts an XML string to a PHP array.
This is the reverse function of array2xml()

$string string XML content to convert into an array
$NSprefix='' string The tag-prefix resolve, eg. a namespace like "T3:"
Returns: mixed If the parsing had errors, a string with the error message is returned. Otherwise an array with the content.
  @see array2xml()

function xmlRecompileFromStructValArray($vals)

This implodes an array of XML parts (made with xml_parse_into_struct()) into XML again.

$vals array A array of XML parts, see xml2tree
Returns: string Re-compiled XML data.

function xmlGetHeaderAttribs($xmlData)

Extract the encoding scheme as found in the first line of an XML document (typically)

$xmlData string XML data
Returns: string Encoding scheme (lowercase), if found.

function getURL($url)

Reads the file or url $url and returns the content
If you are having trouble with proxys when reading URLs you can configure your way out of that with settings like $TYPO3_CONF_VARS['SYS']['curlUse'] etc.

Usage: 79

$url string Filepath/URL to read
Returns: string The content from the resource given as input.

function writeFile($file,$content)

Writes $content to the file $file

Usage: 31

$file string Filepath to write to
$content string Content to write
Returns: boolean True if the file was successfully opened and written to.

function get_dirs($path)

Returns an array with the names of folders in a specific path
Will return 'error' (string) if there were an error with reading directory content.

Usage: 13

$path string Path to list directories from
Returns: array Returns an array with the directory entries as values. If no path, the return value is nothing.

function getFilesInDir($path,$extensionList='',$prependPath=0,$order='')

Returns an array with the names of files in a specific path

Usage: 17

$path string $path: Is the path to the file
$extensionList='' string $extensionList is the comma list of extensions to read only (blank = all)
$prependPath=0 boolean If set, then the path is prepended the filenames. Otherwise only the filenames are returned in the array
$order='' string $order is sorting: 1= sort alphabetically, 'mtime' = sort by modification time.
Returns: array Array of the files found

function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99)

Recursively gather all files and folders of a path.

$fileArr array $fileArr: Empty input array (will have files added to it)
$path string $path: The path to read recursively from (absolute)
$extList='' string $extList: Comma list of file extensions: Only files with extensions in this list (if applicable) will be selected.
$regDirs=0 boolean $regDirs: If set, directories are also included in output.
$recursivityLevels=99 integer $recursivityLevels: The number of levels to dig down...
Returns: array An array with the found files/directories.

function removePrefixPathFromList($fileArr,$prefixToRemove)

Removes the absolute part of all files/folders in fileArr

$fileArr array $fileArr: The file array to remove the prefix from
$prefixToRemove string $prefixToRemove: The prefix path to remove (if found as first part of string!)
Returns: array The input $fileArr processed.

function fixWindowsFilePath($theFile)

Fixes a path for windows-backslashes and reduces double-slashes to single slashes

Usage: 2

$theFile string File path to process
Returns: string

function resolveBackPath($pathStr)

Resolves "../" sections in the input path string

$pathStr string File path in which "/../" is resolved
Returns: string

function locationHeaderUrl($path)

Prefixes a URL used with 'header-location' with 'http://...' depending on whether it has it already.
- If already having a scheme, nothing is prepended
- If having REQUEST_URI slash '/', then prefixing 'http://[host]' (relative to host)
- Otherwise prefixed with TYPO3_REQUEST_DIR (relative to current dir / TYPO3_REQUEST_DIR)

Usage: 31

$path string URL / path to prepend full URL addressing to.
Returns: string

function debug_ordvalue($string,$characters=100)

Returns a string with a list of ascii-values for the first $characters characters in $string
Usage: 5

$string string String to show ASCII value for
$characters=100 integer Number of characters to show
Returns: string The string with ASCII values in separated by a space char.
  @internal

function view_array($array_in)

Returns HTML-code, which is a visual representation of a multidimensional array
use t3lib_div::print_array() in order to print an array
Returns false if $array_in is not an array
Usage: 27

$array_in array Array to view
Returns: string HTML output

function print_array($array_in)

Prints an array
Usage: 28

$array_in array Array to print visually (in a table).
Returns: void
  @internal
  @see view_array()

function debug($var="",$brOrHeader=0)

Makes debug output
Prints $var in bold between two vertical lines
If not $var the word 'debug' is printed
If $var is an array, the array is printed by t3lib_div::print_array()

Usage: 8

$var="" mixed Variable to print
$brOrHeader=0 mixed If the parameter is a string it will be used as header. Otherwise number of break tags to apply after (positive integer) or before (negative integer) the output.
Returns: void

function getThisUrl()

Returns the HOST+DIR-PATH of the current script (The URL, but without 'http://' and without script-filename)
Usage: 1

Returns: string

function linkThisScript($getParams=array())

Returns the link-url to the current script.
In $getParams you can set associative keys corresponding to the get-vars you wish to add to the url. If you set them empty, they will remove existing get-vars from the current url.
REMEMBER to always htmlspecialchar() content in href-properties to ampersands get converted to entities (XHTML requirement and XSS precaution)

Usage: 54

$getParams=array() array Array of GET parameters to include
Returns: string

function linkThisUrl($url,$getParams=array())

Takes a full URL, $url, possibly with a querystring and overlays the $getParams arrays values onto the quirystring, packs it all together and returns the URL again.
So basically it adds the parameters in $getParams to an existing URL, $url
Usage: 2

$url string URL string
$getParams=array() array Array of key/value pairs for get parameters to add/overrule with. Can be multidimensional.
Returns: string Output URL with added getParams.

function getIndpEnv($getEnvName)

Abstraction method which returns System Environment Variables regardless of server OS, CGI/MODULE version etc. Basically this is SERVER variables for most of them.
This should be used instead of getEnv() and HTTP_SERVER_VARS/ENV_VARS to get reliable values for all situations.

Usage: 226

$getEnvName string Name of the "environment variable"/"server variable" you wish to use. Valid values are SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI, PATH_INFO, REMOTE_ADDR, REMOTE_HOST, HTTP_REFERER, HTTP_HOST, HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, QUERY_STRING, TYPO3_DOCUMENT_ROOT, TYPO3_HOST_ONLY, TYPO3_HOST_ONLY, TYPO3_REQUEST_HOST, TYPO3_REQUEST_URL, TYPO3_REQUEST_SCRIPT, TYPO3_REQUEST_DIR, TYPO3_SITE_URL, _ARRAY
Returns: string Value based on the input key, independent of server/os environment.

function milliseconds()

milliseconds

microtime recalculated to t3lib_div::milliseconds(1/1000 sec)

Usage: 39

Returns: integer

function clientInfo($useragent='')

Client Browser Information

Usage: 4

$useragent='' string Alternative User Agent string (if empty, t3lib_div::getIndpEnv('HTTP_USER_AGENT') is used)
Returns: array Parsed information about the HTTP_USER_AGENT in categories BROWSER, VERSION, SYSTEM and FORMSTYLE

function getFileAbsFileName($filename,$onlyRelative=1,$relToTYPO3_mainDir=0)

Returns the absolute filename of $filename.
Decodes the prefix EXT: for TYPO3 Extensions.

Usage: 9

$filename string The input filename/filepath to evaluate
$onlyRelative=1 boolean If $onlyRelative is set (which it is by default), then only return values relative to the current PATH_site is accepted.
$relToTYPO3_mainDir=0 boolean If $relToTYPO3_mainDir is set, then relative paths are relative to PATH_typo3 constant - otherwise (default) they are relative to PATH_site
Returns: string Returns the absolute filename of $filename IF valid, otherwise blank string.

function validPathStr($theFile)

Returns true if no '//', '..' or '\' is in the $theFile
This should make sure that the path is not pointing 'backwards' and further doesn't contain double/back slashes.
So it's compatible with the UNIX style path strings valid for TYPO3 internally.

Usage: 8

$theFile string Filepath to evaluate
Returns: boolean True, if no '//', '..' or '\' is in the $theFile
  @todo Possible improvement: Should it rawurldecode the string first to check if any of these characters is encoded ?

function isAbsPath($path)

Checks if the $path is absolute or relative (detecting either '/' or 'x:/' as first part of string) and returns true if so.

Usage: 9

$path string Filepath to evaluate
Returns: boolean

function isAllowedAbsPath($path)

Returns true if the path is absolute, without backpath '..' and within the PATH_site OR within the lockRootPath

Usage: 1

$path string Filepath to evaluate
Returns: boolean

function verifyFilenameAgainstDenyPattern($filename)

Verifies the input filename againts the 'fileDenyPattern'. Returns true if OK.

Usage: 2

$filename string Filepath to evaluate
Returns: boolean

function upload_copy_move($source,$destination)

Moves $source file to $destination if uploaded, otherwise try to make a copy
Usage: 3

$source string Source file, absolute path
$destination string Destination file, absolute path
Returns: boolean Returns true if the file was moved.
  @coauthor Dennis Petersen <fessor@software.dk>
  @see upload_to_tempfile()

function upload_to_tempfile($uploadedFileName)

Will move an uploaded file (normally in "/tmp/xxxxx") to a temporary filename in PATH_site."typo3temp/" from where TYPO3 can use it under safe_mode.
Use this function to move uploaded files to where you can work on them.
REMEMBER to use t3lib_div::unlink_tempfile() afterwards - otherwise temp-files will build up! They are NOT automatically deleted in PATH_site."typo3temp/"!

$uploadedFileName string The temporary uploaded filename, eg. $GLOBALS['HTTP_POST_FILES']['[upload field name here]']['tmp_name']
Returns: string If a new file was successfully created, return its filename, otherwise blank string.
  @see unlink_tempfile(), upload_copy_move()

function unlink_tempfile($uploadedTempFileName)

Deletes (unlink) a temporary filename in 'PATH_site."typo3temp/"' given as input.
The function will check that the file exists, is in PATH_site."typo3temp/" and does not contain back-spaces ("../") so it should be pretty safe.
Use this after upload_to_tempfile() or tempnam() from this class!

$uploadedTempFileName string Filepath for a file in PATH_site."typo3temp/". Must be absolute.
Returns: boolean Returns true if the file was unlink()'ed
  @see upload_to_tempfile(), tempnam()

function tempnam($filePrefix)

Create temporary filename (Create file with unique file name)
This function should be used for getting temporary filenames - will make your applications safe for open_basedir = on
REMEMBER to delete the temporary files after use! This is done by t3lib_div::unlink_tempfile()

$filePrefix string Prefix to temp file (which will have no extension btw)
Returns: string result from PHP function tempnam() with PATH_site.'typo3temp/' set for temp path.
  @see unlink_tempfile()

function stdAuthCode($uid_or_record,$fields='')

standard authentication code - can't remember what it's used for.
Usage: 2

$uid_or_record mixed Uid (integer) or record (array)
$fields='' string List of fields from the record if that is given.
Returns: string MD5 hash of 8 chars.
  @internal

function loadTCA($table)

Loads the $TCA (Table Configuration Array) for the $table

Requirements:
1) must be configured table (the ctrl-section configured),
2) columns must not be an array (which it is always if whole table loaded), and
3) there is a value for dynamicConfigFile (filename in typo3conf)
Usage: 92

$table string Table name for which to load the full TCA array part into the global $TCA
Returns: void

function resolveSheetDefInDS($dataStructArray,$sheet='sDEF')

Looks for a sheet-definition in the input data structure array. If found it will return the data structure for the sheet given as $sheet (if found).
If the sheet definition is in an external file that file is parsed and the data structure inside of that is returned.

$dataStructArray array Input data structure, possibly with a sheet-definition and references to external data source files.
$sheet='sDEF' string The sheet to return, preferably.
Returns: array An array with two num. keys: key0: The data structure is returned in this key (array) UNLESS an error happend in which case an error string is returned (string). key1: The used sheet key value!

function resolveAllSheetsInDS($dataStructArray)

Resolves ALL sheet definitions in dataStructArray
If no sheet is found, then the default "sDEF" will be created with the dataStructure inside.

$dataStructArray array Input data structure, possibly with a sheet-definition and references to external data source files.
Returns: array Output data structure with all sheets resolved as arrays.

function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)

Calls a userdefined function/method in class
Such a function/method should look like this: "function proc(&$params, &$ref) {...}"

Usage: 3

$funcName string Method reference, [class]->[method] or [function]. You can prefix this reference with "[file-reference]:" and t3lib_div::getFileAbsFileName() will then be used to resolve the filename and subsequently include it by "require_once()" which means you don't have to worry about including the class file either! Example: "EXT:realurl/class.tx_realurl.php:tx_realurl->>encodeSpURL". Finally; for method references the normal operator "->" creates a new instance each time; if you use "->>" instead you will reuse the previous instance of the object identified by the full reference string (meaning; if you call another method in the same class another object is created for that).
&$params mixed Parameters to be pass along (typically an array) (REFERENCE!)
&$ref mixed Reference to be passed along (typically "$this" - being a reference to the calling object) (REFERENCE!)
$checkPrefix='user_' string Required prefix of class or function name
$silent=0 boolean If set, not debug() error message is shown if class/function is not present.
Returns: mixed Content from method/function call

function makeInstanceService($serviceType, $serviceSubType='', $excludeServiceKeys='')

Find the best service and check if it works.
Returns object of the service class.

$serviceType string Type of service (service key).
$serviceSubType='' string Sub type like file extensions or similar. Defined by the service.
$excludeServiceKeys='' string List of service keys which should be exluded in the search for a service.
Returns: object The service object or an array with error info's.
  @author René Fritz <r.fritz@colorcube.de>

function makeInstanceClassName($className)

Return classname for new instance
Takes the class-extensions API of TYPO3 into account

Usage: 18

$className string Base Class name to evaluate
Returns: string Final class name to instantiate with "new [classname]"

function plainMailEncoded($email,$subject,$message,$headers='',$enc='',$charset='ISO-8859-1',$dontEncodeSubject=0)

Simple substitute for the PHP function mail().
The fifth parameter, $enc, will allow you to specify 'base64' encryption for the output (set $enc=base64)
Further the output has the charset set to ISO-8859-1 by default.

Usage: 4

$email string Email address to send to. (see PHP function mail())
$subject string Subject line, non-encoded. (see PHP function mail())
$message string Message content, non-encoded. (see PHP function mail())
$headers='' string Headers, separated by chr(10)
$enc='' string Encoding type: "base64", "quoted-printable", "8bit". If blank, no encoding will be used, no encoding headers set.
$charset='ISO-8859-1' string Charset used in encoding-headers (only if $enc is set to a valid value which produces such a header)
$dontEncodeSubject=0 boolean If set, the content of $subject will not be encoded.
Returns: void

function quoted_printable($string,$maxlen=76)

Implementation of quoted-printable encode.
This functions is buggy. It seems that in the part where the lines are breaked every 76th character, that it fails if the break happens right in a quoted_printable encode character!
(Originally taken from class.t3lib_htmlmail.php - which may be updated if this function should ever be improved!
See RFC 1521, section 5.1 Quoted-Printable Content-Transfer-Encoding

Usage: 2

$string string Content to encode
$maxlen=76 integer Length of the lines, default is 76
Returns: string The QP encoded string

function substUrlsInPlainText($message,$urlmode='76',$index_script_url='')

Takes a clear-text message body for a plain text email, finds all 'http://' links and if they are longer than 76 chars they are converted to a shorter URL with a hash parameter. The real parameter is stored in the database and the hash-parameter/URL will be redirected to the real parameter when the link is clicked.
This function is about preserving long links in messages.

Usage: 3

$message string Message content
$urlmode='76' string URL mode; "76" or "all"
$index_script_url='' string URL of index script (see makeRedirectUrl())
Returns: string Processed message content
  @see makeRedirectUrl()

function makeRedirectUrl($inUrl,$l=0,$index_script_url='')

Subfunction for substUrlsInPlainText() above.

Usage: 2

$inUrl string Input URL
$l=0 integer URL string length limit
$index_script_url='' string URL of "index script" - the prefix of the "?RDCT=..." parameter. If not supplyed it will default to t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR')
Returns: string Processed URL
  @internal

function freetypeDpiComp($font_size)

Function to compensate for FreeType2 96 dpi

Usage: 16

$font_size integer Fontsize for freetype function call
Returns: integer Compensated fontsize based on $GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']

function devLog($msg, $extKey, $severity=0, $dataVar=FALSE)

Developer log; This should be implemented around the source code, both frontend and backend, logging everything from the flow through an application, messages, results from comparisons to fatal errors.
The result is meant to make sense to developers during development or debugging of a site.
The idea is that this function is only a wrapper for external extensions which can set a hook which will be allowed to handle the logging of the information to any format they might wish and with any kind of filter they would like.
If you want to implement the devLog in your applications, simply add lines like:
if (TYPO3_DLOG) t3lib_div::devLog('[write message in english here]', 'extension key');

$msg string Message (in english).
$extKey string Extension key (from which extension you are calling the log)
$severity=0 integer Severity: 0 is info, 1 is notice, 2 is warning, 3 is fatal error, -1 is "OK" message
$dataVar=FALSE array Additional data you want to pass to the logger.
Returns: void

class.t3lib_extmgm.php

Extension Management functions

This class is never instantiated, rather the methods inside is called as functions like
t3lib_extMgm::isLoaded('my_extension');

Filesize: 38 K
Func/Classes: 32
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_extMgm

Extension Management functions

This class is never instantiated, rather the methods inside is called as functions like
t3lib_extMgm::isLoaded('my_extension');

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function isLoaded($key,$exitOnError=0)

Returns true if the extension with extension key $key is loaded.

$key string Extension key to test
$exitOnError=0 boolean If $exitOnError is true and the extension is not loaded the function will die with an error message
Returns: boolean

function extPath($key,$script='')

Returns the absolute path to the extension with extension key $key
If the extension is not loaded the function will die with an error message
Useful for internal fileoperations

$key string Extension key
$script='' string $script is appended to the output if set.
Returns: string

function extRelPath($key)

Returns the relative path to the extension as measured from from the TYPO3_mainDir
If the extension is not loaded the function will die with an error message
Useful for images and links from backend

$key string Extension key
Returns: string

function siteRelPath($key)

Returns the relative path to the extension as measured from the PATH_site (frontend)
If the extension is not loaded the function will die with an error message
Useful for images and links from the frontend

$key string Extension key
Returns: string

function getCN($key)

Returns the correct class name prefix for the extension key $key

$key string Extension key
Returns: string
  @internal

function addTCAcolumns($table,$columnArray,$addTofeInterface=0)

Adding fields to an existing table definition in $TCA
Adds an array with $TCA column-configuration to the $TCA-entry for that table.
This function adds the configuration needed for rendering of the field in TCEFORMS - but it does NOT add the field names to the types lists!
So to have the fields displayed you must also call fx. addToAllTCAtypes or manually add the fields to the types list.
FOR USE IN ext_tables.php FILES

$table string $table is the table name of a table already present in $TCA with a columns section
$columnArray array $columnArray is the array with the additional columns (typical some fields an extension wants to add)
$addTofeInterface=0 boolean If $addTofeInterface is true the list of fields are also added to the fe_admin_fieldList.
Returns: void

function addToAllTCAtypes($table,$str,$specificTypesList='',$beforeList='')

Makes fields visible on the form, adding them to the end.

Adds a string $str (comma list of field names) to all ["types"][xxx]["showitem"] entries for table $table (unless limited by $specificTypesList)
This is needed to have new fields shown automatically in the TCEFORMS of a record from $table.
Typically this function is called after having added new columns (database fields) with the addTCAcolumns function
FOR USE IN ext_tables.php FILES

$table string Table name
$str string Field list to add.
$specificTypesList='' string List of specific types to add the field list to. (If empty, all type entries are affected)
$beforeList='' string Insert fields before one of this fields (commalist). Example: "keywords,--palette--;;4,description". Palettes must be passed like in the example no matter how the palette definition looks like in TCA.
Returns: void

function allowTableOnStandardPages($table)

Add tablename to default list of allowed tables on pages.
Will add the $table to the list of tables allowed by default on pages as setup by $PAGES_TYPES['default']['allowedTables']
FOR USE IN ext_tables.php FILES

$table string Table name
Returns: void

function addModule($main,$sub='',$position='',$path='')

Adds a module (main or sub) to the backend interface
FOR USE IN ext_tables.php FILES

$main string $main is the main module key, $sub is the submodule key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there.
$sub='' string $sub is the submodule key. If $sub is not set a blank $main module is created.
$position='' string $position can be used to set the position of the $sub module within the list of existing submodules for the main module. $position has this syntax: [cmd]:[submodule-key]. cmd can be "after", "before" or "top" (or blank which is default). If "after"/"before" then submodule will be inserted after/before the existing submodule with [submodule-key] if found. If not found, the bottom of list. If "top" the module is inserted in the top of the submodule list.
$path='' string $path is the absolute path to the module. If this value is defined the path is added as an entry in $TBE_MODULES['_PATHS'][ main_sub ]=$path; and thereby tells the backend where the newly added modules is found in the system.
Returns: void

function insertModuleFunction($modname,$className,$classPath,$title,$MM_key='function')

Adds a "Function menu module" ('third level module') to an existing function menu for some other backend module
The arguments values are generally determined by which function menu this is supposed to interact with
See Inside TYPO3 for information on how to use this function.
FOR USE IN ext_tables.php FILES

$modname string Module name
$className string Class name
$classPath string Class path
$title string Title of module
$MM_key='function' string Menu array key - default is "function"
Returns: void
  @see t3lib_SCbase::mergeExternalItems()

function addPageTSConfig($content)

Adds $content to the default Page TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultPageTSconfig']
Prefixed with a [GLOBAL] line
FOR USE IN ext_tables.php/ext_locallang.php FILES

$content string Page TSconfig content
Returns: void

function addUserTSConfig($content)

Adds $content to the default User TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultUserTSconfig']
Prefixed with a [GLOBAL] line
FOR USE IN ext_tables.php/ext_locallang.php FILES

$content string User TSconfig content
Returns: void

function addLLrefForTCAdescr($tca_descr_key,$file_ref)

Adds a reference to a locallang file with TCA_DESCR labels
FOR USE IN ext_tables.php FILES
eg. t3lib_extMgm::addLLrefForTCAdescr('pages','EXT:lang/locallang_csh_pages.php'); for the pages table or t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_layout','EXT:cms/locallang_csh_weblayout.php'); for the Web > Page module.

$tca_descr_key string Description key. Typically a database table (like "pages") but for applications can be other strings, but prefixed with "_MOD_")
$file_ref string File reference to locallang file, eg. "EXT:lang/locallang_csh_pages.php"
Returns: void

function addService($extKey, $serviceType, $serviceKey, $info)

Adds a service to the global services array

$extKey string Extension key
$serviceType string Service type
$serviceKey string Service key
$info array Service description array
Returns: void
  @author René Fritz <r.fritz@colorcube.de>

function findService($serviceType, $serviceSubType='', $excludeServiceKeys='')

Find the available service with highest priority

$serviceType string Service type
$serviceSubType='' string Service sub type
$excludeServiceKeys='' string Service key that should be excluded in the search for a service
Returns: mixed Service info array if a service was found, FLASE otherwise
  @author René Fritz <r.fritz@colorcube.de>

function deactivateService($serviceType, $serviceKey)

Deactivate a service

$serviceType string Service type
$serviceKey string Service key
Returns: void
  @author René Fritz <r.fritz@colorcube.de>

function addPlugin($itemArray,$type='list_type')

Adds an entry to the list of plugins in content elements of type "Insert plugin"

Takes the $itemArray (label,value[,icon]) and adds to the items-array of $TCA[tt_content] elements with CType "listtype" (or another field if $type points to another fieldname)
If the value (array pos. 1) is already found in that items-array, the entry is substituted, otherwise the input array is added to the bottom.
Use this function to add a frontend plugin to this list of plugin-types - or more generally use this function to add an entry to any selectorbox/radio-button set in the TCEFORMS
FOR USE IN ext_tables.php FILES

$itemArray array Item Array
$type='list_type' string Type (eg. "list_type") - basically a field from "tt_content" table
Returns: void

function addPiFlexFormValue($piKeyToMatch,$value)

Adds an entry to the "ds" array of the tt_content field "pi_flexform".
This is used by plugins to add a flexform XML reference / content for use when they are selected as plugin.

$piKeyToMatch string The same value as the key for the plugin
$value string Either a reference to a flex-form XML file (eg. "FILE:EXT:newloginbox/flexform_ds.xml") or the XML directly.
Returns: void
  @see addPlugin()

function addToInsertRecords($table,$content_table='tt_content',$content_field='records')

Adds the $table tablename to the list of tables allowed to be includes by content element type "Insert records"
By using $content_table and $content_field you can also use the function for other tables.
FOR USE IN ext_tables.php FILES

$table string Table name to allow for "insert record"
$content_table='tt_content' string Table name TO WHICH the $table name is applied. See $content_field as well.
$content_field='records' string Field name in the database $content_table in which $table is allowed to be added as a reference ("Insert Record")
Returns: void

function addPItoST43($key,$classFile='',$prefix='',$type='list_type',$cached=0)

Add PlugIn to Static Template #43

When adding a frontend plugin you will have to add both an entry to the TCA definition of tt_content table AND to the TypoScript template which must initiate the rendering.
Since the static template with uid 43 is the "content.default" and practically always used for rendering the content elements it's very useful to have this function automatically adding the necessary TypoScript for calling your plugin.
$type determines the type of frontend plugin:
"list_type" (default) - the good old "Insert plugin" entry
"menu_type" - a "Menu/Sitemap" entry
"splash_layout" - a "Textbox" entry
"CType" - a new content element type
"header_layout" - an additional header type (added to the selection of layout1-5)
"includeLib" - just includes the library for manual use somewhere in TypoScript.
(Remember that your $type definition should correspond to the column/items array in $TCA[tt_content] where you added the selector item for the element! See addPlugin() function)
FOR USE IN ext_locallang.php FILES

$key string $key is the extension key
$classFile='' string $classFile is the PHP-class filename relative to the extension root directory. If set to blank a default value is chosen according to convensions.
$prefix='' string $prefix is used as a - yes, suffix - of the class name (fx. "_pi1")
$type='list_type' string $type, see description above
$cached=0 boolean If $cached is set as USER content object (cObject) is created - otherwise a USER_INT object is created.
Returns: void

function addStaticFile($extKey,$path,$title)

Call this method to add an entry in the static template list found in sys_templates
"static template files" are the modern equalent (provided from extensions) to the traditional records in "static_templates"
FOR USE IN ext_locallang.php FILES

$extKey string $extKey is of course the extension key
$path string $path is the path where the template files (fixed names) include_static.txt (integer list of uids from the table "static_templates"), constants.txt, setup.txt and editorcfg.txt is found (relative to extPath, eg. 'static/')
$title string $title is the title in the selector box.
Returns: void
  @see addTypoScript()

function addTypoScriptSetup($content)

Adds $content to the default TypoScript setup code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_setup']
Prefixed with a [GLOBAL] line
FOR USE IN ext_locallang.php FILES

$content string TypoScript Setup string
Returns: void

function addTypoScriptConstants($content)

Adds $content to the default TypoScript constants code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_constants']
Prefixed with a [GLOBAL] line
FOR USE IN ext_locallang.php FILES

$content string TypoScript Constants string
Returns: void

function addTypoScript($key,$type,$content,$afterStaticUid=0)

Adds $content to the default TypoScript code for either setup, constants or editorcfg as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_*']
(Basically this function can do the same as addTypoScriptSetup and addTypoScriptConstants - just with a little more hazzle, but also with some more options!)
FOR USE IN ext_locallang.php FILES

$key string $key is the extension key (informative only).
$type string $type is either "setup", "constants" or "editorcfg" and obviously determines which kind of TypoScript code we are adding.
$content string $content is the TS content, prefixed with a [GLOBAL] line and a comment-header.
$afterStaticUid=0 string $afterStaticUid is either an integer pointing to a uid of a static_template or a string pointing to the "key" of a static_file template ([reduced extension_key]/[local path]). The points is that the TypoScript you add is included only IF that static template is included (and in that case, right after). So effectively the TypoScript you set can specifically overrule settings from those static templates.
Returns: void

function typo3_loadExtensions()

Loading extensions configured in $TYPO3_CONF_VARS['EXT']['extList']

CACHING ON: ($TYPO3_CONF_VARS['EXT']['extCache'] = 1 or 2)
If caching is enabled (and possible), the output will be $extensions['_CACHEFILE'] set to the cacheFilePrefix. Subsequently the cache files must be included then since those will eventually set up the extensions.
If cachefiles are not found they will be generated
CACHING OFF: ($TYPO3_CONF_VARS['EXT']['extCache'] = 0)
The returned value will be an array where each key is an extension key and the value is an array with filepaths for the extension.
This array will later be set in the global var $TYPO3_LOADED_EXT

Usages of this function can be see in config_default.php
Extensions are always detected in the order local - global - system.

Returns: array Extension Array
  @internal

function _makeIncludeHeader($key,$file)

Returns the section headers for the compiled cache-files.

$key string $key is the extension key
$file string $file is the filename (only informative for comment)
Returns: string
  @internal

function isCacheFilesAvailable($cacheFilePrefix)

Returns true if both the localconf and tables cache file exists (with $cacheFilePrefix)

$cacheFilePrefix string Prefix of the cache file to check
Returns: boolean
  @internal

function isLocalconfWritable()

Returns true if the "localconf.php" file in "typo3conf/" is writable

Returns: boolean
  @internal

function cannotCacheFilesWritable($cacheFilePrefix)

Returns an error string if typo3conf/ or cache-files with $cacheFilePrefix are NOT writable
Returns false if no problem.

$cacheFilePrefix string Prefix of the cache file to check
Returns: string
  @internal

function currentCacheFiles()

Returns an array with the two cache-files (0=>localconf, 1=>tables) from typo3conf/ if they (both) exist. Otherwise false.
Evaluation relies on $TYPO3_LOADED_EXT['_CACHEFILE']

Returns: array
  @internal

function writeCacheFiles($extensions,$cacheFilePrefix)

Compiles/Creates the two cache-files in typo3conf/ based on $cacheFilePrefix
Returns a array with the key "_CACHEFILE" set to the $cacheFilePrefix value

$extensions array Extension information array
$cacheFilePrefix string Prefix for the cache files
Returns: array
  @internal

class.t3lib_extobjbase.php

Parent class for 'Extension Objects' in backend modules.
Used for 'submodules' to other modules. Also called 'Function menu modules' in t3lib_extMgm. And now its even called 'Extension Objects'. Or 'Module functions'. Wish we had just one name. Or a name at all...(?) Thank God its not so advanced when it works...
In other words this class is used for backend modules which is not true backend modules appearing in the menu but rather adds themselves as a new entry in the function menu which typically exists for a backend module (like Web>Functions, Web>Info or Tools etc...)
The magic that binds this together is stored in the global variable $TBE_MODULES_EXT where extensions wanting to connect a module based on this class to an existing backend module store configuration which consists of the classname, script-path and a label (title/name)
For more information about this, please see the large example comment for the class t3lib_SCbase. This will show the principle of a 'level-1' connection.
The more advanced example - having two layers as it is done by the 'func_wizards' extension with the 'web_info' module - can be seen in the comment above.

Filesize: 10.9 K
Func/Classes: 7
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_SCbase,tx_funcwizards_webfunc::init(), tx_funcwizards_webfunc, tx_wizardsortpages_webfunc_2

class t3lib_extobjbase

Parent class for 'Extension Objects' in backend modules.
Used for 'submodules' to other modules. Also called 'Function menu modules' in t3lib_extMgm. And now its even called 'Extension Objects'. Or 'Module functions'. Wish we had just one name. Or a name at all...(?) Thank God its not so advanced when it works...
In other words this class is used for backend modules which is not true backend modules appearing in the menu but rather adds themselves as a new entry in the function menu which typically exists for a backend module (like Web>Functions, Web>Info or Tools etc...)
The magic that binds this together is stored in the global variable $TBE_MODULES_EXT where extensions wanting to connect a module based on this class to an existing backend module store configuration which consists of the classname, script-path and a label (title/name)
For more information about this, please see the large example comment for the class t3lib_SCbase. This will show the principle of a 'level-1' connection.
The more advanced example - having two layers as it is done by the 'func_wizards' extension with the 'web_info' module - can be seen in the comment above.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_SCbase,tx_funcwizards_webfunc::init(), tx_funcwizards_webfunc, tx_wizardsortpages_webfunc_2

function init(&$pObj,$conf)

Initialize the object

&$pObj object A reference to the parent (calling) object (which is probably an instance of an extension class to t3lib_SCbase)
$conf array The configuration set for this module - from global array TBE_MODULES_EXT
Returns: void
  @see t3lib_SCbase::checkExtObj()

function handleExternalFunctionValue()

If $this->function_key is set (which means there are two levels of object connectivity) then $this->extClassConf is loaded with the TBE_MODULES_EXT configuration for that sub-sub-module

Returns: void
  @see $function_key, tx_funcwizards_webfunc::init()

function incLocalLang()

Including any locallang file configured and merging its content over the current global LOCAL_LANG array (which is EXPECTED to exist!!!)

Returns: void

function checkExtObj()

Same as t3lib_SCbase::checkExtObj()

Returns: void
  @see t3lib_SCbase::checkExtObj()

function extObjContent()

Calls the main function inside ANOTHER sub-submodule which might exist.

Returns: void

function modMenu()

Dummy function - but is used to set up additional menu items for this submodule.
For an example see the extension 'cms' where the 'web_info' submodule is defined in cms/web_info/class.tx_cms_webinfo.php, tx_cms_webinfo_page::modMenu()

Returns: array A MOD_MENU array which will be merged together with the one from the parent object
  @see init(), tx_cms_webinfo_page::modMenu()

class.t3lib_foldertree.php

Extension class for the t3lib_treeView class, specially made for browsing folders in the File module

Filesize: 10.3 K
Func/Classes: 10
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@coauthor René Fritz <r.fritz@colorcube.de>
@package TYPO3
@subpackage t3lib
@see class t3lib_treeView

class t3lib_folderTree extends t3lib_treeView

Extension class for the t3lib_treeView class, specially made for browsing folders in the File module

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @coauthor René Fritz <r.fritz@colorcube.de>
  @package TYPO3
  @subpackage t3lib
  @see class t3lib_treeView

function t3lib_folderTree()

Constructor function of the class

Returns: void

function wrapIcon($icon,$row)

Wrapping the folder icon

$icon string The image tag for the icon
$row array The row for the current element
Returns: string The processed icon input value.

function getId($v)

Returns the id from the record - for folders, this is an md5 hash.

$v array Record array
Returns: integer The "uid" field value.

function getJumpToParm($v)

Returns jump-url parameter value.

$v array The record array.
Returns: string The jump-url parameter.

function getTitleStr($row,$titleLen=30)

Returns the title for the input record. If blank, a "no title" labele (localized) will be returned.
'_title' is used for setting an alternative title for folders.

$row array The input row array (where the key "_title" is used for the title)
$titleLen=30 integer Title length (30)
Returns: string The title.

function getBrowsableTree()

Will create and return the HTML code for a browsable tree of folders.
Is based on the mounts found in the internal array ->MOUNTS (set in the constructor)

Returns: string HTML code for the browsable tree

function getFolderTree($files_path, $depth=999, $depthData='')

Fetches the data for the tree

$files_path string Abs file path
$depth=999 integer Max depth (recursivity limit)
$depthData='' string HTML-code prefix for recursive calls.
Returns: integer The count of items on the level
  @see getBrowsableTree()

function getCount($files_path)

Counts the number of directories in a file path.

$files_path string File path.
Returns: integer

function initializePositionSaving()

Get stored tree structure AND updating it if needed according to incoming PM GET var.

Returns: void

class.t3lib_formmail.php

Formmail class, used by the TYPO3 "cms" extension (default frontend) to send email forms.

Filesize: 6.8 K
Func/Classes: 3
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see tslib_fe::sendFormmail(), t3lib/formmail.php

class t3lib_formmail extends t3lib_htmlmail

Formmail class, used by the TYPO3 "cms" extension (default frontend) to send email forms.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see tslib_fe::sendFormmail(), t3lib/formmail.php

function start($V,$base64=1)

Start function
This class is able to generate a mail in formmail-style from the data in $V
Fields:

[recipient]: email-adress of the one to receive the mail. If array, then all values are expected to be recipients
[attachment]: ....

[subject]: The subject of the mail
[from_email]: Sender email. If not set, [email] is used
[from_name]: Sender name. If not set, [name] is used
[replyto_email]: Reply-to email. If not set [from_email] is used
[replyto_name]: Reply-to name. If not set [from_name] is used
[organisation]: Organisation (header)
[priority]: Priority, 1-5, default 3
[html_enabled]: If mail is sent as html
[quoted_printable]: if set, quoted-printable will be used instead of base 64

$V array Contains values for the field names listed above (with slashes removed if from POSt input)
$base64=1 boolean Whether to base64 encode the mail content
Returns: void

function addAttachment($file, $filename)

Adds an attachment to the mail

$file string The absolute path to the file to add as attachment
$filename string The files original filename (not necessarily the same as the current since this could be uploaded files...)
Returns: boolean True if the file existed and was added.

class.t3lib_iconworks.php

Icon generation, backend
This library has functions that returns - and if necessary creates - the icon for an element in TYPO3

Expects global vars:
- $BACK_PATH
- PATH_typo3
- $TCA, $PAGES_TYPES


Notes:
These functions are strongly related to the interface of TYPO3.
The class is included in eg. init.php
ALL functions called without making a class instance, eg. "t3lib_iconWorks::getIconImage()"

Filesize: 19.9 K
Func/Classes: 8
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_iconWorks

Icon generation, backend
This library has functions that returns - and if necessary creates - the icon for an element in TYPO3

Expects global vars:
- $BACK_PATH
- PATH_typo3
- $TCA, $PAGES_TYPES


Notes:
These functions are strongly related to the interface of TYPO3.
The class is included in eg. init.php
ALL functions called without making a class instance, eg. "t3lib_iconWorks::getIconImage()"

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function getIconImage($table,$row=array(),$backPath,$params='',$shaded=FALSE)

Returns an icon image tag, 18x16 pixels, based on input information.
This function is recommended to use in your backend modules.

$table string The table name
$row=array() array The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
$backPath string The backpath to the main TYPO3 directory (relative path back to PATH_typo3)
$params='' string Additional attributes for the image tag
$shaded=FALSE boolean If set, the icon will be grayed/shaded
Returns: string <img>-tag
  @see getIcon()

function getIcon($table,$row=array(),$shaded=FALSE)

Creates the icon for input table/row
Returns filename for the image icon, relative to PATH_typo3

$table string The table name
$row=array() array The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
$shaded=FALSE boolean If set, the icon will be grayed/shaded
Returns: string Icon filename
  @see getIconImage()

function skinImg($backPath,$src,$wHattribs='',$outputMode=0)

Returns the src=... for the input $src value OR any alternative found in $TBE_STYLES['skinImg']
Used for skinning the TYPO3 backend with an alternative set of icons

$backPath string Current backpath to PATH_typo3 folder
$src string Icon file name relative to PATH_typo3 folder
$wHattribs='' string Default width/height, defined like 'width="12" height="14"'
$outputMode=0 integer Mode: 0 (zero) is default and returns src/width/height. 1 returns value of src+backpath, 2 returns value of w/h.
Returns: string Returns ' src="[backPath][src]" [wHattribs]'
  @see skinImgFile()

function makeIcon($iconfile,$mode, $user, $protectSection,$absFile,$iconFileName_stateTagged)

Creates the icon file for the function getIcon()

$iconfile string Original unprocessed Icon file, relative path to PATH_typo3
$mode string Mode string, eg. "deleted" or "futuretiming" determining how the icon will look
$user integer The number of the fe_group record uid if applicable
$protectSection boolean Flag determines if the protected-section icon should be applied.
$absFile string Absolute path to file from which to create the icon.
$iconFileName_stateTagged string The filename that this icon should have had, basically [icon base name]_[flags].[extension] - used for part of temporary filename
Returns: string Filename relative to PATH_typo3

function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)

The necessity of using this function for combining two images if GD is version 2 is that
GD2 cannot manage to combine two indexed-color images without totally spoiling everything.
In class.t3lib_stdgraphic this was solved by combining the images onto a first created true color image
However it has turned out that this method will not work if the indexed png-files contains transparency.
So I had to turn my attention to ImageMagick - my 'enemy of death'.
And so it happend - ImageMagick is now used to combine my two indexed-color images with transparency. And that works.
Of course it works only if ImageMagick is able to create valid png-images - which you cannot be sure of with older versions (still 5+)
The only drawback is (apparently) that IM creates true-color png's. The transparency of these will not be shown by MSIE on windows at this time (although it's straight 0%/100% transparency!) and the file size may be larger.

For parameters, see PHP function "imagecopyresized()"

&$im pointer see PHP function "imagecopyresized()"
$cpImg pointer see PHP function "imagecopyresized()"
$Xstart integer see PHP function "imagecopyresized()"
$Ystart integer see PHP function "imagecopyresized()"
$cpImgCutX integer see PHP function "imagecopyresized()"
$cpImgCutY integer see PHP function "imagecopyresized()"
$w integer see PHP function "imagecopyresized()"
$h integer see PHP function "imagecopyresized()"
$w integer see PHP function "imagecopyresized()"
$h integer see PHP function "imagecopyresized()"
Returns: void

function imagecreatefrom($file)

Create new image pointer from input file (either gif/png, in case the wrong format it is converted by t3lib_div::read_png_gif())

$file string Absolute filename of the image file from which to start the icon creation.
Returns: mixed If success, image pointer, otherwise "-1"
  @see t3lib_div::read_png_gif

function imagemake($im, $path)

Write the icon in $im pointer to $path

$im pointer Pointer to GDlib image resource
$path string Absolute path to the filename in which to write the icon.
Returns: void

class.t3lib_loaddbgroup.php

Load database groups (relations)
Used to process the relations created by the TCA element types "group" and "select" for database records. Manages MM-relations as well.

Filesize: 12.8 K
Func/Classes: 9
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_loadDBGroup

Load database groups (relations)
Used to process the relations created by the TCA element types "group" and "select" for database records. Manages MM-relations as well.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function start ($itemlist,$tablelist, $MMtable='',$MMuid=0)

Initialization of the class.

$itemlist string List of group/select items
$tablelist string Comma list of tables, first table takes priority if no table is set for an entry in the list.
$MMtable='' string Name of a MM table.
$MMuid=0 integer Local UID for MM lookup
Returns: void

function readList($itemlist)

Explodes the item list and stores the parts in the internal arrays itemArray and tableArray from MM records.

$itemlist string Item list
Returns: void

function readMM($tableName,$uid)

Reads the record tablename/id into the internal arrays itemArray and tableArray from MM records.
You can call this function after start if you supply no list to start()

$tableName string MM Tablename
$uid integer Local UID
Returns: void

function writeMM($tableName,$uid,$prependTableName=0)

Writes the internal itemArray to MM table:

$tableName string MM table name
$uid integer Local UID
$prependTableName=0 boolean If set, then table names will always be written.
Returns: void

function getValueArray($prependTableName='')

After initialization you can extract an array of the elements from the object. Use this function for that.

$prependTableName='' boolean If set, then table names will ALWAYS be prepended (unless its a _NO_TABLE value)
Returns: array A numeric array.

function convertPosNeg($valueArray,$fTable,$nfTable)

Converts id numbers from negative to positive.

$valueArray array Array of [table]_[id] pairs.
$fTable string Foreign table (the one used for positive numbers)
$nfTable string NEGative foreign table
Returns: array The array with ID integer values, converted to positive for those where the table name was set but did NOT match the positive foreign table.

function getFromDB()

Reads all records from internal tableArray into the internal ->results array where keys are table names and for each table, records are stored with uids as their keys.
If $this->fromTC is set you can save a little memory since only uid,pid and a few other fields are selected.

Returns: void

function readyForInterface()

Prepare items from itemArray to be transferred to the TCEforms interface (as a comma list)

Returns: string
  @see t3lib_transferdata::renderRecord()

class.t3lib_loadmodules.php

Load Backend Interface modules

Typically instantiated like this:
$this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
$this->loadModules->load($TBE_MODULES);

Filesize: 19.0 K
Func/Classes: 8
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_loadModules

Load Backend Interface modules

Typically instantiated like this:
$this->loadModules = t3lib_div::makeInstance('t3lib_loadModules');
$this->loadModules->load($TBE_MODULES);

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function load($modulesArray,$BE_USER='')

Init.
The outcome of the load() function will be a $this->modules array populated with the backend module structure available to the BE_USER
Further the global var $LANG will have labels and images for the modules loaded in an internal array.

$modulesArray array $modulesArray should be the global var $TBE_MODULES, $BE_USER can optionally be set to an alternative Backend user object than the global var $BE_USER (which is the currently logged in user)
$BE_USER='' object Optional backend user object to use. If not set, the global BE_USER object is used.
Returns: void

function checkExtensionModule($name)

If the module name ($name) is a module from an extension (has path in $this->absPathArray) then that path is returned relative to PATH_site

$name string Module name
Returns: string If found, the relative path from PATH_site

function checkMod($name, $fullpath)

Here we check for the module. If not a conf-file is set then it's regarded to be a spacer
Return values:
'notFound': If the module was not found in the path
false: If no access to the module
array(): Configuration array, in case a valid module where access IS granted exists.

$name string Module name
$fullpath string Absolute path to module
Returns: mixed See description of function

function checkModAccess($name,$MCONF)

Returns true if the internal BE_USER has access to the module $name with $MCONF (based on security level set for that module)

$name string Module name
$MCONF array MCONF array (module configuration array) from the modules conf.php file (contains settings about what access level the module has)
Returns: boolean True if access is granted for $this->BE_USER

function parseModulesArray ($arr)

Parses the moduleArray ($TBE_MODULES) into a internally useful structure.
Returns an array where the keys are names of the module and the values may be true (only module) or an array (of submodules)

$arr array moduleArray ($TBE_MODULES)
Returns: array Output structure with available modules

function cleanName ($str)

The $str is cleaned so that it contains alphanumerical characters only. Modules must only consist of these characters

$str string String to clean up
Returns: string

function getRelativePath($baseDir,$destDir)

Get relative path for $destDir compared to $baseDir

$baseDir string Base directory
$destDir string Destination directory
Returns: string The relative path of destination compared to base.

class.t3lib_matchcondition.php

Matching TypoScript conditions

Used with the TypoScript parser.
Matches browserinfo, IPnumbers for use with templates

Filesize: 17.5 K
Func/Classes: 8
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_TStemplate::matching(), t3lib_TStemplate::generateConfig()

class t3lib_matchCondition

Matching TypoScript conditions

Used with the TypoScript parser.
Matches browserinfo, IPnumbers for use with templates

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_TStemplate::matching(), t3lib_TStemplate::generateConfig()

function match($string)

Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"

$string string The condition to match against its criterias.
Returns: boolean Returns true or false based on the evaluation.
  @see t3lib_tsparser::parse()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=292&cHash=c6c7d43d2f

function testNumber($test,$value)

Will evaluate a $value based on an operator: "<", ">" or "=" (default)

$test string The value to compare with on the form [operator][number]. Eg. "< 123"
$value integer The number
Returns: boolean If $value is "50" and $test is "< 123" then it will return true.

function matchWild($haystack,$needle)

Matching two strings against each other, supporting a "*" wildcard in either end of the $needle

$haystack string The string in which to find $needle.
$needle string The string to find in $haystack
Returns: boolean Returns true if $needle matches or is found in (according to wildcards) in $haystack. Eg. if $haystack is "Netscape 6.5" and $needle is "Net*" or "Netscape*" then it returns true.

function whichDevice($useragent)

Returns a code for a browsing device based on the input useragent string

$useragent string User agent string from browser, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
Returns: string A code. See link.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=296&cHash=a8ae66c7d6

function browserInfo($useragent)

Generates an array with abstracted browser information
In the function match() this method is called and the result stored in $this->browserInfoArray

$useragent string The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
Returns: array Contains keys "browser", "version", "system"
  @see match()

function getGlobal($var,$inArr='')

Return global variable where the input string $var defines array keys separated by "|"

$var string Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the id GET parameter back.
$inArr='' array Alternative array than $GLOBAL to get variables from.
Returns: mixed Whatever value. If none, then blank string.

function getGP_ENV_TSFE($var)

Returns GP / ENV / TSFE vars

$var string Identifier
Returns: mixed The value of the variable pointed to.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=311&cHash=487cbd5cdf

class.t3lib_page.php

Page functions, a lot of sql/pages-related functions
Mainly used in the frontend but also in some cases in the backend.
It's important to set the right $where_hid_del in the object so that the functions operate properly

Filesize: 25 K
Func/Classes: 19
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see tslib_fe::fetch_the_id()

class t3lib_pageSelect

Page functions, a lot of sql/pages-related functions
Mainly used in the frontend but also in some cases in the backend.
It's important to set the right $where_hid_del in the object so that the functions operate properly

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see tslib_fe::fetch_the_id()

function init($show_hidden)

init() MUST be run directly after creating a new template-object
This sets the internal variable $this->where_hid_del to the correct where clause for page records taking deleted/hidden/starttime/endtime into account

$show_hidden boolean If $show_hidden is true, the hidden-field is ignored!! Normally this should be false. Is used for previewing.
Returns: void
  @see tslib_fe::fetch_the_id(), tx_tstemplateanalyzer::initialize_editor()

function getPage($uid)

Returns the $row for the page with uid = $uid (observing ->where_hid_del)
Any pages_language_overlay will be applied before the result is returned.
If no page is found an empty array is returned.

$uid integer The page id to look up.
Returns: array The page row with overlayed localized fields. Empty it no page.
  @see getPage_noCheck()

function getPage_noCheck($uid)

Return the $row for the page with uid = $uid WITHOUT checking for ->where_hid_del (start- and endtime or hidden). Only "deleted" is checked!

$uid integer The page id to look up
Returns: array The page row with overlayed localized fields. Empty it no page.
  @see getPage()

function getFirstWebPage($uid)

Returns the $row of the first web-page in the tree (for the default menu...)

$uid integer The page id for which to fetch first subpages (PID)
Returns: mixed If found: The page record (with overlayed localized fields, if any). If NOT found: blank value (not array!)
  @see tslib_fe::fetch_the_id()

function getPageIdFromAlias($alias)

Returns a pagerow for the page with alias $alias

$alias string The alias to look up the page uid for.
Returns: integer Returns page uid (integer) if found, otherwise 0 (zero)
  @see tslib_fe::checkAndSetAlias(), tslib_cObj::typoLink()

function getPageOverlay($pageInput,$lUid=-1)

Returns the relevant page overlay record fields

$pageInput mixed If $pageInput is an integer, it's the pid of the pageOverlay record and thus the page overlay record is returned. If $pageInput is an array, it's a page-record and based on this page record the language record is found and OVERLAYED before the page record is returned.
$lUid=-1 integer Language UID if you want to set an alternative value to $this->sys_language_uid which is default. Should be >=0
Returns: array Page row which is overlayed with language_overlay record (or the overlay record alone)

function getMenu($uid,$fields='*',$sortField='sorting',$addWhere='')

Returns an array with pagerows for subpages with pid=$uid (which is pid here!). This is used for menus.

$uid integer The page id for which to fetch subpages (PID)
$fields='*' string List of fields to select. Default is "*" = all
$sortField='sorting' string The field to sort by. Default is "sorting"
$addWhere='' string Optional additional where clauses. Like "AND title like '%blabla%'" for instance.
Returns: array Array with key/value pairs; keys are page-uid numbers. values are the corresponding page records (with overlayed localized fields, if any)
  @see tslib_fe::getPageShortcut(), tslib_menu::makeMenu(), tx_wizardcrpages_webfunc_2, tx_wizardsortpages_webfunc_2

function getDomainStartPage($domain, $path='',$request_uri='')

Will find the page carrying the domain record matching the input domain.
Might exit after sending a redirect-header IF a found domain record instructs to do so.

$domain string Domain name to search for. Eg. "www.typo3.com". Typical the HTTP_HOST value.
$path='' string Path for the current script in domain. Eg. "/somedir/subdir". Typ. supplied by t3lib_div::getIndpEnv('SCRIPT_NAME')
$request_uri='' string Request URI: Used to get parameters from if they should be appended. Typ. supplied by t3lib_div::getIndpEnv('REQUEST_URI')
Returns: mixed If found, returns integer with page UID where found. Otherwise blank. Might exit if location-header is sent, see description.
  @see tslib_fe::findDomainRecord()

function getRootLine($uid, $MP='')

Returns array with fields of the pages from here ($uid) and back to the root
NOTICE: This function only takes deleted pages into account! So hidden, starttime and endtime restricted pages are included no matter what.
Further: If any "recycler" page is found (doktype=255) then it will also block for the rootline)
If you want more fields in the rootline records than default such can be added by listing them in $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']

$uid integer The page uid for which to seek back to the page tree root.
$MP='' string Commalist of MountPoint parameters, eg. "1-2,3-4" etc. Normally this value comes from the GET var, MP
Returns: array Array with page records from the root line as values. The array is ordered with the outer records first and root record in the bottom. The keys are numeric but in reverse order. So if you traverse/sort the array by the numeric keys order you will get the order from root and out. If an error is found (like eternal looping or invalid mountpoint) it will return an empty array.
  @see tslib_fe::getPageAndRootline()

function getPathFromRootline($rl,$len=20)

Creates a "path" string for the input root line array titles.
Used for writing statistics.

$rl array A rootline array!
$len=20 integer The max length of each title from the rootline.
Returns: string The path in the form "/page title/This is another pageti.../Another page"
  @see tslib_fe::getConfigArray()

function getExtURL($pagerow,$disable=0)

Returns the URL type for the input page row IF the doktype is 3 and not disabled.

$pagerow array The page row to return URL type for
$disable=0 boolean A flag to simply disable any output from here.
Returns: string The URL type from $this->urltypes array. Blank if not found or disabled.
  @see tslib_fe::checkJumpUrl()

function checkRecord($table,$uid,$checkPage=0)

Checks if a record exists and is accessible.
The row is returned if everything's OK.

$table string The table name to search
$uid integer The uid to look up in $table
$checkPage=0 boolean If checkPage is set, it's also required that the page on which the record resides is accessible
Returns: mixed Returns array (the record) if OK, otherwise blank/0 (zero)

function getRawRecord($table,$uid,$fields='*')

Returns record no matter what - except if record is deleted

$table string The table name to search
$uid integer The uid to look up in $table
$fields='*' string The fields to select, default is "*"
Returns: mixed Returns array (the record) if found, otherwise blank/0 (zero)
  @see getPage_noCheck()

function getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='')

Selects records based on matching a field (ei. other than UID) with a value

$theTable string The table name to search, eg. "pages" or "tt_content"
$theField string The fieldname to match, eg. "uid" or "alias"
$theValue string The value that fieldname must match, eg. "123" or "frontpage"
$whereClause='' string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
$groupBy='' string Optional GROUP BY field(s), if none, supply blank string.
$orderBy='' string Optional ORDER BY field(s), if none, supply blank string.
$limit='' string Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns: mixed Returns array (the record) if found, otherwise blank/0 (zero)

function getHash($hash,$expTime=0)

Returns string value stored for the hash string in the table "cache_hash"
Can be used to retrieved a cached value
Can be used from your frontend plugins if you like. Is also used to store the parsed TypoScript template structures. You can call it directly like t3lib_pageSelect::getHash()

$hash string The hash-string which was used to store the data value
$expTime=0 integer Allowed expiretime in seconds. Basically a record is selected only if it is not older than this value in seconds. If expTime is not set, the hashed value will never expire.
Returns: string The "content" field of the "cache_hash" table row.
  @see tslib_TStemplate::start(), storeHash()

function storeHash($hash,$data,$ident)

Stores a string value in the cache_hash table identified by $hash.
Can be used from your frontend plugins if you like. You can call it directly like t3lib_pageSelect::storeHash()

$hash string 32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored)
$data string The data string. If you want to store an array, then just serialize it first.
$ident string $ident is just a textual identification in order to inform about the content! May be 20 characters long.
Returns: void
  @see tslib_TStemplate::start(), getHash()

function deleteClause($table)

Returns the "AND NOT deleted" clause for the tablename given IF $TCA configuration points to such a field.

$table string Tablename
Returns: string
  @see enableFields()

function enableFields($table,$show_hidden=-1,$ignore_array=array())

Returns a part of a WHERE clause which will filter out records with start/end times or hidden/fe_groups fields set to values that should de-select them according to the current time, preview settings or user login. Definitely a frontend function.
Is using the $TCA arrays "ctrl" part where the key "enablefields" determines for each table which of these features applies to that table.

$table string Table name found in the $TCA array
$show_hidden=-1 integer If $show_hidden is set (0/1), any hidden-fields in records are ignored. NOTICE: If you call this function, consider what to do with the show_hidden parameter. Maybe it should be set? See tslib_cObj->enableFields where it's implemented correctly.
$ignore_array=array() array Array you can pass where keys can be "disabled", "starttime", "endtime", "fe_group" (keys from "enablefields" in TCA) and if set they will make sure that part of the clause is not added. Thus disables the specific part of the clause. For previewing etc.
Returns: string The clause starting like " AND ...=... AND ...=..."
  @see tslib_cObj::enableFields(), deleteClause()

class.t3lib_pagetree.php

Class for generating a page tree.

Filesize: 4.4 K
Func/Classes: 5
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@coauthor René Fritz <r.fritz@colorcube.de>
@see t3lib_treeView, t3lib_browseTree
@package TYPO3
@subpackage t3lib

class t3lib_pageTree extends t3lib_treeView

Class for generating a page tree.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @coauthor René Fritz <r.fritz@colorcube.de>
  @see t3lib_treeView, t3lib_browseTree
  @package TYPO3
  @subpackage t3lib

function init($clause='')

Init function
REMEMBER to feed a $clause which will filter out non-readable pages!

$clause='' string Part of where query which will filter out non-readable pages.
Returns: void

function expandNext($id)

Returns true/false if the next level for $id should be expanded - and all levels should, so we always return 1.

$id integer ID (uid) to test for (see extending classes where this is checked againts session data)
Returns: boolean

function PMicon($row,$a,$c,$nextCount,$exp)

Generate the plus/minus icon for the browsable tree.
In this case, there is no plus-minus icon displayed.

$row array record for the entry
$a integer The current entry number
$c integer The total number of entries. If equal to $a, a 'bottom' element is returned.
$nextCount integer The number of sub-elements to the current element.
$exp boolean The element was expanded to render subelements if this flag is set.
Returns: string Image tag with the plus/minus icon.
  @see t3lib_treeView::PMicon()

function initializePositionSaving()

Get stored tree structure AND updating it if needed according to incoming PM GET var.
- Here we just set it to nothing since we want to just render the tree, nothing more.

Returns: void

class.t3lib_parsehtml.php

Functions for parsing HTML.
You are encouraged to use this class in your own applications

Filesize: 48 K
Func/Classes: 27
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_parsehtml

Functions for parsing HTML.
You are encouraged to use this class in your own applications

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function getSubpart($content, $marker)

Returns the first subpart encapsulated in the marker, $marker (possibly present in $content as a HTML comment)

$content string Content with subpart wrapped in fx. "###CONTENT_PART###" inside.
$marker string Marker string, eg. "###CONTENT_PART###"
Returns: string

function substituteSubpart($content,$marker,$subpartContent,$recursive=1,$keepMarker=0)

Substitutes a subpart in $content with the content of $subpartContent.

$content string Content with subpart wrapped in fx. "###CONTENT_PART###" inside.
$marker string Marker string, eg. "###CONTENT_PART###"
$subpartContent array If $subpartContent happens to be an array, it's [0] and [1] elements are wrapped around the content of the subpart (fetched by getSubpart())
$recursive=1 boolean If $recursive is set, the function calls itself with the content set to the remaining part of the content after the second marker. This means that proceding subparts are ALSO substituted!
$keepMarker=0 boolean If set, the marker around the subpart is not removed, but kept in the output
Returns: string Processed input content

function splitIntoBlock($tag,$content,$eliminateExtraEndTags=0)

Returns an array with the $content divided by tag-blocks specified with the list of tags, $tag
Even numbers in the array are outside the blocks, Odd numbers are block-content.
Use ->getAllParts() and ->removeFirstAndLastTag() to process the content if needed.

$tag string List of tags, comma separated.
$content string HTML-content
$eliminateExtraEndTags=0 boolean If set, excessive end tags are ignored - you should probably set this in most cases.
Returns: array Even numbers in the array are outside the blocks, Odd numbers are block-content.
  @see splitTags(), getAllParts(), removeFirstAndLastTag()

function splitTags($tag,$content)

Returns an array with the $content divided by tag-blocks specified with the list of tags, $tag
Even numbers in the array are outside the blocks, Odd numbers are block-content.
Use ->getAllParts() and ->removeFirstAndLastTag() to process the content if needed.

$tag string List of tags
$content string HTML-content
Returns: array Even numbers in the array are outside the blocks, Odd numbers are block-content.
  @see splitIntoBlock(), getAllParts(), removeFirstAndLastTag()

function getAllParts($parts,$tag_parts=1,$include_tag=1)

Returns an array with either tag or non-tag content of the result from ->splitIntoBlock()/->splitTags()

$parts array Parts generated by ->splitIntoBlock() or >splitTags()
$tag_parts=1 boolean Whether to return the tag-parts (default,true) or what was outside the tags.
$include_tag=1 boolean Whether to include the tags in the tag-parts (most useful for input made by ->splitIntoBlock())
Returns: array Tag-parts/Non-tag-parts depending on input argument settings
  @see splitIntoBlock(), splitTags()

function removeFirstAndLastTag($str)

Removes the first and last tag in the string
Anything before and after the first and last tags respectively is also removed

$str string String to process
Returns: string

function getFirstTag($str)

Returns the first tag in $str
Actually everything from the begining of the $str is returned, so you better make sure the tag is the first thing...

$str string HTML string with tags
Returns: string

function getFirstTagName($str,$preserveCase=FALSE)

Returns the NAME of the first tag in $str

$str string HTML tag (The element name MUST be separated from the attributes by a space character! Just *whitespace* will not do)
$preserveCase=FALSE boolean If set, then the tag is NOT converted to uppercase by case is preserved.
Returns: string Tag name in upper case
  @see getFirstTag()

function checkTagTypeCounts($content,$blockTags='a,b,blockquote,body,div,em,font,form,h1,h2,h3,h4,h5,h6,i,li,map,ol,option,p,pre,select,span,strong,table,td,textarea,tr,u,ul', $soloTags='br,hr,img,input,area')

Checks whether block/solo tags are found in the correct amounts in HTML content
Block tags are tags which are required to have an equal amount of start and end tags, eg. "<table>...</table>"
Solo tags are tags which are required to have ONLY start tags (possibly with an XHTML ending like ".../>")
NOTICE: Correct XHTML might actually fail since "<br></br>" is allowed as well as "<br/>". However only the LATTER is accepted by this function (with "br" in the "solo-tag" list), the first example will result in a warning.
NOTICE: Correct XHTML might actually fail since "<p/>" is allowed as well as "<p></p>". However only the LATTER is accepted by this function (with "p" in the "block-tag" list), the first example will result in an ERROR!
NOTICE: Correct HTML version "something" allows eg. <p> and <li> to be NON-ended (implicitly ended by other tags). However this is NOT accepted by this function (with "p" and "li" in the block-tag list) and it will result in an ERROR!

$content string HTML content to analyze
$blockTags='a,b,blockquote,body,div,em,font,form,h1,h2,h3,h4,h5,h6,i,li,map,ol,option,p,pre,select,span,strong,table,td,textarea,tr,u,ul' string Tag names for block tags (eg. table or div or p) in lowercase, commalist (eg. "table,div,p")
$soloTags='br,hr,img,input,area' string Tag names for solo tags (eg. img, br or input) in lowercase, commalist ("img,br,input")
Returns: array Analyse data.

function HTMLcleaner($content, $tags=array(),$keepAll=0,$hSC=0,$addConfig=array())

Function that can clean up HTML content according to configuration given in the $tags array.

Initializing the $tags array to allow a list of tags (in this case <B>,<I>,<U> and <A>), set it like this: $tags = array_flip(explode(',','b,a,i,u'))
If the value of the $tags[$tagname] entry is an array, advanced processing of the tags is initialized. These are the options:

$tags[$tagname] = Array(
'overrideAttribs' => '' If set, this string is preset as the attributes of the tag
'allowedAttribs' => '0' (zero) = no attributes allowed, '[commalist of attributes]' = only allowed attributes. If blank, all attributes are allowed.
'fixAttrib' => Array(
'[attribute name]' => Array (
'default' => If no attribute exists by this name, this value is set as default value (if this value is not blank)
'always' => Boolean. If set, the attribute is always processed. Normally an attribute is processed only if it exists
'trim,intval,lower,upper' => All booleans. If any of these keys are set, the value is passed through the respective PHP-functions.
'range' => Array ('[low limit]','[high limit, optional]') Setting integer range.
'list' => Array ('[value1/default]','[value2]','[value3]') Attribute must be in this list. If not, the value is set to the first element.
'removeIfFalse' => Boolean/'blank'. If set, then the attribute is removed if it is 'false'. If this value is set to 'blank' then the value must be a blank string (that means a 'zero' value will not be removed)
'removeIfEquals' => [value] If the attribute value matches the value set here, then it is removed.
'casesensitiveComp' => 1 If set, then the removeIfEquals and list comparisons will be case sensitive. Otherwise not.
)
),
'protect' => '', Boolean. If set, the tag <> is converted to &lt; and &gt;
'remap' => '', String. If set, the tagname is remapped to this tagname
'rmTagIfNoAttrib' => '', Boolean. If set, then the tag is removed if no attributes happend to be there.
'nesting' => '', Boolean/'global'. If set true, then this tag must have starting and ending tags in the correct order. Any tags not in this order will be discarded. Thus '</B><B><I></B></I></B>' will be converted to '<B><I></B></I>'. Is the value 'global' then true nesting in relation to other tags marked for 'global' nesting control is preserved. This means that if <B> and <I> are set for global nesting then this string '</B><B><I></B></I></B>' is converted to '<B></B>'
)

$content string $content; is the HTML-content being processed. This is also the result being returned.
$tags=array() array $tags; is an array where each key is a tagname in lowercase. Only tags present as keys in this array are preserved. The value of the key can be an array with a vast number of options to configure.
$keepAll=0 string $keepAll; boolean/'protect', if set, then all tags are kept regardless of tags present as keys in $tags-array. If 'protect' then the preserved tags have their <> converted to &lt; and &gt;
$hSC=0 integer $hSC; Values -1,0,1,2: Set to zero= disabled, set to 1 then the content BETWEEN tags is htmlspecialchar()'ed, set to -1 its the opposite and set to 2 the content will be HSC'ed BUT with preservation for real entities (eg. "&amp;" or "&#234;")
$addConfig=array() array Configuration array send along as $conf to the internal functions ->processContent() and ->processTag()
Returns: string Processed HTML content

function get_tag_attributes($tag,$deHSC=0)

Returns an array with all attributes as keys. Attributes are only lowercase a-z
If a attribute is empty (shorthand), then the value for the key is empty. You can check if it existed with isset()

$tag string Tag: $tag is either a whole tag (eg '<TAG OPTION ATTRIB=VALUE>') or the parameterlist (ex ' OPTION ATTRIB=VALUE>')
$deHSC=0 boolean If set, the attribute values are de-htmlspecialchar'ed. Should actually always be set!
Returns: array array(Tag attributes,Attribute meta-data)

function split_tag_attributes($tag)

Returns an array with the 'components' from an attribute list. The result is normally analyzed by get_tag_attributes
Removes tag-name if found

$tag string The tag or attributes
Returns: array
  @see t3lib_div::split_tag_attributes()

function bidir_htmlspecialchars($value,$dir)

Converts htmlspecialchars forth ($dir=1) AND back ($dir=-1)

$value string Input value
$dir integer Direction: forth ($dir=1, dir=2 for preserving entities) AND back ($dir=-1)
Returns: string Output value

function prefixResourcePath($main_prefix,$content,$alternatives=array())

Prefixes the relative paths of hrefs/src/action in the tags [td,table,body,img,input,form,link,script,a] in the $content with the $main_prefix or and alternative given by $alternatives

$main_prefix string Prefix string
$content string HTML content
$alternatives=array() array Array with alternative prefixes for certain of the tags. key=>value pairs where the keys are the tag element names in uppercase
Returns: string Processed HTML content

function prefixRelPath($prefix,$srcVal)

Internal sub-function for ->prefixResourcePath()

$prefix string Prefix string
$srcVal string Relative path/URL
Returns: string Output path, prefixed if no scheme in input string

function cleanFontTags($value,$keepFace=0,$keepSize=0,$keepColor=0)

Cleans up the input $value for fonttags.
If keepFace,-Size and -Color is set then font-tags with an allowed property is kept. Else deleted.

$value string HTML content with font-tags inside to clean up.
$keepFace=0 boolean If set, keep "face" attribute
$keepSize=0 boolean If set, keep "size" attribute
$keepColor=0 boolean If set, keep "color" attribute
Returns: string Processed HTML content

function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<')

This is used to map certain tag-names into other names.

$value string HTML content
$tags=array() array Array with tag key=>value pairs where key is from-tag and value is to-tag
$ltChar='<' string Alternative less-than char to search for (search regex string)
$ltChar2='<' string Alternative less-than char to replace with (replace regex string)
Returns: string Processed HTML content

function unprotectTags($content,$tagList='')

This converts htmlspecialchar()'ed tags (from $tagList) back to real tags. Eg. '&lt;strong&gt' would be converted back to '<strong>' if found in $tagList

$content string HTML content
$tagList='' string Tag list, separated by comma. Lowercase!
Returns: string Processed HTML content

function stripTagsExcept($value,$tagList)

Strips tags except the tags in the list, $tagList
OBSOLETE - use PHP function strip_tags()

$value string Value to process
$tagList string List of tags
Returns: string Output value

function caseShift($str,$flag,$cacheKey='')

Internal function for case shifting of a string or whole array

$str mixed Input string/array
$flag boolean If $str is a string AND this boolean is true, the string is returned in uppercase
$cacheKey='' string Key string used for internal caching of the results. Could be an MD5 hash of the serialized version of the input $str if that is an array.
Returns: string Output string, processed

function compileTagAttribs($tagAttrib,$meta=array(), $xhtmlClean=0)

Compiling an array with tag attributes into a string

$tagAttrib array Tag attributes
$meta=array() array Meta information about these attributes (like if they were quoted)
$xhtmlClean=0 boolean If set, then the attribute names will be set in lower case, value quotes in double-quotes and the value will be htmlspecialchar()'ed
Returns: string Imploded attributes, eg: 'attribute="value" attrib2="value2"'

function get_tag_attributes_classic($tag,$deHSC=0)

Get tag attributes, the classic version (which had some limitations?)

$tag string The tag
$deHSC=0 boolean De-htmlspecialchar flag.
Returns: array

function HTMLparserConfig($TSconfig,$keepTags=array())

Converts TSconfig into an array for the HTMLcleaner function.

$TSconfig array TSconfig for HTMLcleaner
$keepTags=array() array Array of tags to keep (?)
Returns: array

function XHTML_clean($content)

Tries to convert the content to be XHTML compliant and other stuff like that.
STILL EXPERIMENTAL. See comments below.

What it does NOT do (yet) according to XHTML specs.:
- Wellformedness: Nesting is NOT checked
- name/id attribute issue is not observed at this point.
- Certain nesting of elements not allowed. Most interesting, <PRE> cannot contain img, big,small,sub,sup ...
- Wrapping scripts and style element contents in CDATA - or alternatively they should have entitites converted.
- Setting charsets may put some special requirements on both XML declaration/ meta-http-equiv. (C.9)
- UTF-8 encoding is in fact expected by XML!!
- stylesheet element and attribute names are NOT converted to lowercase
- ampersands (and entities in general I think) MUST be converted to an entity reference! (&amps;). This may mean further conversion of non-tag content before output to page. May be related to the charset issue as a whole.
- Minimized values not allowed: Must do this: selected="selected"

What it does at this point:
- All tags (frame,base,meta,link + img,br,hr,area,input) is ended with "/>" - others?
- Lowercase for elements and attributes
- All attributes in quotes
- Add "alt" attribute to img-tags if it's not there already.

$content string Content to clean up
Returns: string Cleaned up content returned.

function processTag($value,$conf,$endTag,$protected=0)

Processing all tags themselves
(Some additions by Sacha Vorbeck)

$value string Tag to process
$conf array Configuration array passing instructions for processing. If count()==0, function will return value unprocessed. See source code for details
$endTag boolean Is endtag, then set this.
$protected=0 boolean If set, just return value straight away
Returns: string Processed value.

function processContent($value,$dir,$conf)

Processing content between tags for HTML_cleaner

$value string The value
$dir integer Direction, either -1 or +1. 0 (zero) means no change to input value.
$conf mixed Not used, ignore.
Returns: string The processed value.

class.t3lib_parsehtml_proc.php

Class for parsing HTML for the Rich Text Editor. (also called transformations)

Filesize: 56 K
Func/Classes: 28
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_parsehtml_proc extends t3lib_parsehtml

Class for parsing HTML for the Rich Text Editor. (also called transformations)

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function init($elRef='',$recPid=0)

Initialize, setting element reference and record PID

$elRef='' string Element reference, eg "tt_content:bodytext"
$recPid=0 integer PID of the record (page id)
Returns: void

function setRelPath($path)

Setting the ->relPath and ->relBackPath to proper values so absolute references to links and images can be converted to relative dittos.
This is used when editing files with the RTE

$path string The relative path from PATH_site to the place where the file being edited is. Eg. "fileadmin/static".
Returns: void There is no output, it is set in internal variables. With the above example of "fileadmin/static" as input this will yield ->relPath to be "fileadmin/static/" and ->relBackPath to be "../../"

function evalWriteFile($pArr,$currentRecord)

Evaluate the environment for editing a staticFileEdit file.
Called for almost all fields being saved in the database. Is called without an instance of the object: t3lib_parsehtml_proc::evalWriteFile()

$pArr array Parameters for the current field as found in types-config
$currentRecord array Current record we are editing.
Returns: mixed On success an array with various information is returned, otherwise a string with an error message
  @see t3lib_TCEmain, t3lib_transferData

function RTE_transform($value,$specConf,$direction='rte',$thisConfig=array())

Tranform value for RTE based on specConf in the direction specified by $direction (rte/db)
This is the main function called from tcemain and transfer data classes

$value string Input value
$specConf array Special configuration for a field; This is coming from the types-configuration of the field in the TCA. In the types-configuration you can setup features for the field rendering and in particular the RTE takes al its major configuration options from there!
$direction='rte' string Direction of the transformation. Two keywords are allowed; "db" or "rte". If "db" it means the transformation will clean up content coming from the Rich Text Editor and goes into the database. The other direction, "rte", is of course when content is coming from database and must be transformed to fit the RTE.
$thisConfig=array() array Parsed TypoScript content configuring the RTE, probably coming from Page TSconfig.
Returns: string Output value
  @see t3lib_TCEmain::fillInFieldArray(), t3lib_transferData::renderRecord_typesProc()

function TS_images_db($value)

Transformation handler: 'ts_images' / direction: "db"
Processing images inserted in the RTE.
This is used when content goes from the RTE to the database.
Images inserted in the RTE has an absolute URL applied to the src attribute. This URL is converted to a relative URL
If it turns out that the URL is from another website than the current the image is read from that external URL and moved to the local server.
Also "magic" images are processed here.

$value string The content from RTE going to Database
Returns: string Processed content

function TS_images_rte($value)

Transformation handler: 'ts_images' / direction: "rte"
Processing images from database content going into the RTE.
Processing includes converting the src attribute to an absolute URL.

$value string Content input
Returns: string Content output

function TS_reglinks($value,$direction)

Transformation handler: 'ts_reglinks' / direction: "db"+"rte" depending on $direction variable.
Converting <A>-tags to/from abs/rel

$value string Content input
$direction string Direction of conversion; "rte" (from database to RTE) or "db" (from RTE to database)
Returns: string Content output

function TS_links_db($value)

Transformation handler: 'ts_links' / direction: "db"
Converting <A>-tags to <LINK tags>

$value string Content input
Returns: string Content output
  @see TS_links_rte()

function TS_links_rte($value)

Transformation handler: 'ts_links' / direction: "rte"
Converting <LINK tags> to <A>-tags

$value string Content input
Returns: string Content output
  @see TS_links_rte()

function TS_preserve_db($value)

Preserve special tags

$value string Content input
Returns: string Content output

function TS_preserve_rte($value)

Preserve special tags

$value string Content input
Returns: string Content output

function TS_transform_db($value,$css=FALSE)

Transformation handler: 'ts_transform' + 'css_transform' / direction: "db"
Cleaning (->db) for standard content elements (ts)

$value string Content input
$css=FALSE boolean If true, the transformation was "css_transform", otherwise "ts_transform"
Returns: string Content output
  @see TS_transform_rte()

function TS_transform_rte($value,$css=0)

Transformation handler: 'ts_transform' + 'css_transform' / direction: "rte"
Set (->rte) for standard content elements (ts)

$value string Content input
$css=0 boolean If true, the transformation was "css_transform", otherwise "ts_transform"
Returns: string Content output
  @see TS_transform_db()

function TS_strip_db($value)

Transformation handler: 'ts_strip' / direction: "db"
Removing all non-allowed tags

$value string Content input
Returns: string Content output

function getURL($url)

Reads the file or url $url and returns the content

$url string Filepath/URL to read
Returns: string The content from the resource given as input.
  @see t3lib_div::getURL()

function HTMLcleaner_db($content,$tagList='')

Function for cleaning content going into the database.
Content is cleaned eg. by removing unallowed HTML and ds-HSC content
It is basically calling HTMLcleaner from the parent class with some preset configuration specifically set up for cleaning content going from the RTE into the db

$content string Content to clean up
$tagList='' string Comma list of tags to specifically allow. Default comes from getKeepTags and is ""
Returns: string Clean content
  @see getKeepTags()

function getKeepTags($direction='rte',$tagList='')

Creates an array of configuration for the HTMLcleaner function based on whether content go TO or FROM the Rich Text Editor ($direction)
Unless "tagList" is given, the function will cache the configuration for next time processing goes on. (In this class that is the case only if we are processing a bulletlist)

$direction='rte' string The direction of the content being processed by the output configuration; "db" (content going into the database FROM the rte) or "rte" (content going into the form)
$tagList='' string Comma list of tags to keep (overriding default which is to keep all + take notice of internal configuration)
Returns: array Configuration array
  @see HTMLcleaner_db()

function divideIntoLines($value,$count=5,$returnArray=FALSE)

This resolves the $value into parts based on <div></div>-sections and <p>-sections and <br />-tags. These are returned as lines separated by chr(10).
This point is to resolve the HTML-code returned from RTE into ordinary lines so it's 'human-readable'
The function ->setDivTags does the opposite.
This function processes content to go into the database.

$value string Value to process.
$count=5 integer Recursion brake. Decremented on each recursion down to zero. Default is 5 (which equals the allowed nesting levels of p/div tags).
$returnArray=FALSE boolean If true, an array with the lines is returned, otherwise a string of the processed input value.
Returns: string Processed input value.
  @see setDivTags()

function setDivTags($value,$dT='p')

Converts all lines into <div></div>/<p></p>-sections (unless the line is a div-section already)
For processing of content going FROM database TO RTE.

$value string Value to convert
$dT='p' string Tag to wrap with. Either "p" or "div" should it be. Lowercase preferably.
Returns: string Processed value.
  @see divideIntoLines()

function internalizeFontTags($value)

This splits the $value in font-tag chunks.
If there are any <P>/<DIV> sections inside of them, the font-tag is wrapped AROUND the content INSIDE of the P/DIV sections and the outer font-tag is removed.
This functions seems to be a good choice for pre-processing content if it has been pasted into the RTE from eg. star-office.
In that case the font-tags are normally on the OUTSIDE of the sections.
This function is used by eg. divideIntoLines() if the procesing option 'internalizeFontTags' is set.

$value string Input content
Returns: string Output content
  @see divideIntoLines()

function siteUrl()

Returns SiteURL based on thisScript.

Returns: string Value of t3lib_div::getIndpEnv('TYPO3_SITE_URL');
  @see t3lib_div::getIndpEnv()

function rteImageStorageDir()

Return the storage folder of RTE image files.
Default is $GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_imageStorageDir'] unless something else is configured in the types configuration for the RTE.

Returns: string

function removeTables($value,$breakChar='<br />')

Remove all tables from incoming code
The function is trying to to this is some more or less respectfull way. The approach is to resolve each table cells content and implode it all by <br /> chars. Thus at least the content is preserved in some way.

$value string Input value
$breakChar='<br />' string Break character to use for linebreaks.
Returns: string Output value

function defaultTStagMapping($code,$direction='rte')

Default tag mapping for TS

$code string Input code to process
$direction='rte' string Direction To databsae (db) or from database to RTE (rte)
Returns: string Processed value

function getWHFromAttribs($attribArray)

Finds width and height from attrib-array
If the width and height is found in the style-attribute, use that!

$attribArray array Array of attributes from tag in which to search. More specifically the content of the key "style" is used to extract "width:xxx / height:xxx" information
Returns: array Integer w/h in key 0/1. Zero is returned if not found.

function urlInfoForLinkTags($url)

Parse <A>-tag href and return status of email,external,file or page

$url string URL to analyse.
Returns: array Information in an array about the URL

function TS_AtagToAbs($value,$dontSetRTEKEEP=FALSE)

Converting <A>-tags to absolute URLs (+ setting rtekeep attribute)

$value string Content input
$dontSetRTEKEEP=FALSE boolean If true, then the "rtekeep" attribute will not be set.
Returns: string Content output

class.t3lib_positionmap.php

Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
Used for pages / tt_content element wizards of various kinds.

Filesize: 19.8 K
Func/Classes: 18
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_positionMap

Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
Used for pages / tt_content element wizards of various kinds.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function positionTree($id,$pageinfo,$perms_clause,$R_URI)

Creates a "position tree" based on the page tree.
Notice: A class, "localPageTree" must exist and probably it is an extension class of the t3lib_pageTree class. See "db_new.php" in the core for an example.

$id integer Current page id
$pageinfo array Current page record.
$perms_clause string Page selection permission clause.
$R_URI string Current REQUEST_URI
Returns: string HTML code for the tree.

function JSimgFunc($prefix='')

Creates the JavaScritp for insert new-record rollover image

$prefix='' string Insert record image prefix.
Returns: string <script> section

function boldTitle($t_code,$dat,$id)

Wrap $t_code in bold IF the $dat uid matches $id

$t_code string Title string
$dat array Infomation array with record array inside.
$id integer The current id.
Returns: string The title string.

function onClickEvent($pid,$newPagePID)

Creates the onclick event for the insert-icons.

TSconfig mod.web_list.newPageWiz.overrideWithExtension may contain an extension which provides a module
to be used instead of the normal create new page wizard.

$pid integer The pid.
$newPagePID integer New page id.
Returns: string Onclick attribute content

function insertlabel()

Get label, htmlspecialchars()'ed

Returns: string The localized label for "insert new page here"

function linkPageTitle($str,$rec)

Wrapping page title.

$str string Page title.
$rec array Page record (?)
Returns: string Wrapped title.

function checkNewPageInPid($pid)

Checks if the user has permission to created pages inside of the $pid page.
Uses caching so only one regular lookup is made - hence you can call the function multiple times without worrying about performance.

$pid integer Page id for which to test.
Returns: boolean

function getModConfig($pid)

Returns module configuration for a pid.

$pid integer Page id for which to get the module configuration.
Returns: array The properties of teh module configuration for the page id.
  @see onClickEvent()

function insertQuadLines($codes,$allBlank=0)

Insert half/quad lines.

$codes string keywords for which lines to insert.
$allBlank=0 boolean If true all lines are just blank clear.gifs
Returns: string HTML content.

function printContentElementColumns($pid,$moveUid,$colPosList,$showHidden,$R_URI)

Creates HTML for inserting/moving content elements.

$pid integer page id onto which to insert content element.
$moveUid integer Move-uid (tt_content element uid?)
$colPosList string List of columns to show
$showHidden boolean If not set, then hidden/starttime/endtime records are filtered out.
$R_URI string Request URI
Returns: string HTML

function printRecordMap($lines,$colPosArray)

Creates the table with the content columns

$lines array Array with arrays of lines for each column
$colPosArray array Column position array
Returns: string HTML

function wrapColumnHeader($str,$vv)

Wrapping the column header

$str string Header value
$vv string Column info.
Returns: string
  @see printRecordMap()

function insertPositionIcon($row,$vv,$kk,$moveUid,$pid)

Creates a linked position icon.

$row array Element row.
$vv string Column position value.
$kk integer Column key.
$moveUid integer Move uid
$pid integer PID value.
Returns: string

function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0)

Create on-click event value.

$row array The record.
$vv string Column position value.
$moveUid integer Move uid
$pid integer PID value.
$sys_lang=0 integer System language (not used currently)
Returns: string

function wrapRecordHeader($str,$row)

Wrapping the record header (from getRecordHeader())

$str string HTML content
$row array Record array.
Returns: string HTML content

function getRecordHeader($row)

Create record header (includes teh record icon, record title etc.)

$row array Record row.
Returns: string HTML

function wrapRecordTitle($str,$row)

Wrapping the title of the record.

$str string The title value.
$row array The record row.
Returns: string Wrapped title string.

class.t3lib_readmail.php

Functions used to read email content
The class is still just a bunch of miscellaneous functions used to read content out of emails

Filesize: 16.9 K
Func/Classes: 15
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_readmail

Functions used to read email content
The class is still just a bunch of miscellaneous functions used to read content out of emails

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function find_MIDfromReturnPath($to)

Returns special TYPO3 Message ID (MID) from input TO header (the return address of the sent mail from Dmailer. Used by Dmailer, return mails)

$to string email address, return address string
Returns: mixed array with 'mid', 'rtbl' and 'rid' keys are returned.
  @internal

function find_XTypo3MID($content)

Returns special TYPO3 Message ID (MID) from input mail content (used by Dmailer, return mails)

$content string Mail (header) content
Returns: mixed If "X-Typo3MID" header is found and integrity is OK, then an array with 'mid', 'rtbl' and 'rid' keys are returned. Otherwise void.
  @internal

function getMessage($mailParts)

Returns the text content of a mail which has previously been parsed by eg. extractMailHeader()
Probably obsolete since the function fullParse() is more advanced and safer to use.

$mailParts array Output from extractMailHeader()
Returns: string The content.

function getTextContent($content)

Returns the body part of a raw mail message (including headers)
Probably obsolete since the function fullParse() is more advanced and safer to use.

$content string Raw mail content
Returns: string Body of message

function getMailBoundaryParts($boundary,$content)

Splits the body of a mail into parts based on the boundary string given.
Obsolete, use fullParse()

$boundary string Boundary string used to split the content.
$content string BODY section of a mail
Returns: array Parts of the mail based on this

function getCType($str)

Returns Content Type plus more.
Obsolete, use fullParse()

$str string "ContentType" string with more
Returns: array parts in key/value pairs

function analyseReturnError($c)

Analyses the return-mail content for the Dmailer module - used to find what reason there was for rejecting the mail
Used by the Dmailer, but not exclusively.

$c string message body/text
Returns: array key/value pairs with analysis result. Eg. "reason", "content", "reason_text", "mailserver" etc.

function decodeHeaderString($str)

Decodes a header-string with the =?....?= syntax including base64/quoted-printable encoding.

$str string A string (encoded or not) from a mail header, like sender name etc.
Returns: string The input string, but with the parts in =?....?= decoded.

function extractNameEmail($str)

Extracts name/email parts from a header field (like 'To:' or 'From:' with name/email mixed up.

$str string Value from a header field containing name/email values.
Returns: array Array with the name and email in. Email is validated, otherwise not set.

function getContentTypeData($contentTypeStr)

Returns the data from the 'content-type' field. That is the boundary, charset and mime-type

$contentTypeStr string "Content-type-string"
Returns: array key/value pairs with the result.

function makeUnixDate($dateStr)

Makes a UNIX-date based on the timestamp in the 'Date' header field.

$dateStr string String with a timestamp according to email standards.
Returns: integer The timestamp converted to unix-time in seconds and compensated for GMT/CET ($this->serverGMToffsetMinutes);

function getGMToffset($GMT)

Parsing the GMT offset value from a mail timestamp.

$GMT string A string like "+0100" or so.
Returns: integer Minutes to offset the timestamp

function extractMailHeader($content,$limit=0)

This returns the mail header items in an array with associative keys and the mail body part in another CONTENT field

$content string Raw mail content
$limit=0 integer A safety limit that will put a upper length to how many header chars will be processed. Set to zero means that there is no limit. (Uses a simple substr() to limit the amount of mail data to process to avoid run-away)
Returns: array An array where each key/value pair is a header-key/value pair. The mail BODY is returned in the key 'CONTENT' if $limit is not set!

function fullParse($content)

The extended version of the extractMailHeader() which will also parse all the content body into an array and further process the header fields and decode content etc. Returns every part of the mail ready to go.

$content string Raw email input.
Returns: array Multidimensional array with all parts of the message organized nicely. Use t3lib_div::debug() to analyse it visually.

class.t3lib_recordlist.php

This class is the base for listing of database records and files in the modules Web>List and File>Filelist

Filesize: 10.4 K
Func/Classes: 8
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see typo3/db_list.php, typo3/file_list.php

class t3lib_recordList

This class is the base for listing of database records and files in the modules Web>List and File>Filelist

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see typo3/db_list.php, typo3/file_list.php

function addElement($h,$icon,$data,$tdParams='',$lMargin='',$altLine='')

Returns a table-row with the content from the fields in the input data array.
OBS: $this->fieldArray MUST be set! (represents the list of fields to display)

$h integer $h is an integer >=0 and denotes how tall a element is. Set to '0' makes a halv line, -1 = full line, set to 1 makes a 'join' and above makes 'line'
$icon string $icon is the <img>+<a> of the record. If not supplied the first 'join'-icon will be a 'line' instead
$data array $data is the dataarray, record with the fields. Notice: These fields are (currently) NOT htmlspecialchar'ed before being wrapped in <td>-tags
$tdParams='' string $tdParams is insert in the <td>-tags. Must carry a ' ' as first character
$lMargin='' integer OBSOLETE - NOT USED ANYMORE. $lMargin is the leftMargin (integer)
$altLine='' string $altLine is the HTML <img>-tag for an alternative 'gfx/ol/line.gif'-icon (used in the top)
Returns: string HTML content for the table row

function writeTop()

Dummy function, used to write the top of a table listing.

Returns: void

function writeBottom()

Finishes the list with the "stopper"-gif, adding the HTML code for that item to the internal ->HTMLcode string

Returns: void

function fwd_rwd_nav($table='')

Creates a forward/reverse button based on the status of ->eCounter, ->firstElementNumber, ->iLimit

$table='' string Table name
Returns: array array([boolean], [HTML]) where [boolean] is 1 for reverse element, [HTML] is the table-row code for the element

function fwd_rwd_HTML($type,$pointer,$table='')

Creates the button with link to either forward or reverse

$type string Type: "fwd" or "rwd"
$pointer integer Pointer
$table='' string Table name
Returns: string

function listURL()

Returning "listURL" - the script with parameters to which forward/backward requests are sent

Returns: string

function CBfunctions()

Returning JavaScript for ClipBoard functionality.

Returns: string

class.t3lib_scbase.php

Parent class for 'ScriptClasses' in backend modules.
See example comment above.

Filesize: 13.5 K
Func/Classes: 10
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_extobjbase

class t3lib_SCbase

Parent class for 'ScriptClasses' in backend modules.
See example comment above.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_extobjbase

function init()

Initializes the backend module by setting internal variables, initializing the menu.

Returns: void
  @see menuConfig()

function menuConfig()

Initializes the internal MOD_MENU array setting and unsetting items based on various conditions. It also merges in external menu items from the global array TBE_MODULES_EXT (see mergeExternalItems())
Then MOD_SETTINGS array is cleaned up (see t3lib_BEfunc::getModuleData()) so it contains only valid values. It's also updated with any SET[] values submitted.
Also loads the modTSconfig internal variable.

Returns: void
  @see init(), $MOD_MENU, $MOD_SETTINGS, t3lib_BEfunc::getModuleData(), mergeExternalItems()

function mergeExternalItems($modName,$menuKey,$menuArr)

Merges menu items from global array $TBE_MODULES_EXT

$modName string Module name for which to find value
$menuKey string Menu key, eg. 'function' for the function menu.
$menuArr array The part of a MOD_MENU array to work on.
Returns: array Modified array part.
  @see t3lib_extMgm::insertModuleFunction(), menuConfig()

function handleExternalFunctionValue($MM_key='function')

Loads $this->extClassConf with the configuration for the CURRENT function of the menu.
If for this array the key 'path' is set then that is expected to be an absolute path to a file which should be included - so it is set in the internal array $this->include_once

$MM_key='function' string The key to MOD_MENU for which to fetch configuration. 'function' is default since it is first and foremost used to get information per "extension object" (I think that is what its called)
Returns: void
  @see $include_once, init()

function getExternalItemConfig($modName,$menuKey,$value='')

Returns configuration values from the global variable $TBE_MODULES_EXT for the module given.
For example if the module is named "web_info" and the "function" key ($menuKey) of MOD_SETTINGS is "stat" ($value) then you will have the values of $TBE_MODULES_EXT['webinfo']['MOD_MENU']['function']['stat'] returned.

$modName string Module name
$menuKey string Menu key, eg. "function" for the function menu. See $this->MOD_MENU
$value='' string Optionally the value-key to fetch from the array that would otherwise have been returned if this value was not set. Look source...
Returns: mixed The value from the TBE_MODULES_EXT array.
  @see handleExternalFunctionValue()

function checkExtObj()

Creates an instance of the class found in $this->extClassConf['name'] in $this->extObj if any (this should hold three keys, "name", "path" and "title" if a "Function menu module" tries to connect...)
This value in extClassConf might be set by an extension (in a ext_tables/ext_localconf file) which thus "connects" to a module.
The array $this->extClassConf is set in handleExternalFunctionValue() based on the value of MOD_SETTINGS[function]
(Should be) called from global scope right after inclusion of files from the ->include_once array.
If an instance is created it is initiated with $this passed as value and $this->extClassConf as second argument. Further the $this->MOD_SETTING is cleaned up again after calling the init function.

Returns: void
  @see handleExternalFunctionValue(), t3lib_extMgm::insertModuleFunction(), $extObj

function checkSubExtObj()

Calls the checkExtObj function in sub module if present.

Returns: void

function extObjHeader()

Calls the 'header' function inside the "Function menu module" if present.
A header function might be needed to add JavaScript or other stuff in the head. This can't be done in the main function because the head is already written.
example call in the header function:
$this->pObj->doc->JScode = $this->pObj->doc->wrapScriptTags(' ...

Returns: void

function extObjContent()

Calls the 'main' function inside the "Function menu module" if present

Returns: void

class.t3lib_sqlengine.php

PHP SQL engine / server

Filesize: 72 K
Func/Classes: 63
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_sqlengine

PHP SQL engine / server

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function init($config, &$pObj)

Dummy function for initializing SQL handler. Create you own in derived classes.

$config array Configuration array from handler
&$pObj object Parent object
Returns: void

function resetStatusVars()

Reset SQL engine status variables (insert id, affected rows, error status)

Returns: void

function processAccordingToConfig(&$value,$fInfo)

Processing of update/insert values based on field type.

&$value [type] $$value: ...
$fInfo [type] $fInfo: ...
Returns: [type] ...

function exec_INSERTquery($table,$fields_values)

Execute an INSERT query

$table string Table name
$fields_values array Field values as key=>value pairs.
Returns: boolean TRUE on success and FALSE on failure (error is set internally)

function exec_UPDATEquery($table,$where,$fields_values)

Execute UPDATE query on table

$table string Table name
$where string WHERE clause
$fields_values array Field values as key=>value pairs.
Returns: boolean TRUE on success and FALSE on failure (error is set internally)

function exec_DELETEquery($table,$where)

Execute DELETE query

$table string Table to delete from
$where string WHERE clause
Returns: boolean TRUE on success and FALSE on failure (error is set internally)

function exec_SELECTquery($select_fields,$from_table,$where_clause,$groupBy,$orderBy,$limit)

Execute SELECT query

$select_fields string List of fields to select from the table. This is what comes right after "SELECT ...". Required value.
$from_table string Table(s) from which to select. This is what comes right after "FROM ...". Required value.
$where_clause string Optional additional WHERE clauses put in the end of the query. NOTICE: You must escape values in this argument with $this->quoteStr() yourself! DO NOT PUT IN GROUP BY, ORDER BY or LIMIT!
$groupBy string Optional GROUP BY field(s), if none, supply blank string.
$orderBy string Optional ORDER BY field(s), if none, supply blank string.
$limit string Optional LIMIT value ([begin,]max), if none, supply blank string.
Returns: object Returns result object, but if errors, returns false

function sql_query($query)

Performs an SQL query on the "database"

$query string Query to execute
Returns: object Result object or false if error

function sql_error()

Returns most recent error

Returns: string Error message, if any

function sql_insert_id()

Returns most recently create unique ID (of INSERT queries)

Returns: integer Last unique id created.

function sql_affected_rows()

Returns affected rows (of UPDATE and DELETE queries)

Returns: integer Last amount of affected rows.

function quoteStr($str)

Quoting strings for insertion in SQL queries

$str string String
Returns: string String, with quotes escaped

function admin_get_tables()

(DUMMY) Returns the list of tables from the database

Returns: array Tables in an array (tablename is in both key and value)

function admin_get_fields($tableName)

(DUMMY) Returns information about each field in the $table

$tableName string Table name
Returns: array Field information in an associative array with fieldname => field row

function admin_get_keys($tableName)

(DUMMY) Returns information about each index key in the $table

$tableName string Table name
Returns: array Key information in a numeric array

function admin_query($query)

(DUMMY) mysql() wrapper function, used by the Install Tool and EM for all queries regarding management of the database!

$query string Query to execute
Returns: pointer Result pointer

function readDataSource($table)

Dummy function for setting table data. Create your own.
NOTICE: Handler to "table-locking" needs to be made probably!

$table string Table name
Returns: void
  @todo Table locking tools?

function saveDataSource($table)

Dummy function for setting table data. Create your own.
NOTICE: Handler to "table-locking" needs to be made probably!

$table string Table name
Returns: void
  @todo Table locking tools?

function selectFromData($table,$where)

[Describe function...]

$table [type] $table: ...
$where [type] $where: ...
Returns: [type] ...

function select_evalSingle($table,$config,&$itemKeys)

[Describe function...]

$table [type] $table: ...
$config [type] $config: ...
&$itemKeys [type] $itemKeys: ...
Returns: [type] ...

function getResultSet($keys, $table, $fieldList)

[Describe function...]

$keys [type] $keys: ...
$table [type] $table: ...
$fieldList [type] $fields: ...
Returns: [type] ...

function parseSQL($parseString)

Parses any single SQL query

$parseString string SQL query
Returns: array Result array with all the parts in - or error message string
  @see compileSQL(), debug_testSQL()

function parseSELECT($parseString)

Parsing SELECT query

$parseString string SQL string with SELECT query to parse
Returns: mixed Returns array with components of SELECT query on success, otherwise an error message string.
  @see compileSELECT()

function parseUPDATE($parseString)

Parsing UPDATE query

$parseString string SQL string with UPDATE query to parse
Returns: mixed Returns array with components of UPDATE query on success, otherwise an error message string.
  @see compileUPDATE()

function parseINSERT($parseString)

Parsing INSERT query

$parseString string SQL string with INSERT query to parse
Returns: mixed Returns array with components of INSERT query on success, otherwise an error message string.
  @see compileINSERT()

function parseDELETE($parseString)

Parsing DELETE query

$parseString string SQL string with DELETE query to parse
Returns: mixed Returns array with components of DELETE query on success, otherwise an error message string.
  @see compileDELETE()

function parseEXPLAIN($parseString)

Parsing EXPLAIN query

$parseString string SQL string with EXPLAIN query to parse
Returns: mixed Returns array with components of EXPLAIN query on success, otherwise an error message string.
  @see parseSELECT()

function parseCREATETABLE($parseString)

Parsing CREATE TABLE query

$parseString string SQL string starting with CREATE TABLE
Returns: mixed Returns array with components of CREATE TABLE query on success, otherwise an error message string.
  @see compileCREATETABLE()

function parseALTERTABLE($parseString)

Parsing ALTER TABLE query

$parseString string SQL string starting with ALTER TABLE
Returns: mixed Returns array with components of ALTER TABLE query on success, otherwise an error message string.
  @see compileALTERTABLE()

function parseDROPTABLE($parseString)

Parsing DROP TABLE query

$parseString string SQL string starting with DROP TABLE
Returns: mixed Returns array with components of DROP TABLE query on success, otherwise an error message string.

function parseFieldList(&$parseString, $stopRegex='')

Parsing the fields in the "SELECT [$selectFields] FROM" part of a query into an array.
The output from this function can be compiled back into a field list with ->compileFieldList()
Will detect the keywords "DESC" and "ASC" after the table name; thus is can be used for parsing the more simply ORDER BY and GROUP BY field lists as well!

&$parseString string The string with fieldnames, eg. "title, uid AS myUid, max(tstamp), count(*)" etc. NOTICE: passed by reference!
$stopRegex='' string Regular expressing to STOP parsing, eg. '^(FROM)([[:space:]]*)'
Returns: array If successful parsing, returns an array, otherwise an error string.
  @see compileFieldList()

function parseFromTables(&$parseString, $stopRegex='')

Parsing the tablenames in the "FROM [$parseString] WHERE" part of a query into an array.
The success of this parsing determines if that part of the query is supported by TYPO3.

&$parseString string list of tables, eg. "pages, tt_content" or "pages A, pages B". NOTICE: passed by reference!
$stopRegex='' string Regular expressing to STOP parsing, eg. '^(WHERE)([[:space:]]*)'
Returns: array If successful parsing, returns an array, otherwise an error string.
  @see compileFromTables()

function parseWhereClause(&$parseString, $stopRegex='')

Parsing the WHERE clause fields in the "WHERE [$parseString] ..." part of a query into a multidimensional array.
The success of this parsing determines if that part of the query is supported by TYPO3.

&$parseString string WHERE clause to parse. NOTICE: passed by reference!
$stopRegex='' string Regular expressing to STOP parsing, eg. '^(GROUP BY|ORDER BY|LIMIT)([[:space:]]*)'
Returns: mixed If successful parsing, returns an array, otherwise an error string.

function parseFieldDef(&$parseString, $stopRegex='')

Parsing the WHERE clause fields in the "WHERE [$parseString] ..." part of a query into a multidimensional array.
The success of this parsing determines if that part of the query is supported by TYPO3.

&$parseString string WHERE clause to parse. NOTICE: passed by reference!
$stopRegex='' string Regular expressing to STOP parsing, eg. '^(GROUP BY|ORDER BY|LIMIT)([[:space:]]*)'
Returns: mixed If successful parsing, returns an array, otherwise an error string.

function nextPart(&$parseString,$regex,$trimAll=FALSE)

Strips of a part of the parseString and returns the matching part.
Helper function for the parsing methods.

&$parseString string Parse string; if $regex finds anything the value of the first () level will be stripped of the string in the beginning. Further $parseString is left-trimmed (on success). Notice; parsestring is passed by reference.
$regex string Regex to find a matching part in the beginning of the string. Rules: You MUST start the regex with "^" (finding stuff in the beginning of string) and the result of the first parenthesis is what will be returned to you (and stripped of the string). Eg. '^(AND|OR|&&)[[:space:]]+' will return AND, OR or && if found and having one of more whitespaces after it, plus shorten $parseString with that match and any space after (by ltrim())
$trimAll=FALSE boolean If set the full match of the regex is stripped of the beginning of the string!
Returns: string The value of the first parenthesis level of the REGEX.

function getValue(&$parseString,$comparator='')

Finds value in beginning of $parseString, returns result and strips it of parseString

&$parseString string The parseString, eg. "(0,1,2,3) ..." or "('asdf','qwer') ..." or "1234 ..." or "'My string value here' ..."
$comparator='' string The comparator used before. If "NOT IN" or "IN" then the value is expected to be a list of values. Otherwise just an integer (un-quoted) or string (quoted)
Returns: string The value (string/integer). Otherwise an array with error message in first key (0)

function getValueInQuotes(&$parseString,$quote)

Get value in quotes from $parseString.
NOTICE: If a query being parsed was prepared for another database than MySQL this function should probably be changed

&$parseString string String from which to find value in quotes. Notice that $parseString is passed by reference and is shortend by the output of this function.
$quote string The quote used; input either " or '
Returns: string The value, passed through stripslashes() !

function parseStripslashes($str)

Strip slashes function used for parsing
NOTICE: If a query being parsed was prepared for another database than MySQL this function should probably be changed

$str string Input string
Returns: string Output string

function compileAddslashes($str)

Add slashes function used for compiling queries
NOTICE: If a query being parsed was prepared for another database than MySQL this function should probably be changed

$str string Input string
Returns: string Output string

function parseError($msg,$restQuery)

Setting the internal error message value, $this->parse_error and returns that value.

$msg string Input error message
$restQuery string Remaining query to parse.
Returns: string Error message.

function trimSQL($str)

Trimming SQL as preparation for parsing.
";" in the end is stripped of.
White space is trimmed away around the value
A single space-char is added in the end

$str string Input string
Returns: string Output string

function compileSQL($components)

Compiles an SQL query from components

$components array Array of SQL query components
Returns: string SQL query
  @see parseSQL()

function compileSELECT($components)

Compiles a SELECT statement from components array

$components array Array of SQL query components
Returns: string SQL SELECT query
  @see parseSELECT()

function compileUPDATE($components)

Compiles an UPDATE statement from components array

$components array Array of SQL query components
Returns: string SQL UPDATE query
  @see parseUPDATE()

function compileINSERT($components)

Compiles an INSERT statement from components array

$components array Array of SQL query components
Returns: string SQL INSERT query
  @see parseINSERT()

function compileDELETE($components)

Compiles an DELETE statement from components array

$components array Array of SQL query components
Returns: string SQL DELETE query
  @see parseDELETE()

function compileCREATETABLE($components)

Compiles a CREATE TABLE statement from components array

$components array Array of SQL query components
Returns: string SQL CREATE TABLE query
  @see parseCREATETABLE()

function compileALTERTABLE($components)

Compiles an ALTER TABLE statement from components array

$components array Array of SQL query components
Returns: string SQL ALTER TABLE query
  @see parseALTERTABLE()

function compileFieldList($selectFields)

Compiles a "SELECT [output] FROM..:" field list based on input array (made with ->parseFieldList())
Can also compile field lists for ORDER BY and GROUP BY.

$selectFields array Array of select fields, (made with ->parseFieldList())
Returns: string Select field string
  @see parseFieldList()

function compileFromTables($tablesArray)

Compiles a "FROM [output] WHERE..:" table list based on input array (made with ->parseFromTables())

$tablesArray array Array of table names, (made with ->parseFromTables())
Returns: string Table name string
  @see parseFromTables()

function compileWhereClause($clauseArray)

Implodes an array of WHERE clause configuration into a WHERE clause.
NOTICE: MIGHT BY A TEMPORARY FUNCTION. Use for debugging only!

$clauseArray array WHERE clause configuration
Returns: string WHERE clause as string.
  @see explodeWhereClause()

function compileFieldCfg($fieldCfg)

Compile field definition

$fieldCfg array Field definition parts
Returns: string Field definition string

function debug_parseSQLpart($part,$str)

Check parsability of input SQL part string; Will parse and re-compile after which it is compared

$part string Part definition of string; "SELECT" = fieldlist (also ORDER BY and GROUP BY), "FROM" = table list, "WHERE" = Where clause.
$str string SQL string to verify parsability of
Returns: mixed Returns array with string 1 and 2 if error, otherwise false

function debug_parseSQLpartCompare($str,$newStr,$caseInsensitive=FALSE)

Compare two query strins by stripping away whitespace.

$str string SQL String 1
$newStr string SQL string 2
$caseInsensitive=FALSE boolean If true, the strings are compared insensitive to case
Returns: mixed Returns array with string 1 and 2 if error, otherwise false

function debug_testSQL($SQLquery)

Performs the ultimate test of the parser: Direct a SQL query in; You will get it back (through the parsed and re-compiled) if no problems, otherwise the script will print the error and exit

$SQLquery string SQL query
Returns: string Query if all is well, otherwise exit.

function debug_printResultSet($array)

Returns the result set (in array) as HTML table. For debugging.

$array array Result set array (array of rows)
Returns: string HTML table

class t3lib_sqlengine_resultobj

PHP SQL engine, result object

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function sql_num_rows()

Counting number of rows

Returns: integer

function sql_fetch_assoc()

Fetching next row in result array

Returns: array Associative array

function sql_fetch_row()

Fetching next row, numerical indices

Returns: array Numerical array

function sql_data_seek($pointer)

Seeking position in result

$pointer integer Position pointer.
Returns: boolean Returns true on success

function sql_field_type()

[Describe function...]

Returns: [type] ...

class.t3lib_stdgraphic.php

Class contains a bunch of cool functions for manipulating graphics with GDlib/Freetype and ImageMagick
VERY OFTEN used with gifbuilder that extends this class and provides a TypoScript API to using these functions

Filesize: 76 K
Func/Classes: 53
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see tslib_gifBuilder

class t3lib_stdGraphic

Class contains a bunch of cool functions for manipulating graphics with GDlib/Freetype and ImageMagick
VERY OFTEN used with gifbuilder that extends this class and provides a TypoScript API to using these functions

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see tslib_gifBuilder

function init()

Init function. Must always call this when using the class.
This function will read the configuration information from $GLOBALS['TYPO3_CONF_VARS']['GFX'] can set some values in internal variables.

Returns: void

function maskImageOntoImage(&$im,$conf,$workArea)

Implements the "IMAGE" GIFBUILDER object, when the "mask" property is true.
It reads the two images defined by $conf['file'] and $conf['mask'] and copies the $conf['file'] onto the input image pointer image using the $conf['mask'] as a grayscale mask
The operation involves ImageMagick for combining.

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
Returns: void
  @see tslib_gifBuilder::make()

function copyImageOntoImage(&$im,$conf,$workArea)

Implements the "IMAGE" GIFBUILDER object, when the "mask" property is false (using only $conf['file'])

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
Returns: void
  @see tslib_gifBuilder::make(), maskImageOntoImage()

function copyGifOntoGif(&$im,$cpImg,$conf,$workArea)

Copies two GDlib image pointers onto each other, using TypoScript configuration from $conf and the input $workArea definition.

&$im pointer GDlib image pointer, destination (bottom image)
$cpImg pointer GDlib image pointer, source (top image)
$conf array TypoScript array with the properties for the IMAGE GIFBUILDER object. Only used for the "tile" property value.
$workArea array Work area
Returns: void Works on the $im image pointer

function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)

Alternative function for using the similat PHP function imagecopyresized(). Used for GD2 only.

OK, the reason for this stupid fix is the following story:
GD1.x was capable of copying two images together and combining their palettes! GD2 is apparently not.
With GD2 only the palette of the dest-image is used which mostly results in totally black images when trying to
copy a color-ful image onto the destination.
The GD2-fix is to
1) Create a blank TRUE-COLOR image
2) Copy the destination image onto that one
3) Then do the actual operation; Copying the source (top image) onto that
4) ... and return the result pointer.
5) Reduce colors (if we do not, the result may become strange!)
It works, but the resulting images is now a true-color PNG which may be very large.
So, why not use 'imagetruecolortopalette ($im, TRUE, 256)' - well because it does NOT WORK! So simple is that.

For parameters, see PHP function "imagecopyresized()"

&$im pointer see PHP function "imagecopyresized()"
$cpImg pointer see PHP function "imagecopyresized()"
$Xstart integer see PHP function "imagecopyresized()"
$Ystart integer see PHP function "imagecopyresized()"
$cpImgCutX integer see PHP function "imagecopyresized()"
$cpImgCutY integer see PHP function "imagecopyresized()"
$w integer see PHP function "imagecopyresized()"
$h integer see PHP function "imagecopyresized()"
$w integer see PHP function "imagecopyresized()"
$h integer see PHP function "imagecopyresized()"
Returns: void
  @see t3lib_iconWorks::imagecopyresized()

function makeText(&$im,$conf,$workArea)

Implements the "TEXT" GIFBUILDER object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
Returns: void
  @see tslib_gifBuilder::make()

function txtPosition($conf,$workArea,$BB)

Calculates text position for printing the text onto the image based on configuration like alignment and workarea.

$conf array TypoScript array for the TEXT GIFBUILDER object
$workArea array Workarea definition
$BB array Bounding box information, was set in tslib_gifBuilder::start()
Returns: array [0]=x, [1]=y, [2]=w, [3]=h
  @see makeText()

function calcBBox($conf)

Calculates bounding box information for the TEXT GIFBUILDER object.

$conf array TypoScript array for the TEXT GIFBUILDER object
Returns: array Array with three keys [0]/[1] being x/y and [2] being the bounding box array
  @see txtPosition(), tslib_gifBuilder::start()

function addToMap($cords,$conf)

Adds an <area> tag to the internal variable $this->map which is used to accumulate the content for an ImageMap

$cords array Coordinates for a polygon image map as created by ->calcTextCordsForMap()
$conf array Configuration for "imgMap." property of a TEXT GIFBUILDER object.
Returns: void
  @see makeText(), calcTextCordsForMap()

function calcTextCordsForMap($cords,$offset, $conf)

Calculating the coordinates for a TEXT string on an image map. Used in an <area> tag

$cords array Coordinates (from BBOX array)
$offset array Offset array
$conf array Configuration for "imgMap." property of a TEXT GIFBUILDER object.
Returns: array
  @see makeText(), calcTextCordsForMap()

function SpacedImageTTFText(&$im, $fontSize, $angle, $x, $y, $Fcolor, $fontFile, $text, $spacing, $wordSpacing)

Printing text onto an image like the PHP function imageTTFText does but in addition it offers options for spacing of letters and words.
Spacing is done by printing one char at a time and this means that the spacing is rather uneven and probably not very nice.
See

&$im pointer (See argument for PHP function imageTTFtext())
$fontSize integer (See argument for PHP function imageTTFtext())
$angle integer (See argument for PHP function imageTTFtext())
$x integer (See argument for PHP function imageTTFtext())
$y integer (See argument for PHP function imageTTFtext())
$Fcolor integer (See argument for PHP function imageTTFtext())
$fontFile string (See argument for PHP function imageTTFtext())
$text string (See argument for PHP function imageTTFtext()). UTF-8 string, possibly with entities in.
$spacing integer The spacing of letters in pixels
$wordSpacing integer The spacing of words in pixels
Returns: void

function fontResize($conf)

Function that finds the right fontsize that will render the textstring within a certain width

$conf array The TypoScript properties of the TEXT GIFBUILDER object
Returns: integer The new fontSize
  @author Rene Fritz <r.fritz@colorcube.de>
  @see tslib_gifBuilder::start()

function makeOutline(&$im,$conf,$workArea,$txtConf)

Implements the "OUTLINE" GIFBUILDER object / property for the TEXT object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
$txtConf array TypoScript array with configuration for the associated TEXT GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make(), makeText()

function circleOffset($distance, $iterations)

Creates some offset values in an array used to simulate a circularly applied outline around TEXT

access private

$distance integer Distance
$iterations integer Iterations.
Returns: array
  @see makeOutline()

function makeEmboss(&$im,$conf,$workArea,$txtConf)

Implements the "EMBOSS" GIFBUILDER object / property for the TEXT object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
$txtConf array TypoScript array with configuration for the associated TEXT GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make(), makeShadow()

function makeShadow(&$im,$conf,$workArea,$txtConf)

Implements the "SHADOW" GIFBUILDER object / property for the TEXT object
The operation involves ImageMagick for combining.

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
$txtConf array TypoScript array with configuration for the associated TEXT GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make(), makeText(), makeEmboss()

function makeBox(&$im,$conf,$workArea)

Implements the "BOX" GIFBUILDER object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
$workArea array The current working area coordinates.
Returns: void
  @see tslib_gifBuilder::make()

function makeEffect(&$im, $conf)

Implements the "EFFECT" GIFBUILDER object
The operation involves ImageMagick for applying effects

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make(), applyImageMagickToPHPGif()

function IMparams($setup)

Creating ImageMagick paramters from TypoScript property

$setup string A string with effect keywords=value pairs separated by "|"
Returns: string ImageMagick prepared parameters.
  @see makeEffect()

function adjust(&$im, $conf)

Implements the "ADJUST" GIFBUILDER object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make(), autoLevels(), outputLevels(), inputLevels()

function crop(&$im,$conf)

Implements the "CROP" GIFBUILDER object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make()

function scale(&$im,$conf)

Implements the "SCALE" GIFBUILDER object

&$im pointer GDlib image pointer
$conf array TypoScript array with configuration for the GIFBUILDER object.
Returns: void
  @see tslib_gifBuilder::make()

function setWorkArea($workArea)

Implements the "WORKAREA" GIFBUILDER object when setting it
Setting internal working area boundaries (->workArea)

$workArea string Working area dimensions, comma separated
Returns: void
  @see tslib_gifBuilder::make()

function autolevels(&$im)

Apply auto-levels to input image pointer

&$im integer GDlib Image Pointer
Returns: void

function outputLevels(&$im,$low,$high,$swap='')

Apply output levels to input image pointer (decreasing contrast)

&$im integer GDlib Image Pointer
$low integer The "low" value (close to 0)
$high integer The "high" value (close to 255)
$swap='' boolean If swap, then low and high are swapped. (Useful for negated masks...)
Returns: void

function inputLevels(&$im,$low,$high,$swap='')

Apply input levels to input image pointer (increasing contrast)

&$im integer GDlib Image Pointer
$low integer The "low" value (close to 0)
$high integer The "high" value (close to 255)
$swap='' boolean If swap, then low and high are swapped. (Useful for negated masks...)
Returns: void

function reduceColors(&$im,$limit, $cols)

Reduce colors in image

&$im integer GDlib Image Pointer
$limit integer The max number of colors in the image before a reduction will happen; basically this means that IF the GD image current has the same amount or more colors than $limit define, THEN a reduction is performed.
$cols integer Number of colors to reduce the image to.
Returns: void

function prependAbsolutePath($fontFile)

Checks if the $fontFile is already at an absolute path and if not, prepends the correct path.
Use PATH_site unless we are in the backend.
Call it by t3lib_stdGraphic::prependAbsolutePath()

$fontFile string The font file
Returns: string The font file with absolute path.

function v5_sharpen($factor)

Returns the IM command for sharpening with ImageMagick 5 (when $this->V5_EFFECTS is set).
Uses $this->im5fx_sharpenSteps for translation of the factor to an actual command.

$factor integer The sharpening factor, 0-100 (effectively in 10 steps)
Returns: string The sharpening command, eg. " -sharpen 3x4"
  @see makeText(), IMparams(), v5_blur()

function v5_blur($factor)

Returns the IM command for blurring with ImageMagick 5 (when $this->V5_EFFECTS is set).
Uses $this->im5fx_blurSteps for translation of the factor to an actual command.

$factor integer The blurring factor, 0-100 (effectively in 10 steps)
Returns: string The blurring command, eg. " -blur 3x4"
  @see makeText(), IMparams(), v5_sharpen()

function randomName()

Returns a random filename prefixed with "temp_" and then 32 char md5 hash (without extension) from $this->tempPath.
Used by functions in this class to create truely temporary files for the on-the-fly processing. These files will most likely be deleted right away.

Returns: string

function applyOffset($cords,$OFFSET)

Applies offset value to coordinated in $cords.
Basically the value of key 0/1 of $OFFSET is added to keys 0/1 of $cords

$cords array Integer coordinates in key 0/1
$OFFSET array Offset values in key 0/1
Returns: array Modified $cords array

function convertColor($string)

Converts a "HTML-color" TypoScript datatype to RGB-values.
Default is 0,0,0

$string string "HTML-color" data type string, eg. 'red', '#ffeedd' or '255,0,255'. You can also add a modifying operator afterwards. There are two options: "255,0,255 : 20" - will add 20 to values, result is "255,20,255". Or "255,0,255 : *1.23" which will multiply all RGB values with 1.23
Returns: array RGB values in key 0/1/2 of the array

function recodeString($string)

Recode string
Used with text strings for fonts when languages has other character sets.

$string string The text to recode
Returns: string The recoded string. Should be UTF-8 output. MAY contain entities (eg. &#123; or &#quot; which should render as real chars).

function singleChars($theText)

Split a string into an array of individual characters
The function will look at $this->nativeCharset and if that is set, the input string is expected to be UTF-8 encoded, possibly with entities in it. Otherwise the string is supposed to be a single-byte charset which is just splitted by a for-loop.

$theText string The text string to spli
Returns: array Numerical array with a char as each value.

function objPosition($conf,$workArea,$BB)

Create an array with object position/boundaries based on input TypoScript configuration (such as the "align" property is used), the work area definition and $BB array

$conf array TypoScript configuration for a GIFBUILDER object
$workArea array Workarea definition
$BB array BB (Bounding box) array. Not just used for TEXT objects but also for others
Returns: array [0]=x, [1]=y, [2]=w, [3]=h
  @see copyGifOntoGif(), makeBox(), crop()

function imageMagickConvert($imagefile,$newExt='',$w='',$h='',$params='',$frame='',$options='',$mustCreate=0)

Converts $imagefile to another file in temp-dir of type $newExt (extension).

$imagefile string The image filepath
$newExt='' string New extension, eg. "gif", "png", "jpg", "tif". If $newExt is NOT set, the new imagefile will be of the original format. If newExt = 'WEB' then one of the web-formats is applied.
$w='' string Width. $w / $h is optional. If only one is given the image is scaled proportionally. If an 'm' exists in the $w or $h and if both are present the $w and $h is regarded as the Maximum w/h and the proportions will be kept
$h='' string Height. See $w
$params='' string Additional ImageMagick parameters.
$frame='' string Refers to which frame-number to select in the image. '' or 0 will select the first frame, 1 will select the next and so on...
$options='' array An array with options passed to getImageScale (see this function).
$mustCreate=0 boolean If set, then another image than the input imagefile MUST be returned. Otherwise you can risk that the input image is good enough regarding messures etc and is of course not rendered to a new, temporary file in typo3temp/. But this option will force it to.
Returns: array [0]/[1] is w/h, [2] is file extension and [3] is the filename.
  @see getImageScale(), typo3/show_item.php, fileList_ext::renderImage(), tslib_cObj::getImgResource(), SC_tslib_showpic::show(), maskImageOntoImage(), copyImageOntoImage(), scale()

function getImageDimensions($imagefile)

Gets the input image dimensions.

$imagefile string The image filepath
Returns: array Returns an array where [0]/[1] is w/h, [2] is extension and [3] is the filename.
  @see imageMagickConvert(), tslib_cObj::getImgResource()

function getImageScale($info,$w,$h,$options)

Get numbers for scaling the image based on input

$info array Current image information: Width, Height etc.
$w integer "required" width
$h integer "required" height
$options array Options: Keys are like "maxW", "maxH", "minW", "minH"
Returns: array
  @see imageMagickConvert()

function file_exists_typo3temp_file($output,$orig='')

Used to check if a certain process of scaling an image is already being carried out (can be logged in the SQL database)

$output string Output imagefile
$orig='' string Original basis file
Returns: boolean Returns true if the file is already being made; thus "true" means "Don't render the image again"

function imageMagickIdentify($imagefile)

Returns an array where [0]/[1] is w/h, [2] is extension and [3] is the filename.
Using ImageMagick

$imagefile string The absolute image filepath
Returns: array

function imageMagickExec($input,$output,$params)

Executes a ImageMagick "convert" on two filenames, $input and $output using $params before them.
Can be used for many things, mostly scaling and effects.

$input string The absolute image filepath, input file (read from)
$output string The absolute image filepath, output filename (written to)
$params string ImageMagick parameters
Returns: string The result of a call to PHP function "exec()"

function combineExec($input,$overlay,$mask,$output)

Executes a ImageMagick "combine" (or composite in newer times) on four filenames - $input, $overlay and $mask as input files and $output as the output filename (written to)
Can be used for many things, mostly scaling and effects.

$input string The absolute image filepath, bottom file
$overlay string The absolute image filepath, overlay file (top)
$mask string The absolute image filepath, the mask file (grayscale)
$output string The absolute image filepath, output filename (written to)
Returns: void

function wrapFileName($inputName)

Wrapping the input filename in double-quotes

$inputName string Input filename
Returns: string The output wrapped in "" (if there are spaces in the filepath)

function checkFile($file)

Returns true if the input file existed

$file string Input file to check
Returns: string Returns the filename if the file existed, otherwise empty.

function applyImageMagickToPHPGif(&$im, $command)

Applies an ImageMagick parameter to a GDlib image pointer resource by writing the resource to file, performing an IM operation upon it and reading back the result into the ImagePointer.

&$im pointer The image pointer (reference)
$command string The ImageMagick parameters. Like effects, scaling etc.
Returns: void

function gif_or_jpg($type,$w,$h)

Returns an image extension for an output image based on the number of pixels of the output and the file extension of the original file.
For example: If the number of pixels exceeds $this->pixelLimitGif (normally 10000) then it will be a "jpg" string in return.

$type string The file extension, lowercase.
$w integer The width of the output image.
$h integer The height of the output image.
Returns: string The filename, either "jpg" or "gif"/"png" (whatever $this->gifExtension is set to.)

function output($file)

Writing the internal image pointer, $this->im, to file based on the extension of the input filename
Used in GIFBUILDER
Uses $this->setup['reduceColors'] for gif/png images and $this->setup['quality'] for jpg images to reduce size/quality if needed.

$file string The filename to write to.
Returns: string Returns input filename
  @see tslib_gifBuilder::gifBuild()

function destroy()

Destroy internal image pointer, $this->im

Returns: void
  @see tslib_gifBuilder::gifBuild()

function imgTag ($imgInfo)

Returns Image Tag for input image information array.

$imgInfo array Image information array, key 0/1 is width/height and key 3 is the src value
Returns: string Image tag for the input image information array.

function ImageGif($destImg, $theImage)

Writes the input GDlib image pointer to file

$destImg pointer The GDlib image resource pointer
$theImage string The filename to write to
Returns: mixed The output of either imageGif or imagePng based on whether the $this->gifExtension was set to "gif" or "png"
  @see maskImageOntoImage(), scale(), output()

function imageCreateFromGif($sourceImg)

Creates a new GDlib image resource based on the input image filename.
If it fails creating a image from the input file a blank gray image with the dimensions of the input image will be created instead.

$sourceImg string Image filename
Returns: pointer Image Resource pointer

class.t3lib_superadmin.php

Super Admin class has functions for the administration of multiple TYPO3 sites in folders
See 'misc/superadmin.php' for details on how to use!

$Id: t3lib_api.html,v 1.2 2004/03/22 16:37:55 typo3 Exp $
Revised for TYPO3 3.6 February/2004 by Kasper Skaarhoj
XHTML Compliant

Filesize: 42 K
Func/Classes: 29
Tags: @author Kasper Skaarhoj <kasper@typo3.com>

function debug($p1,$p2='')

Debug function. Substitute since no config_default.php file is included anywhere

$p1 mixed Debug var
$p2='' string Header string
Returns: void

class t3lib_superadmin

Super Admin class has functions for the administration of multiple TYPO3 sites in folders
NOTICE: Only compliant with single MySQL database usage per installation!

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function t3lib_superadmin()

Constructor, setting GP vars

Returns: void

function init($parentDirs)

Initialize with configuration - from the 'superadmin.php' script. See misc/superadmin.php for example.

$parentDirs array Numerical array with arrays having two keys, 'dir' and 'url' where 'dir' is the absolute path to a directory with TYPO3 installations inside.
Returns: void

function defaultSet()

Main function, creating HTML content; frameset, menu, content frames.
Outputs the full HTML to browser.

Returns: void

function make()

Main function, creating page content.

Returns: string HTML content.

function setMenuItem($code,$label)

Creates menu item from input.

$code string Value for "&exp" parameter
$label string The label
Returns: string Wrapped value

function error($str)

Wrap string in red span tag (for errors)

$str string Input string
Returns: string Output string

function headerParentDir($str)

Wraps input string in <h2>

$str string Input string
Returns: string Output string, wrapped in <h2>

function headerSiteDir($str)

Wraps input string in <h3>

$str string Input string
Returns: string Output string, wrapped in <h3>

function initProcess()

Traverses the parent dirs, collecting the list of TYPO3 installations into $this->globalSiteInfo

Returns: string HTML content (The default view seen when starting the superadmin.php script)

function processSiteDir($path,$dir)

Creating information array for a specific TYPO3 installation
Information about site is stored in ->globalSiteInfo array

$path string Absolute path to installation (PATH_site)
$dir string Directory of main directory (level under PATH_site)
Returns: string HTML content with information about the site.
  @see initProcess()

function includeLocalconf($localconf)

Includes "localconf" of a TYPO3 installation an loads $this->globalSiteInfo with this information.

$localconf string Absolute path to localconf.php file to include.
Returns: array Array with information about the site.
  @see processSiteDir()

function connectToDatabase($siteInfo)

Connects to a MySQL database with the TYPO3 db host/username/password and database as found in the localconf.php file!
This is NOT compatible with DBAL and connection will obviously just fail with an error message if it turns out that the _DEFAULT handler of a site is not in a MySQL database

$siteInfo array $siteInfo array, containing username/password/host/database values.
Returns: string Array message if any

function getDBInfo($key)

Get database information, assuming standard tables like "be_users"
Adding the information to ->globalSiteInfo

$key string Key for site in ->globalSiteInfo
Returns: void
  @see processSiteDir()

function makeTable()

Creates big table with information about all installations in ->globalSiteInfo

Returns: string HTML table

function localExtensions()

Based on the globalSiteInfo array, this prints information about local extensions for each site.
In particular version number and most recent mod-time is interesting!

Returns: string HTML

function getExtensionInfo($path,$extKey,$k)

Gets information for an extension, eg. version and most-recently-edited-script

$path string Path to local extension folder
$extKey string Extension key
$k string Key to globalSiteInformation array
Returns: array Information array (unless an error occured)

function getAllFilesAndFoldersInPath($fileArr,$extPath,$extList='',$regDirs=0)

Recursively gather all files and folders of extension path.

$fileArr array Array of files to which new files are added
$extPath string Path to look up files in
$extList='' string List of file extensions to include. Blank = all
$regDirs=0 boolean If set, directories are included as well.
Returns: array $fileArr with new entries added.

function findMostRecent($fileArr,$extPath)

Creates an array with modification times of all files in $fileArr

$fileArr array Files in extension (rel path)
$extPath string Abs path prefix for files.
Returns: array Array with modification times of files (filenames are keys)

function removePrefixPathFromList($fileArr,$extPath)

Removes the absolute part of all files/folders in fileArr

$fileArr array File array
$extPath string Prefix to remove
Returns: array Modified file array (or error string)

function singleSite($exp)

Shows detailed information for a single installation of TYPO3

$exp string KEY pointing to installation
Returns: string HTML content

function loginLog($DB)

Get last-login log for database.

$DB string Database
Returns: string HTML

function log_getDetails($text,$data)

Compile log details into template string

$text string Log message (template)
$data array Data array to insert in log message
Returns: string Log details.

function rmCachedFiles($exp)

Removing temp_CACHED files for installation

$exp string KEY pointing to installation
Returns: string HTML content

function menuContent($exp)

Menu for either update/information, showing links for each installation found

$exp string Action key "update" or "info"
Returns: string HTML output.

function makeAdminLogin()

Create list of admin logins.

Returns: string HTML table

function changeAdminPasswordsForm()

For for changing admin passwords

Returns: string Form content.

function setNewPasswords()

Setting new passwords

Returns: string Status
  @see changeAdminPasswordsForm()

class.t3lib_syntaxhl.php

Syntax Highlighting class.

Filesize: 11.5 K
Func/Classes: 7
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_syntaxhl

Syntax Highlighting class.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function highLight_DS($str)

Makes syntax highlighting of a Data Structure, <T3DataStructure>

$str string Data Structure XML, must be valid since it's parsed.
Returns: string HTML code with highlighted content. Must be wrapped in <PRE> tags

function highLight_DS_markUpRecursively($struct,$parent='',$app='')

Making syntax highlighting of the parsed Data Structure XML.
Called recursively.

$struct array The structure, see splitXMLbyTags()
$parent='' string Parent tag.
$app='' string "Application" - used to denote if we are 'inside' a section
Returns: string HTML

function highLight_FF($str)

Makes syntax highlighting of a FlexForm Data, <T3FlexForms>

$str string Data Structure XML, must be valid since it's parsed.
Returns: string HTML code with highlighted content. Must be wrapped in <PRE> tags

function highLight_FF_markUpRecursively($struct,$parent='',$app='')

Making syntax highlighting of the parsed FlexForm XML.
Called recursively.

$struct array The structure, see splitXMLbyTags()
$parent='' string Parent tag.
$app='' string "Application" - used to denote if we are 'inside' a section
Returns: string HTML

function getAllTags($str)

Returning all tag names found in XML/HTML input string

$str string HTML/XML input
Returns: array Array with all found tags (starttags only)

function splitXMLbyTags($tagList,$str)

Splitting the input source by the tags listing in $tagList.
Called recursively.

$tagList string Commalist of tags to split source by (into blocks, ALL being block-tags!)
$str string Input string.
Returns: array Array with the content arranged hierarchically.

class.t3lib_tceforms.php

'TCEforms' - Class for creating the backend editing forms.

Filesize: 147 K
Func/Classes: 84
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@coauthor Rene Fritz <r.fritz@colorcube.de>
@package TYPO3
@subpackage t3lib

class t3lib_TCEforms

'TCEforms' - Class for creating the backend editing forms.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @coauthor Rene Fritz <r.fritz@colorcube.de>
  @package TYPO3
  @subpackage t3lib

function t3lib_TCEforms()

Constructor function, setting internal variables, loading the styles used.

Returns: void

function initDefaultBEmode()

Initialize various internal variables.

Returns: void

function getSoloField($table,$row,$theFieldToReturn)

Will return the TCEform element for just a single field from a record.
The field must be listed in the currently displayed fields (as found in [types][showitem]) for the record.
This also means that the $table/$row supplied must be complete so the list of fields to show can be found correctly

$table string The table name
$row array The record from the table for which to render a field.
$theFieldToReturn string The field name to return the TCEform element for.
Returns: string HTML output
  @see getMainFields()

function getMainFields($table,$row,$depth=0)

Based on the $table and $row of content, this displays the complete TCEform for the record.
The input-$row is required to be preprocessed if necessary by eg. the t3lib_transferdata class. For instance the RTE content should be transformed through this class first.

$table string The table name
$row array The record from the table for which to render a field.
$depth=0 integer Depth level
Returns: string HTML output
  @see getSoloField()

function getListedFields($table,$row,$list)

Will return the TCEform elements for a pre-defined list of fields.
Notice that this will STILL use the configuration found in the list [types][showitem] for those fields which are found there. So ideally the list of fields given as argument to this function should also be in the current [types][showitem] list of the record.
Used for displaying forms for the frontend edit icons for instance.

$table string The table name
$row array The record array.
$list string Commalist of fields from the table. These will be shown in the specified order in a form.
Returns: string TCEform elements in a string.

function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')

Creates a palette (collection of secondary options).

$table string The table name
$row array The row array
$palette string The palette number/pointer
$header='' string Header string for the palette (used when in-form). If not set, no header item is made.
$itemList='' string Optional alternative list of fields for the palette
$collapsedHeader='' string Optional Link text for activating a palette (when palettes does not have another form element to belong to).
Returns: string HTML code.

function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)

Returns the form HTML code for a database table field.

$table string The table name
$field string The field name
$row array The record to edit from the database table.
$altName='' string Alternative field name label to show.
$palette=0 boolean Set this if the field is on a palette (in top frame), otherwise not. (if set, field will render as a hidden field).
$extra='' string The "extra" options from "Part 4" of the field configurations found in the "types" "showitem" list. Typically parsed by $this->getSpecConfFromString() in order to get the options as an associative array.
$pal=0 integer The palette pointer.
Returns: mixed String (normal) or array (palettes)

function getSingleField_SW($table,$field,$row,&$PA)

Rendering a single item for the form

$table string Table name of record
$field string Fieldname to render
$row array The record
&$PA array parameters array containing a lot of stuff. Value by Reference!
Returns: string Returns the item as HTML code to insert
  @see getSingleField(), getSingleField_typeFlex_draw()

function getSingleField_typeInput($table,$field,$row,&$PA)

Generation of TCEform elements of the type "input"
This will render a single-line input form field, possibly with various control/validation features

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeText($table,$field,$row,&$PA)

Generation of TCEform elements of the type "text"
This will render a <textarea> OR RTE area form field, possibly with various control/validation features

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeCheck($table,$field,$row,&$PA)

Generation of TCEform elements of the type "check"
This will render a check-box OR an array of checkboxes

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeRadio($table,$field,$row,&$PA)

Generation of TCEform elements of the type "radio"
This will render a series of radio buttons.

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeSelect($table,$field,$row,&$PA)

Generation of TCEform elements of the type "select"
This will render a selector box element, or possibly a special construction with two selector boxes. That depends on configuration.

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeGroup($table,$field,$row,&$PA)

Generation of TCEform elements of the type "group"
This will render a selectorbox into which elements from either the file system or database can be inserted. Relations.

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeNone($table,$field,$row,&$PA)

Generation of TCEform elements of the type "none"
This will render a non-editable display of the content of the field.

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeFlex($table,$field,$row,&$PA)

Handler for Flex Forms

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)

Creates the language menu for FlexForms:

$languages [type] $languages: ...
$elName [type] $elName: ...
$selectedLanguage [type] $selectedLanguage: ...
$multi=1 [type] $multi: ...
Returns: string HTML for menu

function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)

Creates the menu for selection of the sheets:

$sArr array Sheet array for which to render the menu
$elName string Form element name of the field containing the sheet pointer
$sheetKey string Current sheet key
Returns: string HTML for menu

function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())

[Describe function...]

$dataStruct [type] $dataStruct: ...
$editData [type] $editData: ...
$cmdData [type] $cmdData: ...
$table [type] $table: ...
$field [type] $field: ...
$row [type] $row: ...
&$PA [type] $PA: ...
$formPrefix='' [type] $formPrefix: ...
$level=0 [type] $level: ...
$tRows=array() [type] $tRows: ...
Returns: [type] ...

function getSingleField_typeUnknown($table,$field,$row,&$PA)

Handler for unknown types.

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getSingleField_typeUser($table,$field,$row,&$PA)

User defined field type

$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: string The HTML code for the TCEform field

function getRTypeNum($table,$row)

Calculate and return the current "types" pointer value for a record

$table string The table name. MUST be in $TCA
$row array The row from the table, should contain at least the "type" field, if applicable.
Returns: string Return the "type" value for this record, ready to pick a "types" configuration from the $TCA array.

function rearrange($fields)

Used to adhoc-rearrange the field order normally set in the [types][showitem] list

$fields array A [types][showitem] list of fields, exploded by ","
Returns: array Returns rearranged version (keys are changed around as well.)
  @see getMainFields()

function getExcludeElements($table,$row,$typeNum)

Producing an array of field names NOT to display in the form, based on settings from subtype_value_field, bitmask_excludelist_bits etc.
Notice, this list is in NO way related to the "excludeField" flag

$table string Table name, MUST be in $TCA
$row array A record from table.
$typeNum string A "type" pointer value, probably the one calculated based on the record array.
Returns: array Array with fieldnames as values. The fieldnames are those which should NOT be displayed "anyways"
  @see getMainFields()

function getFieldsToAdd($table,$row,$typeNum)

Finds possible field to add to the form, based on subtype fields.

$table string Table name, MUST be in $TCA
$row array A record from table.
$typeNum string A "type" pointer value, probably the one calculated based on the record array.
Returns: array An array containing two values: 1) Another array containing fieldnames to add and 2) the subtype value field.
  @see getMainFields()

function mergeFieldsWithAddedFields($fields,$fieldsToAdd)

Merges the current [types][showitem] array with the array of fields to add for the current subtype field of the "type" value.

$fields array A [types][showitem] list of fields, exploded by ","
$fieldsToAdd array The output from getFieldsToAdd()
Returns: array Return the modified $fields array.
  @see getMainFields(),getFieldsToAdd()

function setTSconfig($table,$row,$field='')

Returns TSconfig for table/row
Multiple requests to this function will return cached content so there is no performance loss in calling this many times since the information is looked up only once.

$table string The table name
$row array The table row (Should at least contain the "uid" value, even if "NEW..." string. The "pid" field is important as well, and negative values will be intepreted as pointing to a record from the same table.)
$field='' string Optionally you can specify the field name as well. If that case the TSconfig for the field is returned.
Returns: mixed The TSconfig values (probably in an array)
  @see t3lib_BEfunc::getTCEFORM_TSconfig()

function getSpecConfForField($table,$row,$field)

Returns the "special" configuration (from the "types" "showitem" list) for a fieldname based on input table/record
(Not used anywhere...?)

$table string The table name
$row array The table row (Should at least contain the "uid" value, even if "NEW..." string. The "pid" field is important as well, and negative values will be intepreted as pointing to a record from the same table.)
$field string Specify the field name.
Returns: array
  @see getSpecConfFromString(), t3lib_BEfunc::getTCAtypes()

function getSpecConfFromString($extraString)

Returns the "special" configuration of an "extra" string (non-parsed)

$extraString string The "Part 4" of the fields configuration in "types" "showitem" lists.
Returns: array An array with the special options in.
  @see getSpecConfForField(), t3lib_BEfunc::getSpecConfParts()

function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')

Prints the selector box form-field for the db/file/select elements (multiple)

$fName string Form element name
$mode string Mode "db", "file" (internal_type for the "group" type) OR blank (then for the "select" type)
$allowed string Commalist of "allowed"
$itemArray array The array of items. For "select" and "group"/"file" this is just a set of value. For "db" its an array of arrays with table/uid pairs.
$selector='' string Alternative selector box.
$params=array() array An array of additional parameters, eg: "size", "info", "headers" (array with "selector" and "items"), "noBrowser", "thumbnails"
$onFocus='' string On focus attribute string
Returns: string The form fields for the selection.

function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)

Rendering wizards for form fields.

$itemKinds array Array with the real item in the first value, and an alternative item in the second value.
$wizConf array The "wizard" key from the config array for the field (from TCA)
$table string Table name
$row array The record array
$field string The field name
&$PA array Additional configuration array. (passed by reference!)
$itemName string The field name
$specConf array Special configuration if available.
$RTE=0 boolean Whether the RTE could have been loaded.
Returns: string The new item value.

function getIcon($icon)

Get icon (for example for selector boxes)

$icon string Icon reference
Returns: array Array with two values; the icon file reference, the icon file information array (getimagesize())

function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)

Wraps a string with a link to the palette.

$header string The string to wrap in an A-tag
$table string The table name for which to open the palette.
$row array The record array
$palette integer The palette pointer.
$retFunc=0 boolean Determines the output type of the function.
Returns: mixed If $retFunc is set, then returns an array with icon code and palette JavaScript function. Otherwise just the icon code.

function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')

Creates checkbox parameters

$itemName string Form element name
$thisValue integer The value of the checkbox (representing checkboxes with the bits)
$c integer Checkbox # (0-9?)
$iCount integer Total number of checkboxes in the array.
$addFunc='' string Additional JavaScript for the onclick handler.
Returns: string The onclick attribute + possibly the checked-option set.

function elName($itemName)

Returns element reference for form element name

$itemName string Form element name
Returns: string Form element reference (JS)

function noTitle($str,$wrapParts=array())

Returns the "No title" string if the input $str is empty.

$str string The string which - if empty - will become the no-title string.
$wrapParts=array() array Array with wrappin parts for the no-title output (in keys [0]/[1])
Returns: string

function blur()

Returns 'this.blur();' string, if supported.

Returns: string If the current browser supports styles, the string 'this.blur();' is returned.

function getSingleHiddenField($table,$field,$row)

Returns the form field for a single HIDDEN field.
(Not used anywhere...?)

$table string Table name
$field string Field name
$row array The row
Returns: string The hidden-field <input> tag.

function formWidth($size=48,$textarea=0)

Returns parameters to set the width for a <input>-element

$size=48 integer The abstract size value (1-48)
$textarea=0 boolean If this is for a text area.
Returns: string Either a "style" attribute string or "cols"/"size" attribute string.

function formWidthText($size=48,$wrap='')

Returns parameters to set with for a textarea field

$size=48 integer The abstract width (1-48)
$wrap='' string Empty or "off" (text wrapping in the field or not)
Returns: string The "cols" attribute string (or style from formWidth())
  @see formWidth()

function formElStyle($type)

Get style CSS values for the current field type.

$type string Field type (eg. "check", "radio", "select")
Returns: string CSS attributes

function insertDefStyle($type)

Return default "style" attribute line.

$type string Field type (eg. "check", "radio", "select")
Returns: string CSS attributes

function initItemArray($fieldValue)

Initialize item array (for checkbox, selectorbox, radio buttons)
Will resolve the label value.

$fieldValue array The "columns" array for the field (from TCA)
Returns: array An array of arrays with three elements; label, value, icon

function addItems($items,$iArray)

Merges items into an item-array

$items array The existing item array
$iArray array An array of items to add. NOTICE: The keys are mapped to values, and the values and mapped to be labels. No possibility of adding an icon.
Returns: array The updated $item array

function procItems($items,$iArray,$config,$table,$row,$field)

Perform user processing of the items arrays of checkboxes, selectorboxes and radio buttons.

$items array The array of items (label,value,icon)
$iArray array The "itemsProcFunc." from fieldTSconfig of the field.
$config array The config array for the field.
$table string Table name
$row array Record row
$field string Field name
Returns: array The modified $items array

function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)

Add selector box items of more exotic kinds.

$items array The array of items (label,value,icon)
$fieldValue array The "columns" array for the field (from TCA)
$TSconfig array TSconfig for the table/row
$field string The fieldname
Returns: array The $items array modified.

function addSelectOptionsToItemArray_makeModuleData($value)

Creates value/label pair for a backend module (main and sub)

$value string The module key
Returns: string The rawurlencoded 2-part string to transfer to interface
  @see addSelectOptionsToItemArray()

function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)

Adds records from a foreign table (for selector boxes)

$items array The array of items (label,value,icon)
$fieldValue array The 'columns' array for the field (from TCA)
$TSconfig array TSconfig for the table/row
$field string The fieldname
$pFFlag=0 boolean If set, then we are fetching the 'neg_' foreign tables.
Returns: array The $items array modified.
  @see addSelectOptionsToItemArray(), t3lib_BEfunc::exec_foreign_table_where_query()

function setFancyDesign()

Sets the fancy front-end design of the editor.
Frontend

Returns: void

function setNewBEDesign()

Sets the design to the backend design.
Backend

Returns: void

function intoTemplate($inArr,$altTemplate='')

This inserts the content of $inArr into the field-template

$inArr array Array with key/value pairs to insert in the template.
$altTemplate='' string Alternative template to use instead of the default.
Returns: string

function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)

Overwrite this function in own extended class to add own markers for output

$marker array Array with key/value pairs to insert in the template.
$table string The table name of the record
$field string The field name which this element is supposed to edit
$row array The record data array where the value(s) for the field can be found
&$PA array An array with additional configuration options.
Returns: array marker array for template output
  @see function intoTemplate()

function wrapLabels($str)

Wrapping labels
Currently not implemented - just returns input value.

$str string Input string.
Returns: string Output string.

function wrapTotal($c,$rec,$table)

Wraps all the table rows into a single table.
Used externally from scripts like alt_doc.php and db_layout.php (which uses TCEforms...)

$c string Code to output between table-parts; table rows
$rec array The record
$table string The table name
Returns: string

function replaceTableWrap($arr,$rec,$table)

This replaces markers in the total wrap

$arr array An array of template parts containing some markers.
$rec array The record
$table string The table name
Returns: string

function wrapBorder(&$out_array,&$out_pointer)

Wraps an element in the $out_array with the template row for a "section" ($this->sectionWrap)

&$out_array array The array with form elements stored in (passed by reference and changed!)
&$out_pointer integer The pointer to the entry in the $out_array (passed by reference and incremented!)
Returns: void

function rplColorScheme($inTemplate)

Replaces colorscheme markers in the template string

$inTemplate string Template string with markers to be substituted.
Returns: string

function getDivider()

Returns divider.
Currently not implemented and returns only blank value.

Returns: string

function printPalette($palArr)

Creates HTML output for a palette

$palArr array The palette array to print
Returns: string HTML output

function helpTextIcon($table,$field,$force=0)

Returns help-text ICON if configured for.

$table string The table name
$field string The field name
$force=0 boolean Force the return of the help-text icon.
Returns: string HTML, <a>-tag with

function helpText($table,$field)

Returns help text DESCRIPTION, if configured for.

$table string The table name
$field string The field name
Returns: string

function setColorScheme($scheme)

Setting the current color scheme ($this->colorScheme) based on $this->defColorScheme plus input string.

$scheme string A color scheme string.
Returns: void

function resetSchemes()

Reset color schemes.

Returns: void

function storeSchemes()

Store current color scheme

Returns: void

function restoreSchemes()

Restore the saved color scheme

Returns: void

function JStop($formname='forms[0]')

JavaScript code used for input-field evaluation.

$formname='forms[0]' string The identification of the form on the page.
Returns: string A <script></script> section with JavaScript.

function JSbottom($formname='forms[0]')

JavaScript code used for input-field evaluation.

Example use:

$msg.='Distribution time (hh:mm dd-mm-yy):<br /><input type="text" name="send_mail_datetime_hr" onchange="typo3FormFieldGet(\'send_mail_datetime\', \'datetime\', \'\', 0,0);"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).' /><input type="hidden" value="'.time().'" name="send_mail_datetime" /><br />';
$this->extJSCODE.='typo3FormFieldSet("send_mail_datetime", "datetime", "", 0,0);';

... and then include the result of this function after the form

$formname='forms[0]' string The identification of the form on the page.
Returns: string A <script></script> section with JavaScript.

function dbFileCon($formObj='document.forms[0]')

Used to connect the db/file browser with this document and the formfields on it!

$formObj='document.forms[0]' string Form object reference (including "document.")
Returns: string JavaScript functions/code (NOT contained in a <script>-element)

function printNeededJSFunctions()

Prints necessary JavaScript for TCEforms (after the form HTML).

Returns: void

function printNeededJSFunctions_top()

Returns necessary JavaScript for the top

Returns: void

function getDefaultRecord($table,$pid=0)

Gets default record. Maybe not used anymore. FE-editor?

$table string Database Tablename
$pid=0 integer PID value (positive / negative)
Returns: array "default" row.

function getRecordPath($table,$rec)

Return record path (visually formatted, using t3lib_BEfunc::getRecordPath() )

$table string Table name
$rec array Record array
Returns: string The record path.
  @see t3lib_BEfunc::getRecordPath()

function readPerms()

Returns the select-page read-access SQL clause.
Returns cached string, so you can call this function as much as you like without performance loss.

Returns: string

function sL($str)

Fetches language label for key

$str string Language label reference, eg. 'LLL:EXT:lang/locallang_core.php:labels.blablabla'
Returns: string The value of the label, fetched for the current backend language.

function getLL($str)

Returns language label from locallang_core.php
Labels must be prefixed with either "l_" or "m_".
The prefix "l_" maps to the prefix "labels." inside locallang_core.php
The prefix "m_" maps to the prefix "mess." inside locallang_core.php

$str string The label key
Returns: string The value of the label, fetched for the current backend language.

function isPalettesCollapsed($table,$palette)

Returns true, if the palette, $palette, is collapsed (not shown, but found in top-frame) for the table.

$table string The table name
$palette integer The palette pointer/number
Returns: boolean

function isDisplayCondition($displayCond,$row)

Returns true, if the evaluation of the required-field code is OK.

$displayCond string The required-field code
$row array The record to evaluate
Returns: boolean

function getTSCpid($table,$uid,$pid)

Return TSCpid (cached)
Using t3lib_BEfunc::getTSCpid()

$table string Tablename
$uid string UID value
$pid string PID value
Returns: integer Returns the REAL pid of the record, if possible. If both $uid and $pid is strings, then pid=-1 is returned as an error indication.
  @see t3lib_BEfunc::getTSCpid()

function doLoadTableDescr($table)

Returns true if descriptions should be loaded always

$table string Table for which to check
Returns: boolean

function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)

Returns an array of available languages (to use for FlexForms)

$onlyIsoCoded=1 boolean If set, only languages which are paired with a static_info_table / static_language record will be returned.
$setDefault=1 boolean If set, an array entry for a default language is set.
Returns: array

class t3lib_TCEforms_FE extends t3lib_TCEforms

Extension class for the rendering of TCEforms in the frontend

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>

function wrapLabels($str)

Function for wrapping labels.

$str string The string to wrap
Returns: string

function printPalette($palArr)

Prints the palette in the frontend editing (forms-on-page?)

$palArr array The palette array to print
Returns: string HTML output

class.t3lib_timetrack.php

Frontend Timetracking functions

Is used to register how much time is used with operations in TypoScript
Used by index_ts

Filesize: 18.3 K
Func/Classes: 16
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_tsfeBeUserAuth, tslib_fe, tslib_cObj, TSpagegen

class t3lib_timeTrack

Frontend Timetracking functions

Is used to register how much time is used with operations in TypoScript
Used by index_ts

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_tsfeBeUserAuth, tslib_fe, tslib_cObj, TSpagegen

function start()

Constructor
Sets the starting time

Returns: void

function push($tslabel, $value='')

Pushes an element to the TypoScript tracking array

$tslabel string Label string for the entry, eg. TypoScript property name
$value='' string Additional value(?)
Returns: void
  @see tslib_cObj::cObjGetSingle(), pull()

function pull($content='')

Pulls an element from the TypoScript tracking array

$content='' string The content string generated within the push/pull part.
Returns: void
  @see tslib_cObj::cObjGetSingle(), push()

function setTSlogMessage($content,$num=0)

Logs the TypoScript entry

$content string The message string
$num=0 integer Message type: 0: information, 1: message, 2: warning, 3: error
Returns: void
  @see tslib_cObj::CONTENT()

function setTSselectQuery($query,$msg)

Set TSselectQuery - for messages in TypoScript debugger.

$query string Query string
$msg string Message/Label to attach
Returns: void

function incStackPointer()

Increases the stack pointer

Returns: void
  @see decStackPointer(), TSpagegen::renderContent(), tslib_cObj::cObjGetSingle()

function decStackPointer()

Decreases the stack pointer

Returns: void
  @see incStackPointer(), TSpagegen::renderContent(), tslib_cObj::cObjGetSingle()

function mtime()

Returns the current time in milliseconds

Returns: integer

function convertMicrotime($microtime)

Returns microtime input to milliseconds

$microtime string PHP microtime string
Returns: integer

function printTSlog()

Print TypoScript parsing log

Returns: string HTML table with the information about parsing times.
  @see t3lib_tsfeBeUserAuth::extGetCategory_tsdebug()

function fixContent(&$arr, $content, $depthData='', $first=0, $vKey='')

Recursively generates the content to display

&$arr array Array which is modified with content. Reference
$content string Current content string for the level
$depthData='' string Prefixed icons for new PM icons
$first=0 boolean Set this for the first call from outside.
$vKey='' string Seems to be the previous tsStackLog key
Returns: string Returns the $content string generated/modified. Also the $arr array is modified!

function fixCLen($c,$v)

Wraps the input content string in green colored font-tags IF the length o fthe input string exceeds $this->printConf['contentLength'] (or $this->printConf['contentLength_FILE'] if $v == "FILE"

$c string The content string
$v string Command: If "FILE" then $this->printConf['contentLength_FILE'] is used for content length comparison, otherwise $this->printConf['contentLength']
Returns: string

function fw($str)

Wraps input string in a <font> tag with verdana, black and size 1

$str string The string to be wrapped
Returns: string

function createHierarchyArray(&$arr,$pointer,$uniqueId)

Helper function for internal data manipulation

&$arr array Array (passed by reference) and modified
$pointer integer Pointer value
$uniqueId string Unique ID string
Returns: void
  @see printTSlog()

function debug_typo3PrintError($header,$text,$js)

This prints out a TYPO3 error message.

$header string Header string
$text string Message string
$js boolean If set, then this will produce a alert() line for inclusion in JavaScript.
Returns: string

class.t3lib_transferdata.php

Class for getting and transforming data for display in backend forms (TCEforms)

Filesize: 33 K
Func/Classes: 19
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_transferData

Class for getting and transforming data for display in backend forms (TCEforms)

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function fetchRecord($table,$idList,$operation)

A function which can be used for load a batch of records from $table into internal memory of this object.
The function is also used to produce proper default data for new records
Ultimately the function will call renderRecord()

$table string Table name, must be found in $TCA
$idList string Comma list of id values. If $idList is "prev" then the value from $this->prevPageID is used. NOTICE: If $operation is "new", then negative ids are meant to point to a "previous" record and positive ids are PID values for new records. Otherwise (for existing records that is) it is straight forward table/id pairs.
$operation string If "new", then a record with default data is returned. Further, the $id values are meant to be PID values (or if negative, pointing to a previous record). If NOT new, then the table/ids are just pointing to an existing record!
Returns: void
  @see renderRecord()

function renderRecord($table, $id, $pid, $row)

This function performs processing on the input $row array and stores internally a corresponding array which contains processed values, ready to pass on to the TCEforms rendering in the frontend!
The objective with this function is to prepare the content for handling in TCEforms.
Default values from outside/TSconfig is added by fetchRecord(). In this function default values from TCA is used if a field is NOT defined in $row.
The resulting, processed row is stored in $this->regTableItems_data[$uniqueItemRef], where $uniqueItemRef is "[tablename]_[id-value]"

$table string The table name
$id string The uid value of the record (integer). Can also be a string (NEW-something) if the record is a NEW record.
$pid integer The pid integer. For existing records this is of course the row's "pid" field. For new records it can be either a page id (positive) or a pointer to another record from the SAME table (negative) after which the record should be inserted (or on same page)
$row array The row of the current record. If NEW record, then it may be loaded with default values (by eg. fetchRecord()).
Returns: void
  @see fetchRecord()

function renderRecord_SW($data,$fieldConfig,$TSconfig,$table,$row,$field)

Function with the switch() construct which triggers functions for processing of the data value depending on the TCA-config field type.

$data string Value to process
$fieldConfig array TCA/columns array for field (independant of TCA for flexforms - coming from XML then)
$TSconfig array TSconfig (blank for flexforms for now)
$table string Table name
$row array The row array, always of the real record (also for flexforms)
$field string The field (empty for flexforms!)
Returns: string Modified $value

function renderRecord_groupProc($data,$fieldConfig,$TSconfig,$table,$row,$field)

Processing of the data value in case the field type is "group"

$data string The field value
$fieldConfig array TCA field config
$TSconfig array TCEform TSconfig for the record
$table string Table name
$row array The row
$field string Field name
Returns: string The processed input field value ($data)
  @see renderRecord()

function renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field)

Processing of the data value in case the field type is "select"

$data string The field value
$fieldConfig array TCA field config
$TSconfig array TCEform TSconfig for the record
$table string Table name
$row array The row
$field string Field name
Returns: string The processed input field value ($data)
  @see renderRecord()

function renderRecord_flexProc($data,$fieldConfig,$TSconfig,$table,$row,$field)

Processing of the data value in case the field type is "select"

$data string The field value
$fieldConfig array TCA field config
$TSconfig array TCEform TSconfig for the record
$table string Table name
$row array The row
$field string Field name
Returns: string The processed input field value ($data)
  @see renderRecord()

function renderRecord_typesProc($totalRecordContent,$types_fieldConfig,$tscPID,$table,$pid)

Processing of the content in $totalRecordcontent based on settings in the types-configuration

$totalRecordContent array The array of values which has been processed according to their type (eg. "group" or "select")
$types_fieldConfig array The "types" configuration for the current display of fields.
$tscPID integer PAGE TSconfig PID
$table string Table name
$pid integer PID value
Returns: array The processed version of $totalRecordContent

function renderRecord_flexProc_procInData($dataPart,$dataStructArray,$pParams)

Function traversing sheets/languages for flex form data structures

$dataPart array Data array
$dataStructArray array Data Structure array
$pParams array Various parameters to pass-through
Returns: array Modified $dataPart array.
  @see t3lib_TCEmain::checkValue_flex_procInData(), renderRecord_flexProc_procInData_travDS()

function renderRecord_flexProc_procInData_travDS(&$dataValues,$DSelements,$pParams)

Traverse data array / structure

&$dataValues array Data array passed by reference.
$DSelements array Data structure
$pParams array Various parameters pass-through.
Returns: void
  @see renderRecord_flexProc_procInData(), t3lib_TCEmain::checkValue_flex_procInData_travDS()

function selectAddSpecial($dataAcc, $elements, $specialKey)

Adding "special" types to the $dataAcc array of selector items

$dataAcc array Array with numeric keys, containing values for the selector box, prepared for interface. We are going to add elements to this array as needed.
$elements array The array of original elements - basically the field value exploded by ","
$specialKey string The "special" key from the TCA config of the field. Determines the type of processing in here.
Returns: array Modified $dataAcc array
  @see renderRecord_selectProc()

function selectAddForeign($dataAcc, $elements, $fieldConfig, $field, $TSconfig, $row)

Adds the foreign record elements to $dataAcc, if any

$dataAcc array Array with numeric keys, containing values for the selector box, prepared for interface. We are going to add elements to this array as needed.
$elements array The array of original elements - basically the field value exploded by ","
$fieldConfig array Field configuration from TCA
$field string The field name
$TSconfig array TSconfig for the record
$row array The record
Returns: array Modified $dataAcc array
  @see renderRecord_selectProc()

function getDataIdList($elements, $fieldConfig, $row)

Returning the id-list processed by loadDBgroup for the foreign tables.

$elements array The array of original elements - basically the field value exploded by ","
$fieldConfig array Field configuration from TCA
$row array The data array, currently. Used to set the "local_uid" for selecting MM relation records.
Returns: array An array with ids of the records from the input elements array.

function procesItemArray($selItems,$config,$fieldTSConfig,$table,$row,$field)

Processing of selector box items. This includes the automated adding of elements plus user-function processing.

$selItems array The elements to process
$config array TCA/columns configuration
$fieldTSConfig array TSconfig for the field
$table string The table name
$row array The current row
$field string The field name
Returns: array The modified input $selItems array
  @see renderRecord_selectProc()

function addItems($items,$iArray)

Adding items from $iArray to $items array

$items array The array of selector box items to which key(value) / value(label) pairs from $iArray will be added.
$iArray array The array of elements to add. The keys will become values. The value will become the label.
Returns: array The modified input $items array
  @see procesItemArray()

function procItems($items,$itemsProcFuncTSconfig,$config,$table,$row,$field)

User processing of a selector box array of values.

$items array The array of selector box items
$itemsProcFuncTSconfig array TSconfig for the fields itemProcFunc
$config array TCA/columns configuration
$table string The table name
$row array The current row
$field string The field name
Returns: array The modified input $items array
  @see procesItemArray()

function lockRecord($table, $id, $pid=0)

Sets the lock for a record from table/id, IF $this->lockRecords is set!

$table string The table name
$id integer The id of the record
$pid=0 integer The pid of the record
Returns: void

function regItem($table, $id, $field, $content)

Dummy function, can be used to "register" records. Used by eg. the "show_item" script.

$table string Table name
$id integer Record id
$field string Field name
$content string Field content.
Returns: void
  @see renderRecord()

function sL($in)

Local wrapper function for LANG->sL (returning language labels)

$in string Language label key
Returns: string Localized label value.

class.t3lib_treeview.php

Base class for creating a browsable array/page/folder tree in HTML

Filesize: 29 K
Func/Classes: 32
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@coauthor René Fritz <r.fritz@colorcube.de>
@package TYPO3
@subpackage t3lib
@see t3lib_browsetree, t3lib_pagetree, t3lib_foldertree

class t3lib_treeView

Base class for creating a browsable array/page/folder tree in HTML

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @coauthor René Fritz <r.fritz@colorcube.de>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_browsetree, t3lib_pagetree, t3lib_foldertree

function init($clause='', $orderByFields='')

Initialize the tree class. Needs to be overwritten
Will set ->fieldsArray, ->backPath and ->clause

$clause='' string record WHERE clause
$orderByFields='' string record ORDER BY field
Returns: void

function setTreeName($treeName='')

Sets the tree name which is used to identify the tree
Used for JavaScript and other things

$treeName='' string Default is the table name. Underscores are stripped.
Returns: void

function addField($field,$noCheck=0)

Adds a fieldname to the internal array ->fieldArray

$field string Field name to
$noCheck=0 boolean If set, the fieldname will be set no matter what. Otherwise the field name must either be found as key in $TCA[$table]['columns'] or in the list ->defaultList
Returns: void

function reset()

Resets the tree, recs, ids, and ids_hierarchy internal variables. Use it if you need it.

Returns: void

function getBrowsableTree()

Will create and return the HTML code for a browsable tree
Is based on the mounts found in the internal array ->MOUNTS (set in the constructor)

Returns: string HTML code for the browsable tree

function printTree($treeArr='')

Compiles the HTML code for displaying the structure found inside the ->tree array

$treeArr='' array "tree-array" - if blank string, the internal ->tree array is used.
Returns: string The HTML code for the tree

function PMicon($row,$a,$c,$nextCount,$exp)

Generate the plus/minus icon for the browsable tree.

$row array record for the entry
$a integer The current entry number
$c integer The total number of entries. If equal to $a, a "bottom" element is returned.
$nextCount integer The number of sub-elements to the current element.
$exp boolean The element was expanded to render subelements if this flag is set.
Returns: string Image tag with the plus/minus icon.
  @see t3lib_pageTree::PMicon()

function PM_ATagWrap($icon,$cmd,$bMark='')

Wrap the plus/minus icon in a link

$icon string HTML string to wrap, probably an image tag.
$cmd string Command for 'PM' get var
$bMark='' boolean If set, the link will have a anchor point (=$bMark) and a name attribute (=$bMark)
Returns: string Link-wrapped input string

function wrapTitle($title,$row,$bank=0)

Wrapping $title in a-tags.

$title string Title string
$row string Item record
$bank=0 integer Bank pointer (which mount point number)
Returns: string

function wrapIcon($icon,$row)

Wrapping the image tag, $icon, for the row, $row (except for mount points)

$icon string The image tag for the icon
$row array The row for the current element
Returns: string The processed icon input value.

function addTagAttributes($icon,$attr)

Adds attributes to image tag.

$icon string Icon image tag
$attr string Attributes to add, eg. ' border="0"'
Returns: string Image tag, modified with $attr attributes added.

function wrapStop($str,$row)

Adds a red "+" to the input string, $str, if the field "php_tree_stop" in the $row (pages) is set

$str string Input string, like a page title for the tree
$row array record row with "php_tree_stop" field
Returns: string Modified string

function expandNext($id)

Returns true/false if the next level for $id should be expanded - based on data in $this->stored[][] and ->expandAll flag.
Extending parent function

$id integer record id/key
Returns: boolean
  @see t3lib_pageTree::expandNext()

function initializePositionSaving()

Get stored tree structure AND updating it if needed according to incoming PM GET var.

Returns: void

function savePosition()

Saves the content of ->stored (keeps track of expanded positions in the tree)
$this->treeName will be used as key for BE_USER->uc[] to store it in

Returns: void

function getRootIcon($rec)

Returns the root icon for a tree/mountpoint (defaults to the globe)

$rec array Record for root.
Returns: string Icon image tag.

function getIcon($row)

Get icon for the row.
If $this->iconPath and $this->iconName is set, try to get icon based on those values.

$row array Item row.
Returns: string Image tag.

function getTitleStr($row,$titleLen=30)

Returns the title for the input record. If blank, a "no title" labele (localized) will be returned.
Do NOT htmlspecialchar the string from this function - has already been done.

$row array The input row array (where the key "title" is used for the title)
$titleLen=30 integer Title length (30)
Returns: string The title.

function getTitleAttrib($row)

Returns the value for the image "title" attribute

$row array The input row array (where the key "title" is used for the title)
Returns: string The attribute value (is htmlspecialchared() already)
  @see wrapIcon()

function getId($row)

Returns the id from the record (typ. uid)

$row array Record array
Returns: integer The "uid" field value.

function getJumpToParm($row)

Returns jump-url parameter value.

$row array The record array.
Returns: string The jump-url parameter.

function getTree($uid, $depth=999, $depthData='',$blankLineCode='')

Fetches the data for the tree

$uid integer item id for which to select subitems (parent id)
$depth=999 integer Max depth (recursivity limit)
$depthData='' string HTML-code prefix for recursive calls.
$blankLineCode='' string ? (internal)
Returns: integer The count of items on the level

function getCount($uid)

Returns the number of records having the parent id, $uid

$uid integer id to count subitems for
Returns: integer

function getRootRecord($uid)

Returns root record for uid (<=0)

$uid integer uid, <= 0 (normally, this does not matter)
Returns: array Array with title/uid keys with values of $this->title/0 (zero)

function getRecord($uid)

Returns the record for a uid.
For tables: Looks up the record in the database.
For arrays: Returns the fake record for uid id.

$uid integer UID to look up
Returns: array The record

function getDataInit($parentId)

Getting the tree data: Selecting/Initializing data pointer to items for a certain parent id.
For tables: This will make a database query to select all children to "parent"
For arrays: This will return key to the ->dataLookup array

$parentId integer parent item id
Returns: mixed data handle (Tables: An sql-resource, arrays: A parentId integer. -1 is returned if there were NO subLevel.)

function getDataCount(&$res)

Getting the tree data: Counting elements in resource

&$res mixed data handle
Returns: integer number of items
  @see getDataInit()

function getDataNext(&$res)

Getting the tree data: next entry

&$res mixed data handle
Returns: array item data array OR FALSE if end of elements.
  @see getDataInit()

function getDataFree(&$res)

Getting the tree data: frees data handle

&$res mixed data handle
Returns: void

function setDataFromArray(&$dataArr,$traverse=FALSE,$pid=0)

Used to initialize class with an array to browse.
The array inputted will be traversed and an internal index for lookup is created.
The keys of the input array are perceived as "uid"s of records which means that keys GLOBALLY must be unique like uids are.
"uid" and "pid" "fakefields" are also set in each record.
All other fields are optional.

&$dataArr array The input array, see examples below in this script.
$traverse=FALSE boolean Internal, for recursion.
$pid=0 integer Internal, for recursion.
Returns: void

function setDataFromTreeArray(&$treeArr, &$treeLookupArr)

Sets the internal data arrays

&$treeArr array Content for $this->data
&$treeLookupArr array Content for $this->dataLookup
Returns: void

class.t3lib_tsfebeuserauth.php

TYPO3 backend user authentication in the TSFE frontend.
This includes mainly functions related to the Admin Panel

Filesize: 44 K
Func/Classes: 26
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth

TYPO3 backend user authentication in the TSFE frontend.
This includes mainly functions related to the Admin Panel

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function extInitFeAdmin()

Initialize the usage of Admin Panel.
Called from index_ts.php if a backend users is correctly logged in.
Sets $this->extAdminConfig to the "admPanel" config for the user and $this->extAdmEnabled = 1 IF access is enabled.

Returns: void

function extPrintFeAdminDialog()

Creates and returns the HTML code for the Admin Panel in the TSFE frontend.
Called from index_ts.php - in the end of the script

Returns: string HTML for the Admin Panel
  @see index_ts.php

function extGetCategory_preview($out='')

Creates the content for the "preview" section ("module") of the Admin Panel

$out='' string Optional start-value; The generated content is added to this variable.
Returns: string HTML content for the section. Consists of a string with table-rows with four columns.
  @see extPrintFeAdminDialog()

function extGetCategory_cache($out='')

Creates the content for the "cache" section ("module") of the Admin Panel

$out='' string Optional start-value; The generated content is added to this variable.
Returns: string HTML content for the section. Consists of a string with table-rows with four columns.
  @see extPrintFeAdminDialog()

function extGetCategory_publish($out='')

Creates the content for the "publish" section ("module") of the Admin Panel

$out='' string Optional start-value; The generated content is added to this variable.
Returns: string HTML content for the section. Consists of a string with table-rows with four columns.
  @see extPrintFeAdminDialog()

function extGetCategory_edit($out='')

Creates the content for the "edit" section ("module") of the Admin Panel

$out='' string Optional start-value; The generated content is added to this variable.
Returns: string HTML content for the section. Consists of a string with table-rows with four columns.
  @see extPrintFeAdminDialog()

function extGetCategory_tsdebug($out='')

Creates the content for the "tsdebug" section ("module") of the Admin Panel

$out='' string Optional start-value; The generated content is added to this variable.
Returns: string HTML content for the section. Consists of a string with table-rows with four columns.
  @see extPrintFeAdminDialog()

function extGetCategory_info($out='')

Creates the content for the "info" section ("module") of the Admin Panel

$out='' string Optional start-value; The generated content is added to this variable.
Returns: string HTML content for the section. Consists of a string with table-rows with four columns.
  @see extPrintFeAdminDialog()

function extGetHead($pre)

Returns a row (with colspan=4) which is a header for a section in the Admin Panel.
It will have a plus/minus icon and a label which is linked so that it submits the form which surrounds the whole Admin Panel when clicked, alterting the TSFE_ADMIN_PANEL[display_'.$pre.'] value
See the functions extGetCategory_*

$pre string The suffix to the display_ label. Also selects the label from the LOCAL_LANG array.
Returns: string HTML table row.
  @see extGetItem()

function extItemLink($pre,$str)

Wraps a string in a link which will open/close a certain part of the Admin Panel

$pre string The code for the display_ label/key
$str string Input string
Returns: string Linked input string
  @see extGetHead()

function extGetItem($pre,$element)

Returns a row (with 4 columns) for content in a section of the Admin Panel.
It will take $pre as a key to a label to display and $element as the content to put into the forth cell.

$pre string Key to label
$element string The HTML content for the forth table cell.
Returns: string HTML table row.
  @see extGetHead()

function extFw($str)

Wraps a string in a font-tag with verdana, size 1 and black

$str string The string to wrap
Returns: string

function ext_makeToolBar()

Creates the tool bar links for the "edit" section of the Admin Panel.

Returns: string A string containing images wrapped in <a>-tags linking them to proper functions.

function checkBackendAccessSettingsFromInitPhp()

Implementing the access checks that the typo3/init.php script does before a user is ever logged in.
Used in the frontend.

Returns: boolean Returns true if access is OK
  @see typo3/init.php, t3lib_beuserauth::backendCheckLogin()

function extPageReadAccess($pageRec)

Evaluates if the Backend User has read access to the input page record.
The evaluation is based on both read-permission and whether the page is found in one of the users webmounts. Only if both conditions are true will the function return true.
Read access means that previewing is allowed etc.
Used in index_ts.php

$pageRec array The page record to evaluate for
Returns: boolean True if read access

function extAdmModuleEnabled($key)

Checks if a Admin Panel section ("module") is available for the user. If so, true is returned.

$key string The module key, eg. "edit", "preview", "info" etc.
Returns: boolean
  @see extPrintFeAdminDialog()

function extSaveFeAdminConfig()

Saves any change in settings made in the Admin Panel.
Called from index_ts.php right after access check for the Admin Panel

Returns: void

function extGetFeAdminValue($pre,$val='')

Returns the value for a Admin Panel setting. You must specify both the module-key and the internal setting key.

$pre string Module key
$val='' string Setting key
Returns: string The setting value

function extIsAdmMenuOpen($pre)

Returns true if admin panel module is open

$pre string Module key
Returns: boolean True, if the admin panel is open for the specified admin panel module key.

function extGetTreeList($id,$depth,$begin=0,$perms_clause)

Generates a list of Page-uid's from $id. List does not include $id itself
The only pages excluded from the list are deleted pages.

$id integer Start page id
$depth integer Depth to traverse down the page tree.
$begin=0 integer $begin is an optional integer that determines at which level in the tree to start collecting uid's. Zero means 'start right away', 1 = 'next level and out'
$perms_clause string Perms clause
Returns: string Returns the list with a comma in the end (if any pages selected!)

function extGetNumberOfCachedPages($page_id)

Returns the number of cached pages for a page id.

$page_id integer The page id.
Returns: integer The number of pages for this page in the table "cache_pages"

function extGetLL($key)

Returns the label for key, $key. If a translation for the language set in $this->uc['lang'] is found that is returned, otherwise the default value.
IF the global variable $LOCAL_LANG is NOT an array (yet) then this function loads the global $LOCAL_LANG array with the content of "sysext/lang/locallang_tsfe.php" so that the values therein can be used for labels in the Admin Panel

$key string Key for a label in the $LOCAL_LANG array of "sysext/lang/locallang_tsfe.php"
Returns: string The value for the $key

function extIsEditAction()

Returns true in an edit-action is sent from the Admin Panel

Returns: boolean
  @see index_ts.php

function extIsFormShown()

Returns true if an edit form is shown on the page.
Used from index_ts.php where a true return-value will result in classes etc. being included.

Returns: boolean
  @see index_ts.php

function extEditAction()

Management of the on-page frontend editing forms and edit panels.
Basically taking in the data and commands and passes them on to the proper classes as they should be.

Returns: void
  @see index_ts.php

class.t3lib_tsparser.php

The TypoScript parser

Filesize: 25 K
Func/Classes: 13
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_tstemplate, t3lib_matchcondition, t3lib_BEfunc::getPagesTSconfig(), t3lib_userAuthGroup::fetchGroupData(), t3lib_TStemplate::generateConfig()

class t3lib_TSparser

The TypoScript parser

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_tstemplate, t3lib_matchcondition, t3lib_BEfunc::getPagesTSconfig(), t3lib_userAuthGroup::fetchGroupData(), t3lib_TStemplate::generateConfig()

function parse($string,$matchObj='')

Start parsing the input TypoScript text piece. The result is stored in $this->setup

$string string The TypoScript text
$matchObj='' object If is object (instance of t3lib_matchcondition), then this is used to match conditions found in the TypoScript code. If matchObj not specified, then no conditions will work! (Except [GLOBAL])
Returns: void

function nextDivider()

Will search for the next condition. When found it will return the line content (the condition value) and have advanced the internal $this->rawP pointer to point to the next line after the condition.

Returns: string The condition value
  @see parse()

function parseSub(&$setup)

Parsing the $this->raw TypoScript lines from pointer, $this->rawP

&$setup array Reference to the setup array in which to accumulate the values.
Returns: string Returns the string of the condition found, the exit signal or possible nothing (if it completed parsing with no interruptions)

function rollParseSub($string,&$setup)

Parsing of TypoScript keys inside a curly brace where the key is composite of at least two keys, thus having to recursively call itself to get the value

$string string The object sub-path, eg "thisprop.another_prot"
&$setup array The local setup array from the function calling this function
Returns: string Returns the exitSignal
  @see parseSub()

function getVal($string,$setup)

Get a value/property pair for an object path in TypoScript, eg. "myobject.myvalue.mysubproperty". Here: Used by the "copy" operator, <

$string string Object path for which to get the value
$setup array Global setup code if $string points to a global object path. But if string is prefixed with "." then its the local setup array.
Returns: array An array with keys 0/1 being value/property respectively

function setVal($string,&$setup,$value,$wipeOut=0)

Setting a value/property of an object string in the setup array.

$string string The object sub-path, eg "thisprop.another_prot"
&$setup array The local setup array from the function calling this function.
$value array The value/property pair array to set. If only one of them is set, then the other is not touched (unless $wipeOut is set, which it is when copies are made which must include both value and property)
$wipeOut=0 boolean If set, then both value and property is wiped out when a copy is made of another value.
Returns: void

function error($err,$num=2)

Stacks errors/messages from the TypoScript parser into an internal array, $this->error
If "TT" is a global object (as it is in the frontend when backend users are logged in) the message will be registered here as well.

$err string The error message string
$num=2 integer The error severity (in the scale of $GLOBALS['TT']->setTSlogMessage: Approx: 2=warning, 1=info, 0=nothing, 3=fatal.)
Returns: void

function checkIncludeLines($string)

Checks the input string (un-parsed TypoScript) for include-commands ("<INCLUDE_TYPOSCRIPT: ....")
Use: t3lib_TSparser::checkIncludeLines()

$string string Unparsed TypoScript
Returns: string Complete TypoScript with includes added.

function checkIncludeLines_array($array)

Parses the string in each value of the input array for include-commands

$array array Array with TypoScript in each value
Returns: array Same array but where the values has been parsed for include-commands

function doSyntaxHighlight($string,$lineNum='',$highlightBlockMode=0)

Syntax highlight a TypoScript text
Will parse the content. Remember, the internal setup array may contain INvalid parsed content since conditions are ignored!

$string string The TypoScript text
$lineNum='' mixed If blank, linenumbers are NOT printed. If array then the first key is the linenumber offset to add to the internal counter.
$highlightBlockMode=0 boolean If set, then the highlighted output will be formatted in blocks based on the brace levels. prespace will be ignored and empty lines represented with a single no-break-space.
Returns: string HTML code for the syntax highlighted string

function regHighLight($code,$pointer,$strlen=-1)

Registers a part of a TypoScript line for syntax highlighting.

$code string Key from the internal array $this->highLightStyles
$pointer integer Pointer to the line in $this->raw which this is about
$strlen=-1 integer The number of chars LEFT on this line before the end is reached.
Returns: void
  @see parse()

function syntaxHighlight_print($lineNumDat,$highlightBlockMode)

Formatting the TypoScript code in $this->raw based on the data collected by $this->regHighLight in $this->highLightData

$lineNumDat mixed If blank, linenumbers are NOT printed. If array then the first key is the linenumber offset to add to the internal counter.
$highlightBlockMode boolean If set, then the highlighted output will be formatted in blocks based on the brace levels. prespace will be ignored and empty lines represented with a single no-break-space.
Returns: string HTML content
  @see doSyntaxHighlight()

class.t3lib_tstemplate.php

Template object that is responsible for generating the TypoScript template based on template records.

Filesize: 56 K
Func/Classes: 25
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see t3lib_tsparser.php, t3lib_matchcondition.php

class t3lib_TStemplate

Template object that is responsible for generating the TypoScript template based on template records.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see t3lib_tsparser.php, t3lib_matchcondition.php

function init()

Initialize
MUST be called directly after creating a new template-object

Returns: void
  @see tslib_fe::initTemplate()

function getCurrentPageData()

Fetches the "currentPageData" array from cache

NOTE about currentPageData:
It holds information about the TypoScript conditions along with the list of template uid's which is used on the page.
In the getFromCache function in TSFE, currentPageData is used to evaluate if there is a template and if the matching conditions are alright
Unfortunately this does not take into account if the templates in the rowSum of currentPageData has changed composition, eg. due to hidden fields or start/end time.
So if a template is hidden or times out, it'll not be discovered unless the page is regenerated - at least the this->start function must be called, because this will make a new portion of data in currentPageData string

Returns: mixed The array $this->currentPageData if found cached in "cache_pagesection". If the string "none" was returned it means the array must be generated and stored in the cache-table
  @see start(), t3lib_fe::getFromCache()

function matching($cc)

Fetches data about which TypoScript-matches there are at this page. Then it performs a matchingtest.

$cc array An array with three keys, "all", "rowSum" and "rootLine" - all coming from the $this->currentPageData array
Returns: array The input array but with a new key added, "match" which contains the items from the "all" key which when passed to tslib_matchCondition returned true.
  @see t3lib_matchCondition, t3lib_fe::getFromCache()

function start($theRootLine)

This is all about fetching the right TypoScript template structure. If it's not cached then it must be generated and cached!
The method traverse the rootline structure from out to in, fetches the hierarchy of template records and based on this either finds the cached TypoScript template structure or parses the template and caches it for next time.
Sets $this->setup to the parsed TypoScript Template array

$theRootLine array The rootline of the current page (going ALL the way to tree root)
Returns: void
  @see tslib_fe::getConfigArray()

function runThroughTemplates($theRootLine,$start_template_uid=0)

Traverses the rootLine from the root and out. For each page it checks if there is a template record. If there is a template record, $this->processTemplate() is called.
Resets and affects internal variables like $this->constants, $this->config, $this->editorcfg and $this->rowSum
Also creates $this->rootLine which is a root line stopping at the root template (contrary to $GLOBALS['TSFE']->rootLine which goes all the way to the root of the tree

$theRootLine array The rootline of the current page (going ALL the way to tree root)
$start_template_uid=0 integer Set specific template record UID to select; this is only for debugging/development/analysis use in backend modules like "Web > Template". For parsing TypoScript templates in the frontend it should be 0 (zero)
Returns: void
  @see start()

function processTemplate($row, $idList,$pid,$templateID='',$templateParent='')

Checks if the template ($row) has some included templates and after including them it fills the arrays with the setup
Builds up $this->rowSum

$row array A full TypoScript template record (sys_template/static_template/forged "dummy" record made from static template file)
$idList string A list of already processed template ids including the current; The list is on the form "[prefix]_[uid]" where [prefix] is "sys" for "sys_template" records, "static" for "static_template" records and "ext_" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.
$pid array The PID of the input template record
$templateID='' string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
$templateParent='' string Parent template id (during recursive call); Same syntax as $idList ids, eg. "sys_123"
Returns: void
  @see runThroughTemplates()

function includeStaticTypoScriptSources($idList,$templateID,$pid,$row)

Includes static template records (from static_template table) and static template files (from extensions) for the input template record row.

$idList string A list of already processed template ids including the current; The list is on the form "[prefix]_[uid]" where [prefix] is "sys" for "sys_template" records, "static" for "static_template" records and "ext_" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.
$templateID string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
$pid array The PID of the input template record
$row array A full TypoScript template record
Returns: void
  @see processTemplate()

function addExtensionStatics($idList,$templateID,$pid,$row)

Adds the default TypoScript files for extensions if any.

$idList string A list of already processed template ids including the current; The list is on the form "[prefix]_[uid]" where [prefix] is "sys" for "sys_template" records, "static" for "static_template" records and "ext_" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.
$templateID string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
$pid array The PID of the input template record
$row array A full TypoScript template record
Returns: void
  @see includeStaticTypoScriptSources()

function prependStaticExtra($subrow)

Appends (not prepends) additional TypoScript code to static template records/files as set in TYPO3_CONF_VARS
For records the "uid" value is the integer of the "static_template" record
For files the "uid" value is the extension key but with any underscores removed. Possibly with a path if its a static file selected in the template record

$subrow array Static template record/file
Returns: array Returns the input array where the values for keys "config", "constants" and "editorcfg" may have been modified with prepended code.
  @see addExtensionStatics(), includeStaticTypoScriptSources()

function generateConfig()

Generates the configuration array by replacing constants and parsing the whole thing.
Depends on $this->config and $this->constants to be set prior to this! (done by processTemplate/runThroughTemplates)

Returns: void
  @see t3lib_TSparser, start()

function procesIncludes()

Searching TypoScript code text (for constants, config (Setup) and editorcfg) for include instructions and does the inclusion if needed.
Modifies

Returns: void
  @see t3lib_TSparser, generateConfig()

function mergeConstantsFromPageTSconfig($constArray)

Loads Page TSconfig until the outermost template record and parses the configuration - if TSFE.constants object path is found it is merged with the default data in here!

$constArray array Constants array, default input.
Returns: array Constants array, modified
  @todo Apply caching to the parsed Page TSconfig. This is done in the other similar functions for both frontend and backend. However, since this functions works for BOTH frontend and backend we will have to either write our own local caching function or (more likely) detect if we are in FE or BE and use caching functions accordingly. Not having caching affects mostly the backend modules inside the "Template" module since the overhead in the frontend is only seen when TypoScript templates are parsed anyways (after which point they are cached anyways...)

function flattenSetup($setupArray, $prefix, $resourceFlag)

This flattens a hierarchical TypoScript array to $this->flatSetup

$setupArray array TypoScript array
$prefix string Prefix to the object path. Used for recursive calls to this function.
$resourceFlag boolean If set, then the constant value will be resolved as a TypoScript "resource" data type. Also used internally during recursive calls so that all subproperties for properties named "file." will be resolved as resources.
Returns: void
  @see generateConfig()

function substituteConstants($all)

Substitutes the constants from $this->flatSetup in the text string $all

$all string TypoScript code text string
Returns: string The processed string with all constants found in $this->flatSetup as key/value pairs substituted.
  @see generateConfig(), flattenSetup()

function splitConfArray($conf,$splitCount)

Implementation of the "optionSplit" feature in TypoScript (used eg. for MENU objects)
What it does is to split the incoming TypoScript array so that the values are exploded by certain strings ("||" and "|*|") and each part distributed into individual TypoScript arrays with a similar structure, but individualized values.
The concept is known as "optionSplit" and is rather advanced to handle but quite powerful, in particular for creating menus in TYPO3.

$conf array A TypoScript array
$splitCount integer The number of items for which to generated individual TypoScript arrays
Returns: array The individualized TypoScript array.
  @see tslib_cObj::IMGTEXT(), tslib_menu::procesItemStates()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=289&cHash=6604390b37

function getFileName($fileFromSetup)

Returns the reference to a 'resource' in TypoScript.
This could be from the filesystem if '/' is found in the value $fileFromSetup, else from the resource-list

$fileFromSetup string TypoScript "resource" data type value.
Returns: string Resulting filename, if any.

function extractFromResources($res,$file)

Searches for the TypoScript resource filename in the list of resource filenames.

$res string The resource file name list (from $this->setup['resources'])
$file string The resource value to match
Returns: string If found, this will be the resource filename that matched. Typically this file is found in "uploads/tf/"
  @see getFileName()

function checkFile($name,$menuArr)

CheckFile runs through the $menuArr and checks every file-reference in $name
(Not used anywhere)

$name string Property name in the menu array
$menuArr array Menu array to traverse
Returns: array Modified menu array
  @depreciated
  @internal

function printTitle($title,$no_title=0,$titleFirst=0)

Compiles the content for the page <title> tag.

$title string The input title string, typically the "title" field of a page's record.
$no_title=0 boolean If set, then only the site title is outputted (from $this->setup['sitetitle'])
$titleFirst=0 boolean If set, then "sitetitle" and $title is swapped
Returns: string The page title on the form "[sitetitle]: [input-title]". Not htmlspecialchar()'ed.
  @see tslib_fe::tempPageCacheContent(), TSpagegen::renderContentWithHeader()

function fileContent($fName)

Reads the fileContent of $fName and returns it.
The same as t3lib_div::getUrl()

$fName string Absolute filepath to record
Returns: string The content returned
  @see tslib_cObj::fileResource(), tslib_cObj::MULTIMEDIA(), t3lib_div::getUrl()

function wrap($content,$wrap)

Ordinary "wrapping" function. Used in the tslib_menu class and extension classes instead of the similar function in tslib_cObj

$content string The content to wrap
$wrap string The wrap value, eg. "<b> | </b>"
Returns: string Wrapped input string
  @see tslib_menu, tslib_cObj::wrap()

function linkData($page,$oTarget,$no_cache,$script,$overrideArray='',$addParams='',$typeOverride='')

The mother of all functions creating links/URLs etc in a TypoScript environment.
See the references below.
Basically this function takes care of issues such as type,id,alias and Mount Points, simulate static documents, M5/B6 encoded parameters etc.
It is important to pass all links created through this function since this is the guarantee that globally configured settings for link creating are observed and that your applications will conform to the various/many configuration options in TypoScript Templates regarding this.

$page array The page record of the page to which we are creating a link. Needed due to fields like uid, alias, target, no_cache, title and sectionIndex_uid.
$oTarget string Default target string to use IF not $page['target'] is set.
$no_cache boolean If set, then the "&no_cache=1" parameter is included in the URL.
$script string Alternative script name if you don't want to use $GLOBALS['TSFE']->config['mainScript'] (normally set to "index.php")
$overrideArray='' array Array with overriding values for the $page array.
$addParams='' string Additional URL parameters to set in the URL. Syntax is "&foo=bar&foo2=bar2" etc. Also used internally to add parameters if needed.
$typeOverride='' string If you set this value to something else than a blank string, then the typeNumber used in the link will be forced to this value. Normally the typeNum is based on the target set OR on $GLOBALS['TSFE']->config['config']['forceTypeValue'] if found.
Returns: array Contains keys like "totalURL", "url", "sectionIndex", "linkVars", "no_cache", "type", "target" of which "totalURL" is normally the value you would use while the other keys contains various parts that was used to construct "totalURL"
  @see tslib_frameset::frameParams(), tslib_cObj::typoLink(), tslib_cObj::SEARCHRESULT(), TSpagegen::pagegenInit(), tslib_menu::link()

function removeQueryString($url)

Removes the "?" of input string IF the "?" is the last character.

$url string Input string
Returns: string Output string, free of "?" in the end, if any such character.
  @see linkData(), tslib_frameset::frameParams()

function sortedKeyList($setupArr)

Takes a TypoScript array as input and returns an array which contains all integer properties found which had a value (not only properties). The output array will be sorted numerically.
Call it like t3lib_TStemplate::sortedKeyList()

$setupArr array TypoScript array with numerical array in
Returns: array An array with all integer properties listed in numeric order.
  @see tslib_cObj::cObjGet(), tslib_gifBuilder, tslib_imgmenu::makeImageMap()

class.t3lib_userauth.php

Authentication of users in TYPO3

This class is used to authenticate a login user.
The class is used by both the frontend and backend. In both cases this class is a parent class to beuserauth and feuserauth

See Inside TYPO3 for more information about the API of the class and internal variables.

Filesize: 28 K
Func/Classes: 18
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_userAuth

Authentication of users in TYPO3

This class is used to authenticate a login user.
The class is used by both the frontend and backend. In both cases this class is a parent class to beuserauth and feuserauth

See Inside TYPO3 for more information about the API of the class and internal variables.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function start()

Starts a user session
Typical configurations will:
a) check if session cookie was set and if not, set one,
b) check if a password/username was sent and if so, try to authenticate the user
c) Lookup a session attached to a user and check timeout etc.
d) Garbage collection, setting of no-cache headers.
If a user is authenticated the database record of the user (array) will be set in the ->user internal variable.

Returns: void

function check_authentication()

Checks if a submission of username and password is present

Returns: string Returns "login" if login, "logout" if logout, or empty if $F_status was none of these values.
  @internal

function redirect()

Redirect to somewhere. Obsolete, depreciated etc.

Returns: void

function logoff()

Log out current user!
Removes the current session record, sets the internal ->user array to a blank string; Thereby the current user (if any) is effectively logged out!

Returns: void

function gc()

Garbage collector, removing old expired sessions.

Returns: void
  @internal

function user_where_clause()

This returns the where-clause needed to select the user with respect flags like deleted, hidden, starttime, endtime

Returns: string

function ipLockClause()

This returns the where-clause needed to lock a user to the IP address

Returns: string

function writeUC($variable='')

This writes $variable to the user-record. This is a way of providing session-data.
You can fetch the data again through $this->uc in this class!
If $variable is not an array, $this->uc is saved!

$variable='' array An array you want to store for the user as session data. If $variable is not supplied (is blank string), the internal variable, ->uc, is stored by default
Returns: void

function writelog($type,$action,$error,$details_nr,$details,$data,$tablename,$recuid,$recpid)

DUMMY: Writes to log database table (in some extension classes)

$type integer $type: denotes which module that has submitted the entry. This is the current list: 1=tce_db; 2=tce_file; 3=system (eg. sys_history save); 4=modules; 254=Personal settings changed; 255=login / out action: 1=login, 2=logout, 3=failed login (+ errorcode 3), 4=failure_warning_email sent
$action integer $action: denotes which specific operation that wrote the entry (eg. 'delete', 'upload', 'update' and so on...). Specific for each $type. Also used to trigger update of the interface. (see the log-module for the meaning of each number !!)
$error integer $error: flag. 0 = message, 1 = error (user problem), 2 = System Error (which should not happen), 3 = security notice (admin)
$details_nr integer $details_nr: The message number. Specific for each $type and $action. in the future this will make it possible to translate errormessages to other languages
$details string $details: Default text that follows the message
$data array $data: Data that follows the log. Might be used to carry special information. If an array the first 5 entries (0-4) will be sprintf'ed the details-text...
$tablename string $tablename: Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
$recuid integer $recuid: Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
$recpid integer $recpid: Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
Returns: void
  @see t3lib_userauthgroup::writelog()

function checkLogFailures()

DUMMY: Check login failures (in some extension classes)

Returns: void

function unpack_uc($theUC='')

Sets $theUC as the internal variable ->uc IF $theUC is an array. If $theUC is false, the 'uc' content from the ->user array will be unserialized and restored in ->uc

$theUC='' mixed If an array, then set as ->uc, otherwise load from user record
Returns: void

function pushModuleData($module,$data,$noSave=0)

Stores data for a module.
The data is stored with the session id so you can even check upon retrieval if the module data is from a previous session or from the current session.

$module string $module is the name of the module ($MCONF['name'])
$data mixed $data is the data you want to store for that module (array, string, ...)
$noSave=0 boolean If $noSave is set, then the ->uc array (which carries all kinds of user data) is NOT written immediately, but must be written by some subsequent call.
Returns: void

function getModuleData($module,$type='')

Gets module data for a module (from a loaded ->uc array)

$module string $module is the name of the module ($MCONF['name'])
$type='' string If $type = 'ses' then module data is returned only if it was stored in the current session, otherwise data from a previous session will be returned (if available).
Returns: mixed The module data if available: $this->uc['moduleData'][$module];

function getSessionData($key)

Returns the session data stored for $key.
The data will last only for this login session since it is stored in the session table.

$key string Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
Returns: mixed

function setAndSaveSessionData($key,$data)

Sets the session data ($data) for $key and writes all session data (from ->user['ses_data']) to the database.
The data will last only for this login session since it is stored in the session table.

$key string Pointer to an associative key in the session data array which is stored serialized in the field "ses_data" of the session table.
$data mixed The variable to store in index $key
Returns: void

function setBeUserByUid($uid)

Raw initialization of the be_user with uid=$uid
This will circumvent all login procedures and select a be_users record from the database and set the content of ->user to the record selected. Thus the BE_USER object will appear like if a user was authenticated - however without a session id and the fields from the session table of course.
Will check the users for disabled, start/endtime, etc. ($this->user_where_clause())

$uid integer The UID of the backend user to set in ->user
Returns: void
  @params integer 'uid' of be_users record to select and set.
  @internal
  @see SC_mod_tools_be_user_index::compareUsers(), SC_mod_user_setup_index::simulateUser(), freesite_admin::startCreate()

function setBeUserByName($name)

Raw initialization of the be_user with username=$name

$name string The username to look up.
Returns: void
  @see t3lib_userAuth::setBeUserByUid()
  @internal

class.t3lib_userauthgroup.php

Extension to class.t3lib_userauth.php; Authentication of users in TYPO3 Backend

Actually this class is extended again by t3lib_beuserauth which is the actual backend user class that will be instantiated.
In fact the two classes t3lib_beuserauth and this class could just as well be one, single class since t3lib_userauthgroup is not - to my knowledge - used separately elsewhere. But for historical reasons they are two separate classes.

Filesize: 38 K
Func/Classes: 25
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class t3lib_userAuthGroup extends t3lib_userAuth

Extension to class.t3lib_userauth.php; Authentication of users in TYPO3 Backend

Actually this class is extended again by t3lib_beuserauth which is the actual backend user class that will be instantiated.
In fact the two classes t3lib_beuserauth and this class could just as well be one, single class since t3lib_userauthgroup is not - to my knowledge - used separately elsewhere. But for historical reasons they are two separate classes.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function isAdmin()

Returns true if user is admin
Basically this function evaluates if the ->user[admin] field has bit 0 set. If so, user is admin.

Returns: boolean

function isMemberOfGroup($groupId)

Returns true if the current user is a member of group $groupId
$groupId must be set. $this->groupList must contain groups
Will return true also if the user is a member of a group through subgroups.

$groupId integer Group ID to look for in $this->groupList
Returns: boolean

function doesUserHaveAccess($row,$perms)

Checks if the permissions is granted based on a page-record ($row) and $perms (binary and'ed)

Bits for permissions, see $perms variable:

1 - Show: See/Copy page and the pagecontent.
16- Edit pagecontent: Change/Add/Delete/Move pagecontent.
2- Edit page: Change/Move the page, eg. change title, startdate, hidden.
4- Delete page: Delete the page and pagecontent.
8- New pages: Create new pages under the page.

$row array $row is the pagerow for which the permissions is checked
$perms integer $perms is the binary representation of the permission we are going to check. Every bit in this number represents a permission that must be set. See function explanation.
Returns: boolean True or False upon evaluation

function isInWebMount($id,$readPerms='',$exitOnError=0)

Checks if the page id, $id, is found within the webmounts set up for the user.
This should ALWAYS be checked for any page id a user works with, whether it's about reading, writing or whatever.
The point is that this will add the security that a user can NEVER touch parts outside his mounted pages in the page tree. This is otherwise possible if the raw page permissions allows for it. So this security check just makes it easier to make safe user configurations.
If the user is admin OR if this feature is disabled (fx. by setting TYPO3_CONF_VARS['BE']['lockBeUserToDBmounts']=0) then it returns "1" right away
Otherwise the function will return the uid of the webmount which was first found in the rootline of the input page $id

$id integer Page ID to check
$readPerms='' string Content of "->getPagePermsClause(1)" (read-permissions). If not set, they will be internally calculated (but if you have the correct value right away you can save that database lookup!)
$exitOnError=0 boolean If set, then the function will exit with an error message.
Returns: integer The page UID of a page in the rootline that matched a mount point

function modAccess($conf,$exitOnError)

Checks access to a backend module with the $MCONF passed as first argument

$conf array $MCONF array of a backend module!
$exitOnError boolean If set, an array will issue an error message and exit.
Returns: boolean Will return true if $MCONF['access'] is not set at all, if the BE_USER is admin or if the module is enabled in the be_users/be_groups records of the user (specifically enabled). Will return false if the module name is not even found in $TBE_MODULES

function getPagePermsClause($perms)

Returns a WHERE-clause for the pages-table where user permissions according to input argument, $perms, is validated.
$perms is the 'mask' used to select. Fx. if $perms is 1 then you'll get all pages that a user can actually see!
2^0 = show (1)
2^1 = edit (2)
2^2 = delete (4)
2^3 = new (8)
If the user is 'admin' " 1=1" is returned (no effect)
If the user is not set at all (->user is not an array), then " 1=0" is returned (will cause no selection results at all)
The 95% use of this function is "->getPagePermsClause(1)" which will return WHERE clauses for *selecting* pages in backend listings - in other words will this check read permissions.

$perms integer Permission mask to use, see function description
Returns: string Part of where clause. Prefix " AND " to this.

function calcPerms($row)

Returns a combined binary representation of the current users permissions for the page-record, $row.
The perms for user, group and everybody is OR'ed together (provided that the page-owner is the user and for the groups that the user is a member of the group
If the user is admin, 31 is returned (full permissions for all five flags)

$row array Input page row with all perms_* fields available.
Returns: integer Bitwise representation of the users permissions in relation to input page row, $row

function isRTE()

Returns true if the RTE (Rich Text Editor) can be enabled for the user
Strictly this is not permissions being checked but rather a series of settings like a loaded extension, browser/client type and a configuration option in ->uc[edit_RTE]

Returns: boolean

function check ($type,$value)

Returns true if the $value is found in the list in a $this->groupData[] index pointed to by $type (array key).
Can thus be users to check for modules, exclude-fields, select/modify permissions for tables etc.
If user is admin true is also returned
Please see the document Inside TYPO3 for examples.

$type string The type value; "webmounts", "filemounts", "pagetypes_select", "tables_select", "tables_modify", "non_exclude_fields", "modules"
$value string String to search for in the groupData-list
Returns: boolean True if permission is granted (that is, the value was found in the groupData list - or the BE_USER is "admin")

function isPSet($lCP,$table,$type='')

Will check a type of permission against the compiled permission integer, $lCP, and in relation to table, $table

$lCP integer $lCP could typically be the "compiled permissions" integer returned by ->calcPerms
$table string $table is the tablename to check: If "pages" table then edit,new,delete and editcontent permissions can be checked. Other tables will be checked for "editcontent" only (and $type will be ignored)
$type='' string For $table='pages' this can be 'edit' (2), 'new' (8 or 16), 'delete' (4), 'editcontent' (16). For all other tables this is ignored. (16 is used)
Returns: boolean

function mayMakeShortcut()

Returns true if the BE_USER is allowed to *create* shortcuts in the backend modules

Returns: boolean

function getTSConfig($objectString,$config='')

Returns the value/properties of a TS-object as given by $objectString, eg. 'options.dontMountAdminMounts'
Nice (general!) function for returning a part of a TypoScript array!

$objectString string Pointer to an "object" in the TypoScript array, fx. 'options.dontMountAdminMounts'
$config='' array Optional TSconfig array: If array, then this is used and not $this->userTS. If not array, $this->userTS is used.
Returns: array An array with two keys, "value" and "properties" where "value" is a string with the value of the objectsting and "properties" is an array with the properties of the objectstring.
  @params array An array with the TypoScript where the $objectString is located. If this argument is not an array, then internal ->userTS (User TSconfig for the current BE_USER) will be used instead.

function getTSConfigVal($objectString)

Returns the "value" of the $objectString from the BE_USERS "User TSconfig" array

$objectString string Object string, eg. "somestring.someproperty.somesubproperty"
Returns: string The value for that object string (object path)
  @see getTSConfig()

function getTSConfigProp($objectString)

Returns the "properties" of the $objectString from the BE_USERS "User TSconfig" array

$objectString string Object string, eg. "somestring.someproperty.somesubproperty"
Returns: array The properties for that object string (object path) - if any
  @see getTSConfig()

function inList($in_list,$item)

Returns true if $item is in $in_list

$in_list string Comma list with items, no spaces between items!
$item string The string to find in the list of items
Returns: string Boolean

function returnWebmounts()

Returns an array with the webmounts.
If no webmounts, and empty array is returned.

Returns: array

function returnFilemounts()

Returns an array with the filemounts for the user. Each filemount is represented with an array of a "name", "path" and "type".
If no filemounts an empty array is returned.

Returns: array

function fetchGroupData()

Initializes a lot of stuff like the access-lists, database-mountpoints and filemountpoints
This method is called by ->backendCheckLogin() (from extending class t3lib_beuserauth) if the backend user login has verified OK.

Returns: void
  @see t3lib_TSparser

function fetchGroups($grList,$idList='')

Fetches the group records, subgroups and fills internal arrays.
Function is called recursively to fetch subgroups

$grList string Commalist of be_groups uid numbers
$idList='' string List of already processed be_groups-uids so the function will not fall into a eternal recursion.
Returns: void

function setCachedList($cList)

Updates the field be_users.usergroup_cached_list if the groupList of the user has changed/is different from the current list.
The field "usergroup_cached_list" contains the list of groups which the user is a member of. After authentication (where these functions are called...) one can depend on this list being a representation of the exact groups/subgroups which the BE_USER has membership with.

$cList string The newly compiled group-list which must be compared with the current list in the user record and possibly stored if a difference is detected.
Returns: void

function addFileMount($title, $altTitle, $path, $webspace, $type)

Adds a filemount to the users array of filemounts, $this->groupData['filemounts'][hash_key] = Array ('name'=>$name, 'path'=>$path, 'type'=>$type);
Is a part of the authentication proces of the user.
A final requirement for a path being mounted is that a) it MUST return true on is_dir(), b) must contain either PATH_site+'fileadminDir' OR 'lockRootPath' - if lockRootPath is set - as first part of string!
Paths in the mounted information will always be absolute and have a trailing slash.

$title string $title will be the (root)name of the filemount in the folder tree
$altTitle string $altTitle will be the (root)name of the filemount IF $title is not true (blank or zero)
$path string $path is the path which should be mounted. Will accept backslash in paths on windows servers (will substituted with forward slash). The path should be 1) relative to TYPO3_CONF_VARS[BE][fileadminDir] if $webspace is set, otherwise absolute.
$webspace boolean If $webspace is set, the $path is relative to 'fileadminDir' in TYPO3_CONF_VARS, otherwise $path is absolute. 'fileadminDir' must be set to allow mounting of relative paths.
$type string Type of filemount; Can be blank (regular) or "user" / "group" (for user and group filemounts presumably). Probably sets the icon first and foremost.
Returns: boolean Returns "1" if the requested filemount was mounted, otherwise no return value.

function addTScomment($str)

Creates a TypoScript comment with the string text inside.

$str string The text to wrap in comment prefixes and delimiters.
Returns: string TypoScript comment with the string text inside.

function writelog($type,$action,$error,$details_nr,$details,$data,$tablename='',$recuid='',$recpid='',$event_pid=-1,$NEWid='')

Writes an entry in the logfile
... Still missing documentation for syntax etc...

$type integer $type: denotes which module that has submitted the entry. This is the current list: 1=tce_db; 2=tce_file; 3=system (eg. sys_history save); 4=modules; 254=Personal settings changed; 255=login / out action: 1=login, 2=logout, 3=failed login (+ errorcode 3), 4=failure_warning_email sent
$action integer $action: denotes which specific operation that wrote the entry (eg. 'delete', 'upload', 'update' and so on...). Specific for each $type. Also used to trigger update of the interface. (see the log-module for the meaning of each number !!)
$error integer $error: flag. 0 = message, 1 = error (user problem), 2 = System Error (which should not happen), 3 = security notice (admin)
$details_nr integer $details_nr: The message number. Specific for each $type and $action. in the future this will make it possible to translate errormessages to other languages
$details string $details: Default text that follows the message
$data array $data: Data that follows the log. Might be used to carry special information. If an array the first 5 entries (0-4) will be sprintf'ed the details-text...
$tablename='' string $tablename: Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
$recuid='' integer $recuid: Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
$recpid='' integer $recpid: Special field used by tce_main.php. These ($tablename, $recuid, $recpid) holds the reference to the record which the log-entry is about. (Was used in attic status.php to update the interface.)
$event_pid=-1 integer $event_pid: The page_uid (pid) where the event occurred. Used to select log-content for specific pages.
$NEWid='' string $NEWid: NEWid string
Returns: void

function checkLogFailures($email, $secondsBack=3600, $max=3)

Sends a warning to $email if there has been a certain amount of failed logins during a period.
If a login fails, this function is called. It will look up the sys_log to see if there has been more than $max failed logins the last $secondsBack seconds (default 3600). If so, an email with a warning is sent to $email.

$email string Email address
$secondsBack=3600 integer Number of sections back in time to check. This is a kind of limit for how many failures an hour for instance.
$max=3 integer Max allowed failures before a warning mail is sent
Returns: void

class.t3lib_xml.php

XML class, Used to create XML output from input rows.
Doesn't contain a lot of advanced features - pretty straight forward, practical stuff
You are encouraged to use this class in your own applications.

Filesize: 9.7 K
Func/Classes: 18
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib
@see user_xmlversion, user_wapversion

class t3lib_xml

XML class, Used to create XML output from input rows.
Doesn't contain a lot of advanced features - pretty straight forward, practical stuff
You are encouraged to use this class in your own applications.

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib
  @see user_xmlversion, user_wapversion

function t3lib_xml($topLevelName)

Constructor, setting topLevelName to the input var

$topLevelName string Top Level Name
Returns: void

function setRecFields($table,$list)

When outputting a input record in XML only fields listed in $this->XML_recFields for the current table will be rendered.

$table string Table name
$list string Commalist of fields names from the table, $table, which is supposed to be rendered in the XML output. If a field is not in this list, it is not rendered.
Returns: void

function getResult()

Returns the result of the XML rendering, basically this is imploding the internal ->lines array with linebreaks.

Returns: string

function WAPHeader()

Initialize WML (WAP) document with <?xml + <!DOCTYPE header tags and setting ->topLevelName as the first level.

Returns: void

function renderHeader()

Initialize "anonymous" XML document with <?xml + <!DOCTYPE header tags and setting ->topLevelName as the first level.
Encoding is set to UTF-8!

Returns: void

function renderFooter()

Sets the footer (of ->topLevelName)

Returns: void

function newLevel($name,$beginEndFlag=0,$params=array())

Indents/Outdents a new level named, $name

$name string The name of the new element for this level
$beginEndFlag=0 boolean If false, then this function call will *end* the level, otherwise create it.
$params=array() array Array of attributes in key/value pairs which will be added to the element (tag), $name
Returns: void

function output($content)

Function that will return the content from string $content. If the internal ->XMLdebug flag is set the content returned will be formatted in <pre>-tags

$content string The XML content to output
Returns: string Output

function indent($b)

Increments/Decrements Indentation counter, ->XMLIndent
Sets and returns ->Icode variable which is a line prefix consisting of a number of tab-chars corresponding to the indent-levels of the current posision (->XMLindent)

$b boolean If true the XMLIndent var is increased, otherwise decreased
Returns: string ->Icode - the prefix string with TAB-chars.

function renderRecords($table,$res)

Takes a SQL result for $table and traverses it, adding rows

$table string Tablename
$res pointer SQL resource pointer, should be reset
Returns: void

function addRecord($table,$row)

Adds record, $row, from table, $table, to the internal array of XML-lines

$table string Table name
$row array The row to add to XML structure from the table name
Returns: void

function getRowInXML($table,$row)

Internal function for adding the actual content of the $row from $table to the internal structure.
Notice that only fields from $table that are listed in $this->XML_recFields[$table] (set by setRecFields()) will be rendered (and in the order found in that array!)
Content from the row will be htmlspecialchar()'ed, UTF-8 encoded and have chr(10) (newlines) exchanged for '<newline/>' tags. The element name for a value equals the fieldname from the record.

$table string Table name
$row array Row from table to add.
Returns: void

function utf8($content)

UTF-8 encodes the input content (from ISO-8859-1!)

$content string String content to UTF-8 encode
Returns: string Encoded content.

function substNewline($string)

Substitutes chr(10) characters with a '<newline/>' tag.

$string string Input value
Returns: string Processed input value

function fieldWrap($field,$value)

Wraps the value in tags with element name, $field.

$field string Fieldname from a record - will be the element name
$value string Value from the field - will be wrapped in the elements.
Returns: string The wrapped string.

function WAPback()

Creates the BACK button for WAP documents

Returns: void

function addLine($str)

Add a line to the internal XML structure (automatically prefixed with ->Icode.

$str string Line to add to the $this->lines array
Returns: void

thumbs.php

Class for generating a thumbnail from the input parameters given to the script

Input GET var, &file: relative or absolute reference to an imagefile. WILL be validated against PATH_site / lockRootPath
Input GET var, &size: integer-values defining size of thumbnail, format '[int]' or '[int]x[int]'

Relative paths MUST BE the first two characters ONLY: eg: '../dir/file.gif', otherwise it is expect to be absolute

Filesize: 12.4 K
Func/Classes: 6
Tags: @author Kasper Skaarhoj <kasper@typo3.com>
@package TYPO3
@subpackage t3lib

class SC_t3lib_thumbs

Class for generating a thumbnail from the input parameters given to the script

Input GET var, &file: relative or absolute reference to an imagefile. WILL be validated against PATH_site / lockRootPath
Input GET var, &size: integer-values defining size of thumbnail, format '[int]' or '[int]x[int]'

Relative paths MUST BE the first two characters ONLY: eg: '../dir/file.gif', otherwise it is expect to be absolute

Returns: [type] ...
  @author Kasper Skaarhoj <kasper@typo3.com>
  @package TYPO3
  @subpackage t3lib

function init()

Initialize; reading parameters with GPvar and checking file path
Results in internal var, $this->input, being set to the absolute path of the file for which to make the thumbnail.

Returns: void

function main()

Create the thumbnail
Will exit before return if all is well.

Returns: void

function errorGif($l1,$l2,$l3)

Creates error image based on gfx/notfound_thumb.png
Requires GD lib enabled, otherwise it will exit with the three textstrings outputted as text.
Outputs the image stream to browser and exits!

$l1 string Text line 1
$l2 string Text line 2
$l3 string Text line 3
Returns: void

function fontGif($font)

Creates a font-preview thumbnail.
This means a PNG/GIF file with the text "AaBbCc...." set with the font-file given as input and in various sizes to show how the font looks
Requires GD lib enabled.
Outputs the image stream to browser and exits!

$font string The filepath to the font file (absolute, probably)
Returns: void

function wrapFileName($inputName)

Wrapping the input filename in double-quotes

$inputName string Input filename
Returns: string The output wrapped in "" (if there are spaces in the filepath)