Bug #22194 » 13670-whilelist-foreach_v3-general.patch
t3lib/class.t3lib_admin.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
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;
|
||
... | ... | |
*/
|
||
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;
|
||
... | ... | |
*/
|
||
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') ||
|
||
... | ... | |
*/
|
||
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);
|
||
}
|
||
... | ... | |
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);
|
||
... | ... | |
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);
|
||
... | ... | |
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.'!=\'\'';
|
||
}
|
||
... | ... | |
$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') {
|
||
... | ... | |
$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'];
|
||
}
|
||
... | ... | |
} 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;
|
||
... | ... | |
// 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;
|
||
}
|
||
}
|
||
... | ... | |
// 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;
|
||
}
|
||
... | ... | |
}
|
||
}
|
||
}
|
||
$GLOBALS['TYPO3_DB']->sql_free_result($mres);
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
}
|
||
$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);
|
||
... | ... | |
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);
|
||
... | ... | |
}
|
||
}
|
||
$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;
|
||
... | ... | |
}
|
||
$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++;
|
||
... | ... | |
*/
|
||
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));
|
||
... | ... | |
$result.='Strange Error. ...<br />';
|
||
}
|
||
}
|
||
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.']<br />';
|
||
}
|
||
}
|
||
... | ... | |
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(
|
||
... | ... | |
$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;
|
||
}
|
||
... | ... | |
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,
|
||
... | ... | |
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']);
|
t3lib/class.t3lib_arraybrowser.php (Arbeitskopie) | ||
---|---|---|
if ($depth_in) {$depth_in = $depth_in.'.';}
|
||
$c=count($arr);
|
||
reset($arr);
|
||
while (list($key,)=each($arr)) {
|
||
foreach ($arr as $key => $value) {
|
||
$a++;
|
||
$depth = $depth_in.$key;
|
||
$goto = 'a' . substr(md5($depth), 0, 6);
|
||
... | ... | |
* @return array
|
||
*/
|
||
function getSearchKeys($keyArr, $depth_in, $searchString, $keyArray) {
|
||
reset($keyArr);
|
||
$c=count($keyArr);
|
||
if ($depth_in) {$depth_in = $depth_in.'.';}
|
||
while (list($key,)=each($keyArr)) {
|
||
foreach ($keyArr as $key => $value) {
|
||
$depth=$depth_in.$key;
|
||
$deeper = is_array($keyArr[$key]);
|
||
... | ... | |
*/
|
||
function depthKeys($arr,$settings) {
|
||
$tsbrArray=array();
|
||
reset($arr);
|
||
while(list($theK,$theV)=each($arr)) {
|
||
foreach($arr as $theK => $theV) {
|
||
$theKeyParts = explode('.',$theK);
|
||
$depth='';
|
||
$c=count($theKeyParts);
|
||
$a=0;
|
||
while(list(,$p)=each($theKeyParts)) {
|
||
foreach($theKeyParts as $p) {
|
||
$a++;
|
||
$depth.=($depth?'.':'').$p;
|
||
$tsbrArray[$depth]= ($c==$a) ? $theV : 1;
|
||
}
|
||
}
|
||
// Modify settings
|
||
reset($tsbrArray);
|
||
while(list($theK,$theV)=each($tsbrArray)) {
|
||
foreach($tsbrArray as $theK => $theV) {
|
||
if ($theV) {
|
||
$settings[$theK] = 1;
|
||
} else {
|
t3lib/class.t3lib_basicfilefunc.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
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;
|
||
}
|
||
... | ... | |
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;
|
||
}
|
||
... | ... | |
*/
|
||
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;
|
t3lib/class.t3lib_bedisplaylog.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
function stripPath($inArr) {
|
||
if ($this->stripPath && is_array($inArr)) {
|
||
while(list($key,$val)=each($inArr)) {
|
||
foreach($inArr as $key => $val) {
|
||
$inArr[$key]=basename($val);
|
||
}
|
||
}
|
t3lib/class.t3lib_befunc.php (Arbeitskopie) | ||
---|---|---|
$list = Array();
|
||
if ((string)trim($in_list)!='') {
|
||
$tempItemArray = explode(',', trim($in_list));
|
||
while(list($key, $val) = each($tempItemArray)) {
|
||
foreach($tempItemArray as $key => $val) {
|
||
$val = strrev($val);
|
||
$parts = explode('_', $val, 2);
|
||
if ((string)trim($parts[0])!='') {
|
||
... | ... | |
public static function getSpecConfParametersFromArray($pArr) {
|
||
$out = array();
|
||
if (is_array($pArr)) {
|
||
reset($pArr);
|
||
while(list($k, $v) = each($pArr)) {
|
||
foreach($pArr as $k => $v) {
|
||
$parts = explode('=', $v, 2);
|
||
if (count($parts)==2) {
|
||
$out[trim($parts[0])] = trim($parts[1]);
|
||
... | ... | |
if (!is_array($impParams)) {
|
||
$impParams =t3lib_BEfunc::implodeTSParams(t3lib_BEfunc::getPagesTSconfig($id));
|
||
}
|
||
reset($pageTS);
|
||
$set = array();
|
||
while(list($f, $v) = each($pageTS)) {
|
||
foreach($pageTS as $f => $v) {
|
||
$f = $TSconfPrefix.$f;
|
||
if ((!isset($impParams[$f])&&trim($v)) || strcmp(trim($impParams[$f]), trim($v))) {
|
||
$set[$f] = trim($v);
|
||
... | ... | |
$TSlines = explode(chr(10), $pRec['TSconfig']);
|
||
$TSlines = array_reverse($TSlines);
|
||
// Reset the set of changes.
|
||
reset($set);
|
||
while(list($f, $v) = each($set)) {
|
||
reset($TSlines);
|
||
foreach($set as $f => $v) {
|
||
$inserted = 0;
|
||
while(list($ki, $kv) = each($TSlines)) {
|
||
foreach($TSlines as $ki => $kv) {
|
||
if (substr($kv, 0, strlen($f)+1)==$f.'=') {
|
||
$TSlines[$ki] = $f.'='.$v;
|
||
$inserted = 1;
|
||
... | ... | |
public static function implodeTSParams($p, $k = '') {
|
||
$implodeParams = array();
|
||
if (is_array($p)) {
|
||
reset($p);
|
||
while(list($kb, $val) = each($p)) {
|
||
foreach($p as $kb => $val) {
|
||
if (is_array($val)) {
|
||
$implodeParams = array_merge($implodeParams, t3lib_BEfunc::implodeTSParams($val, $k.$kb));
|
||
} else {
|
||
... | ... | |
*/
|
||
public static function blindUserNames($usernames, $groupArray, $excludeBlindedFlag = 0) {
|
||
if (is_array($usernames) && is_array($groupArray)) {
|
||
while(list($uid, $row) = each($usernames)) {
|
||
foreach($usernames as $uid => $row) {
|
||
$userN = $uid;
|
||
$set = 0;
|
||
if ($row['uid']!=$GLOBALS['BE_USER']->user['uid']) {
|
||
reset($groupArray);
|
||
while(list(,$v) = each($groupArray)) {
|
||
foreach($groupArray as $v) {
|
||
if ($v && t3lib_div::inList($row['usergroup_cached_list'], $v)) {
|
||
$userN = $row['username'];
|
||
$set = 1;
|
||
... | ... | |
*/
|
||
public static function blindGroupNames($groups, $groupArray, $excludeBlindedFlag = 0) {
|
||
if (is_array($groups) && is_array($groupArray)) {
|
||
while(list($uid, $row) = each($groups)) {
|
||
foreach($groups as $uid => $row) {
|
||
$groupN = $uid;
|
||
$set = 0;
|
||
if (t3lib_div::inArray($groupArray, $uid)) {
|
||
... | ... | |
// Traverse files:
|
||
$thumbs = explode(',', $row[$field]);
|
||
$thumbData = '';
|
||
while(list(,$theFile) = each($thumbs)) {
|
||
foreach($thumbs as $theFile) {
|
||
if (trim($theFile)) {
|
||
$fI = t3lib_div::split_fileref($theFile);
|
||
$ext = $fI['fileext'];
|
||
... | ... | |
// Check, if there is an "items" array:
|
||
if (is_array($TCA[$table]) && is_array($TCA[$table]['columns'][$col]) && is_array($TCA[$table]['columns'][$col]['config']['items'])) {
|
||
// Traverse the items-array...
|
||
reset($TCA[$table]['columns'][$col]['config']['items']);
|
||
while(list($k, $v) = each($TCA[$table]['columns'][$col]['config']['items'])) {
|
||
foreach($TCA[$table]['columns'][$col]['config']['items'] as $k => $v) {
|
||
// ... and return the first found label where the value was equal to $key
|
||
if (!strcmp($v[1], $key)) return $v[0];
|
||
}
|
||
... | ... | |
$l = $value;
|
||
} else {
|
||
$rParts = t3lib_div::trimExplode(',', $value, 1);
|
||
reset($rParts);
|
||
$lA = array();
|
||
while(list(,$rVal) = each($rParts)) {
|
||
foreach($rParts as $rVal) {
|
||
$rVal = intval($rVal);
|
||
if ($rVal>0) {
|
||
$r = t3lib_BEfunc::getRecordWSOL($theColConf['foreign_table'], $rVal);
|
||
... | ... | |
if (!is_array($theColConf['items']) || count($theColConf['items'])==1) {
|
||
$l = $value ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:yes') : $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:no');
|
||
} else {
|
||
reset($theColConf['items']);
|
||
$lA = Array();
|
||
while(list($key, $val) = each($theColConf['items'])) {
|
||
foreach($theColConf['items'] as $key => $val) {
|
||
if ($value & pow(2, $key)) {$lA[] = $GLOBALS['LANG']->sL($val[0]);}
|
||
}
|
||
$l = implode(', ', $lA);
|
||
... | ... | |
public static function makeConfigForm($configArray, $defaults, $dataPrefix) {
|
||
$params = $defaults;
|
||
if (is_array($configArray)) {
|
||
reset($configArray);
|
||
$lines = array();
|
||
while(list($fname, $config) = each($configArray)) {
|
||
foreach($configArray as $fname => $config) {
|
||
if (is_array($config)) {
|
||
$lines[$fname] = '<strong>'.htmlspecialchars($config[1]).'</strong><br />';
|
||
$lines[$fname].=$config[2].'<br />';
|
||
... | ... | |
$formEl = '';
|
||
break;
|
||
case 'select':
|
||
reset($config[3]);
|
||
$opt = array();
|
||
while(list($k, $v) = each($config[3])) {
|
||
foreach($config[3] as $k => $v) {
|
||
$opt[] = '<option value="'.htmlspecialchars($k).'"'.($params[$fname]==$k?' selected="selected"':'').'>'.htmlspecialchars($v).'</option>';
|
||
}
|
||
$formEl = '<select name="'.$dataPrefix.'['.$fname.']">'.implode('', $opt).'</select>';
|
||
... | ... | |
// Getting TS-config options for this module for the Backend User:
|
||
$conf = $GLOBALS['BE_USER']->getTSConfig($TSref, $modTSconfig);
|
||
if (is_array($conf['properties'])) {
|
||
reset($conf['properties']);
|
||
while(list($key, $val) = each($conf['properties'])) {
|
||
foreach($conf['properties'] as $key => $val) {
|
||
if (!$val) {
|
||
unset($itemArray[$key]);
|
||
}
|
||
... | ... | |
$fTWHERE = $fieldValue['config'][$prefix.'foreign_table_where'];
|
||
if (strstr($fTWHERE, '###REC_FIELD_')) {
|
||
$fTWHERE_parts = explode('###REC_FIELD_', $fTWHERE);
|
||
while(list($kk, $vv) = each($fTWHERE_parts)) {
|
||
foreach($fTWHERE_parts as $kk => $vv) {
|
||
if ($kk) {
|
||
$fTWHERE_subpart = explode('###', $vv, 2);
|
||
$fTWHERE_parts[$kk] = $TSconfig['_THIS_ROW'][$fTWHERE_subpart[0]].$fTWHERE_subpart[1];
|
||
... | ... | |
if ($TScID>=0) {
|
||
$tempConf = $GLOBALS['BE_USER']->getTSConfig('TCEFORM.'.$table, t3lib_BEfunc::getPagesTSconfig($TScID, $rootLine));
|
||
if (is_array($tempConf['properties'])) {
|
||
while(list($key, $val) = each($tempConf['properties'])) {
|
||
foreach($tempConf['properties'] as $key => $val) {
|
||
if (is_array($val)) {
|
||
$fieldN = substr($key, 0, -1);
|
||
$res[$fieldN] = $val;
|
||
... | ... | |
$res['_THIS_CID'] = $row['cid'];
|
||
$res['_THIS_ROW'] = $row; // So the row will be passed to foreign_table_where_query()
|
||
reset($rootLine);
|
||
while(list(,$rC) = each($rootLine)) {
|
||
foreach($rootLine as $rC) {
|
||
if (!$res['_STORAGE_PID']) $res['_STORAGE_PID'] = intval($rC['storage_pid']);
|
||
if (!$res['_SITEROOT']) $res['_SITEROOT'] = $rC['is_siteroot']?intval($rC['uid']):0;
|
||
}
|
||
... | ... | |
*/
|
||
public static function firstDomainRecord($rootLine) {
|
||
if (t3lib_extMgm::isLoaded('cms')) {
|
||
reset($rootLine);
|
||
while(list(,$row) = each($rootLine)) {
|
||
foreach($rootLine as $row) {
|
||
$dRec = t3lib_BEfunc::getRecordsByField('sys_domain', 'pid', $row['uid'], ' AND redirectTo=\'\' AND hidden=0', '', 'sorting');
|
||
if (is_array($dRec)) {
|
||
reset($dRec);
|
||
... | ... | |
* @return boolean
|
||
*/
|
||
public static function isModuleSetInTBE_MODULES($modName) {
|
||
reset($GLOBALS['TBE_MODULES']);
|
||
$loaded = array();
|
||
while(list($mkey, $list) = each($GLOBALS['TBE_MODULES'])) {
|
||
foreach($GLOBALS['TBE_MODULES'] as $mkey => $list) {
|
||
$loaded[$mkey] = 1;
|
||
if (!is_array($list) && trim($list)) {
|
||
$subList = t3lib_div::trimExplode(',', $list, 1);
|
||
while(list(,$skey) = each($subList)) {
|
||
foreach($subList as $skey) {
|
||
$loaded[$mkey.'_'.$skey] = 1;
|
||
}
|
||
}
|
||
... | ... | |
public static function processParams($params) {
|
||
$paramArr = array();
|
||
$lines = explode(chr(10), $params);
|
||
while(list(,$val) = each($lines)) {
|
||
foreach($lines as $val) {
|
||
$val = trim($val);
|
||
if ($val) {
|
||
$pair = explode('=', $val, 2);
|
t3lib/class.t3lib_clipboard.php (Arbeitskopie) | ||
---|---|---|
*/
|
||
function setCmd($cmd) {
|
||
if (is_array($cmd['el'])) {
|
||
reset($cmd['el']);
|
||
while(list($k,$v)=each($cmd['el'])) {
|
||
foreach($cmd['el'] as $k => $v) {
|
||
if ($this->current=='normal') {
|
||
unset($this->clipData['normal']);
|
||
}
|
||
... | ... | |
*/
|
||
function cleanUpCBC($CBarr,$table,$removeDeselected=0) {
|
||
if (is_array($CBarr)) {
|
||
reset($CBarr);
|
||
while(list($k,$v)=each($CBarr)) {
|
||
foreach($CBarr as $k => $v) {
|
||
$p=explode('|',$k);
|
||
if ((string)$p[0]!=(string)$table || ($removeDeselected && !$v)) {
|
||
unset($CBarr[$k]);
|
||
... | ... | |
$lines=array();
|
||
if (is_array($this->clipData[$pad]['el'])) {
|
||
reset($this->clipData[$pad]['el']);
|
||
while(list($k,$v)=each($this->clipData[$pad]['el'])) {
|
||
foreach($this->clipData[$pad]['el'] as $k => $v) {
|
||
if ($v) {
|
||
list($table,$uid) = explode('|',$k);
|
||
$bgColClass = ($table=='_FILE'&&$this->fileMode)||($table!='_FILE'&&!$this->fileMode) ? 'bgColor4-20' : 'bgColor4';
|
||
... | ... | |
*/
|
||
function editUrl() {
|
||
$elements = $this->elFromTable(''); // all records
|
||
reset($elements);
|
||
$editCMDArray=array();
|
||
while(list($tP)=each($elements)) {
|
||
foreach($elements as $tP => $value) {
|
||
list($table,$uid) = explode('|',$tP);
|
||
$editCMDArray[] = '&edit['.$table.']['.$uid.']=edit';
|
||
}
|
||
... | ... | |
// Traverse items:
|
||
if (is_array($this->clipData[$pad]['el'])) {
|
||
reset($this->clipData[$pad]['el']);
|
||
while(list($k,$v)=each($this->clipData[$pad]['el'])) {
|
||
foreach($this->clipData[$pad]['el'] as $k => $v) {
|
||
if ($v) {
|
||
list($table,$uid) = explode('|',$k);
|
||
... | ... | |
*/
|
||
function cleanCurrent() {
|
||
if (is_array($this->clipData[$this->current]['el'])) {
|
||
reset($this->clipData[$this->current]['el']);
|
||
while(list($k,$v)=each($this->clipData[$this->current]['el'])) {
|
||
foreach($this->clipData[$this->current]['el'] as $k => $v) {
|
||
list($table,$uid) = explode('|',$k);
|
||
if ($table!='_FILE') {
|
||
if (!$v || !is_array(t3lib_BEfunc::getRecord($table,$uid,'uid'))) {
|
||
... | ... | |
$pad = $pad ? $pad : $this->current;
|
||
$list=array();
|
||
if (is_array($this->clipData[$pad]['el'])) {
|
||
reset($this->clipData[$pad]['el']);
|
||
while(list($k,$v)=each($this->clipData[$pad]['el'])) {
|
||
foreach($this->clipData[$pad]['el'] as $k => $v) {
|
||
if ($v) {
|
||
list($table,$uid) = explode('|',$k);
|
||
if ($table!='_FILE') {
|
||
... | ... | |
$mode = $this->currentMode()=='copy' ? 'copy' : 'move';
|
||
// Traverse elements and make CMD array
|
||
reset($elements);
|
||
while(list($tP)=each($elements)) {
|
||
foreach($elements as $tP => $value) {
|
||
list($table,$uid) = explode('|',$tP);
|
||
if (!is_array($CMD[$table])) $CMD[$table]=array();
|
||
$CMD[$table][$uid][$mode]=$pUid;
|
||
... | ... | |
*/
|
||
function makeDeleteCmdArray($CMD) {
|
||
$elements = $this->elFromTable(''); // all records
|
||
reset($elements);
|
||
while(list($tP)=each($elements)) {
|
||
foreach($elements as $tP => $value) {
|
||
list($table,$uid) = explode('|',$tP);
|
||
if (!is_array($CMD[$table])) $CMD[$table]=array();
|
||
$CMD[$table][$uid]['delete']=1;
|
||
... | ... | |
$mode = $this->currentMode()=='copy' ? 'copy' : 'move';
|
||
// Traverse elements and make CMD array
|
||
reset($elements);
|
||
while(list($tP,$path)=each($elements)) {
|
||
foreach($elements as $tP => $path) {
|
||
$FILE[$mode][]=array('data'=>$path,'target'=>$pUid,'altName'=>1);
|
||
if ($mode=='move') $this->removeElement($tP);
|
||
}
|
||
... | ... | |
function makeDeleteCmdArray_file($FILE) {
|
||
$elements = $this->elFromTable('_FILE');
|
||
// Traverse elements and make CMD array
|
||
reset($elements);
|
||
while(list($tP,$path)=each($elements)) {
|
||
foreach($elements as $tP => $path) {
|
||
$FILE['delete'][]=array('data'=>$path);
|
||
$this->removeElement($tP);
|
||
}
|
t3lib/class.t3lib_diff.php (Arbeitskopie) | ||
---|---|---|
$diffRes = $this->getDiff(implode(chr(10),$str1Lines).chr(10),implode(chr(10),$str2Lines).chr(10));
|
||
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;
|
||
... | ... | |
function explodeStringIntoWords($str) {
|
||
$strArr = t3lib_div::trimExplode(chr(10),$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[]='';
|
t3lib/class.t3lib_div.php (Arbeitskopie) | ||
---|---|---|
$reg = array();
|
||
preg_match_all('/'.$regex.'/',$string,$reg);
|
||
reset($reg[2]);
|
||
$number=0;
|
||
$Msign='+';
|
||
$err='';
|
||
$buffer=doubleval(current($reg[2]));
|
||
next($reg[2]); // Advance pointer
|
||
while(list($k,$v)=each($reg[2])) {
|
||
foreach($reg[2] as $k => $v) {
|
||
$v=doubleval($v);
|
||
$sign = $reg[1][$k];
|
||
if ($sign=='+' || $sign=='-') {
|
t3lib/class.t3lib_extmgm.php (Arbeitskopie) | ||
---|---|---|
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;
|
||
}
|
||
... | ... | |
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;
|
||
... | ... | |
?>';
|
||
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']);
|
t3lib/class.t3lib_formmail.php (Arbeitskopie) | ||
---|---|---|
// Runs through $V and generates the mail
|
||
if (is_array($V)) {
|
||
reset($V);
|
||
while (list($key,$val)=each($V)) {
|
||
foreach ($V as $key => $val) {
|
||
if (!t3lib_div::inList($this->reserved_names,$key)) {
|
||
$space = (strlen($val)>60)?chr(10):'';
|
||
$val = (is_array($val) ? implode($val,chr(10)) : $val);
|
t3lib/class.t3lib_fullsearch.php (Arbeitskopie) | ||
---|---|---|
// Store Array:
|
||
$opt=array();
|
||
reset($storeArray);
|
||
while(list($k,$v)=each($storeArray)) {
|
||
foreach($storeArray as $k => $v) {
|
||
$opt[]='<option value="'.$k.'"'.(!strcmp($cur,$v)?' selected':'').'>'.htmlspecialchars($v).'</option>';
|
||
}
|
||
... | ... | |
*/
|
||
function cleanStoreQueryConfigs($storeQueryConfigs,$storeArray) {
|
||
if (is_array($storeQueryConfigs)) {
|
||
reset($storeQueryConfigs);
|
||
while(list($k,$v)=each($storeQueryConfigs)) {
|
||
foreach($storeQueryConfigs as $k => $v) {
|
||
if (!isset($storeArray[$k])) unset($storeQueryConfigs[$k]);
|
||
}
|
||
}
|
||
... | ... | |
*/
|
||
function addToStoreQueryConfigs($storeQueryConfigs,$index) {
|
||
$keyArr = explode(',',$this->storeList);
|
||
reset($keyArr);
|
||
$storeQueryConfigs[$index]=array();
|
||
while(list(,$k)=each($keyArr)) {
|
||
foreach($keyArr as $k) {
|
||
$storeQueryConfigs[$index][$k]=$GLOBALS['SOBE']->MOD_SETTINGS[$k];
|
||
}
|
||
return $storeQueryConfigs;
|
||
... | ... | |
function saveQueryInAction($uid) {
|
||
if (t3lib_extMgm::isLoaded('sys_action')) {
|
||
$keyArr = explode(',',$this->storeList);
|
||
reset($keyArr);
|
||
$saveArr=array();
|
||
while(list(,$k)=each($keyArr)) {
|
||
foreach($keyArr as $k) {
|
||
$saveArr[$k]=$GLOBALS['SOBE']->MOD_SETTINGS[$k];
|
||
}
|
||
... | ... | |
function loadStoreQueryConfigs($storeQueryConfigs,$storeIndex,$writeArray) {
|
||
if ($storeQueryConfigs[$storeIndex]) {
|
||
$keyArr = explode(',',$this->storeList);
|
||
reset($keyArr);
|
||
while(list(,$k)=each($keyArr)) {
|
||
foreach($keyArr => $k) {
|
||
$writeArray[$k]=$storeQueryConfigs[$storeIndex][$k];
|
||
}
|
||
}
|
||
... | ... | |
$limit=200;
|
||
$showAlways=0;
|
||
if ($swords) {
|
||
reset($TCA);
|
||
while(list($table)=each($TCA)) {
|
||
foreach($TCA as $table => $value) {
|
||
// Get fields list
|
||
t3lib_div::loadTCA($table);
|
||
$conf=$TCA[$table];
|
||
... | ... | |
continue;
|
||
}
|
||
reset($conf['columns']);
|
||
$list=array();
|
||
while(list($field,)=each($conf['columns'])) {
|
||
$list[]=$field;
|
||
}
|
||
$list = array_keys($conf['columns']);
|
||
// Get query
|
||
$qp = $GLOBALS['TYPO3_DB']->searchQuery(array($swords), $list, $table);
|
||
... | ... | |
$SET = $GLOBALS['SOBE']->MOD_SETTINGS;
|
||
$out='<tr class="bgColor' . ($even ? '6' : '4') . '">';
|
||
$even = !$even;
|
||
reset($row);
|
||
while(list($fN,$fV)=each($row)) {
|
||
foreach($row as $fN => $fV) {
|
||
if (t3lib_div::inList($SET['queryFields'], $fN) || (!$SET['queryFields'] && $fN!='pid' && $fN!='deleted')) {
|
||
if ($SET['search_result_labels']) {
|
||
$fVnew = $this->getProcessedValueExtra($table, $fN, $fV, $conf, '<br />');
|
t3lib/class.t3lib_modsettings.php (Arbeitskopie) | ||
---|---|---|
$prefix = $prefix ? $prefix : $this->prefix;
|
||
reset($SOBE->MOD_SETTINGS);
|
||
while(list($key)=each($SOBE->MOD_SETTINGS)) {
|
||
foreach($SOBE->MOD_SETTINGS as $key => $value) {
|
||
if (preg_match('/^'.$prefix.'/',$key)) {
|
||
$this->storeList[$key]=$key;
|
||
}
|
t3lib/class.t3lib_parsehtml.php (Arbeitskopie) | ||
---|---|---|
if (is_array($tags[$tagName]['fixAttrib'])) {
|
||
$tagAttrib = $this->get_tag_attributes($tagParts[1]);
|
||
$tagParts[1]='';
|
||
reset($tags[$tagName]['fixAttrib']);
|
||
while(list($attr,$params)=each($tags[$tagName]['fixAttrib'])) {
|
||
foreach($tags[$tagName]['fixAttrib'] as $attr => $params) {
|
||
if (strlen($params['set'])) $tagAttrib[0][$attr] = $params['set'];
|
||
if (strlen($params['unset'])) unset($tagAttrib[0][$attr]);
|
||
if (strcmp($params['default'],'') && !isset($tagAttrib[0][$attr])) $tagAttrib[0][$attr]=$params['default'];
|
||
... | ... | |
// Set config properties.
|
||
if (is_array($TSconfig['tags.'])) {
|
||
reset($TSconfig['tags.']);
|
||
while(list($key,$tagC)=each($TSconfig['tags.'])) {
|
||
foreach($TSconfig['tags.'] as $key => $tagC) {
|
||
if (!is_array($tagC) && $key==strtolower($key)) {
|
||
if (!strcmp($tagC,'0')) unset($keepTags[$key]);
|
||
if (!strcmp($tagC,'1') && !isset($keepTags[$key])) $keepTags[$key]=1;
|
||
}
|
||
}
|
||
reset($TSconfig['tags.']);
|
||
foreach ($TSconfig['tags.'] as $key => $tagC) {
|
||
if (is_array($tagC) && $key==strtolower($key)) {
|
||
$key=substr($key,0,-1);
|
||
if (!is_array($keepTags[$key])) $keepTags[$key]=array();
|
||
if (is_array($tagC['fixAttrib.'])) {
|
||
reset($tagC['fixAttrib.']);
|
||
while(list($atName,$atConfig)=each($tagC['fixAttrib.'])) {
|
||
foreach($tagC['fixAttrib.'] as $atName => $atConfig) {
|
||
if (is_array($atConfig)) {
|
||
$atName=substr($atName,0,-1);
|
||
if (!is_array($keepTags[$key]['fixAttrib'][$atName])) {
|
||
... | ... | |
// localNesting
|
||
if ($TSconfig['localNesting']) {
|
||
$lN = t3lib_div::trimExplode(',',strtolower($TSconfig['localNesting']),1);
|
||
while(list(,$tn)=each($lN)) {
|
||
foreach($lN as $tn) {
|
||
if (isset($keepTags[$tn])) {
|
||
$keepTags[$tn]['nesting']=1;
|
||
}
|
||
... | ... | |
}
|
||
if ($TSconfig['globalNesting']) {
|
||
$lN = t3lib_div::trimExplode(',',strtolower($TSconfig['globalNesting']),1);
|
||
while(list(,$tn)=each($lN)) {
|
||
foreach($lN as $tn) {
|
||
if (isset($keepTags[$tn])) {
|
||
if (!is_array($keepTags[$tn])) $keepTags[$tn]=array();
|
||
$keepTags[$tn]['nesting']='global';
|
||
... | ... | |
}
|
||
if ($TSconfig['rmTagIfNoAttrib']) {
|
||
$lN = t3lib_div::trimExplode(',',strtolower($TSconfig['rmTagIfNoAttrib']),1);
|
||
while(list(,$tn)=each($lN)) {
|
||
foreach($lN as $tn) {
|
||
if (isset($keepTags[$tn])) {
|
||
if (!is_array($keepTags[$tn])) $keepTags[$tn]=array();
|
||
$keepTags[$tn]['rmTagIfNoAttrib']=1;
|
||
... | ... | |
}
|
||
if ($TSconfig['noAttrib']) {
|
||
$lN = t3lib_div::trimExplode(',',strtolower($TSconfig['noAttrib']),1);
|
||
while(list(,$tn)=each($lN)) {
|
||
foreach($lN as $tn) {
|
||
if (isset($keepTags[$tn])) {
|
||
if (!is_array($keepTags[$tn])) $keepTags[$tn]=array();
|
||
$keepTags[$tn]['allowedAttribs']=0;
|
||
... | ... | |
}
|
||
if ($TSconfig['removeTags']) {
|
||
$lN = t3lib_div::trimExplode(',',strtolower($TSconfig['removeTags']),1);
|
||
while(list(,$tn)=each($lN)) {
|
||
foreach($lN as $tn) {
|
||
$keepTags[$tn]=array();
|
||
$keepTags[$tn]['allowedAttribs']=0;
|
||
$keepTags[$tn]['rmTagIfNoAttrib']=1;
|
||
... | ... | |
if (!strcmp($tagName,'img') && !isset($tagAttrib[0]['alt'])) $tagAttrib[0]['alt']=''; // Set alt attribute for all images (not XHTML though...)
|
||
if (!strcmp($tagName,'script') && !isset($tagAttrib[0]['type'])) $tagAttrib[0]['type']='text/javascript'; // Set type attribute for all script-tags
|
||
$outA=array();
|
||
reset($tagAttrib[0]);
|
||
while(list($attrib_name,$attrib_value)=each($tagAttrib[0])) {
|
||
foreach($tagAttrib[0] as $attrib_name => $attrib_value) {
|
||
// Set attributes: lowercase, always in quotes, with htmlspecialchars converted.
|
||
$outA[]=$attrib_name.'="'.$this->bidir_htmlspecialchars($attrib_value,2).'"';
|
||
}
|
t3lib/class.t3lib_parsehtml_proc.php (Arbeitskopie) | ||
---|---|---|
case 'db':
|
||
$siteURL = $this->siteUrl();
|
||
$blockSplit = $this->splitIntoBlock('A',$value);
|
||
reset($blockSplit);
|
||
while(list($k,$v)=each($blockSplit)) {
|
||
foreach($blockSplit as $k => $v) {
|
||
if ($k%2) { // block:
|
||
$attribArray=$this->get_tag_attributes_classic($this->getFirstTag($v),1);
|
||
// If the url is local, remove url-prefix
|
||
... | ... | |
if (!$css) {
|
||
if (!isset($this->procOptions['typolist']) || $this->procOptions['typolist']) {
|
||
$parts = $this->getAllParts($this->splitIntoBlock('LI',$this->removeFirstAndLastTag($blockSplit[$k])),1,0);
|
||
while(list($k2)=each($parts)) {
|
||
foreach($parts as $k2 => $value) {
|
||
$parts[$k2]=preg_replace('/['.preg_quote(chr(10).chr(13)).']+/','',$parts[$k2]); // remove all linesbreaks!
|
||
$parts[$k2]=$this->defaultTStagMapping($parts[$k2],'db');
|
||
$parts[$k2]=$this->cleanFontTags($parts[$k2],0,0,0);
|
||
... | ... | |
}
|
||
// Traverse sublines (there is typically one, except if <br/> has been converted to lines as well!)
|
||
reset($subLines);
|
||
while(list($sk)=each($subLines)) {
|
||
foreach($subLines as $sk => $value) {
|
||
// Clear up the subline for DB.
|
||
$subLines[$sk]=$this->HTMLcleaner_db($subLines[$sk]);
|
||
... | ... | |
*/
|
||
function TS_AtagToAbs($value,$dontSetRTEKEEP=FALSE) {
|
||
$blockSplit = $this->splitIntoBlock('A',$value);
|
||
reset($blockSplit);
|
||
while(list($k,$v)=each($blockSplit)) {
|
||
foreach($blockSplit as $k => $v) {
|
||
if ($k%2) { // block:
|
||
$attribArray = $this->get_tag_attributes_classic($this->getFirstTag($v),1);
|
||
t3lib/class.t3lib_positionmap.php (Arbeitskopie) | ||
---|---|---|
$codeA = t3lib_div::trimExplode(',',$codes.",line",1);
|
||
$lines=array();
|
||
while(list(,$code)=each($codeA)) {
|
||
foreach($codeA as $code) {
|
||
if ($code=="blank" || $allBlank) {
|
||
$lines[]='<img src="clear.gif" width="18" height="8" align="top" alt="" />';
|
||
} else {
|
||
... | ... | |
$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',
|
t3lib/class.t3lib_querygenerator.php (Arbeitskopie) | ||
---|---|---|
$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';
|
||
... | ... | |
$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'];
|
||
... | ... | |
*/
|
||
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);
|
||
... | ... | |
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'];
|
||
... | ... | |
$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_'));
|
||
... | ... | |
* @return [type] ...
|
||
*/
|
||
function printCodeArray($codeArr,$l=0) {
|
||
reset($codeArr);
|
||
$line='';
|
||
if ($l) $indent='<td style="vertical-align:top;"><img height="1" width="50"></td>';
|
||
$lf=$l*30;
|
||
$bgColor = t3lib_div::modifyHTMLColor($GLOBALS['TBE_TEMPLATE']->bgColor2,$lf,$lf,$lf);
|
||
while(list($k,$v)=each($codeArr)) {
|
||
foreach($codeArr as $k => $v) {
|
||
$line.= '<tr>'.$indent.'<td bgcolor="'.$bgColor.'"'.$this->noWrap.'>'.$v['html'].'</td></tr>';
|
||
if ($this->enableQueryParts) {$line.= '<tr>'.$indent.'<td>'.$this->formatQ($v['query']).'</td></tr>';}
|
||
if (is_array($v['sub'])) {
|
||
... | ... | |
function mkTypeSelect($name,$fieldName,$prepend='FIELD_') {
|
||
$out='<select name="'.$name.'" onChange="submit();">';
|
||
$out.='<option value=""></option>';
|
||
reset($this->fields);
|
||
while(list($key,)=each($this->fields)) {
|
||
foreach($this->fields as $key => $value) {
|
||
if (!$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table.':'.$key)) {
|
||
$label = $this->fields[$key]['label'];
|
||
$label_alt = $this->fields[$key]['label_alt'];
|
||
... | ... | |
* @return [type] ...
|
||
*/
|
||
function verifyType($fieldName) {
|
||
reset($this->fields);
|
||
$first = '';
|
||
while(list($key,)=each($this->fields)) {
|
||
foreach($this->fields as $key => $value) {
|
||
if (!$first) $first = $key;
|
||
if ($key==$fieldName) return $key;
|
||
}
|
||
... | ... | |
$out='<input type="Text" value="'.htmlspecialchars($fieldName).'" name="'.$name.'"'.$GLOBALS['TBE_TEMPLATE']->formWidth().'>'.$this->updateIcon();
|
||
$out.='<a href="#" onClick="document.forms[0][\''.$name.'\'].value=\'\';return false;"><img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/garbage.gif', 'width="11" height="12"') . ' class="absmiddle" title="Clear list" border="0"></a>';
|
||
$out.='<BR><select name="_fieldListDummy" size="5" onChange="document.forms[0][\''.$name.'\'].value+=\',\'+this.value">';
|
||
reset($this->fields);
|
||
while(list($key,)=each($this->fields)) {
|
||
foreach($this->fields as $key => $value) {
|
||
if (!$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $this->table.':'.$key)) {
|
||
$label = $this->fields[$key]['label'];
|
||
$label_alt = $this->fields[$key]['label_alt'];
|
||
... | ... | |
global $TCA;
|
||
$out='<select name="'.$name.'" onChange="submit();">';
|
||
$out.='<option value=""></option>';
|
||
reset($TCA);
|
||
while(list($tN)=each($TCA)) {
|
||
foreach($TCA as $tN => $value) {
|
||
if ($GLOBALS['BE_USER']->check('tables_select',$tN)) {
|
||
$out.='<option value="'.$tN.'"'.($tN==$cur ? ' selected':'').'>'.$GLOBALS['LANG']->sl($TCA[$tN]['ctrl']['title']).'</option>';
|
||
}
|
||
... | ... | |
$qs = '';
|
||
// Since we don't traverse the array using numeric keys in the upcoming whileloop make sure it's fresh and clean
|
||
ksort($queryConfig);
|
||
reset($queryConfig);
|
||
$first=1;
|
||
while(list($key,$conf) = each($queryConfig)) {
|
||
foreach($queryConfig as $key => $conf) {
|
||
switch($conf['type']) {
|
||
case 'newlevel':
|
||
$qs.=chr(10).$pad.trim($conf['operator']).' ('.$this->getQuery($queryConfig[$key]['nl'],$pad.' ').chr(10).$pad.')';
|
||
... | ... | |
if ($this->extFieldLists['queryOrder']) {
|
||
$descParts = explode(',',$modSettings['queryOrderDesc'].','.$modSettings['queryOrder2Desc']);
|
||
$orderParts = explode(',',$this->extFieldLists['queryOrder']);
|
||
reset($orderParts);
|
||
$reList=array();
|
||
while(list($kk,$vv)=each($orderParts)) {
|
||
foreach($orderParts as $kk => $vv) {
|
||
$reList[]=$vv.($descParts[$kk]?' DESC':'');
|
||
}
|
||
$this->extFieldLists['queryOrder_SQL'] = implode(',',$reList);
|
t3lib/class.t3lib_readmail.php (Arbeitskopie) | ||
---|---|---|
function getMailBoundaryParts($boundary,$content) {
|
||
$mParts = explode('--'.$boundary,$content);
|
||
unset($mParts[0]);
|
||
reset($mParts);
|
||
$new=array();
|
||
while(list(,$val)=each($mParts)) {
|
||
foreach($mParts as $val) {
|
||
if (trim($val)=='--') break;
|
||
$new[] = ltrim($val);
|
||
}
|
||
... | ... | |
$lines=explode(chr(10),ltrim($content));
|
||
$headers=array();
|
||
$p='';
|
||
while(list($k,$str)=each($lines)) {
|
||
foreach($lines as $k => $str) {
|
||
if (!trim($str)) break; // header finished
|
||
$parts = explode(' ',$str,2);
|
||
if ($parts[0] && substr($parts[0],-1)==':') {
|
||
... | ... | |
// Decoding header values which potentially can be encoded by =?...?=
|
||
$list = explode(',','subject,thread-topic,from,to');
|
||
while(list(,$headerType)=each($list)) {
|
||
foreach($list as $headerType) {
|
||
if (isset($mailParts[$headerType])) $mailParts[$headerType]=$this->decodeHeaderString($mailParts[$headerType]);
|
||
}
|
||
// Separating email/names from header fields which can contain email addresses.
|
||
$list = explode(',','from,to,reply-to,sender,return-path');
|
||
while(list(,$headerType)=each($list)) {
|
||
foreach($list as $headerType) {
|
||
if (isset($mailParts[$headerType])) {
|
||
$mailParts['_'.strtoupper($headerType)]=$this->extractNameEmail($mailParts[$headerType]);
|
||
}
|
||
... | ... | |
$contentSectionParts = t3lib_div::trimExplode('--'.$mailParts['_CONTENT_TYPE_DAT']['boundary'],$mailParts['CONTENT'],1);
|
||
$contentSectionParts_proc=array();
|
||
reset($contentSectionParts);
|
||
while(list($k,$v)=each($contentSectionParts)) {
|
||
foreach($contentSectionParts as $k => $v) {
|
||
if (substr($v,0,2)=='--') break;
|
||
$contentSectionParts_proc[$k]=$this->fullParse($v);
|
||
}
|
t3lib/class.t3lib_recordlist.php (Arbeitskopie) | ||
---|---|---|
$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];
|
t3lib/class.t3lib_refindex.php (Arbeitskopie) | ||
---|---|---|
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
|
t3lib/class.t3lib_scbase.php (Arbeitskopie) | ||
---|---|---|
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')) ||
|
t3lib/class.t3lib_stdgraphic.php (Arbeitskopie) | ||
---|---|---|
$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]);
|
||
... | ... | |
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);
|
||
... | ... | |
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]));
|
||
... | ... | |
$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]));
|
||
... | ... | |
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])) {
|
t3lib/class.t3lib_superadmin.php (Arbeitskopie) | ||
---|---|---|
if (@is_dir($dir)) {
|
||
$in_dirs = t3lib_div::get_dirs($dir);
|
||
asort($in_dirs);
|
||
reset($in_dirs);
|
||
$dirArr=array();
|
||
while(list($k,$v)=each($in_dirs)) {
|
||
foreach($in_dirs as $k => $v) {
|
||
if (substr($v,0,9)!='typo3_src') {
|
||
$this->currentUrl = $baseUrl.'/'.$v;
|
||
$content.= $this->headerSiteDir($v);
|
||
... | ... | |
$mtimes = array();
|
||
// Find most recent mtime of the options:
|
||
reset($instances);
|
||
while(list($k,$eInfo)=each($instances)) {
|
||
foreach($instances as $k => $eInfo) {
|
||
$mtimes[] = $eInfo['mtime'];
|
||
}
|
||
// Max mtime:
|
||
... | ... | |
* @return array Modified file array (or error string)
|
||
*/
|
||
function removePrefixPathFromList($fileArr,$extPath) {
|
||
reset($fileArr);
|
||
while(list($k,$absFileRef)=each($fileArr)) {
|
||
foreach($fileArr as $k => $absFileRef) {
|
||
if(t3lib_div::isFirstPartOfStr($absFileRef,$extPath)) {
|
||
$fileArr[$k]=substr($absFileRef,strlen($extPath));
|
||
} else return 'ERROR: One or more of the files was NOT prefixed with the prefix-path!';
|
t3lib/class.t3lib_timetrack.php (Arbeitskopie) | ||
---|---|---|
$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);
|
||
... | ... | |
$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);
|
||
}
|
||
}
|
||
... | ... | |
$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++;
|
||
... | ... | |
$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, '<strong style="color:red;">['.$this->tsStackLog[$v]['key'].']</strong>', $content);
|
t3lib/class.t3lib_transferdata.php (Arbeitskopie) | ||
---|---|---|
if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
|
||
// Gets the list of fields to copy from the previous record.
|
||
$fArr=t3lib_div::trimExplode(',',$TCA[$table]['ctrl']['useColumnsForDefaultValues'],1);
|
||
while(list(,$theF)=each($fArr)) {
|
||
foreach($fArr as $theF) {
|
||
if (isset($TCA[$table]['columns'][$theF])) {
|
||
$newRow[$theF]=$row[$theF];
|
||
}
|
t3lib/class.t3lib_tsparser_ext.php (Arbeitskopie) | ||
---|---|---|
function flattenSetup($setupArray, $prefix, $resourceFlag) {
|
||
if (is_array($setupArray)) {
|
||
$this->getFileName_backPath=PATH_site; // Setting absolute prefixed path for relative resources.
|
||
reset($setupArray);
|
||
while(list($key,$val)=each($setupArray)) {
|
||
foreach($setupArray as $key => $val) {
|
||
if ($prefix || substr($key,0,16)!='TSConstantEditor') { // We don't want 'TSConstantEditor' in the flattend setup.
|
||
if (is_array($val)) {
|
||
$this->flattenSetup($val,$prefix.$key, ($key=='file.'));
|
||
... | ... | |
$c=0;
|
||
$cc=count($this->constants);
|
||
reset($this->constants);
|
||
while (list(,$str)=each($this->constants)) {
|
||
foreach($this->constants as $str) {
|
||
$c++;
|
||
if ($c==$cc) {
|
||
if (strstr($str,$this->edit_divider)) {
|
||
... | ... | |
$HTML='';
|
||
$a=0;
|
||
reset($arr);
|
||
if($alphaSort == '1') {
|
||
ksort($arr);
|
||
}
|
||
$keyArr_num=array();
|
||
$keyArr_alpha=array();
|
||
while (list($key,)=each($arr)) {
|
||
foreach ($arr as $key => $value) {
|
||
if (substr($key,-2)!='..') { // Don't do anything with comments / linenumber registrations...
|
||
$key=preg_replace('/\.$/','',$key);
|
||
if (substr($key,-1)!='.') {
|
||
... | ... | |
}
|
||
ksort($keyArr_num);
|
||
$keyArr=$keyArr_num+$keyArr_alpha;
|
||
reset($keyArr);
|
||
$c=count($keyArr);
|
||
if ($depth_in) {$depth_in = $depth_in.'.';}
|
||
while (list($key,)=each($keyArr)) {
|
||
foreach ($keyArr as $key => $value) {
|
||
$a++;
|
||
$depth=$depth_in.$key;
|
||
if ($this->bType!='const' || substr($depth,0,1)!='_') { // this excludes all constants starting with '_' from being shown.
|
||
... | ... | |
* @return [type] ...
|
||
*/
|
||
function ext_getSearchKeys($arr, $depth_in, $searchString, $keyArray) {
|
||
reset($arr);
|
||
$keyArr=array();
|
||
while (list($key,)=each($arr)) {
|
||
foreach ($arr as $key => $value) {
|
||
$key=preg_replace('/\.$/','',$key);
|
||
if (substr($key,-1)!='.') {
|
||
$keyArr[$key]=1;
|
||
}
|
||
}
|
||
reset($keyArr);
|
||
$c=count($keyArr);
|
||
if ($depth_in) { $depth_in = $depth_in.'.'; }
|
||
while (list($key,)=each($keyArr)) {
|
||
foreach ($keyArr as $key => $value) {
|
||
$depth=$depth_in.$key;
|
||
$deeper = is_array($arr[$key.'.']);
|
||