Index: trunk/kernel/include/item.php =================================================================== diff -u -N -r7391 -r8009 --- trunk/kernel/include/item.php (.../item.php) (revision 7391) +++ trunk/kernel/include/item.php (.../item.php) (revision 8009) @@ -134,42 +134,28 @@ { if (strlen($f->Get("ValueList") && (($f->Get("ElementType") == "select") || ($f->Get("ElementType") == "radio")))) { - if ($f->HasField('Value')) - { + if ($f->HasField('Value')) { $objConfigDummy = new clsConfigAdminItem(); - $ValueList = explode(",", $objConfigDummy->replace_sql($f->Get("ValueList"))); - if (is_array($ValueList)) - { - foreach ($ValueList as $curr => $value) - { - $c_data = explode("=", $value); - if ($c_data[0] == $f->Get('Value')) - { + $ValueList = $objConfigDummy->GetValues($f->Get('ValueList')); + if (is_array($ValueList)) { + foreach ($ValueList as $option_id => $option_title) { + if ($option_id == $f->Get('Value')) { $this->CustomFields[$f->Get("FieldName")]['value'] = $f->Get('Value'); - // if option value starts with + then not a language variable - if (eregi("^+", $c_data[1])) - $c_data[1] = language($c_data[1]); - else - $c_data[1] = substr($c_data[1], 1); - - $this->CustomFields[$f->Get("FieldName")]['lang_value'] = $c_data[1]; + $this->CustomFields[$f->Get("FieldName")]['lang_value'] = $option_title; } } } - else - { + else { $this->CustomFields[$f->Get("FieldName")]['value'] = $f->HasField('Value') ? $f->Get('Value') : ''; $this->CustomFields[$f->Get("FieldName")]['lang_value'] = null; } } - else - { + else { $this->CustomFields[$f->Get("FieldName")]['value'] = strlen($f->HasField('Value')) ? $f->Get('Value') : ''; $this->CustomFields[$f->Get("FieldName")]['lang_value'] = null; } } - else - { + else { $this->CustomFields[$f->Get("FieldName")]['value'] = strlen($f->HasField('Value')) ? $f->Get('Value') : ''; $this->CustomFields[$f->Get("FieldName")]['lang_value'] = null;