protected function _msgText($stream, $data)
    {
        if ($data instanceof Horde_Stream) {
            if ($stream) {
                $data->rewind();
                return $data->stream;
            }
            return strval($data);
        }

        if (is_resource($data)) {
            rewind($data);
            return $stream
                ? $data
                : stream_get_contents($data);
        }

        if (!$stream) {
            return strval($data);
        }

        $tmp = fopen('php://temp', 'w+');

        if (!is_null($data)) {
            fwrite($tmp, $data);
            rewind($tmp);
        }

        return $tmp;
    }
protected function _msgText($stream, $data)
    {
        if ($data instanceof Horde_Stream) {
            if ($stream) {
                $data->rewind();
                return $data->stream;
            }
            return strval($data);
        }

        if (is_resource($data)) {
            rewind($data);
            return $stream
                ? $data
                : stream_get_contents($data);
        }

        if (!$stream) {
            return strval($data);
        }

        $tmp = fopen('php://temp', 'w+');

        if (!is_null($data)) {
            fwrite($tmp, $data);
            rewind($tmp);
        }

        return $tmp;
    }
protected function _msgText ( $ stream , $ data ) { if ( $ data instanceof Horde_Stream ) { if ( $ stream ) { $ data -> rewind ( ) ; return $ data -> stream ; } return strval ( $ data ) ; } if ( is_resource ( $ data ) ) { rewind ( $ data ) ; return $ stream ? $ data : stream_get_contents ( $ data ) ; } if ( ! $ stream ) { return strval ( $ data ) ; } $ tmp = fopen ( 'php://temp' , 'w+' ) ; if ( ! is_null ( $ data ) ) { fwrite ( $ tmp , $ data ) ; rewind ( $ tmp ) ; } return $ tmp ; }
Return text representation of a field.

@param boolean $stream  Return as a stream?
@param mixed $data      The field data (string or resource) or null if
field does not exist.

@return mixed  Requested text representation.
Return text representation of a field .