Index: trunk/kernel/units/general/custom_fields.php =================================================================== diff -u -r1566 -r2285 --- trunk/kernel/units/general/custom_fields.php (.../custom_fields.php) (revision 1566) +++ trunk/kernel/units/general/custom_fields.php (.../custom_fields.php) (revision 2285) @@ -1,27 +1,36 @@ ParseConfigSQL($values_list); - $optionValuesTmp=explode(',', $optionValuesStr); - $optionValues=array(); - foreach ($optionValuesTmp as $optionValue){ - list($key, $val) = @explode("=", $optionValue); - - if (substr($val,0,1)=="+") - $val = substr($val, 1); - else - $val = $this->Application->Phrase($val); - - $optionValues[$key]=$val; + $optionValuesTmp = explode(',', $optionValuesStr); + $optionValues = Array(); + foreach($optionValuesTmp as $optionValue) + { + list($key, $val) = explode('=', $optionValue); + $val = (substr($val,0,1) == '+') ? substr($val, 1) : $this->Application->Phrase($val); + $optionValues[$key] = $val; } return $optionValues; } - function ParseConfigSQL($valueString){ - $string = trim(str_replace("",TABLE_PREFIX,$valueString)); + /** + * Replace SQL's in valueList with appropriate queried values + * + * @param string $valueString + * @return string + * @todo Fully rewrite !!! + */ + function ParseConfigSQL($valueString) + { + $string = trim( str_replace('', TABLE_PREFIX, $valueString) ); preg_match_all("|\{(.*)\}|U", $string, $embedded_vars, PREG_SET_ORDER); @@ -32,40 +41,39 @@ Will output: what to output if Hello is set */ - if (sizeof($embedded_vars)>0){ - for ($i=0; $i"); - if(!$end){ + $end = strpos($string, ''); + if(!$end) + { $end = strlen($string); } $len = $end - $start; @@ -82,29 +90,20 @@ $chunk2=substr($string,$end+$skip_length+1); $s = $chunk1.$sql_val.$chunk2; - $string = $s; - $start = strpos($string,"Application->GetADODBConnection(); - - $valArray=$db->Query($sql); - for ($i=0; $iConn->Query($sql); + for($i=0; $i