function charsetEntity2utf8(&$contentArr, $charset) {
// Convert charset if necessary
- reset($contentArr);
- while(list($key,)=each($contentArr)) {
+ foreach ($contentArr as $key => $value) {
if (strlen($contentArr[$key])) {
if ($charset!=='utf-8') {
function processWordsInArrays($contentArr) {
// split all parts to words
- reset($contentArr);
- while(list($key,)=each($contentArr)) {
+ foreach ($contentArr as $key => $value) {
$contentArr[$key] = $this->lexerObj->split2Words($contentArr[$key]);
}
* @return void
*/
function analyzeHeaderinfo(&$retArr,$content,$key,$offset) {
- reset($content[$key]);
- while(list(,$val)=each($content[$key])) {
+ foreach ($content[$key] as $val) {
$val = substr($val,0,60); // Max 60 - because the baseword varchar IS 60. This MUST be the same.
$retArr[$val]['cmp'] = $retArr[$val]['cmp']|pow(2,$offset);
$retArr[$val]['count'] = $retArr[$val]['count']+1;
* @return void
*/
function checkWordList($wl) {
- reset($wl);
$phashArr = array();
- while(list($key,) = each($wl)) {
+ foreach ($wl as $key => $value) {
$phashArr[] = $wl[$key]['hash'];
}
if (count($phashArr)) {
unset($wl[$row['baseword']]);
}
- reset($wl);
- while(list($key,$val)=each($wl)) {
+ foreach ($wl as $key => $val) {
$insertFields = array(
'wid' => $val['hash'],
'baseword' => $key,
function getRecordsNumbers() {
$tables=explode(",","index_phash,index_words,index_rel,index_grlist,index_section,index_fulltext");
$recList=array();
- reset($tables);
- while(list(,$t)=each($tables)) {
+ foreach ($tables as $t) {
$recList[] = array(
$this->tableHead($t),
$GLOBALS['TYPO3_DB']->exec_SELECTcountRows('*', $t)
* @return [type] ...
*/
function formatFeGroup($fegroup_recs) {
- reset($fegroup_recs);
$str = array();
- while(list(,$row)=each($fegroup_recs)) {
+ foreach ($fegroup_recs as $row) {
$str[] = $row["gr_list"]=="0,-1" ? "NL" : $row["gr_list"];
}
arsort($str);
* @return [type] ...
*/
function formatCHash($arr) {
- reset($arr);
- $list=array();
- while(list($k,$v)=each($arr)) {
- $list[]=$k."=".$v;
+ $list = array();
+ foreach ($arr as $k => $v) {
+ $list[] = $k . '=' . $v;
}
- return implode("<BR>",$list);
+ return implode('<br />', $list);
}
/**
*/
function printExtraGrListRows($extraGrListRows) {
if (count($extraGrListRows)) {
- reset($extraGrListRows);
$lines=array();
- while(list(,$r)=each($extraGrListRows)) {
+ foreach ($extraGrListRows as $r) {
$lines[] = $r['gr_list'];
}
return '<br />' . $GLOBALS['TBE_TEMPLATE']->dfw(implode('<br />', $lines));
// This selects the first and secondary menus for the "sections" selector - so we can search in sections and sub sections.
if ($this->conf['show.']['L1sections']) {
$firstLevelMenu = $this->getMenu($this->wholeSiteIdList);
- while(list($kk,$mR) = each($firstLevelMenu)) {
+ foreach ($firstLevelMenu as $kk => $mR) {
// @TODO: RFC #7370: doktype 2&5 are deprecated since TYPO3 4.2-beta1
if ($mR['doktype']!=5 && !$mR['nav_hide']) {
$this->optValues['sections']['rl1_'.$mR['uid']] = trim($this->pi_getLL('opt_RL1').' '.$mR['title']);
if ($this->conf['show.']['L2sections']) {
$secondLevelMenu = $this->getMenu($mR['uid']);
- while(list($kk2,$mR2) = each($secondLevelMenu)) {
+ foreach ($secondLevelMenu as $kk2 => $mR2) {
// @TODO: RFC #7370: doktype 2&5 are deprecated since TYPO3 4.2-beta1
if ($mR2['doktype']!=5 && !$mR2['nav_hide']) {
$this->optValues['sections']['rl2_'.$mR2['uid']] = trim($this->pi_getLL('opt_RL2').' '.$mR2['title']);
} elseif ($this->wholeSiteIdList>=0) { // Collecting all pages IDs in which to search; filtering out ALL pages that are not accessible due to enableFields. Does NOT look for "no_search" field!
$siteIdNumbers = t3lib_div::intExplode(',',$this->wholeSiteIdList);
$id_list=array();
- while(list(,$rootId)=each($siteIdNumbers)) {
+ foreach ($siteIdNumbers as $rootId) {
$id_list[] = $this->cObj->getTreeList($rootId,9999,0,0,'','').$rootId;
}
$page_where = 'ISEC.page_id IN ('.implode(',',$id_list).')';
$hitRoot = 0;
$path = '';
if (is_array($rl) && count($rl)) {
- reset($rl);
- while(list($k,$v)=each($rl)) {
+ foreach ($rl as $k => $v) {
// Check fe_user
if ($v['fe_group'] && ($v['uid']==$id || $v['extendToSubpages'])) {
$this->fe_groups_required[$id][]=$v['fe_group'];