extension/ezjscore/classes/ezjscajaxcontent.php
public static function autoEncode( $ret, $type = null )
    {
        if ( $type === null )
            $type = self::getHttpAccept( );

        if ( $type === 'xml' )
            return self::xmlEncode( $ret );
        else if ( $type === 'json' )
            return json_encode( $ret );
        else
            return self::textEncode( $ret );
    }
public static function autoEncode( $ret, $type = null )
    {
        if ( $type === null )
            $type = self::getHttpAccept( );

        if ( $type === 'xml' )
            return self::xmlEncode( $ret );
        else if ( $type === 'json' )
            return json_encode( $ret );
        else
            return self::textEncode( $ret );
    }
public static function autoEncode ( $ ret , $ type = null ) { if ( $ type === null ) $ type = self :: getHttpAccept ( ) ; if ( $ type === 'xml' ) return self :: xmlEncode ( $ ret ) ; else if ( $ type === 'json' ) return json_encode ( $ ret ) ; else return self :: textEncode ( $ ret ) ; }
Encodes the content based on http accept values, more on
this on the getHttpAccept function.
Will simply implode the return value if array and not xml or
json is prefered return type.

@param mixed $ret
@param string $type
@return string
Encodes the content based on http accept values more on this on the getHttpAccept function . Will simply implode the return value if array and not xml or json is prefered return type .