PageRenderTime 23ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/news/fpdf/language/korean.php

https://github.com/severnaya99/Sg-2010
PHP | 168 lines | 113 code | 20 blank | 35 comment | 11 complexity | e81b7da873f8755764f31e43ebaafdd3 MD5 | raw file
Possible License(s): LGPL-2.1, AGPL-1.0, GPL-2.0
  1. <?php
  2. // $Id: korean.php,v 1.2 2005/04/18 01:22:29 phppp Exp $
  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. if (!defined('XOOPS_ROOT_PATH')) {
  32. die("XOOPS root path not defined");
  33. }
  34. require NEWS_FPDF_PATH.'/korean.php';
  35. // For end users
  36. $valid_pfd_charset = '';
  37. $pdf_config['margin'] = array(
  38. 'left'=>25,
  39. 'top'=>25,
  40. 'right'=>25
  41. );
  42. $pdf_config['logo'] = array(
  43. 'path'=>'images/news_slogo.png',
  44. 'left'=>150,
  45. 'top'=>5,
  46. 'width'=>0,
  47. 'height'=>0
  48. );
  49. $pdf_config['font']['slogan'] = array(
  50. 'family'=>'UHC-hw',
  51. 'style'=>'bi',
  52. 'size'=>8
  53. );
  54. $pdf_config['font']['title'] = array(
  55. 'family'=>'UHC-hw',
  56. 'style'=>'biu',
  57. 'size'=>12
  58. );
  59. $pdf_config['font']['subject'] = array(
  60. 'family'=>'UHC-hw',
  61. 'style'=>'b',
  62. 'size'=>11
  63. );
  64. $pdf_config['font']['author'] = array(
  65. 'family'=>'UHC-hw',
  66. 'style'=>'',
  67. 'size'=>10
  68. );
  69. $pdf_config['font']['subtitle'] = array(
  70. 'family'=>'UHC-hw',
  71. 'style'=>'b',
  72. 'size'=>11
  73. );
  74. $pdf_config['font']['subsubtitle'] = array(
  75. 'family'=>'UHC-hw',
  76. 'style'=>'b',
  77. 'size'=>10
  78. );
  79. $pdf_config['font']['content'] = array(
  80. 'family'=>'UHC-hw',
  81. 'style'=>'',
  82. 'size'=>10
  83. );
  84. $pdf_config['font']['footer'] = array(
  85. 'family'=>'UHC-hw',
  86. 'style'=>'',
  87. 'size'=>8
  88. );
  89. $pdf_config['action_on_error'] = 0; // 0 - continue; 1 - die
  90. $pdf_config['creator'] = 'NEWS BASED ON FPDF v1.53';
  91. $pdf_config['url'] = XOOPS_URL;
  92. $pdf_config['mail'] = 'mailto:'.$xoopsConfig['adminmail'];
  93. $pdf_config['slogan']=xoops_substr($myts->htmlspecialchars( $xoopsConfig['sitename'] ),0,30);
  94. $pdf_config['scale'] = '0.8';
  95. $pdf_config['dateformat'] = _DATESTRING;
  96. $pdf_config['footerpage'] = _NW_PAGE;
  97. // For local support sites
  98. define('NEWS_PDF_FORUM', 'Forum');
  99. define('NEWS_PDF_TOPIC', 'Topic');
  100. define('NEWS_PDF_SUBJECT', 'Subject');
  101. define('NEWS_PDF_AUTHOR', _POSTEDBY);
  102. define('NEWS_PDF_DATE', _MD_POSTEDON);
  103. // For more details, refer to: http://fpdf.org
  104. class PDF_language extends PDF_Korean
  105. {
  106. function PDF_language($orientation='P',$unit='mm',$format='A4')
  107. {
  108. //Call parent constructor
  109. $this->FPDF($orientation,$unit,$format);
  110. //Initialization
  111. $this->AddUHChwFont();
  112. }
  113. function Error($msg)
  114. {
  115. global $pdf_config;
  116. if($pdf_config['action_on_error']){
  117. //Fatal error
  118. die('<B>FPDF error: </B>'.$msg);
  119. }
  120. }
  121. function encoding(&$text, $in_charset)
  122. {
  123. $out_charset = $GLOBALS["valid_pfd_charset"];
  124. if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;
  125. if(is_array($text) && count($text)>0){
  126. foreach($text as $key=>$val){
  127. $this->_encoding($text[$key], $in_charset, $out_charset);
  128. }
  129. }else{
  130. $this->_encoding($text, $in_charset, $out_charset);
  131. }
  132. }
  133. function _encoding(&$text, $in_charset, $out_charset)
  134. {
  135. $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
  136. if($xconv_handler &&
  137. $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
  138. ){
  139. $text = $converted_text;
  140. return;
  141. }
  142. if(XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) $converted_text = @mb_convert_encoding($text, $out_charset, $in_charset);
  143. else
  144. if(function_exists('iconv')) $converted_text = @iconv($in_charset, $out_charset . "//TRANSLIT", $text);
  145. $text = empty($converted_text)?$text:$converted_text;
  146. }
  147. }
  148. ?>