cvs: pear /Mail_Mime mime.php

From: Date: Thu, 11 Jul 2002 17:30:19 +0000
Subject: cvs: pear /Mail_Mime mime.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-5050@lists.php.net to get a copy of this message
jan Thu Jul 11 13:30:19 2002 EDT Modified files: /pear/Mail_Mime mime.php Log: - add third optional parameter to addTXTBody that allows appending instead - of overwriting Index: pear/Mail_Mime/mime.php diff -u pear/Mail_Mime/mime.php:1.20 pear/Mail_Mime/mime.php:1.21 --- pear/Mail_Mime/mime.php:1.20 Tue Jun 25 09:28:33 2002 +++ pear/Mail_Mime/mime.php Thu Jul 11 13:30:18 2002 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: mime.php,v 1.20 2002/06/25 13:28:33 cox Exp $ +// $Id: mime.php,v 1.21 2002/07/11 17:30:18 jan Exp $ require_once 'PEAR.php'; require_once 'Mail/mimePart.php'; @@ -115,19 +115,29 @@ * contents * @param bool $isfile If true the first param should be trated * as a file name, else as a string (default) + * @param bool If true the text or file is appended to the + * existing body, else the old body is overwritten * @return mixed true on success or PEAR_Error object * @access public */ - function setTXTBody($data, $isfile = false) + function setTXTBody($data, $isfile = false, $append = false) { if (!$isfile) { - $this->_txtbody = $data; + if (!$append) { + $this->_txtbody = $data; + } else { + $this->_txtbody .= $data; + } } else { $cont = $this->_file2str($data); if (PEAR::isError($cont)) { return $cont; } - $this->_txtbody = $cont; + if (!$append) { + $this->_txtbody = $cont; + } else { + $this->_txtbody .= $cont; + } } return true; }

« previous php.pear.cvs (#5050) next »