Index: t3lib/class.t3lib_stdgraphic.php
===================================================================
--- t3lib/class.t3lib_stdgraphic.php (Revision 7591)
+++ t3lib/class.t3lib_stdgraphic.php (Arbeitskopie)
@@ -785,7 +785,7 @@
$x=0;
if (!$spacing && $wordSpacing) {
$bits = explode(' ',$theText);
- while(list(,$word)=each($bits)) {
+ foreach ($bits as $word) {
$word.=' ';
$wordInf = $this->ImageTTFBBoxWrapper($conf['fontSize'], $conf['angle'], $conf['fontFile'], $word, $conf['splitRendering.'],$sF);
$wordW = ($wordInf[2]-$wordInf[0]);
@@ -908,8 +908,7 @@
if (!$spacing && $wordSpacing) {
$bits = explode(' ',$text);
- reset($bits);
- while(list(,$word)=each($bits)) {
+ foreach ($bits as $word) {
$word.=' ';
$word = $word;
$wordInf = $this->ImageTTFBBoxWrapper($fontSize, $angle, $fontFile, $word, $splitRenderingConf ,$sF);
@@ -1653,7 +1652,7 @@
if (!trim($setup)){return '';}
$effects = explode('|', $setup);
$commands = '';
- while(list(,$val)=each($effects)) {
+ foreach ($effects as $val) {
$pairs=explode('=',$val,2);
$value = trim($pairs[1]);
$effect = strtolower(trim($pairs[0]));
@@ -1736,7 +1735,7 @@
$setup = $conf['value'];
if (!trim($setup)){return '';}
$effects = explode('|', $setup);
- while(list(,$val)=each($effects)) {
+ foreach ($effects as $val) {
$pairs=explode('=',$val,2);
$value = trim($pairs[1]);
$effect = strtolower(trim($pairs[0]));
@@ -2635,7 +2634,7 @@
if ($splitstring) {
preg_match('/([^\.]*)$/',$imagefile,$reg);
$splitinfo = explode(' ', $splitstring);
- while (list($key,$val) = each($splitinfo)) {
+ foreach ($splitinfo as $key => $val) {
$temp = '';
if ($val) {$temp = explode('x', $val);}
if (intval($temp[0]) && intval($temp[1])) {
Index: t3lib/class.t3lib_basicfilefunc.php
===================================================================
--- t3lib/class.t3lib_basicfilefunc.php (Revision 7591)
+++ t3lib/class.t3lib_basicfilefunc.php (Arbeitskopie)
@@ -324,8 +324,7 @@
*/
function checkPathAgainstMounts($thePath) {
if ($thePath && $this->isPathValid($thePath) && is_array($this->mounts)) {
- reset ($this->mounts);
- while(list($k,$val)=each($this->mounts)) {
+ foreach ($this->mounts as $k => $val) {
if (t3lib_div::isFirstPartOfStr($thePath,$val['path'])) {
return $k;
}
@@ -342,8 +341,7 @@
global $TYPO3_CONF_VARS;
if (is_array($this->mounts)) {
- reset ($this->mounts);
- while(list($k,$val)=each($this->mounts)) {
+ foreach ($this->mounts as $k => $val) {
if (t3lib_div::isFirstPartOfStr($val['path'], PATH_site.$TYPO3_CONF_VARS['BE']['fileadminDir'])) {
return $k;
}
@@ -376,8 +374,7 @@
*/
function findTempFolder() {
if ($this->tempFN && is_array($this->mounts)) {
- reset ($this->mounts);
- while(list($k,$val)=each($this->mounts)) {
+ foreach ($this->mounts as $k => $val) {
$tDir = $val['path'].$this->tempFN;
if (@is_dir($tDir)) {
return $tDir;
Index: t3lib/class.t3lib_scbase.php
===================================================================
--- t3lib/class.t3lib_scbase.php (Revision 7591)
+++ t3lib/class.t3lib_scbase.php (Arbeitskopie)
@@ -292,8 +292,7 @@
function mergeExternalItems($modName,$menuKey,$menuArr) {
$mergeArray = $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
if (is_array($mergeArray)) {
- reset($mergeArray);
- while(list($k,$v)=each($mergeArray)) {
+ foreach ($mergeArray as $k => $v) {
if ((string)$v['ws']==='' ||
($GLOBALS['BE_USER']->workspace===0 && t3lib_div::inList($v['ws'],'online')) ||
($GLOBALS['BE_USER']->workspace===-1 && t3lib_div::inList($v['ws'],'offline')) ||
Index: t3lib/class.t3lib_refindex.php
===================================================================
--- t3lib/class.t3lib_refindex.php (Revision 7591)
+++ t3lib/class.t3lib_refindex.php (Arbeitskopie)
@@ -931,8 +931,7 @@
unset($wl[$row['baseword']]);
}
- reset($wl);
- while(list($key,$val)=each($wl)) {
+ foreach ($wl as $key => $val) {
$insertFields = array(
'wid' => t3lib_div::md5int($key),
'baseword' => $key
Index: t3lib/config_default.php
===================================================================
--- t3lib/config_default.php (Revision 7591)
+++ t3lib/config_default.php (Arbeitskopie)
@@ -590,8 +590,7 @@
require(PATH_typo3conf.$TYPO3_LOADED_EXT['_CACHEFILE'].'_ext_localconf.php');
} else {
$temp_TYPO3_LOADED_EXT = $TYPO3_LOADED_EXT;
- reset($temp_TYPO3_LOADED_EXT);
- while(list($_EXTKEY,$temp_lEDat)=each($temp_TYPO3_LOADED_EXT)) {
+ foreach ($temp_TYPO3_LOADED_EXT as $_EXTKEY => $temp_lEDat) {
if (is_array($temp_lEDat) && $temp_lEDat['ext_localconf.php']) {
$_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];
require($temp_lEDat['ext_localconf.php']);
Index: t3lib/stddb/load_ext_tables.php
===================================================================
--- t3lib/stddb/load_ext_tables.php (Revision 7591)
+++ t3lib/stddb/load_ext_tables.php (Arbeitskopie)
@@ -11,8 +11,7 @@
* @see tslib_fe::includeTCA(), typo3/init.php
*/
$temp_TYPO3_LOADED_EXT = $GLOBALS['TYPO3_LOADED_EXT'];
-reset($temp_TYPO3_LOADED_EXT);
-while(list($_EXTKEY,$temp_lEDat)=each($temp_TYPO3_LOADED_EXT)) {
+foreach ($temp_TYPO3_LOADED_EXT as $_EXTKEY => $temp_lEDat) {
if (is_array($temp_lEDat) && $temp_lEDat['ext_tables.php']) {
$_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];
require($temp_lEDat['ext_tables.php']);
Index: t3lib/class.t3lib_recordlist.php
===================================================================
--- t3lib/class.t3lib_recordlist.php (Revision 7591)
+++ t3lib/class.t3lib_recordlist.php (Arbeitskopie)
@@ -170,8 +170,7 @@
$ccount=0;
// Traverse field array which contains the data to present:
- reset($this->fieldArray);
- while(list(,$vKey)=each($this->fieldArray)) {
+ foreach ($this->fieldArray as $vKey) {
if (isset($data[$vKey])) {
if ($lastKey) {
$cssClass = $this->addElement_tdCssClass[$lastKey];
Index: t3lib/class.t3lib_timetrack.php
===================================================================
--- t3lib/class.t3lib_timetrack.php (Revision 7591)
+++ t3lib/class.t3lib_timetrack.php (Arbeitskopie)
@@ -398,8 +398,7 @@
$keyLabel = '';
if (!$flag_tree && $data['stackPointer']) {
$temp = array();
- reset($data['tsStack']);
- while(list($k,$v)=each($data['tsStack'])) {
+ foreach ($data['tsStack'] as $k => $v) {
$temp[] = t3lib_div::fixed_lgd_cs(implode($v,$k?'.':'/'),-$keyLgd);
}
array_pop($temp);
@@ -438,8 +437,7 @@
$msgArr = array();
$msg = '';
if ($flag_messages && is_array($data['message'])) {
- reset($data['message']);
- while(list(,$v)=each($data['message'])) {
+ foreach ($data['message'] as $v) {
$msgArr[] = nl2br($v);
}
}
@@ -481,16 +479,14 @@
$ac=0;
$c=0;
// First, find number of entries
- reset($arr);
- while(list($k,$v)=each($arr)) {
+ foreach ($arr as $k => $v) {
if (t3lib_div::testInt($k)) {
$ac++;
}
}
// Traverse through entries
$subtime=0;
- reset($arr);
- while(list($k,$v)=each($arr)) {
+ foreach ($arr as $k => $v) {
if (t3lib_div::testInt($k)) {
$c++;
@@ -522,8 +518,7 @@
$content=$this->fixCLen($content, $this->tsStackLog[$vKey]['value']);
// Traverse array again, this time substitute the unique hash with the red key
- reset($arr);
- while(list($k,$v)=each($arr)) {
+ foreach ($arr as $k => $v) {
if (t3lib_div::testInt($k)) {
if (strlen($this->tsStackLog[$v]['content'])) {
$content = str_replace($v, '['.$this->tsStackLog[$v]['key'].']', $content);
Index: t3lib/class.t3lib_admin.php
===================================================================
--- t3lib/class.t3lib_admin.php (Revision 7591)
+++ t3lib/class.t3lib_admin.php (Arbeitskopie)
@@ -314,10 +314,9 @@
*/
function lostRecords($pid_list) {
global $TCA;
- reset($TCA);
$this->lostPagesList='';
if ($pid_list) {
- while (list($table)=each($TCA)) {
+ foreach ($TCA as $table => $tableConf) {
t3lib_div::loadTCA($table);
$pid_list_tmp = $pid_list;
@@ -373,11 +372,10 @@
*/
function countRecords($pid_list) {
global $TCA;
- reset($TCA);
$list=Array();
$list_n=Array();
if ($pid_list) {
- while (list($table)=each($TCA)) {
+ foreach ($TCA as $table => $tableConf) {
t3lib_div::loadTCA($table);
$pid_list_tmp = $pid_list;
@@ -408,13 +406,11 @@
*/
function getGroupFields($mode) {
global $TCA;
- reset ($TCA);
$result = Array();
- while (list($table)=each($TCA)) {
+ foreach ($TCA as $table => $tableConf) {
t3lib_div::loadTCA($table);
$cols = $TCA[$table]['columns'];
- reset ($cols);
- while (list($field,$config)=each($cols)) {
+ foreach ($cols as $field => $config) {
if ($config['config']['type']=='group') {
if (
((!$mode||$mode=='file') && $config['config']['internal_type']=='file') ||
@@ -442,13 +438,11 @@
*/
function getFileFields($uploadfolder) {
global $TCA;
- reset ($TCA);
$result = Array();
- while (list($table)=each($TCA)) {
+ foreach ($TCA as $table => $tableConf) {
t3lib_div::loadTCA($table);
$cols = $TCA[$table]['columns'];
- reset ($cols);
- while (list($field,$config)=each($cols)) {
+ foreach ($cols as $field => $config) {
if ($config['config']['type']=='group' && $config['config']['internal_type']=='file' && $config['config']['uploadfolder']==$uploadfolder) {
$result[]=Array($table,$field);
}
@@ -467,11 +461,10 @@
global $TCA;
$result = Array();
reset ($TCA);
- while (list($table)=each($TCA)) {
+ foreach ($TCA as $table => $tableConf) {
t3lib_div::loadTCA($table);
$cols = $TCA[$table]['columns'];
- reset ($cols);
- while (list($field,$config)=each($cols)) {
+ foreach ($cols as $field => $config) {
if ($config['config']['type']=='group' && $config['config']['internal_type']=='db') {
if (trim($config['config']['allowed'])=='*' || strstr($config['config']['allowed'],$theSearchTable)) {
$result[]=Array($table,$field);
@@ -494,8 +487,7 @@
function selectNonEmptyRecordsWithFkeys($fkey_arrays) {
global $TCA;
if (is_array($fkey_arrays)) {
- reset($fkey_arrays);
- while (list($table,$field_list)=each($fkey_arrays)) {
+ foreach ($fkey_arrays as $table => $field_list) {
if ($TCA[$table] && trim($field_list)) {
t3lib_div::loadTCA($table);
$fieldArr = explode(',',$field_list);
@@ -506,7 +498,7 @@
list(,$field)=each($fieldArr);
$cl_fl = ($GLOBALS['TYPO3_DB']->MetaType($fields[$field]['type'],$table) == 'I' || $GLOBALS['TYPO3_DB']->MetaType($fields[$field]['type'],$table) == 'N' || $GLOBALS['TYPO3_DB']->MetaType($fields[$field]['type'],$table) == 'R') ?
$field.'!=0' : $field.'!=\'\'';
- while (list(,$field)=each($fieldArr)) {
+ foreach ($fieldArr as $field) {
$cl_fl .= ($GLOBALS['TYPO3_DB']->MetaType($fields[$field]['type'],$table) == 'I' || $GLOBALS['TYPO3_DB']->MetaType($fields[$field]['type'],$table) == 'N' || $GLOBALS['TYPO3_DB']->MetaType($fields[$field]['type'],$table) == 'R') ?
' OR '.$field.'!=0' : ' OR '.$field.'!=\'\'';
}
@@ -518,8 +510,7 @@
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,'.$field_list, $table, $cl_fl);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres)) {
- reset($fieldArr);
- while (list(,$field)=each($fieldArr)) {
+ foreach ($fieldArr as $field) {
if (trim($row[$field])) {
$fieldConf = $TCA[$table]['columns'][$field]['config'];
if ($fieldConf['type']=='group') {
@@ -529,8 +520,7 @@
$tempArr=array();
$dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysis->start('','files',$fieldConf['MM'],$row['uid']);
- reset($dbAnalysis->itemArray);
- while (list($somekey,$someval)=each($dbAnalysis->itemArray)) {
+ foreach ($dbAnalysis->itemArray as $somekey => $someval) {
if ($someval['id']) {
$tempArr[]=$someval['id'];
}
@@ -538,8 +528,7 @@
} else {
$tempArr = explode(',',trim($row[$field]));
}
- reset($tempArr);
- while (list(,$file)=each($tempArr)) {
+ foreach ($tempArr as $file) {
$file = trim($file);
if ($file) {
$this->checkFileRefs[$fieldConf['uploadfolder']][$file]+=1;
@@ -550,8 +539,7 @@
// dbs - group
$dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysis->start($row[$field],$fieldConf['allowed'],$fieldConf['MM'],$row['uid'], $table, $fieldConf);
- reset($dbAnalysis->itemArray);
- while (list(,$tempArr)=each($dbAnalysis->itemArray)) {
+ foreach ($dbAnalysis->itemArray as $tempArr) {
$this->checkGroupDBRefs[$tempArr['table']][$tempArr['id']]+=1;
}
}
@@ -560,8 +548,7 @@
// dbs - select
$dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysis->start($row[$field],$fieldConf['foreign_table'],$fieldConf['MM'],$row['uid'], $table, $fieldConf);
- reset($dbAnalysis->itemArray);
- while (list(,$tempArr)=each($dbAnalysis->itemArray)) {
+ foreach ($dbAnalysis->itemArray as $tempArr) {
if ($tempArr['id']>0) {
$this->checkGroupDBRefs[$fieldConf['foreign_table']][$tempArr['id']]+=1;
}
@@ -570,6 +557,7 @@
}
}
}
+ $GLOBALS['TYPO3_DB']->sql_free_result($mres);
}
}
}
@@ -607,8 +595,7 @@
}
$this->checkFileRefs = $newCheckFileRefs;
- reset($this->checkFileRefs);
- while(list($folder,$fileArr)=each($this->checkFileRefs)) {
+ foreach ($this->checkFileRefs as $folder => $fileArr) {
$path = PATH_site.$folder;
if (@is_dir($path)) {
$d = dir($path);
@@ -618,7 +605,7 @@
if ($fileArr[$entry] > 1) {
$temp = $this->whereIsFileReferenced($folder,$entry);
$tempList = '';
- while(list(,$inf)=each($temp)) {
+ foreach ($temp as $inf) {
$tempList.='['.$inf['table'].']['.$inf['uid'].']['.$inf['field'].'] (pid:'.$inf['pid'].') - ';
}
$output['moreReferences'][] = Array($path,$entry,$fileArr[$entry],$tempList);
@@ -633,9 +620,8 @@
}
}
$d->close();
- reset($fileArr);
$tempCounter=0;
- while(list($file,)=each($fileArr)) {
+ foreach ($fileArr as $file => $value) {
// workaround for direct file references
if (preg_match('/^' . preg_quote($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') . '/', $folder)) {
$file = $folder . '/' . $file;
@@ -644,7 +630,7 @@
}
$temp = $this->whereIsFileReferenced($folder,$file);
$tempList = '';
- while(list(,$inf)=each($temp)) {
+ foreach ($temp as $inf) {
$tempList.='['.$inf['table'].']['.$inf['uid'].']['.$inf['field'].'] (pid:'.$inf['pid'].') - ';
}
$tempCounter++;
@@ -665,13 +651,10 @@
*/
function testDBRefs($theArray) {
global $TCA;
- reset($theArray);
- while(list($table,$dbArr)=each($theArray)) {
+ foreach ($theArray as $table => $dbArr) {
if ($TCA[$table]) {
- $idlist = Array();
- while(list($id,)=each($dbArr)) {
- $idlist[]=$id;
- }
+ $idlist = array_keys($dbArr);
+
$theList = implode(',',$idlist);
if ($theList) {
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', $table, 'uid IN ('.$theList.')'.t3lib_BEfunc::deleteClause($table));
@@ -682,8 +665,7 @@
$result.='Strange Error. ...
';
}
}
- reset($dbArr);
- while (list($theId,$theC)=each($dbArr)) {
+ foreach ($dbArr as $theId => $theC) {
$result.='There are '.$theC.' records pointing to this missing or deleted record; ['.$table.']['.$theId.']
';
}
}
@@ -705,7 +687,7 @@
global $TCA;
$fileFields = $this->getDBFields($searchTable); // Gets tables / Fields that reference to files...
$theRecordList=Array();
- while (list(,$info)=each($fileFields)) {
+ foreach ($fileFields as $info) {
$table=$info[0]; $field=$info[1];
t3lib_div::loadTCA($table);
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
@@ -720,13 +702,13 @@
$dbAnalysis = t3lib_div::makeInstance('t3lib_loadDBGroup');
$dbAnalysis->start($row[$field],$allowedTables,$fieldConf['MM'],$row['uid'], $table, $fieldConf);
- reset($dbAnalysis->itemArray);
- while (list(,$tempArr)=each($dbAnalysis->itemArray)) {
+ foreach ($dbAnalysis->itemArray as $tempArr) {
if ($tempArr['table']==$searchTable && $tempArr['id']==$id) {
$theRecordList[]=Array('table'=>$table,'uid'=>$row['uid'],'field'=>$field,'pid'=>$row['pid']);
}
}
}
+ $GLOBALS['TYPO3_DB']->sql_free_result($mres);
}
return $theRecordList;
}
@@ -742,7 +724,7 @@
global $TCA;
$fileFields = $this->getFileFields($uploadfolder); // Gets tables / Fields that reference to files...
$theRecordList=Array();
- while (list(,$info)=each($fileFields)) {
+ foreach ($fileFields as $info) {
$table=$info[0]; $field=$info[1];
$mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid,pid,'.$TCA[$table]['ctrl']['label'].','.$field,
@@ -752,7 +734,7 @@
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres)) {
// Now this is the field, where the reference COULD come from. But we're not garanteed, so we must carefully examine the data.
$tempArr = explode(',',trim($row[$field]));
- while (list(,$file)=each($tempArr)) {
+ foreach ($tempArr as $file) {
$file = trim($file);
if ($file==$filename) {
$theRecordList[]=Array('table'=>$table,'uid'=>$row['uid'],'field'=>$field,'pid'=>$row['pid']);
Index: t3lib/class.t3lib_tsstyleconfig.php
===================================================================
--- t3lib/class.t3lib_tsstyleconfig.php (Revision 7591)
+++ t3lib/class.t3lib_tsstyleconfig.php (Arbeitskopie)
@@ -123,8 +123,7 @@
$this->flatSetup = $temp;
- reset($theConstants);
- while(list($k,$p)=each($theConstants)) {
+ foreach ($theConstants as $k => $p) {
if (isset($this->objReg[$k])) {
$theConstants[$k]["value"] = $this->ext_realValues[$k];
}
Index: t3lib/class.t3lib_extmgm.php
===================================================================
--- t3lib/class.t3lib_extmgm.php (Revision 7591)
+++ t3lib/class.t3lib_extmgm.php (Arbeitskopie)
@@ -670,8 +670,7 @@
case 'after':
case 'before':
$pointer = 0;
- reset($mods);
- while(list($k, $m) = each($mods)) {
+ foreach ($mods as $k => $m) {
if (!strcmp($m, $modRef)) {
$pointer = strtolower($place)=='after'?$k+1:$k;
}
@@ -1013,8 +1012,7 @@
t3lib_div::loadTCA('tt_content');
if (is_array($TCA['tt_content']['columns']) && is_array($TCA['tt_content']['columns'][$type]['config']['items'])) {
- reset($TCA['tt_content']['columns'][$type]['config']['items']);
- while(list($k, $v) = each($TCA['tt_content']['columns'][$type]['config']['items'])) {
+ foreach ($TCA['tt_content']['columns'][$type]['config']['items'] as $k => $v) {
if (!strcmp($v[1], $itemArray[1])) {
$TCA['tt_content']['columns'][$type]['config']['items'][$k] = $itemArray;
return;
@@ -1465,8 +1463,7 @@
?>';
- reset($extensions);
- while(list($key, $conf) = each($extensions)) {
+ foreach ($extensions as $key => $conf) {
if (is_array($conf)) {
if ($conf['ext_localconf.php']) {
$cFiles['ext_localconf'].=t3lib_extMgm::_makeIncludeHeader($key, $conf['ext_localconf.php']);
Index: t3lib/class.t3lib_positionmap.php
===================================================================
--- t3lib/class.t3lib_positionmap.php (Revision 7591)
+++ t3lib/class.t3lib_positionmap.php (Arbeitskopie)
@@ -367,7 +367,7 @@
$codeA = t3lib_div::trimExplode(',',$codes.",line",1);
$lines=array();
- while(list(,$code)=each($codeA)) {
+ foreach ($codeA as $code) {
if ($code=="blank" || $allBlank) {
$lines[]='';
} else {
@@ -407,7 +407,7 @@
$colPosArray = t3lib_div::trimExplode(',',$colPosList,1);
$lines=array();
- while(list($kk,$vv)=each($colPosArray)) {
+ foreach ($colPosArray as $kk => $vv) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
'tt_content',
Index: t3lib/class.t3lib_diff.php
===================================================================
--- t3lib/class.t3lib_diff.php (Revision 7591)
+++ t3lib/class.t3lib_diff.php (Arbeitskopie)
@@ -97,11 +97,10 @@
$diffRes = $this->getDiff(implode(LF,$str1Lines).LF,implode(LF,$str2Lines).LF);
if (is_array($diffRes)) {
- reset($diffRes);
$c=0;
$diffResArray=array();
$differenceStr = '';
- while(list(,$lValue)=each($diffRes)) {
+ foreach ($diffRes as $lValue) {
if (intval($lValue)) {
$c=intval($lValue);
$diffResArray[$c]['changeInfo']=$lValue;
@@ -205,8 +204,7 @@
function explodeStringIntoWords($str) {
$strArr = t3lib_div::trimExplode(LF,$str);
$outArray=array();
- reset($strArr);
- while(list(,$lineOfWords)=each($strArr)) {
+ foreach ($strArr as $lineOfWords) {
$allWords = t3lib_div::trimExplode(' ',$lineOfWords,1);
$outArray = array_merge($outArray,$allWords);
$outArray[]='';
Index: t3lib/class.t3lib_querygenerator.php
===================================================================
--- t3lib/class.t3lib_querygenerator.php (Revision 7591)
+++ t3lib/class.t3lib_querygenerator.php (Arbeitskopie)
@@ -249,8 +249,7 @@
$fieldListArr = array();
if (is_array($TCA[$this->table])) {
t3lib_div::loadTCA($this->table);
- reset($TCA[$this->table]['columns']);
- while(list($fN)=each($TCA[$this->table]['columns'])) {
+ foreach ($TCA[$this->table]['columns'] as $fN => $value)
$fieldListArr[]=$fN;
}
$fieldListArr[]='uid';
@@ -283,8 +282,7 @@
$this->fieldList = $fieldList ? $fieldList : $this->makeFieldList();
$fieldArr = t3lib_div::trimExplode(',',$this->fieldList,1);
- reset($fieldArr);
- while(list(,$fN)=each($fieldArr)) {
+ foreach ($fieldArr as $fN) {
$fC = $TCA[$this->table]['columns'][$fN];
$this->fields[$fN] = $fC['config'];
$this->fields[$fN]['exclude'] = $fC['exclude'];
@@ -411,9 +409,8 @@
*/
function setAndCleanUpExternalLists($name,$list,$force='') {
$fields = array_unique(t3lib_div::trimExplode(',',$list.','.$force,1));
- reset($fields);
$reList=array();
- while(list(,$fN)=each($fields)) {
+ foreach ($fields as $fN) {
if ($this->fields[$fN]) $reList[]=$fN;
}
$this->extFieldLists[$name]=implode(',',$reList);
@@ -537,10 +534,9 @@
if(!$queryConfig[0] || !$queryConfig[0]['type']) $queryConfig[0] = array('type'=>'FIELD_');
}
// Traverse:
- reset($queryConfig);
$c=0;
$arrCount=0;
- while(list($key,$conf)=each($queryConfig)) {
+ foreach ($queryConfig as $key => $conf) {
if(substr($conf['type'],0,6)=='FIELD_') {
$fName = substr($conf['type'],6);
$fType = $this->fields[$fName]['type'];
@@ -589,10 +585,9 @@
$codeArr=array();
if (!is_array($queryConfig)) $queryConfig=$this->queryConfig;
- reset($queryConfig);
$c=0;
$arrCount=0;
- while(list($key,$conf)=each($queryConfig)) {
+ foreach ($queryConfig as $key => $conf) {
$subscript = $parent.'['.$key.']';
$lineHTML = '';
$lineHTML.=$this->mkOperatorSelect($this->name.$subscript,$conf['operator'],$c,($conf['type']!='FIELD_'));
@@ -953,12 +948,11 @@
* @return [type] ...
*/
function printCodeArray($codeArr,$l=0) {
- reset($codeArr);
$line='';
if ($l) $indent='