Feature #22207 » patchv3.diff
typo3_src.new/t3lib/class.t3lib_tsparser_ext.php 2010-02-28 14:36:42.000000000 +0100 | ||
---|---|---|
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)) {
|
||
... | ... | |
}
|
||
$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)!='.') {
|
||
... | ... | |
$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.
|
||
... | ... | |
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.'.']);
|
||
... | ... | |
function ext_getRootlineNumber($pid) {
|
||
if ($pid && is_array($GLOBALS['rootLine'])) {
|
||
reset($GLOBALS['rootLine']);
|
||
while(list($key,$val)=each($GLOBALS['rootLine'])) {
|
||
foreach($GLOBALS['rootLine'] as $key => $val) {
|
||
if ($val['uid']==$pid) return $key;
|
||
}
|
||
}
|
||
... | ... | |
function ext_getTemplateHierarchyArr($arr,$depthData, $keyArray,$first=0) {
|
||
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;
|
||
... | ... | |
$a=0;
|
||
$c=count($keyArr);
|
||
static $i;
|
||
while (list($key,)=each($keyArr)) {
|
||
foreach($keyArr as $key => $value) {
|
||
$HTML = '';
|
||
$a++;
|
||
$deeper = is_array($arr[$key . '.']);
|
||
... | ... | |
function ext_outputTS($config, $lineNumbers=0, $comments=0, $crop=0, $syntaxHL=0, $syntaxHLBlockmode=0) {
|
||
$all='';
|
||
reset($config);
|
||
while (list(,$str)=each($config)) {
|
||
foreach($config as $str) {
|
||
$all .= chr(10) .'[GLOBAL]' . chr(10) . $str;
|
||
}
|
||
... | ... | |
reset($cArr);
|
||
$n = ceil(log10(count($cArr)+$this->ext_lineNumberOffset));
|
||
$lineNum='';
|
||
while(list($k,$v)=each($cArr)) {
|
||
foreach($cArr as $k => $v) {
|
||
$lln=$k+$this->ext_lineNumberOffset+1;
|
||
if ($ln) $lineNum = $this->ext_lnBreakPointWrap($lln,str_replace(' ',' ',sprintf('% '.$n.'d',$lln))).': ';
|
||
$v=htmlspecialchars($v);
|
||
... | ... | |
function ext_compareFlatSetups($default) {
|
||
$editableComments=array();
|
||
reset($this->flatSetup);
|
||
while(list($const,$value)=each($this->flatSetup)) {
|
||
foreach($this->flatSetup as $const => $value) {
|
||
if (substr($const,-2)!='..' && isset($this->flatSetup[$const.'..'])) {
|
||
$comment = trim($this->flatSetup[$const.'..']);
|
||
$c_arr = explode(chr(10),$comment);
|
||
while(list($k,$v)=each($c_arr)) {
|
||
$cArr = explode(chr(10),$comment);
|
||
foreach($cArr as $k => $v) {
|
||
$line=trim(preg_replace('/^[#\/]*/','',$v));
|
||
if ($line) {
|
||
$parts = explode(';', $line);
|
||
while(list(,$par)=each($parts)) {
|
||
foreach($parts as $par) {
|
||
if (strstr($par,'=')) {
|
||
$keyValPair =explode('=',$par,2);
|
||
switch(trim(strtolower($keyValPair[0]))) {
|
||
... | ... | |
function ext_categorizeEditableConstants($editConstArray) {
|
||
// Runs through the available constants and fills the $this->categories array with pointers and priority-info
|
||
reset($editConstArray);
|
||
while(list($constName,$constData)=each($editConstArray)) {
|
||
foreach($editConstArray as $constName => $constData) {
|
||
if (!$constData['type']) {
|
||
$constData['type']='string';
|
||
}
|
||
$cats = explode(',',$constData['cat']);
|
||
reset($cats);
|
||
while (list(,$theCat)=each($cats)) { // if = only one category, while allows for many. We have agreed on only one category is the most basic way...
|
||
foreach($cats as $theCat) { // if = only one category, while allows for many. We have agreed on only one category is the most basic way...
|
||
$theCat=trim($theCat);
|
||
if ($theCat) {
|
||
$this->categories[$theCat][$constName]=$constData['subcat'];
|
||
... | ... | |
function ext_getCategoryLabelArray() {
|
||
// Returns array used for labels in the menu.
|
||
$retArr = array();
|
||
while(list($k,$v)=each($this->categories)) {
|
||
foreach($this->categories as $k => $v) {
|
||
if (count($v)) {
|
||
$retArr[$k]=strtoupper($k).' ('.count($v).')';
|
||
}
|
||
... | ... | |
$out=array();
|
||
if (is_array($catConf)) {
|
||
reset($catConf);
|
||
while(list($key,$val)=each($catConf)) {
|
||
foreach($catConf as $key => $val) {
|
||
switch($key) {
|
||
case 'image':
|
||
$out['imagetag'] = $this->ext_getTSCE_config_image($catConf['image']);
|
||
... | ... | |
function ext_resourceDims() {
|
||
if ($this->setup['resources']) {
|
||
$rArr=explode(',',$this->setup['resources']);
|
||
while(list($c,$val)=each($rArr)) {
|
||
foreach($rArr as $c => $val) {
|
||
$val=trim($val);
|
||
$theFile = PATH_site.'uploads/tf/'.$val;
|
||
if ($val && @is_file($theFile)) {
|
||
... | ... | |
}
|
||
}
|
||
reset($this->dirResources);
|
||
while(list($c,$val)=each($this->dirResources)) {
|
||
foreach($this->dirResources as $c => $val) {
|
||
$val=trim($val);
|
||
$imgInfo = @getimagesize(PATH_site.$val);
|
||
if (is_array($imgInfo)) {
|
||
... | ... | |
$this->rArr=explode(',',$this->setup['resources'].','.implode($this->dirResources,','));
|
||
if (!$this->doNotSortCategoriesBeforeMakingForm) asort($this->categories[$category]);
|
||
while(list($name,$type)=each($this->categories[$category])) {
|
||
foreach($this->categories[$category] as $name => $type) {
|
||
$params = $theConstants[$name];
|
||
if (is_array($params)) {
|
||
if ($subcat!=$params['subcat_name']) {
|
||
... | ... | |
case 'color':
|
||
$colorNames=explode(',',','.$this->HTMLcolorList);
|
||
$p_field='';
|
||
while(list(,$val)=each($colorNames)) {
|
||
foreach($colorNames as $val) {
|
||
$sel='';
|
||
if ($val==strtolower($params['value'])) {
|
||
$sel = ' selected';
|
||
... | ... | |
case 'options':
|
||
if (is_array($typeDat['params'])) {
|
||
$p_field='';
|
||
while(list(,$val)=each($typeDat['params'])) {
|
||
foreach($typeDat['params'] as $val) {
|
||
$vParts = explode('=',$val,2);
|
||
$label = $vParts[0];
|
||
$val = isset($vParts[1]) ? $vParts[1] : $vParts[0];
|
||
... | ... | |
function ext_depthKeys($arr,$settings) {
|
||
reset($arr);
|
||
$tsbrArray=array();
|
||
while(list($theK,$theV)=each($arr)) {
|
||
foreach($arr as $theK => $theV) {
|
||
$theKeyParts = explode('.',$theK);
|
||
$depth='';
|
||
$c=count($theKeyParts);
|
||
... | ... | |
}
|
||
// Modify settings
|
||
reset($tsbrArray);
|
||
while(list($theK,$theV)=each($tsbrArray)) {
|
||
foreach($tsbrArray as $theK => $theV) {
|
||
if ($theV) {
|
||
$settings[$theK] = 1;
|
||
} else {
|
||
... | ... | |
if (is_array($data)) {
|
||
reset($data);
|
||
while(list($key,$var)=each($data)) {
|
||
foreach($data as $key => $var) {
|
||
if (isset($theConstants[$key])) {
|
||
if ($this->ext_dontCheckIssetValues || isset($check[$key])) { // If checkbox is set, update the value
|
||
list($var) = explode(chr(10),$var); // exploding with linebreak, just to make sure that no multiline input is given!
|
||
... | ... | |
// Remaining keys in $check indicates fields that are just clicked "on" to be edited. Therefore we get the default value and puts that in the template as a start...
|
||
if (!$this->ext_dontCheckIssetValues && is_array($check)) {
|
||
reset($check);
|
||
while(list($key,$var)=each($check)) {
|
||
foreach($check as $key => $var) {
|
||
if (isset($theConstants[$key])) {
|
||
$dValue = $theConstants[$key]['default_value'];
|
||
$this->ext_putValueInConf($key, $dValue);
|
||
... | ... | |
function ext_prevPageWithTemplate($id,$perms_clause) {
|
||
$rootLine = t3lib_BEfunc::BEgetRootLine($id,$perms_clause?' AND '.$perms_clause:'');
|
||
reset($rootLine);
|
||
while(list(,$p)=each($rootLine)) {
|
||
foreach($rootLine as $p) {
|
||
if ($this->ext_getFirstTemplate($p['uid'])) {
|
||
return $p;
|
||
}
|
- « Previous
- 1
- 2
- 3
- Next »