Project

General

Profile

Bug #3402 » 3402.patch

krileon, 28 March 2012 17:54

View differences:

components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php
case 'json':
case 'php':
if ( substr( $reason, -11 ) == ':translated' ) {
// Translated version in case reason finishes by :translated: (will be used later):
if ( in_array( $field->type, array( 'radio', 'select' ) ) ) {
$chosen = getLangDefinition( $value );
if ( $value != '' ) {
$chosen = $this->_explodeCBvalues( $value );
} else {
// multiselect, multicheckbox:
$chosen = $this->_explodeCBvalues( $value );
for( $i = 0, $n = count( $chosen ); $i < $n; $i++ ) {
$chosen[$i] = getLangDefinition( $chosen[$i] );
}
$chosen = array();
}
for( $i = 0, $n = count( $chosen ); $i < $n; $i++ ) {
$chosen[$i] = getLangDefinition( $chosen[$i] );
}
return $this->_arrayToFormat( $field, $chosen, $output );
break;
}
// else: fall-through on purpose here (fixes bug #2960):
case 'csv':
if ( in_array( $field->type, array( 'radio', 'select' ) ) ) {
$chosen = $value;
} else {
// multiselect, multicheckbox:
if ( $value != '' ) {
$chosen = $this->_explodeCBvalues( $value );
} else {
$chosen = array();
}
return $this->_arrayToFormat( $field, $chosen, $output );
break;
(1-1/2)