| [ Index ] |
|
Code source de Typo3 4.1.3 |
[Code source] [Imprimer] [Statistiques]
Standard functions available for the TYPO3 backend. You are encouraged to use this class in your own applications (Backend Modules) Call ALL methods without making an object! Eg. to get a page-record 51 do this: 't3lib_BEfunc::getRecord('pages',51)'
| Author: | Kasper Skaarhoj <kasperYYYY@typo3.com> |
| Poids: | 3734 lignes (150 kb) |
| Inclus ou requis: | 0 fois |
| Référencé: | 0 fois |
| Nécessite: | 0 fichiers |
t3lib_BEfunc:: (101 méthodes):
deleteClause()
getRecord()
getRecordWSOL()
getRecordRaw()
getRecordsByField()
searchQuery()
listQuery()
splitTable_Uid()
getSQLselectableList()
BEenableFields()
mm_query()
DBcompileInsert()
DBcompileUpdate()
BEgetRootLine()
openPageTree()
getRecordPath()
getExcludeFields()
getExplicitAuthFieldValues()
getSystemLanguages()
readPageAccess()
getTCAtypes()
getTCAtypeValue()
getSpecConfParts()
getSpecConfParametersFromArray()
getFlexFormDS()
storeHash()
getHash()
getPagesTSconfig()
updatePagesTSconfig()
implodeTSParams()
getUserNames()
getGroupNames()
getListGroupNames()
blindUserNames()
blindGroupNames()
daysUntil()
date()
datetime()
time()
calcAge()
dateTimeAge()
titleAttrib()
titleAltAttrib()
thumbCode()
getThumbNail()
titleAttribForPages()
getRecordIconAltText()
getLabelFromItemlist()
getItemLabel()
getRecordTitle()
getRecordTitlePrep()
getNoRecordTitle()
getProcessedValue()
getProcessedValueExtra()
getFileIcon()
getCommonSelectFields()
makeConfigForm()
helpTextIcon()
helpText()
cshItem()
editOnClick()
viewOnClick()
getModTSconfig()
getFuncMenu()
getFuncCheck()
getFuncInput()
unsetMenuItems()
getSetUpdateSignal()
getModuleData()
compilePreviewKeyword()
lockRecords()
isRecordLocked()
exec_foreign_table_where_query()
getTCEFORM_TSconfig()
getTSconfig_pidValue()
getPidForModTSconfig()
getTSCpid()
firstDomainRecord()
getDomainStartPage()
RTEsetup()
RTEgetObj()
softRefParserObj()
explodeSoftRefParserList()
isModuleSetInTBE_MODULES()
referenceCount()
selectVersionsOfRecord()
fixVersioningPid()
workspaceOL()
getWorkspaceVersionOfRecord()
getLiveVersionOfRecord()
isPidInVersionizedBranch()
versioningPlaceholderClause()
countVersionsOfRecordsOnPage()
wsMapId()
typo3PrintError()
TYPO3_copyRightNotice()
displayWarningMessages()
getPathType_web_nonweb()
ADMCMD_previewCmds()
processParams()
getListOfBackendModules()
Classe: t3lib_BEfunc - X-Ref
Standard functions available for the TYPO3 backend.| deleteClause($table,$tableAlias='') X-Ref |
| 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: 71 param: string Table name present in $TCA param: string Table alias if any return: string WHERE clause for filtering out deleted records, eg " AND tablename.deleted=0" |
| getRecord($table,$uid,$fields='*',$where='',$useDeleteClause=true) X-Ref |
| 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: 99 param: string Table name present in $TCA param: integer UID of record param: string List of fields to select param: string Additional WHERE clause, eg. " AND blablabla=0" param: boolean Use the deleteClause to check if a record is deleted (default true) return: array Returns the row if found, otherwise nothing |
| getRecordWSOL($table,$uid,$fields='*',$where='',$useDeleteClause=true) X-Ref |
| Like getRecord(), but overlays workspace version if any. param: string Table name present in $TCA param: integer UID of record param: string List of fields to select param: string Additional WHERE clause, eg. " AND blablabla=0" param: boolean Use the deleteClause to check if a record is deleted (default true) return: array Returns the row if found, otherwise nothing |
| getRecordRaw($table,$where='',$fields='*') X-Ref |
| 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) param: string Table name (not necessarily in TCA) param: string WHERE clause param: string $fields is a list of fields to select, default is '*' return: array First row found, if any, FALSE otherwise |
| getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='',$useDeleteClause=true) X-Ref |
| 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 param: string Table name present in $TCA param: string Field to select on param: string Value that $theField must match param: string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT! param: string Optional GROUP BY field(s), if none, supply blank string. param: string Optional ORDER BY field(s), if none, supply blank string. param: string Optional LIMIT value ([begin,]max), if none, supply blank string. param: boolean Use the deleteClause to check if a record is deleted (default true) return: mixed Multidimensional array with selected records (if any is selected) |
| searchQuery($searchWords,$fields,$table='') X-Ref |
| 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: 0 param: array Array of search words param: array Array of fields param: string Table in which we are searching (for DBAL detection of quoteStr() method) return: string WHERE clause for search |
| listQuery($field,$value) X-Ref |
| 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: 0 param: string Table field name param: string Value to find in list return: string WHERE clause for a query |
| splitTable_Uid($str) X-Ref |
| Makes an backwards explode on the $str and returns an array with ($table,$uid). Example: tt_content_45 => array('tt_content',45) Usage: 1 param: string [tablename]_[uid] string to explode return: array |
| getSQLselectableList($in_list,$tablename,$default_tablename) X-Ref |
| 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) param: string Input list param: string Table name from which ids is returned param: string $default_tablename denotes what table the number '45' is from (if nothing is prepended on the value) return: string List of ids |
| BEenableFields($table,$inv=0) X-Ref |
| 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 param: string $table is the table from which to return enableFields WHERE clause. Table name must have a 'ctrl' section in $TCA. param: boolean $inv means that the query will select all records NOT VISIBLE records (inverted selection) return: string WHERE clause part |
| mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='') X-Ref |
| 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. DEPRECATED - 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. param: string Field list for SELECT param: string Tablename, local table param: string Tablename, relation table param: string Tablename, foreign table param: string Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT! param: string Optional GROUP BY field(s), if none, supply blank string. param: string Optional ORDER BY field(s), if none, supply blank string. param: string Optional LIMIT value ([begin,]max), if none, supply blank string. return: string Full SQL query |
| DBcompileInsert($table,$fields_values) X-Ref |
| Creates an INSERT SQL-statement for $table from the array with field/value pairs $fields_values. DEPRECATED - $GLOBALS['TYPO3_DB']->INSERTquery() directly instead! But better yet, use $GLOBALS['TYPO3_DB']->exec_INSERTquery() param: string Table name param: array Field values as key=>value pairs. return: string Full SQL query for INSERT |
| DBcompileUpdate($table,$where,$fields_values) X-Ref |
| Creates an UPDATE SQL-statement for $table where $where-clause (typ. 'uid=...') from the array with field/value pairs $fields_values. DEPRECATED - $GLOBALS['TYPO3_DB']->UPDATEquery() directly instead! But better yet, use $GLOBALS['TYPO3_DB']->exec_UPDATEquery() param: string Database tablename param: string WHERE clause, eg. "uid=1" param: array Field values as key=>value pairs. return: string Full SQL query for UPDATE |
| BEgetRootLine($uid,$clause='',$workspaceOL=FALSE) X-Ref |
| 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: 1 param: integer Page id for which to create the root line. param: string $clause can be used to select other criteria. It would typically be where-clauses that stops the process if we meet a page, the user has no reading access to. param: boolean If true, version overlay is applied. This must be requested specifically because it is usually only wanted when the rootline is used for visual output while for permission checking you want the raw thing! return: array Root line array, all the way to the page tree root (or as far as $clause allows!) |
| openPageTree($pid,$clearExpansion) X-Ref |
| Opens the page tree to the specified page id param: integer Page id. param: boolean If set, then other open branches are closed. return: void |
| getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit=0) X-Ref |
| 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: 15 param: integer Page uid for which to create record path param: string $clause is additional where clauses, eg. " param: integer Title limit param: integer Title limit of Full title (typ. set to 1000 or so) return: mixed Path of record (string) OR array with short/long title if $fullTitleLimit is set. |
| getExcludeFields() X-Ref |
| 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) return: array Array of arrays with excludeFields (fieldname, table:fieldname) from all TCA entries |
| getExplicitAuthFieldValues() X-Ref |
| Returns an array with explicit Allow/Deny fields. Used for listing these field/value pairs in be_groups forms return: array Array with information from all of $TCA |
| getSystemLanguages() X-Ref |
| Returns an array with system languages: return: array Array with languages |
| readPageAccess($id,$perms_clause) X-Ref |
| 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. Thus is works as an access check that returns a page record if access was granted, otherwise not. 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 param: integer Page uid for which to check read-access param: string $perms_clause is typically a value generated with $BE_USER->getPagePermsClause(1); return: array Returns page record if OK, otherwise false. |
| getTCAtypes($table,$rec,$useFieldNameAsKey=0) X-Ref |
| Returns the "types" configuration parsed into an array for the record, $rec, from table, $table Usage: 6 param: string Table name (present in TCA) param: array Record from $table param: boolean If $useFieldNameAsKey is set, then the fieldname is associative keys in the return array, otherwise just numeric keys. return: array |
| getTCAtypeValue($table,$rec) X-Ref |
| 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 param: string Table name present in TCA param: array Record from $table return: string Field value |
| getSpecConfParts($str, $defaultExtras) X-Ref |
| 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: 5 param: string Content from the "types" configuration of TCA (the special configuration) - see description of function param: string The ['defaultExtras'] value from field configuration return: array |
| getSpecConfParametersFromArray($pArr) X-Ref |
| 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 param: array Array of "[key]=[value]" strings to convert. return: array |
| getFlexFormDS($conf,$row,$table,$fieldName='',$WSOL=TRUE,$newRecordPidValue=0) X-Ref |
| Finds the Data Structure for a FlexForm field NOTE ON data structures for deleted records: This function may fail to deliver the data structure for a record for a few reasons: a) The data structure could be deleted (either with deleted-flagged or hard-deleted), b) the data structure is fetched using the ds_pointerField_searchParent in which case any deleted record on the route to the final location of the DS will make it fail. In theory, we can solve the problem in the case where records that are deleted-flagged keeps us from finding the DS - this is done at the markers ###NOTE_A### where we make sure to also select deleted records. However, we generally want the DS lookup to fail for deleted records since for the working website we expect a deleted-flagged record to be as inaccessible as one that is completely deleted from the DB. Any way we look at it, this may lead to integrity problems of the reference index and even lost files if attached. However, that is not really important considering that a single change to a data structure can instantly invalidate large amounts of the reference index which we do accept as a cost for the flexform features. Other than requiring a reference index update, deletion of/changes in data structure or the failure to look them up when completely deleting records may lead to lost files in the uploads/ folders since those are now without a proper reference. Usage: 5 param: array Field config array param: array Record data param: string The table name param: string Optional fieldname passed to hook object param: boolean Boolean; If set, workspace overlay is applied to records. This is correct behaviour for all presentation and export, but NOT if you want a true reflection of how things are in the live workspace. param: integer SPECIAL CASES: Use this, if the DataStructure may come from a parent record and the INPUT row doesn't have a uid yet (hence, the pid cannot be looked up). Then it is necessary to supply a PID value to search recursively in for the DS (used from TCEmain) return: mixed If array, the data structure was found and returned as an array. Otherwise (string) it is an error message. |
| storeHash($hash,$data,$ident) X-Ref |
| 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 param: string 32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored) param: string The data string. If you want to store an array, then just serialize it first. param: string $ident is just a textual identification in order to inform about the content! May be 20 characters long. return: void |
| getHash($hash,$expTime=0) X-Ref |
| 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 param: string Hash key, 32 bytes hex param: 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. return: string |
| getPagesTSconfig($id,$rootLine='',$returnPartArray=0) X-Ref |
| Returns the Page TSconfig for page with id, $id Requires class "t3lib_TSparser" Usage: 26 (spec. in ext info_pagetsconfig) param: integer Page uid for which to create Page TSconfig param: array If $rootLine is an array, that is used as rootline, otherwise rootline is just calculated param: 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. return: array Page TSconfig |
| updatePagesTSconfig($id,$pageTS,$TSconfPrefix,$impParams='') X-Ref |
| 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) param: integer Page id param: array Page TS array to write param: string Prefix for object paths param: array [Description needed.] return: void |
| implodeTSParams($p,$k='') X-Ref |
| Implodes a multi dimensional TypoScript array, $p, into a one-dimentional array (return value) Usage: 3 param: array TypoScript structure param: string Prefix string return: array Imploded TypoScript objectstring/values |
| getUserNames($fields='username,usergroup,usergroup_cached_list,uid',$where='') X-Ref |
| 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") param: string Optional $fields list (default: username,usergroup,usergroup_cached_list,uid) can be used to set the selected fields param: string Optional $where clause (fx. "AND username='pete'") can be used to limit query return: array |
| getGroupNames($fields='title,uid', $where='') X-Ref |
| 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") param: string Field list param: string WHERE clause return: array |
| getListGroupNames($fields='title,uid') X-Ref |
| 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) param: string Field list; $fields specify the fields selected (default: title,uid) return: array |
| blindUserNames($usernames,$groupArray,$excludeBlindedFlag=0) X-Ref |
| 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 param: array User names param: array Group names param: boolean If $excludeBlindedFlag is set, then these records are unset from the array $usernames return: array User names, blinded |
| blindGroupNames($groups,$groupArray,$excludeBlindedFlag=0) X-Ref |
| Corresponds to blindUserNames but works for groups instead Usage: 2 (module web_perm) param: array Group names param: array Group names (reference) param: boolean If $excludeBlindedFlag is set, then these records are unset from the array $usernames return: array |
| daysUntil($tstamp) X-Ref |
| Returns the difference in days between input $tstamp and $EXEC_TIME Usage: 2 (class t3lib_BEfunc) param: integer Time stamp, seconds return: integer |
| date($tstamp) X-Ref |
| Returns $tstamp formatted as "ddmmyy" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy']) Usage: 11 param: integer Time stamp, seconds return: string Formatted time |
| datetime($value) X-Ref |
| Returns $tstamp formatted as "ddmmyy hhmm" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy'] AND $TYPO3_CONF_VARS['SYS']['hhmm']) Usage: 28 param: integer Time stamp, seconds return: string Formatted time |
| time($value) X-Ref |
| 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) param: integer Time stamp, seconds return: string Formatted time |
| calcAge($seconds,$labels = 'min|hrs|days|yrs') X-Ref |
| Returns the "age" in minutes / hours / days / years of the number of $seconds inputted. Usage: 15 param: integer $seconds could be the difference of a certain timestamp and time() param: 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") return: string Formatted time |
| dateTimeAge($tstamp,$prefix=1,$date='') X-Ref |
| Returns a formatted timestamp if $tstamp is set. The date/datetime will be followed by the age in parenthesis. Usage: 3 param: integer Time stamp, seconds param: integer 1/-1 depending on polarity of age. param: string $date=="date" will yield "dd:mm:yy" formatting, otherwise "dd:mm:yy hh:mm" return: string |
| titleAttrib($content='',$hsc=0) X-Ref |
| 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: 0 param: string String to set as title-attribute. If no $content is given only the attribute name is returned. param: boolean If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...) return: string |
| titleAltAttrib($content) X-Ref |
| Returns alt="" and title="" attributes with the value of $content. Usage: 7 param: string Value for 'alt' and 'title' attributes (will be htmlspecialchars()'ed before output) return: string |
| thumbCode($row,$table,$field,$backPath,$thumbScript='',$uploaddir=NULL,$abs=0,$tparams='',$size='') X-Ref |
| Returns a linked image-tag for thumbnail(s)/fileicons/truetype-font-previews 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 param: array $row is the database row from the table, $table. param: string Table name for $row (present in TCA) param: string $field is pointing to the field with the list of image files param: string Back path prefix for image tag src="" field param: string Optional: $thumbScript os by default 'thumbs.php' if you don't set it otherwise param: 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!) param: boolean If set, uploaddir is NOT prepended with "../" param: string Optional: $tparams is additional attributes for the image tags param: integer Optional: $size is [w]x[h] of the thumbnail. 56 is default. return: string Thumbnail image tag. |
| getThumbNail($thumbScript,$theFile,$tparams='',$size='') X-Ref |
| Returns single image tag to thumbnail using a thumbnail script (like thumbs.php) Usage: 3 param: string $thumbScript must point to "thumbs.php" relative to the script position param: string $theFile must be the proper reference to the file thumbs.php should show param: string $tparams are additional attributes for the image tag param: integer $size is the size of the thumbnail send along to "thumbs.php" return: string Image tag |
| titleAttribForPages($row,$perms_clause='',$includeAttrib=1) X-Ref |
| Returns title-attribute information for a page-record informing about id, alias, doktype, hidden, starttime, endtime, fe_group etc. Usage: 8 param: array Input must be a page row ($row) with the proper fields set (be sure - send the full range of fields for the table) param: string $perms_clause is used to get the record path of the shortcut page, if any (and doktype==4) param: boolean If $includeAttrib is set, then the 'title=""' attribute is wrapped about the return value, which is in any case htmlspecialchar()'ed already return: string |
| getRecordIconAltText($row,$table='pages') X-Ref |
| 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 param: array Table row; $row is a row from the table, $table param: string Table name return: string |
| getLabelFromItemlist($table,$col,$key) X-Ref |
| 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 param: string Table name, present in $TCA param: string Field name, present in $TCA param: string items-array value to match return: string Label for item entry |
| getItemLabel($table,$col,$printAllWrap='') X-Ref |
| 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 param: string Table name, present in $TCA param: string Field name param: string Wrap value - set function description return: string |
| getRecordTitle($table,$row,$prep=FALSE,$forceResult=TRUE) X-Ref |
| 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 param: string Table name, present in TCA param: array Row from table param: 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 param: boolean If set, the function always returns an output. If no value is found for the title, '[No title]' is returned (localized). return: string |
| getRecordTitlePrep($title, $titleLength=0) X-Ref |
| Crops a title string to a limited lenght and if it really was cropped, wrap it in a <span title="...">|</span>, which offers a tooltip with the original title when moving mouse over it. param: string $title: The title string to be cropped param: integer $titleLength: Crop title after this length - if not set, BE_USER->uc['titleLen'] is used return: string The processed title string, wrapped in <span title="...">|</span> if cropped |
| getNoRecordTitle($prep=FALSE) X-Ref |
| Get a localized [No title] string, wrapped in <em>|</em> if $prep is true. param: boolean $prep: Wrap result in <em>|</em> return: string Localized [No title] string |
| getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0,$noRecordLookup=FALSE,$uid=0,$forceResult=TRUE) X-Ref |
| 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 param: string Table name, present in TCA param: string Field name, present in TCA param: string $value is the value of that field from a selected record param: integer $fixed_lgd_chars is the max amount of characters the value may occupy param: 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") param: boolean If set, no records will be looked up, UIDs are just shown. param: integer uid of the current record param: boolean If t3lib_BEfunc::getRecordTitle is used to process the value, this parameter is forwarded. return: string |
| getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0,$uid=0,$forceResult=TRUE) X-Ref |
| 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 param: string Table name, present in TCA param: string Field name param: string Field value param: integer $fixed_lgd_chars is the max amount of characters the value may occupy param: integer uid of the current record param: boolean If t3lib_BEfunc::getRecordTitle is used to process the value, this parameter is forwarded. return: string |
| getFileIcon($ext) X-Ref |
| Returns file icon name (from $FILEICONS) for the fileextension $ext Usage: 10 param: string File extension, lowercase return: string File icon filename |
| getCommonSelectFields($table,$prefix='',$fields = array() X-Ref |
| 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 param: string Table name, present in TCA param: string Table prefix param: array Preset fields (must include prefix if that is used) return: string List of fields. |
| makeConfigForm($configArray,$defaults,$dataPrefix) X-Ref |
| 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) param: array Field configuration code. param: array Defaults param: string Prefix for formfields return: string HTML for a form. |
| helpTextIcon($table,$field,$BACK_PATH,$force=0) X-Ref |
| 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 param: string Table name param: string Field name param: string Back path param: boolean Force display of icon nomatter BE_USER setting for help return: string HTML content for a help icon/text |
| helpText($table,$field,$BACK_PATH,$styleAttrib='') X-Ref |
| 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: 4 param: string Table name param: string Field name param: string Back path param: string Additional style-attribute content for wrapping table return: string HTML content for help text |
| cshItem($table,$field,$BACK_PATH,$wrap='',$onlyIconMode=FALSE, $styleAttrib='') X-Ref |
| API for getting CSH icons/text for use in backend modules. TCA_DESCR will be loaded if it isn't already Usage: ? param: string Table name ('_MOD_'+module name) param: string Field name (CSH locallang main key) param: string Back path param: string Wrap code for icon-mode, splitted by "|". Not used for full-text mode. param: boolean If set, the full text will never be shown (only icon). Useful for places where it will break the page if the table with full text is shown. param: string Additional style-attribute content for wrapping table (full text mode only) return: string HTML content for help text |
| editOnClick($params,$backPath='',$requestUri='') X-Ref |
| 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 param: 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. param: string $backPath must point back to the TYPO3_mainDir directory (where alt_doc.php is) param: string $requestUri is an optional returnUrl you can set - automatically set to REQUEST_URI. return: string |
| viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='',$addGetVars='',$switchFocus=TRUE) X-Ref |
| Returns a JavaScript string for viewing the page id, $id It will detect the correct domain name if needed and provide the link with the right back path. Also it will re-use any window already open. Usage: 8 param: integer $id is page id param: string $backpath must point back to TYPO3_mainDir (where the site is assumed to be one level above) param: array If root line is supplied the function will look for the first found domain record and use that URL instead (if found) param: string $anchor is optional anchor to the URL param: 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! param: string Additional GET variables. param: boolean If true, then the preview window will gain the focus. return: string |
| getModTSconfig($id,$TSref) X-Ref |
| Returns the merged User/Page TSconfig for page id, $id. Please read details about module programming elsewhere! Usage: 15 param: integer Page uid param: string $TSref is an object string which determines the path of the TSconfig to return. return: array |
| getFuncMenu($mainParams,$elementName,$currentValue,$menuItems,$script='',$addparams='') X-Ref |
| 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 param: mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=... param: string $elementName it the form elements name, probably something like "SET[...]" param: string $currentValue is the value to be selected currently. param: array $menuItems is an array with the menu items for the selector box param: string $script is the script to send the &id to, if empty it's automatically found param: string $addParams is additional parameters to pass to the script. return: string HTML code for selector box |
| getFuncCheck($mainParams,$elementName,$currentValue,$script='',$addparams='',$tagParams='') X-Ref |
| Checkbox function menu. Works like ->getFuncMenu() but takes no $menuItem array since this is a simple checkbox. Usage: 34 param: mixed $mainParams $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=... param: string $elementName it the form elements name, probably something like "SET[...]" param: string $currentValue is the value to be selected currently. param: string $script is the script to send the &id to, if empty it's automatically found param: string $addParams is additional parameters to pass to the script. param: string Additional attributes for the checkbox input tag return: string HTML code for checkbox |
| getFuncInput($mainParams,$elementName,$currentValue,$size=10,$script="",$addparams="") X-Ref |
| Input field function menu Works like ->getFuncMenu() / ->getFuncCheck() but displays a input field instead which updates the script "onchange" Usage: 1 param: mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=... param: string $elementName it the form elements name, probably something like "SET[...]" param: string $currentValue is the value to be selected currently. param: integer Relative size of input field, max is 48 param: string $script is the script to send the &id to, if empty it's automatically found param: string $addParams is additional parameters to pass to the script. return: string HTML code for input text field. |
| unsetMenuItems($modTSconfig,$itemArray,$TSref) X-Ref |
| 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 param: array Module TS config array param: array Array of items from which to remove items. param: string $TSref points to the "object string" in $modTSconfig return: array The modified $itemArray is returned. |
| getSetUpdateSignal($set='') X-Ref |
| 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 param: 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. return: string HTML code (<script> section) |
| getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='') X-Ref |
| 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 param: array MOD_MENU is an array that defines the options in menus. param: array CHANGED_SETTINGS represents the array used when passing values to the script from the menus. param: string modName is the name of this module. Used to get the correct module data. param: 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. param: 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. param: string List of default values from $MOD_MENU to set in the output array (only if the values from MOD_MENU are not arrays) return: 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 |
| compilePreviewKeyword($getVarsStr, $beUserUid, $ttl=172800) X-Ref |
| Set preview keyword, eg: $previewUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL').'index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword('id='.$pageId.'&L='.$language.'&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS='.$this->workspace, $GLOBALS['BE_USER']->user['uid'], 120); todo for sys_preview: - Add a comment which can be shown to previewer in frontend in some way (plus maybe ability to write back, take other action?) - Add possibility for the preview keyword to work in the backend as well: So it becomes a quick way to a certain action of sorts? param: string Get variables to preview, eg. 'id=1150&L=0&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=8' param: string 32 byte MD5 hash keyword for the URL: "?ADMCMD_prev=[keyword]" param: integer Time-To-Live for keyword return: string Returns keyword to use in URL for ADMCMD_prev= |
| lockRecords($table='',$uid=0,$pid=0) X-Ref |
| 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 param: string Table name param: integer Record uid param: integer Record pid return: void |
| isRecordLocked($table,$uid) X-Ref |
| 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 param: string Table name param: integer Record uid return: array |
| exec_foreign_table_where_query($fieldValue,$field='',$TSconfig=array() X-Ref |
| Returns select statement for MM relations (as used by TCEFORMs etc) Usage: 3 param: array Configuration array for the field, taken from $TCA param: string Field name param: array TSconfig array from which to get further configuration settings for the field name param: string Prefix string for the key "*foreign_table_where" from $fieldValue array return: string Part of query |
| getTCEFORM_TSconfig($table,$row) X-Ref |
| Returns TSConfig for the TCEFORM object in Page TSconfig. Used in TCEFORMs Usage: 4 param: string Table name present in TCA param: array Row from table return: array |
| getTSconfig_pidValue($table,$uid,$pid) X-Ref |
| 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). NOTICE: Make sure that the input PID is never negative because the record was an offline version! Therefore, you should always use t3lib_BEfunc::fixVersioningPid($table,$row); on the data you input before calling this function! Usage: 2 param: string Table name param: integer Record uid param: integer Record pid, could be negative then pointing to a record from same table whose pid to find and return. return: integer |
| getPidForModTSconfig($table,$uid,$pid) X-Ref |
| Return $uid if $table is pages and $uid is integer - otherwise the $pid Usage: 1 param: string Table name param: integer Record uid param: integer Record pid return: integer |
| getTSCpid($table,$uid,$pid) X-Ref |
| 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 param: string Table name param: integer Record uid param: integer Record pid return: array Array of two integers; first is the REAL PID of a record and if its a new record negative values are resolved to the true PID, second value is the PID value for TSconfig (uid if table is pages, otherwise the pid) |
| firstDomainRecord($rootLine) X-Ref |
| Returns first found domain record "domainName" (without trailing slash) if found in the input $rootLine Usage: 2 param: array Root line array return: string Domain name, if found. |
| getDomainStartPage($domain, $path='') X-Ref |
| Returns the sys_domain record for $domain, optionally with $path appended. Usage: 2 param: string Domain name param: string Appended path return: array Domain record, if found |
| RTEsetup($RTEprop,$table,$field,$type='') X-Ref |
| Returns overlayered RTE setup from an array with TSconfig. Used in TCEforms and TCEmain Usage: 8 param: array The properties of Page TSconfig in the key "RTE." param: string Table name param: string Field name param: string Type value of the current record (like from CType of tt_content) return: array Array with the configuration for the RTE |
| RTEgetObj() X-Ref |
| Returns first possible RTE object if available. Usage: $RTEobj = &t3lib_BEfunc::RTEgetObj(); return: mixed If available, returns RTE object, otherwise an array of messages from possible RTEs |
| softRefParserObj($spKey) X-Ref |
| Returns soft-reference parser for the softRef processing type Usage: $softRefObj = &t3lib_BEfunc::softRefParserObj('[parser key]'); param: string softRef parser key return: mixed If available, returns Soft link parser object. |
| explodeSoftRefParserList($parserList) X-Ref |
| Returns array of soft parser references param: string softRef parser list param: string Table name param: string Field name return: array Array where the parser key is the key and the value is the parameter string |
| isModuleSetInTBE_MODULES($modName) X-Ref |
| Returns true if $modName is set and is found as a main- or submodule in $TBE_MODULES array Usage: 1 param: string Module name return: boolean |
| referenceCount($table,$ref,$msg='') X-Ref |
| Counting references to a record/file param: string Table name (or "_FILE" if its a file) param: string Reference: If table, then integer-uid, if _FILE, then file reference (relative to PATH_site) param: string Message with %s, eg. "There were %s records pointing to this file!" return: string Output string (or integer count value if no msg string specified) |
| selectVersionsOfRecord($table, $uid, $fields='*', $workspace=0, $includeDeletedRecords=FALSE) X-Ref |
| Select all versions of a record, ordered by version id (DESC) param: string Table name to select from param: integer Record uid for which to find versions. param: string Field list to select param: integer Workspace ID, if zero all versions regardless of workspace is found. param: boolean If set, deleted-flagged versions are included! (Only for clean-up script!) return: array Array of versions of table/uid |
| fixVersioningPid($table,&$rr,$ignoreWorkspaceMatch=FALSE) X-Ref |
| Find page-tree PID for versionized record Will look if the "pid" value of the input record is -1 and if the table supports versioning - if so, it will translate the -1 PID into the PID of the original record Used whenever you are tracking something back, like making the root line. Will only translate if the workspace of the input record matches that of the current user (unless flag set) Principle; Record offline! => Find online? param: string Table name param: array Record array passed by reference. As minimum, "pid" and "uid" fields must exist! "t3ver_oid" and "t3ver_wsid" is nice and will save you a DB query. param: boolean Ignore workspace match return: void (Passed by ref). If the record had its pid corrected to the online versions pid, then "_ORIG_pid" is set to the original pid value (-1 of course). The field "_ORIG_pid" is used by various other functions to detect if a record was in fact in a versionized branch. |
| workspaceOL($table,&$row,$wsid=-99) X-Ref |
| Workspace Preview Overlay Generally ALWAYS used when records are selected based on uid or pid. If records are selected on other fields than uid or pid (eg. "email = ....") then usage might produce undesired results and that should be evaluated on individual basis. Principle; Record online! => Find offline? param: string Table name param: array Record array passed by reference. As minimum, the "uid", "pid" and "t3ver_swapmode" (pages) fields must exist! Fake fields cannot exist since the fields in the array is used as field names in the SQL look up. param: integer Workspace ID, if not specified will use $GLOBALS['BE_USER']->workspace return: void (Passed by ref). |
| getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields='*') X-Ref |
| Select the workspace version of a record, if exists param: integer Workspace ID param: string Table name to select from param: integer Record uid for which to find workspace version. param: string Field list to select return: array If found, return record, otherwise false |
| getLiveVersionOfRecord($table,$uid,$fields='*') X-Ref |
| Returns live version of record param: string Table name param: integer Record UID of draft, offline version param: string Field list, default is * return: array If found, the record, otherwise nothing. |
| isPidInVersionizedBranch($pid, $table='',$returnStage=FALSE) X-Ref |
| Will fetch the rootline for the pid, then check if anywhere in the rootline there is a branch point and if so everything is allowed of course. Alternatively; if the page of the PID itself is a version and swapmode is zero (page+content) then tables from versioning_followPages are allowed as well. param: integer Page id inside of which you want to edit/create/delete something. param: string Table name you are checking for. If you don't give the table name ONLY "branch" types are found and returned true. Specifying table you might also get a positive response if the pid is a "page" versioning type AND the table has "versioning_followPages" set. param: boolean If set, the keyword "branchpoint" or "first" is not returned by rather the "t3ver_stage" value of the branch-point. return: mixed Returns either "branchpoint" (if branch) or "first" (if page) or false if nothing. Alternatively, it returns the value of "t3ver_stage" for the branchpoint (if any) |
| versioningPlaceholderClause($table) X-Ref |
| Will return where clause de-selecting new-versions from other workspaces. param: string Table name return: string Where clause if applicable. |
| countVersionsOfRecordsOnPage($workspace,$pageId, $allTables=FALSE) X-Ref |
| Count number of versions on a page param: integer Workspace ID param: integer Page ID param: boolean If set, then all tables and not only "versioning_followPages" are found (except other pages) return: array Overview of records |
| wsMapId($table,$uid) X-Ref |
| Performs mapping of new uids to new versions UID in case of import inside a workspace. param: string Table name param: integer Record uid (of live record placeholder) return: integer Uid of offline version if any, otherwise live uid. |
| typo3PrintError($header,$text,$js='',$head=1) X-Ref |
| Print error message with header, text etc. Usage: 19 param: string Header string param: string Content string param: boolean Will return an alert() with the content of header and text. param: boolean Print header. return: void |
| TYPO3_copyRightNotice() X-Ref |
| Prints TYPO3 Copyright notice for About Modules etc. modules. return: void |
| displayWarningMessages() X-Ref |
| Display some warning messages if this installation is obviously insecure!! These warnings are only displayed to admin users return: void |
| getPathType_web_nonweb($path) X-Ref |
| Returns "web" if the $path (absolute) is within the DOCUMENT ROOT - and thereby qualifies as a "web" folder. Usage: 4 param: string Path to evaluate return: boolean |
| ADMCMD_previewCmds($pageinfo) X-Ref |
| Creates ADMCMD parameters for the "viewpage" extension / "cms" frontend Usage: 1 param: array Page record return: string Query-parameters |
| processParams($params) X-Ref |
| 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 param: string String of parameters on multiple lines to parse into key-value pairs (see function description) return: array |
| getListOfBackendModules($name,$perms_clause,$backPath='',$script='index.php') X-Ref |
| Returns "list of backend modules". Most likely this will be obsolete soon / removed. Don't use. Usage: 3 param: array Module names in array. Must be "addslashes()"ed param: string Perms clause for SQL query param: string Backpath param: string The URL/script to jump to (used in A tag) return: array Two keys, rows and list |
| Généré le : Sun Nov 25 17:13:16 2007 | par Balluche grâce à PHPXref 0.7 |
|