Code Duplication    Length = 47-49 lines in 4 locations

fpdf/language/french.php 1 location

@@ 119-165 (lines=47) @@
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
    $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
153
    if($xconv_handler &&
154
      $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
155
    ){
156
      $text = $converted_text;
157
158
      return;
159
    }
160
    if(XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) $converted_text = @mb_convert_encoding($text, $out_charset, $in_charset);
161
    else
162
    if(function_exists('iconv')) $converted_text = @iconv($in_charset, $out_charset . '//TRANSLIT', $text);
163
    $text = empty($converted_text)?$text:$converted_text;
164
  }
165
}
166

fpdf/language/japanese.php 1 location

@@ 119-167 (lines=49) @@
116
define('NEWS_PDF_DATE', _MD_POSTEDON);
117
118
// For more details, refer to: http://fpdf.org
119
class PDF_language extends PDF_Japanese
120
{
121
  function PDF_language($orientation='P',$unit='mm',$format='A4')
122
  {
123
      //Call parent constructor
124
      $this->FPDF($orientation,$unit,$format);
125
      //Initialization
126
    $this->AddSJIShwFont();
127
  }
128
129
  function Error($msg)
130
  {
131
    global $pdf_config;
132
    if($pdf_config['action_on_error']){
133
      //Fatal error
134
      die('<B>FPDF error: </B>'.$msg);
135
    }
136
  }
137
138
  function encoding(&$text, $in_charset)
139
  {
140
    $out_charset = $GLOBALS['valid_pfd_charset'];
141
      if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;
142
143
      if(is_array($text) && count($text)>0){
144
        foreach($text as $key=>$val){
145
          $this->_encoding($text[$key], $in_charset, $out_charset);
146
        }
147
      }else{
148
        $this->_encoding($text, $in_charset, $out_charset);
149
      }
150
  }
151
152
  function _encoding(&$text, $in_charset, $out_charset)
153
  {
154
    $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
155
    if($xconv_handler &&
156
      $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
157
    ){
158
      $text = $converted_text;
159
160
      return;
161
    }
162
    if(XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) $converted_text = @mb_convert_encoding($text, $out_charset, $in_charset);
163
    else
164
    if(function_exists('iconv')) $converted_text = @iconv($in_charset, $out_charset . '//TRANSLIT', $text);
165
    $text = empty($converted_text)?$text:$converted_text;
166
  }
167
}
168

fpdf/language/korean.php 1 location

@@ 119-167 (lines=49) @@
116
define('NEWS_PDF_DATE', _MD_POSTEDON);
117
118
// For more details, refer to: http://fpdf.org
119
class PDF_language extends PDF_Korean
120
{
121
  function PDF_language($orientation='P',$unit='mm',$format='A4')
122
  {
123
      //Call parent constructor
124
      $this->FPDF($orientation,$unit,$format);
125
      //Initialization
126
    $this->AddUHChwFont();
127
  }
128
129
  function Error($msg)
130
  {
131
    global $pdf_config;
132
    if($pdf_config['action_on_error']){
133
      //Fatal error
134
      die('<B>FPDF error: </B>'.$msg);
135
    }
136
  }
137
138
  function encoding(&$text, $in_charset)
139
  {
140
    $out_charset = $GLOBALS['valid_pfd_charset'];
141
      if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;
142
143
      if(is_array($text) && count($text)>0){
144
        foreach($text as $key=>$val){
145
          $this->_encoding($text[$key], $in_charset, $out_charset);
146
        }
147
      }else{
148
        $this->_encoding($text, $in_charset, $out_charset);
149
      }
150
  }
151
152
  function _encoding(&$text, $in_charset, $out_charset)
153
  {
154
    $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
155
    if($xconv_handler &&
156
      $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
157
    ){
158
      $text = $converted_text;
159
160
      return;
161
    }
162
    if(XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) $converted_text = @mb_convert_encoding($text, $out_charset, $in_charset);
163
    else
164
    if(function_exists('iconv')) $converted_text = @iconv($in_charset, $out_charset . '//TRANSLIT', $text);
165
    $text = empty($converted_text)?$text:$converted_text;
166
  }
167
}
168

fpdf/language/tchinese.php 1 location

@@ 119-167 (lines=49) @@
116
define('NEWS_PDF_DATE', _MD_POSTEDON);
117
118
// For more details, refer to: http://fpdf.org
119
class PDF_language extends PDF_Chinese
120
{
121
  function PDF_language($orientation='P',$unit='mm',$format='A4')
122
  {
123
      //Call parent constructor
124
      $this->FPDF($orientation,$unit,$format);
125
      //Initialization
126
    $this->AddBig5hwFont();
127
  }
128
129
  function Error($msg)
130
  {
131
    global $pdf_config;
132
    if($pdf_config['action_on_error']){
133
      //Fatal error
134
      die('<B>FPDF error: </B>'.$msg);
135
    }
136
  }
137
138
  function encoding(&$text, $in_charset)
139
  {
140
    $out_charset = $GLOBALS['valid_pfd_charset'];
141
      if (empty($in_charset) || empty($out_charset) || !strcasecmp($out_charset, $in_charset)) return;
142
143
      if(is_array($text) && count($text)>0){
144
        foreach($text as $key=>$val){
145
          $this->_encoding($text[$key], $in_charset, $out_charset);
146
        }
147
      }else{
148
        $this->_encoding($text, $in_charset, $out_charset);
149
      }
150
  }
151
152
  function _encoding(&$text, $in_charset, $out_charset)
153
  {
154
    $xconv_handler = @xoops_getmodulehandler('xconv', 'xconv', true);
155
    if($xconv_handler &&
156
      $converted_text = @$xconv_handler->convert_encoding($text, $out_charset, $in_charset)
157
    ){
158
      $text = $converted_text;
159
160
      return;
161
    }
162
    if(XOOPS_USE_MULTIBYTES && function_exists('mb_convert_encoding')) $converted_text = @mb_convert_encoding($text, $out_charset, $in_charset);
163
    else
164
    if(function_exists('iconv')) $converted_text = @iconv($in_charset, $out_charset . '//TRANSLIT', $text);
165
    $text = empty($converted_text)?$text:$converted_text;
166
  }
167
}
168