Go to the source code of this file.
Namespaces | |
namespace | TYPO3 |
Classes | |
class | t3lib_BEfunc |
Functions | |
getTCEFORM_TSconfig ($table, $row) | |
Returns TSConfig for the TCEFORM object in Page TSconfig. | |
getTSconfig_pidValue ($table, $uid, $pid) | |
Find the real PID of the record (with $uid from $table). | |
getPidForModTSconfig ($table, $uid, $pid) | |
Return $uid if $table is pages and $uid is integer - otherwise the $pid Usage: 1. | |
getTSCpid ($table, $uid, $pid) | |
Returns the REAL pid of the record, if possible. | |
firstDomainRecord ($rootLine) | |
Returns first found domain record "domainName" (without trailing slash) if found in the input $rootLine Usage: 2. | |
getDomainStartPage ($domain, $path='') | |
Returns the sys_domain record for $domain, optionally with $path appended. | |
selectVersionsOfRecord ($table, $uid, $fields='*') | |
Select all versions of a record, ordered by version id (DESC). | |
RTEsetup ($RTEprop, $table, $field, $type='') | |
Returns overlayered RTE setup from an array with TSconfig. | |
& | RTEgetObj () |
Returns first possible RTE object if available. | |
isModuleSetInTBE_MODULES ($modName) | |
Returns true if $modName is set and is found as a main- or submodule in $TBE_MODULES array Usage: 1. | |
typo3PrintError ($header, $text, $js='', $head=1) | |
Print error message with header, text etc. | |
TYPO3_copyRightNotice () | |
Prints TYPO3 Copyright notice for About Modules etc. | |
getPathType_web_nonweb ($path) | |
Returns "web" if the $path (absolute) is within the DOCUMENT ROOT - and thereby qualifies as a "web" folder. | |
ADMCMD_previewCmds ($pageinfo) | |
Creates ADMCMD parameters for the "viewpage" extension / "cms" frontend Usage: 1. | |
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. | |
getListOfBackendModules ($name, $perms_clause, $backPath='', $script='index.php') | |
Returns "list of backend modules". |
|
Creates ADMCMD parameters for the "viewpage" extension / "cms" frontend Usage: 1.
Definition at line 2979 of file class.t3lib_befunc.php. References t3lib_BEfunc::time(). 02979 { 02980 if ($pageinfo['fe_group']>0) { 02981 $simUser = '&ADMCMD_simUser='.$pageinfo['fe_group']; 02982 } 02983 if ($pageinfo['starttime']>time()) { 02984 $simTime = '&ADMCMD_simTime='.$pageinfo['starttime']; 02985 } 02986 if ($pageinfo['endtime']<time() && $pageinfo['endtime']!=0) { 02987 $simTime = '&ADMCMD_simTime='.($pageinfo['endtime']-1); 02988 } 02989 return $simUser.$simTime; 02990 }
|
|
Returns first found domain record "domainName" (without trailing slash) if found in the input $rootLine Usage: 2.
Definition at line 2697 of file class.t3lib_befunc.php. References t3lib_BEfunc::getRecordsByField(), and t3lib_extMgm::isLoaded(). Referenced by t3lib_BEfunc::viewOnClick(). 02697 { 02698 if (t3lib_extMgm::isLoaded('cms')) { 02699 reset($rootLine); 02700 while(list(,$row)=each($rootLine)) { 02701 $dRec = t3lib_BEfunc::getRecordsByField('sys_domain','pid',$row['uid'],' AND redirectTo="" AND hidden=0', '', 'sorting'); 02702 if (is_array($dRec)) { 02703 reset($dRec); 02704 $dRecord = current($dRec); 02705 return ereg_replace('\/$','',$dRecord['domainName']); 02706 } 02707 } 02708 } 02709 }
|
|
Returns the sys_domain record for $domain, optionally with $path appended. Usage: 2
Definition at line 2719 of file class.t3lib_befunc.php. References t3lib_extMgm::isLoaded(). Referenced by t3lib_BEfunc::viewOnClick(). 02719 { 02720 if (t3lib_extMgm::isLoaded('cms')) { 02721 $domain = explode(':',$domain); 02722 $domain = strtolower(ereg_replace('\.$','',$domain[0])); 02723 // path is calculated. 02724 $path = trim(ereg_replace('\/[^\/]*$','',$path)); 02725 // stuff: 02726 $domain.=$path; 02727 02728 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_domain.*', 'pages,sys_domain', ' 02729 pages.uid=sys_domain.pid 02730 AND NOT sys_domain.hidden 02731 AND (sys_domain.domainName="'.$GLOBALS['TYPO3_DB']->quoteStr($domain, 'sys_domain').'" or sys_domain.domainName="'.$GLOBALS['TYPO3_DB']->quoteStr($domain.'/', 'sys_domain').'")'. 02732 t3lib_BEfunc::deleteClause('pages'), 02733 '', '', '1'); 02734 return $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res); 02735 } 02736 }
|
|
Returns "list of backend modules". Most likely this will be obsolete soon / removed. Don't use. Usage: 3
Definition at line 3027 of file class.t3lib_befunc.php. References $out, and t3lib_iconWorks::getIconImage(). 03027 { 03028 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'doktype!=255 AND module IN ("'.implode('","',$name).'") AND'.$perms_clause.t3lib_BEfunc::deleteClause('pages')); 03029 if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res)) return false; 03030 03031 $out=''; 03032 $theRows=array(); 03033 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 03034 $theRows[]=$row; 03035 $out.='<span class="nobr"><a href="'.htmlspecialchars($script.'?id='.$row['uid']).'">'. 03036 t3lib_iconWorks::getIconImage('pages',$row,$backPath,'title="'.htmlspecialchars(t3lib_BEfunc::getRecordPath($row['uid'],$perms_clause,20)).'" align="top"'). 03037 htmlspecialchars($row['title']). 03038 '</a></span><br />'; 03039 } 03040 return array('rows'=>$theRows,'list'=>$out); 03041 }
|
|
Returns "web" if the $path (absolute) is within the DOCUMENT ROOT - and thereby qualifies as a "web" folder. Usage: 4
Definition at line 2967 of file class.t3lib_befunc.php. Referenced by localFolderTree::ext_isLinkable(), and t3lib_folderTree::getFolderTree(). 02967 {
02968 return t3lib_div::isFirstPartOfStr($path,t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT')) ? 'web' : '';
02969 }
|
|
Return $uid if $table is pages and $uid is integer - otherwise the $pid Usage: 1.
Definition at line 2665 of file class.t3lib_befunc.php. Referenced by getTSCpid(). 02665 {
02666 $retVal = ($table=='pages' && t3lib_div::testInt($uid)) ? $uid : $pid;
02667 return $retVal;
02668 }
|
|
Returns TSConfig for the TCEFORM object in Page TSconfig. Used in TCEFORMs Usage: 4
Definition at line 2590 of file class.t3lib_befunc.php. References t3lib_BEfunc::BEgetRootLine(), t3lib_BEfunc::getTCAtypeValue(), getTSCpid(), and table(). Referenced by getSingleField_typeFlex_sheetMenu(), SC_wizard_add::init(), SC_wizard_list::main(), and t3lib_transferData::renderRecord(). 02590 { 02591 $res = array(); 02592 $typeVal = t3lib_BEfunc::getTCAtypeValue($table,$row); 02593 02594 // Get main config for the table 02595 list($TScID,$cPid) = t3lib_BEfunc::getTSCpid($table,$row['uid'],$row['pid']); 02596 02597 $rootLine = t3lib_BEfunc::BEgetRootLine($TScID,''); 02598 if ($TScID>=0) { 02599 $tempConf = $GLOBALS['BE_USER']->getTSConfig('TCEFORM.'.$table,t3lib_BEfunc::getPagesTSconfig($TScID,$rootLine)); 02600 if (is_array($tempConf['properties'])) { 02601 while(list($key,$val)=each($tempConf['properties'])) { 02602 if (is_array($val)) { 02603 $fieldN = substr($key,0,-1); 02604 $res[$fieldN] = $val; 02605 unset($res[$fieldN]['types.']); 02606 if (strcmp($typeVal,'') && is_array($val['types.'][$typeVal.'.'])) { 02607 $res[$fieldN] = t3lib_div::array_merge_recursive_overrule($res[$fieldN],$val['types.'][$typeVal.'.']); 02608 } 02609 } 02610 } 02611 } 02612 } 02613 $res['_CURRENT_PID']=$cPid; 02614 $res['_THIS_UID']=$row['uid']; 02615 $res['_THIS_CID']=$row['cid']; 02616 $res['_THIS_ROW']=$row; // So the row will be passed to foreign_table_where_query() 02617 reset($rootLine); 02618 while(list(,$rC)=each($rootLine)) { 02619 if (!$res['_STORAGE_PID']) $res['_STORAGE_PID']=intval($rC['storage_pid']); 02620 if (!$res['_SITEROOT']) $res['_SITEROOT']=$rC['is_siteroot']?intval($rC['uid']):0; 02621 } 02622 02623 return $res; 02624 }
|
|
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
Definition at line 2637 of file class.t3lib_befunc.php. References t3lib_BEfunc::getRecord(), and table(). Referenced by t3lib_TCEmain::copyRecord(), getSingleField_typeFlex_sheetMenu(), and getTSCpid(). 02637 { 02638 if (t3lib_div::testInt($pid)) { // If pid is an integer this takes precedence in our lookup. 02639 $thePidValue = intval($pid); 02640 if ($thePidValue<0) { // If ref to another record, look that record up. 02641 $pidRec = t3lib_BEfunc::getRecord($table,abs($thePidValue),'pid'); 02642 $thePidValue= is_array($pidRec) ? $pidRec['pid'] : -2; // Returns -2 if the record did not exist. 02643 } 02644 // ... else the pos/zero pid is just returned here. 02645 } else { // No integer pid and we are forced to look up the $pid 02646 $rr = t3lib_BEfunc::getRecord($table,$uid,'pid'); // Try to fetch the record pid from uid. If the uid is 'NEW...' then this will of course return nothing... 02647 if (is_array($rr)) { 02648 $thePidValue = $rr['pid']; // Returning the 'pid' of the record 02649 } else $thePidValue=-1; // Returns -1 if the record with the pid was not found. 02650 } 02651 return $thePidValue; 02652 }
|
|
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
Definition at line 2681 of file class.t3lib_befunc.php. References getPidForModTSconfig(), getTSconfig_pidValue(), and table(). Referenced by t3lib_TCEmain::clear_cache(), getSingleField_typeFlex_sheetMenu(), getSingleField_typeText(), getTCEFORM_TSconfig(), tx_cms_layout::isRTEforField(), t3lib_TCEmain::process_datamap(), t3lib_transferData::renderRecord(), and t3lib_TCEmain::setHistory(). 02681 { 02682 // If pid is negative (referring to another record) the pid of the other record is fetched and returned. 02683 $cPid = t3lib_BEfunc::getTSconfig_pidValue($table,$uid,$pid); 02684 // $TScID is the id of $table=pages, else it's the pid of the record. 02685 $TScID = t3lib_BEfunc::getPidForModTSconfig($table,$uid,$cPid); 02686 02687 return array($TScID,$cPid); 02688 }
|
|
Returns true if $modName is set and is found as a main- or submodule in $TBE_MODULES array Usage: 1.
Definition at line 2849 of file class.t3lib_befunc.php. Referenced by SC_alt_main::generateJScode(), SC_alt_doc_nodoc::main(), and t3lib_userAuthGroup::modAccess(). 02849 { 02850 reset($GLOBALS['TBE_MODULES']); 02851 $loaded=array(); 02852 while(list($mkey,$list)=each($GLOBALS['TBE_MODULES'])) { 02853 $loaded[$mkey]=1; 02854 if (trim($list)) { 02855 $subList = t3lib_div::trimExplode(',',$list,1); 02856 while(list(,$skey)=each($subList)) { 02857 $loaded[$mkey.'_'.$skey]=1; 02858 } 02859 } 02860 } 02861 return $modName && isset($loaded[$modName]); 02862 }
|
|
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
Definition at line 3001 of file class.t3lib_befunc.php. References $val. Referenced by typoLink(). 03001 { 03002 $paramArr=array(); 03003 $lines=explode(chr(10),$params); 03004 while(list(,$val)=each($lines)) { 03005 $val = trim($val); 03006 if ($val) { 03007 $pair = explode('=',$val,2); 03008 $paramArr[trim($pair[0])] = trim($pair[1]); 03009 } 03010 } 03011 return $paramArr; 03012 }
|
|
Returns first possible RTE object if available.
Definition at line 2810 of file class.t3lib_befunc.php. Referenced by t3lib_TCEmain::checkValue_flex_procInData_travDS(), t3lib_TCEmain::fillInFieldArray(), getSingleField_typeText(), and t3lib_userAuthGroup::isRTE(). 02810 { 02811 02812 // If no RTE object has been set previously, try to create it: 02813 if (!isset($GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'])) { 02814 02815 // Set the object string to blank by default: 02816 $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'] = array(); 02817 02818 // Traverse registered RTEs: 02819 if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg'])) { 02820 foreach($GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg'] as $extKey => $rteObjCfg) { 02821 $rteObj = &t3lib_div::getUserObj($rteObjCfg['objRef']); 02822 if (is_object($rteObj)) { 02823 if ($rteObj->isAvailable()) { 02824 $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'] = &$rteObj; 02825 break; 02826 } else { 02827 $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'], $rteObj->errorLog); 02828 } 02829 } 02830 } 02831 } 02832 02833 if (!count($GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'])) { 02834 $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'][] = 'No RTEs configured at all'; 02835 } 02836 } 02837 02838 // Return RTE object (if any!) 02839 return $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj']; 02840 }
|
|
Returns overlayered RTE setup from an array with TSconfig. Used in TCEforms and TCEmain Usage: 8
Definition at line 2792 of file class.t3lib_befunc.php. References table(). Referenced by t3lib_TCEmain::checkValue_flex_procInData_travDS(), t3lib_TCEmain::fillInFieldArray(), getSingleField_typeText(), localFolderTree::SC_browse_links::init(), and tx_cms_layout::isRTEforField(). 02792 { 02793 $thisConfig = is_array($RTEprop['default.']) ? $RTEprop['default.'] : array(); 02794 $thisFieldConf = $RTEprop['config.'][$table.'.'][$field.'.']; 02795 if (is_array($thisFieldConf)) { 02796 unset($thisFieldConf['types.']); 02797 $thisConfig = t3lib_div::array_merge_recursive_overrule($thisConfig,$thisFieldConf); 02798 } 02799 if ($type && is_array($RTEprop['config.'][$table.'.'][$field.'.']['types.'][$type.'.'])) { 02800 $thisConfig = t3lib_div::array_merge_recursive_overrule($thisConfig,$RTEprop['config.'][$table.'.'][$field.'.']['types.'][$type.'.']); 02801 } 02802 return $thisConfig; 02803 }
|
|
Select all versions of a record, ordered by version id (DESC).
Definition at line 2746 of file class.t3lib_befunc.php. Referenced by getVersionSelector(). 02746 { 02747 global $TCA; 02748 02749 if ($TCA[$table] && $TCA[$table]['ctrl']['versioning']) { 02750 02751 // Select all versions of record: 02752 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 02753 $fields, 02754 $table, 02755 '(t3ver_oid='.intval($uid).' || uid='.intval($uid).')'. 02756 t3lib_BEfunc::deleteClause($table), 02757 '', 02758 't3ver_id DESC' 02759 ); 02760 02761 // Add rows to output array: 02762 $realPid = 0; 02763 $outputRows = array(); 02764 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 02765 if ($uid==$row['uid']) { 02766 $row['_CURRENT_VERSION']=TRUE; 02767 $realPid = $row['pid']; 02768 } 02769 $outputRows[] = $row; 02770 } 02771 02772 // Set real-pid: 02773 foreach($outputRows as $idx => $oRow) { 02774 $outputRows[$idx]['_REAL_PID'] = $realPid; 02775 } 02776 02777 return $outputRows; 02778 } 02779 }
|
|
Prints TYPO3 Copyright notice for About Modules etc. modules.
Definition at line 2942 of file class.t3lib_befunc.php. Referenced by SC_alt_intro::main(). 02942 { 02943 global $TYPO3_CONF_VARS; 02944 02945 // COPYRIGHT NOTICE: 02946 $loginCopyrightWarrantyProvider = strip_tags(trim($TYPO3_CONF_VARS['SYS']['loginCopyrightWarrantyProvider'])); 02947 $loginCopyrightWarrantyURL = strip_tags(trim($TYPO3_CONF_VARS['SYS']['loginCopyrightWarrantyURL'])); 02948 02949 if (strlen($loginCopyrightWarrantyProvider)>=2 && strlen($loginCopyrightWarrantyURL)>=10) { 02950 $warrantyNote='Warranty is supplied by '.htmlspecialchars($loginCopyrightWarrantyProvider).'; <a href="'.htmlspecialchars($loginCopyrightWarrantyURL).'" target="_blank">click for details.</a>'; 02951 } else { 02952 $warrantyNote='TYPO3 comes with ABSOLUTELY NO WARRANTY; <a href="http://typo3.com/1316.0.html" target="_blank">click for details.</a>'; 02953 } 02954 $cNotice = '<a href="http://typo3.com/" target="_blank"><img src="gfx/loginlogo_transp.gif" width="75" vspace="2" height="19" alt="TYPO3 logo" align="left" />TYPO3 CMS ver. '.htmlspecialchars($GLOBALS['TYPO_VERSION']).'</a>. Copyright © 1998-2004 Kasper Skårhøj. Extensions are copyright of their respective owners. Go to <a href="http://typo3.com/" target="_blank">http://typo3.com/</a> for details. 02955 '.strip_tags($warrantyNote,'<a>').' This is free software, and you are welcome to redistribute it under certain conditions; <a href="http://typo3.com/1316.0.html" target="_blank">click for details</a>. Obstructing the appearance of this notice is prohibited by law.'; 02956 02957 return $cNotice; 02958 }
|
|
Print error message with header, text etc. Usage: 19
Definition at line 2898 of file class.t3lib_befunc.php. References header(), and table(). Referenced by t3lib_beUserAuth::backendCheckLogin(), SC_index::checkRedirect(), SC_wizard_forms::formsWizard(), language::init(), t3lib_userAuthGroup::isInWebMount(), t3lib_userAuthGroup::modAccess(), and SC_wizard_table::tableWizard(). 02898 { 02899 // This prints out a TYPO3 error message. 02900 // If $js is set the message will be output in JavaScript 02901 if ($js) { 02902 echo "alert('".t3lib_div::slashJS($header.'\n'.$text)."');"; 02903 } else { 02904 echo $head?'<html> 02905 <head> 02906 <title>Error!</title> 02907 </head> 02908 <body bgcolor="white" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">':''; 02909 echo '<div align="center"> 02910 <table border="0" cellspacing="0" cellpadding="0" width="333"> 02911 <tr> 02912 <td align="center">'. 02913 ($GLOBALS['TBE_STYLES']['logo_login']?'<img src="'.$GLOBALS['BACK_PATH'].$GLOBALS['TBE_STYLES']['logo_login'].'" alt="" />':'<img src="'.$GLOBALS['BACK_PATH'].'gfx/typo3logo.gif" width="333" height="43" vspace="10" />'). 02914 '</td> 02915 </tr> 02916 <tr> 02917 <td bgcolor="black"> 02918 <table width="100%" border="0" cellspacing="1" cellpadding="10"> 02919 <tr> 02920 <td bgcolor="#F4F0E8"> 02921 <font face="verdana,arial,helvetica" size="2">'; 02922 echo '<b><center><font size="+1">'.$header.'</font></center></b><br />'.$text; 02923 echo ' </font> 02924 </td> 02925 </tr> 02926 </table> 02927 </td> 02928 </tr> 02929 </table> 02930 </div>'; 02931 echo $head?' 02932 </body> 02933 </html>':''; 02934 } 02935 }
|