|
1
|
|
|
<?php |
|
2
|
|
|
// $Id: english.php 8112 2011-11-06 13:41:14Z beckmi $ |
|
3
|
|
|
// ------------------------------------------------------------------------ // |
|
4
|
|
|
// XOOPS - PHP Content Management System // |
|
5
|
|
|
// Copyright (c) 2000 XOOPS.org // |
|
6
|
|
|
// <http://www.xoops.org/> // |
|
7
|
|
|
// ------------------------------------------------------------------------ // |
|
8
|
|
|
// This program is free software; you can redistribute it and/or modify // |
|
9
|
|
|
// it under the terms of the GNU General Public License as published by // |
|
10
|
|
|
// the Free Software Foundation; either version 2 of the License, or // |
|
11
|
|
|
// (at your option) any later version. // |
|
12
|
|
|
// // |
|
13
|
|
|
// You may not change or alter any portion of this comment or credits // |
|
14
|
|
|
// of supporting developers from this source code or any supporting // |
|
15
|
|
|
// source code which is considered copyrighted (c) material of the // |
|
16
|
|
|
// original comment or credit authors. // |
|
17
|
|
|
// // |
|
18
|
|
|
// This program is distributed in the hope that it will be useful, // |
|
19
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of // |
|
20
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
|
21
|
|
|
// GNU General Public License for more details. // |
|
22
|
|
|
// // |
|
23
|
|
|
// You should have received a copy of the GNU General Public License // |
|
24
|
|
|
// along with this program; if not, write to the Free Software // |
|
25
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
|
26
|
|
|
// ------------------------------------------------------------------------ // |
|
27
|
|
|
// Author: Kazumi Ono (AKA onokazu) // |
|
28
|
|
|
// URL: http://www.myweb.ne.jp/, http://www.xoops.org/, http://jp.xoops.org/ // |
|
29
|
|
|
// Project: The XOOPS Project // |
|
30
|
|
|
// ------------------------------------------------------------------------- // |
|
31
|
|
|
|
|
32
|
|
|
// For end users |
|
33
|
|
|
if (!defined('XOOPS_ROOT_PATH')) { |
|
34
|
|
|
die('XOOPS root path not defined'); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
$valid_pfd_charset = 'ISO-8859-1'; |
|
38
|
|
|
|
|
39
|
|
|
$pdf_config['margin'] = array( |
|
40
|
|
|
'left'=>25, |
|
41
|
|
|
'top'=>25, |
|
42
|
|
|
'right'=>25 |
|
43
|
|
|
); |
|
44
|
|
|
|
|
45
|
|
|
$pdf_config['logo'] = array( |
|
46
|
|
|
'path'=>'images/news_slogo.png', |
|
47
|
|
|
'left'=>150, |
|
48
|
|
|
'top'=>5, |
|
49
|
|
|
'width'=>0, |
|
50
|
|
|
'height'=>0 |
|
51
|
|
|
); |
|
52
|
|
|
|
|
53
|
|
|
$pdf_config['font']['slogan'] = array( |
|
54
|
|
|
'family'=>'Arial', |
|
55
|
|
|
'style'=>'bi', |
|
56
|
|
|
'size'=>8 |
|
57
|
|
|
); |
|
58
|
|
|
|
|
59
|
|
|
$pdf_config['font']['title'] = array( |
|
60
|
|
|
'family'=>'Arial', |
|
61
|
|
|
'style'=>'biu', |
|
62
|
|
|
'size'=>12 |
|
63
|
|
|
); |
|
64
|
|
|
|
|
65
|
|
|
$pdf_config['font']['subject'] = array( |
|
66
|
|
|
'family'=>'Arial', |
|
67
|
|
|
'style'=>'b', |
|
68
|
|
|
'size'=>11 |
|
69
|
|
|
); |
|
70
|
|
|
|
|
71
|
|
|
$pdf_config['font']['author'] = array( |
|
72
|
|
|
'family'=>'Arial', |
|
73
|
|
|
'style'=>'', |
|
74
|
|
|
'size'=>10 |
|
75
|
|
|
); |
|
76
|
|
|
|
|
77
|
|
|
$pdf_config['font']['subtitle'] = array( |
|
78
|
|
|
'family'=>'Arial', |
|
79
|
|
|
'style'=>'b', |
|
80
|
|
|
'size'=>11 |
|
81
|
|
|
); |
|
82
|
|
|
|
|
83
|
|
|
$pdf_config['font']['subsubtitle'] = array( |
|
84
|
|
|
'family'=>'Arial', |
|
85
|
|
|
'style'=>'b', |
|
86
|
|
|
'size'=>10 |
|
87
|
|
|
); |
|
88
|
|
|
|
|
89
|
|
|
$pdf_config['font']['content'] = array( |
|
90
|
|
|
'family'=>'Arial', |
|
91
|
|
|
'style'=>'', |
|
92
|
|
|
'size'=>10 |
|
93
|
|
|
); |
|
94
|
|
|
|
|
95
|
|
|
$pdf_config['font']['footer'] = array( |
|
96
|
|
|
'family'=>'Arial', |
|
97
|
|
|
'style'=>'', |
|
98
|
|
|
'size'=>8 |
|
99
|
|
|
); |
|
100
|
|
|
|
|
101
|
|
|
$pdf_config['action_on_error'] = 0; // 0 - continue; 1 - die |
|
102
|
|
|
$pdf_config['creator'] = 'NEWS BASED ON FPDF v1.53'; |
|
103
|
|
|
$pdf_config['url'] = XOOPS_URL; |
|
104
|
|
|
$pdf_config['mail'] = 'mailto:'.$xoopsConfig['adminmail']; |
|
105
|
|
|
$pdf_config['slogan']=xoops_substr($myts->htmlspecialchars( $xoopsConfig['sitename'] ),0,30); |
|
106
|
|
|
$pdf_config['scale'] = '0.8'; |
|
107
|
|
|
$pdf_config['dateformat'] = _DATESTRING; |
|
108
|
|
|
$pdf_config['footerpage'] = _MD_PDF_PAGE; |
|
109
|
|
|
|
|
110
|
|
|
// For local support sites |
|
111
|
|
|
define('NEWS_PDF_FORUM', 'Forum'); |
|
112
|
|
|
define('NEWS_PDF_TOPIC', 'Topic'); |
|
113
|
|
|
define('NEWS_PDF_SUBJECT', 'Subject'); |
|
114
|
|
|
define('NEWS_PDF_AUTHOR', _POSTEDBY); |
|
115
|
|
|
define('NEWS_PDF_DATE', _MD_POSTEDON); |
|
116
|
|
|
|
|
117
|
|
|
// Usually you do not need change the following class if you are not using: S/T Chinese, Korean, Japanese |
|
118
|
|
|
// For more details, refer to: http://fpdf.org |
|
119
|
|
|
class PDF_language extends FPDF |
|
120
|
|
|
{ |
|
121
|
|
|
function PDF_language($orientation='P',$unit='mm',$format='A4') |
|
|
|
|
|
|
122
|
|
|
{ |
|
123
|
|
|
//Call parent constructor |
|
124
|
|
|
$this->FPDF($orientation,$unit,$format); |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
function Error($msg) |
|
|
|
|
|
|
128
|
|
|
{ |
|
129
|
|
|
global $pdf_config; |
|
130
|
|
|
if($pdf_config['action_on_error']){ |
|
131
|
|
|
//Fatal error |
|
132
|
|
|
die('<B>FPDF error: </B>'.$msg); |
|
133
|
|
|
} |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
function encoding(&$text, $in_charset) |
|
|
|
|
|
|
137
|
|
|
{ |
|
138
|
|
|
$out_charset = $GLOBALS['valid_pfd_charset']; |
|
139
|
|
|
if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return; |
|
140
|
|
|
|
|
141
|
|
|
if(is_array($text) && count($text)>0){ |
|
142
|
|
|
foreach($text as $key=>$val){ |
|
143
|
|
|
$this->_encoding($text[$key], $in_charset, $out_charset); |
|
144
|
|
|
} |
|
145
|
|
|
}else{ |
|
146
|
|
|
$this->_encoding($text, $in_charset, $out_charset); |
|
147
|
|
|
} |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
function _encoding(&$text, $in_charset, $out_charset) |
|
|
|
|
|
|
151
|
|
|
{ |
|
152
|
|
|
// some conversion goes here |
|
153
|
|
|
// refer to schinese.php for example |
|
154
|
|
|
} |
|
155
|
|
|
} |
|
156
|
|
|
|
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.