1: <?php
2: /*
3: You may not change or alter any portion of this comment or credits
4: of supporting developers from this source code or any supporting source code
5: which is considered copyrighted (c) material of the original comment or credit authors.
6:
7: This program is distributed in the hope that it will be useful,
8: but WITHOUT ANY WARRANTY; without even the implied warranty of
9: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10: */
11:
12: /**
13: * Xoops MailerLocal
14: *
15: * @copyright XOOPS Project (http://xoops.org)
16: * @license GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
17: * @package class
18: * @subpackage Xoops Mailer Local Language
19: * @since 2.3.0
20: * @author Taiwen Jiang <phppp@users.sourceforge.net>
21: * @version $Id$
22: */
23:
24: /**
25: * Localize the mail functions
26: *
27: * The English localization is solely for demonstration
28: */
29: // Do not change the class name
30: class Xoops_Locale_Mailer_Abstract extends XoopsMailer
31: {
32: /**
33: * Constructor
34: *
35: * @return Xoops_Locale_Mailer_Abstract
36: */
37: public function __construct()
38: {
39: parent::__construct();
40: // It is supposed no need to change the charset
41: $this->charSet = strtolower(XoopsLocale::getCharset());
42: // You MUST specify the language code value so that the file exists: XOOPS_ROOT_PAT/class/mail/phpmailer/language/phpmailer.lang-["your-language-code"].php
43: $this->multimailer->SetLanguage('en');
44: }
45:
46: /**
47: * Multibyte languages are encouraged to make their proper method for encoding FromName
48: *
49: * @param string $text
50: * @return string
51: */
52: public function encodeFromName($text)
53: {
54: // Activate the following line if needed
55: // $text = "=?{$this->charSet}?B?".base64_encode($text)."?=";
56: return $text;
57: }
58:
59: /**
60: * Multibyte languages are encouraged to make their proper method for encoding FromName
61: *
62: * @param string $text
63: * @return string
64: */
65: public function encodeSubject($text)
66: {
67: // Activate the following line if needed
68: // $text = "=?{$this->charSet}?B?".base64_encode($text)."?=";
69: return $text;
70: }
71: }
72: