@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * |
| 31 | 31 | * @param string $orientation page orientation, same as TCPDF |
| 32 | 32 | * @param string $unit User measure unit, same as TCPDF |
| 33 | - * @param mixed $format The format used for pages, same as TCPDF |
|
| 33 | + * @param string $format The format used for pages, same as TCPDF |
|
| 34 | 34 | * @param boolean $unicode TRUE means that the input text is unicode (default = true) |
| 35 | 35 | * @param String $encoding charset encoding; default is UTF-8 |
| 36 | 36 | * @param boolean $diskcache if TRUE reduce the RAM memory usage by caching temporary data on filesystem (slower). |
@@ -1407,7 +1407,6 @@ discard block |
||
| 1407 | 1407 | * set $_myLastPageGroup; |
| 1408 | 1408 | * |
| 1409 | 1409 | * @access public |
| 1410 | - * @param integer $myLastPageGroup; |
|
| 1411 | 1410 | * @param integer $myLastPageGroup |
| 1412 | 1411 | */ |
| 1413 | 1412 | public function setMyLastPageGroup($myLastPageGroup) |
@@ -1430,7 +1429,6 @@ discard block |
||
| 1430 | 1429 | * set $_myLastPageGroupNb; |
| 1431 | 1430 | * |
| 1432 | 1431 | * @access public |
| 1433 | - * @param integer $myLastPageGroupNb; |
|
| 1434 | 1432 | * @param integer $myLastPageGroupNb |
| 1435 | 1433 | */ |
| 1436 | 1434 | public function setMyLastPageGroupNb($myLastPageGroupNb) |
@@ -43,6 +43,7 @@ |
||
| 43 | 43 | * Set the HTML2PDF parent object |
| 44 | 44 | * |
| 45 | 45 | * @param &HTML2PDF reference to the HTML2PDF parent $object |
| 46 | + * @param HTML2PDF_myPdf|null $pdf |
|
| 46 | 47 | * @access public |
| 47 | 48 | */ |
| 48 | 49 | public function setPdfParent(&$pdf) |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | { |
| 485 | 485 | // prepare |
| 486 | 486 | $tagName = strtolower($tagName); |
| 487 | - $id = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id) $id = null; |
|
| 487 | + $id = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id) $id = null; |
|
| 488 | 488 | $name = isset($param['name']) ? strtolower(trim($param['name'])) : null; if ( ! $name) $name = null; |
| 489 | 489 | |
| 490 | 490 | // read the class attribute |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | { |
| 555 | 555 | // prepare the informations |
| 556 | 556 | $tagName = strtolower($tagName); |
| 557 | - $id = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id) $id = null; |
|
| 557 | + $id = isset($param['id']) ? strtolower(trim($param['id'])) : null; if ( ! $id) $id = null; |
|
| 558 | 558 | $name = isset($param['name']) ? strtolower(trim($param['name'])) : null; if ( ! $name) $name = null; |
| 559 | 559 | |
| 560 | 560 | // get the class names to use |
@@ -50,6 +50,7 @@ |
||
| 50 | 50 | * Define the HTML code to parse |
| 51 | 51 | * |
| 52 | 52 | * @param string HTML code |
| 53 | + * @param string $html |
|
| 53 | 54 | * @access public |
| 54 | 55 | */ |
| 55 | 56 | public function setHTML($html) |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | * @param array $frame |
| 1124 | 1124 | * @param int $maskNo |
| 1125 | 1125 | * @param int $level |
| 1126 | - * @return array mask |
|
| 1126 | + * @return integer mask |
|
| 1127 | 1127 | */ |
| 1128 | 1128 | protected function makeMask($width, $frame, $maskNo, $level) { |
| 1129 | 1129 | $masked = array_fill(0, $width, str_repeat("\0", $width)); |
@@ -1165,7 +1165,7 @@ discard block |
||
| 1165 | 1165 | /** |
| 1166 | 1166 | * evaluateSymbol |
| 1167 | 1167 | * @param int $width |
| 1168 | - * @param array $frame |
|
| 1168 | + * @param integer $frame |
|
| 1169 | 1169 | * @return int demerit |
| 1170 | 1170 | */ |
| 1171 | 1171 | protected function evaluateSymbol($width, $frame) { |
@@ -2035,7 +2035,7 @@ discard block |
||
| 2035 | 2035 | |
| 2036 | 2036 | /** |
| 2037 | 2037 | * convertData |
| 2038 | - * @param array $items |
|
| 2038 | + * @param integer $items |
|
| 2039 | 2039 | * @return array items |
| 2040 | 2040 | */ |
| 2041 | 2041 | protected function convertData($items) { |
@@ -2490,7 +2490,7 @@ discard block |
||
| 2490 | 2490 | |
| 2491 | 2491 | /** |
| 2492 | 2492 | * Return BCH encoded format information pattern. |
| 2493 | - * @param array $mask |
|
| 2493 | + * @param integer $mask |
|
| 2494 | 2494 | * @param int $level error correction level |
| 2495 | 2495 | * @return BCH encoded format information pattern |
| 2496 | 2496 | */ |
@@ -180,12 +180,12 @@ discard block |
||
| 180 | 180 | /** |
| 181 | 181 | * Matrix index to get width from $capacity array. |
| 182 | 182 | */ |
| 183 | - define('QRCAP_WIDTH', 0); |
|
| 183 | + define('QRCAP_WIDTH', 0); |
|
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | 186 | * Matrix index to get number of words from $capacity array. |
| 187 | 187 | */ |
| 188 | - define('QRCAP_WORDS', 1); |
|
| 188 | + define('QRCAP_WORDS', 1); |
|
| 189 | 189 | |
| 190 | 190 | /** |
| 191 | 191 | * Matrix index to get remainder from $capacity array. |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | /** |
| 196 | 196 | * Matrix index to get error correction level from $capacity array. |
| 197 | 197 | */ |
| 198 | - define('QRCAP_EC', 3); |
|
| 198 | + define('QRCAP_EC', 3); |
|
| 199 | 199 | |
| 200 | 200 | // ----------------------------------------------------- |
| 201 | 201 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | /** |
| 205 | 205 | * Number of header bits for structured mode |
| 206 | 206 | */ |
| 207 | - define('STRUCTURE_HEADER_BITS', 20); |
|
| 207 | + define('STRUCTURE_HEADER_BITS', 20); |
|
| 208 | 208 | |
| 209 | 209 | /** |
| 210 | 210 | * Max number of symbols for structured mode |
@@ -218,12 +218,12 @@ discard block |
||
| 218 | 218 | /** |
| 219 | 219 | * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column) |
| 220 | 220 | */ |
| 221 | - define('N1', 3); |
|
| 221 | + define('N1', 3); |
|
| 222 | 222 | |
| 223 | 223 | /** |
| 224 | 224 | * Down point base value for case 2 mask pattern (module block of same color) |
| 225 | 225 | */ |
| 226 | - define('N2', 3); |
|
| 226 | + define('N2', 3); |
|
| 227 | 227 | |
| 228 | 228 | /** |
| 229 | 229 | * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column) |
@@ -260,18 +260,18 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | // #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# |
| 262 | 262 | |
| 263 | -if (!class_exists('QRcode', false)) { |
|
| 263 | +if ( ! class_exists('QRcode', false)) { |
|
| 264 | 264 | |
| 265 | 265 | // for compaibility with PHP4 |
| 266 | - if (!function_exists('str_split')) { |
|
| 266 | + if ( ! function_exists('str_split')) { |
|
| 267 | 267 | /** |
| 268 | 268 | * Convert a string to an array (needed for PHP4 compatibility) |
| 269 | 269 | * @param string $string The input string. |
| 270 | 270 | * @param int $split_length Maximum length of the chunk. |
| 271 | 271 | * @return string[] the optional split_length parameter is specified, the returned array will be broken down into chunks with each being split_length in length, otherwise each chunk will be one character in length. FALSE is returned if split_length is less than 1. If the split_length length exceeds the length of string , the entire string is returned as the first (and only) array element. |
| 272 | 272 | */ |
| 273 | - function str_split($string, $split_length=1) { |
|
| 274 | - if ((strlen($string) > $split_length) OR (!$split_length)) { |
|
| 273 | + function str_split($string, $split_length = 1) { |
|
| 274 | + if ((strlen($string) > $split_length) OR ( ! $split_length)) { |
|
| 275 | 275 | do { |
| 276 | 276 | $c = strlen($string); |
| 277 | 277 | $parts[] = substr($string, 0, $split_length); |
@@ -64,6 +64,7 @@ |
||
| 64 | 64 | * Custom query result. |
| 65 | 65 | * |
| 66 | 66 | * @param class_name A string that represents the type of object you want back |
| 67 | + * @param string $class_name |
|
| 67 | 68 | * @return array of objects |
| 68 | 69 | */ |
| 69 | 70 | public function custom_result_object($class_name) |
@@ -164,6 +164,7 @@ |
||
| 164 | 164 | * |
| 165 | 165 | * @access private called by execute() |
| 166 | 166 | * @param string an SQL query |
| 167 | + * @param string $sql |
|
| 167 | 168 | * @return string |
| 168 | 169 | */ |
| 169 | 170 | function _prep_query($sql) |
@@ -293,6 +293,8 @@ discard block |
||
| 293 | 293 | * @access private |
| 294 | 294 | * @param string |
| 295 | 295 | * @param string |
| 296 | + * @param string $string |
|
| 297 | + * @param string $key |
|
| 296 | 298 | * @return string |
| 297 | 299 | */ |
| 298 | 300 | function _xor_merge($string, $key) |
@@ -365,6 +367,7 @@ discard block |
||
| 365 | 367 | * @param string |
| 366 | 368 | * @param string |
| 367 | 369 | * @param string $data |
| 370 | + * @param string $key |
|
| 368 | 371 | * @return string |
| 369 | 372 | */ |
| 370 | 373 | function _add_cipher_noise($data, $key) |
@@ -396,6 +399,8 @@ discard block |
||
| 396 | 399 | * |
| 397 | 400 | * @access public |
| 398 | 401 | * @param type |
| 402 | + * @param string $data |
|
| 403 | + * @param string $key |
|
| 399 | 404 | * @return string |
| 400 | 405 | */ |
| 401 | 406 | function _remove_cipher_noise($data, $key) |
@@ -1010,6 +1010,9 @@ |
||
| 1010 | 1010 | return $this->x; |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | +/** |
|
| 1014 | + * @param integer $x |
|
| 1015 | + */ |
|
| 1013 | 1016 | function SetX($x) |
| 1014 | 1017 | {
|
| 1015 | 1018 | // Set x position |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | *******************************************************************************/ |
| 78 | 78 | function FPDF($props = array()) |
| 79 | 79 | {
|
| 80 | - if(count($props) == 3) |
|
| 80 | + if (count($props) == 3) |
|
| 81 | 81 | {
|
| 82 | - list($orientation,$unit,$format) = $props; |
|
| 83 | - $this->initialize($orientation,$unit,$format); |
|
| 82 | + list($orientation, $unit, $format) = $props; |
|
| 83 | + $this->initialize($orientation, $unit, $format); |
|
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | -function initialize($orientation='P',$unit='mm',$size='A4') |
|
| 87 | +function initialize($orientation = 'P', $unit = 'mm', $size = 'A4') |
|
| 88 | 88 | {
|
| 89 | 89 | // Some checks |
| 90 | 90 | $this->_dochecks(); |
@@ -182,12 +182,12 @@ discard block |
||
| 182 | 182 | * @param double $left |
| 183 | 183 | * @param double $top |
| 184 | 184 | */ |
| 185 | -function SetMargins($left, $top, $right=null) |
|
| 185 | +function SetMargins($left, $top, $right = null) |
|
| 186 | 186 | {
|
| 187 | 187 | // Set left, top and right margins |
| 188 | 188 | $this->lMargin = $left; |
| 189 | 189 | $this->tMargin = $top; |
| 190 | - if($right===null) { |
|
| 190 | + if ($right === null) { |
|
| 191 | 191 | $right = $left; |
| 192 | 192 | } |
| 193 | 193 | $this->rMargin = $right; |
@@ -216,25 +216,25 @@ discard block |
||
| 216 | 216 | /** |
| 217 | 217 | * @param boolean $auto |
| 218 | 218 | */ |
| 219 | -function SetAutoPageBreak($auto, $margin=0) |
|
| 219 | +function SetAutoPageBreak($auto, $margin = 0) |
|
| 220 | 220 | {
|
| 221 | 221 | // Set auto page break mode and triggering margin |
| 222 | 222 | $this->AutoPageBreak = $auto; |
| 223 | 223 | $this->bMargin = $margin; |
| 224 | - $this->PageBreakTrigger = $this->h-$margin; |
|
| 224 | + $this->PageBreakTrigger = $this->h - $margin; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /** |
| 228 | 228 | * @param string $zoom |
| 229 | 229 | */ |
| 230 | -function SetDisplayMode($zoom, $layout='default') |
|
| 230 | +function SetDisplayMode($zoom, $layout = 'default') |
|
| 231 | 231 | {
|
| 232 | 232 | // Set display mode in viewer |
| 233 | - if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) |
|
| 233 | + if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || ! is_string($zoom)) |
|
| 234 | 234 | $this->ZoomMode = $zoom; |
| 235 | 235 | else |
| 236 | 236 | $this->Error('Incorrect zoom display mode: '.$zoom);
|
| 237 | - if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') |
|
| 237 | + if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default') |
|
| 238 | 238 | $this->LayoutMode = $layout; |
| 239 | 239 | else |
| 240 | 240 | $this->Error('Incorrect layout display mode: '.$layout);
|
@@ -412,14 +412,14 @@ discard block |
||
| 412 | 412 | return $this->page; |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | -function SetDrawColor($r, $g=null, $b=null) |
|
| 415 | +function SetDrawColor($r, $g = null, $b = null) |
|
| 416 | 416 | {
|
| 417 | 417 | // Set color for all stroking operations |
| 418 | - if(($r==0 && $g==0 && $b==0) || $g===null) |
|
| 419 | - $this->DrawColor = sprintf('%.3F G',$r/255);
|
|
| 418 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) |
|
| 419 | + $this->DrawColor = sprintf('%.3F G', $r / 255);
|
|
| 420 | 420 | else |
| 421 | - $this->DrawColor = sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255);
|
|
| 422 | - if($this->page>0) |
|
| 421 | + $this->DrawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255);
|
|
| 422 | + if ($this->page > 0) |
|
| 423 | 423 | $this->_out($this->DrawColor); |
| 424 | 424 | } |
| 425 | 425 | |
@@ -428,26 +428,26 @@ discard block |
||
| 428 | 428 | * @param integer $g |
| 429 | 429 | * @param integer $b |
| 430 | 430 | */ |
| 431 | -function SetFillColor($r, $g=null, $b=null) |
|
| 431 | +function SetFillColor($r, $g = null, $b = null) |
|
| 432 | 432 | {
|
| 433 | 433 | // Set color for all filling operations |
| 434 | - if(($r==0 && $g==0 && $b==0) || $g===null) |
|
| 435 | - $this->FillColor = sprintf('%.3F g',$r/255);
|
|
| 434 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) |
|
| 435 | + $this->FillColor = sprintf('%.3F g', $r / 255);
|
|
| 436 | 436 | else |
| 437 | - $this->FillColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
|
|
| 438 | - $this->ColorFlag = ($this->FillColor!=$this->TextColor); |
|
| 439 | - if($this->page>0) |
|
| 437 | + $this->FillColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255);
|
|
| 438 | + $this->ColorFlag = ($this->FillColor != $this->TextColor); |
|
| 439 | + if ($this->page > 0) |
|
| 440 | 440 | $this->_out($this->FillColor); |
| 441 | 441 | } |
| 442 | 442 | |
| 443 | -function SetTextColor($r, $g=null, $b=null) |
|
| 443 | +function SetTextColor($r, $g = null, $b = null) |
|
| 444 | 444 | {
|
| 445 | 445 | // Set color for text |
| 446 | - if(($r==0 && $g==0 && $b==0) || $g===null) |
|
| 447 | - $this->TextColor = sprintf('%.3F g',$r/255);
|
|
| 446 | + if (($r == 0 && $g == 0 && $b == 0) || $g === null) |
|
| 447 | + $this->TextColor = sprintf('%.3F g', $r / 255);
|
|
| 448 | 448 | else |
| 449 | - $this->TextColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
|
|
| 450 | - $this->ColorFlag = ($this->FillColor!=$this->TextColor); |
|
| 449 | + $this->TextColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255);
|
|
| 450 | + $this->ColorFlag = ($this->FillColor != $this->TextColor); |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | function GetStringWidth($s) |
@@ -457,18 +457,18 @@ discard block |
||
| 457 | 457 | $cw = &$this->CurrentFont['cw']; |
| 458 | 458 | $w = 0; |
| 459 | 459 | $l = strlen($s); |
| 460 | - for($i=0;$i<$l;$i++) { |
|
| 460 | + for ($i = 0; $i < $l; $i++) { |
|
| 461 | 461 | $w += $cw[$s[$i]]; |
| 462 | 462 | } |
| 463 | - return $w*$this->FontSize/1000; |
|
| 463 | + return $w * $this->FontSize / 1000; |
|
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | function SetLineWidth($width) |
| 467 | 467 | {
|
| 468 | 468 | // Set line width |
| 469 | 469 | $this->LineWidth = $width; |
| 470 | - if($this->page>0) { |
|
| 471 | - $this->_out(sprintf('%.2F w',$width*$this->k)); |
|
| 470 | + if ($this->page > 0) { |
|
| 471 | + $this->_out(sprintf('%.2F w', $width * $this->k)); |
|
| 472 | 472 | } |
| 473 | 473 | } |
| 474 | 474 | |
@@ -479,57 +479,57 @@ discard block |
||
| 479 | 479 | function Line($x1, $y1, $x2, $y2) |
| 480 | 480 | {
|
| 481 | 481 | // Draw a line |
| 482 | - $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
|
|
| 482 | + $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k));
|
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | -function Rect($x, $y, $w, $h, $style='') |
|
| 485 | +function Rect($x, $y, $w, $h, $style = '') |
|
| 486 | 486 | {
|
| 487 | 487 | // Draw a rectangle |
| 488 | - if($style=='F') { |
|
| 488 | + if ($style == 'F') { |
|
| 489 | 489 | $op = 'f'; |
| 490 | - } elseif($style=='FD' || $style=='DF') { |
|
| 490 | + } elseif ($style == 'FD' || $style == 'DF') { |
|
| 491 | 491 | $op = 'B'; |
| 492 | 492 | } else { |
| 493 | 493 | $op = 'S'; |
| 494 | 494 | } |
| 495 | - $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
|
|
| 495 | + $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x * $this->k, ($this->h - $y) * $this->k, $w * $this->k, -$h * $this->k, $op));
|
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | /** |
| 499 | 499 | * @param string $family |
| 500 | 500 | */ |
| 501 | -function AddFont($family, $style='', $file='') |
|
| 501 | +function AddFont($family, $style = '', $file = '') |
|
| 502 | 502 | {
|
| 503 | 503 | // Add a TrueType, OpenType or Type1 font |
| 504 | 504 | $family = strtolower($family); |
| 505 | - if($file=='') { |
|
| 506 | - $file = str_replace(' ','',$family).strtolower($style).'.php'; |
|
| 505 | + if ($file == '') { |
|
| 506 | + $file = str_replace(' ', '', $family).strtolower($style).'.php'; |
|
| 507 | 507 | } |
| 508 | 508 | $style = strtoupper($style); |
| 509 | - if($style=='IB') { |
|
| 509 | + if ($style == 'IB') { |
|
| 510 | 510 | $style = 'BI'; |
| 511 | 511 | } |
| 512 | 512 | $fontkey = $family.$style; |
| 513 | - if(isset($this->fonts[$fontkey])) { |
|
| 513 | + if (isset($this->fonts[$fontkey])) { |
|
| 514 | 514 | return; |
| 515 | 515 | } |
| 516 | 516 | $info = $this->_loadfont($file); |
| 517 | - $info['i'] = count($this->fonts)+1; |
|
| 518 | - if(!empty($info['diff'])) |
|
| 517 | + $info['i'] = count($this->fonts) + 1; |
|
| 518 | + if ( ! empty($info['diff'])) |
|
| 519 | 519 | {
|
| 520 | 520 | // Search existing encodings |
| 521 | - $n = array_search($info['diff'],$this->diffs); |
|
| 522 | - if(!$n) |
|
| 521 | + $n = array_search($info['diff'], $this->diffs); |
|
| 522 | + if ( ! $n) |
|
| 523 | 523 | {
|
| 524 | - $n = count($this->diffs)+1; |
|
| 524 | + $n = count($this->diffs) + 1; |
|
| 525 | 525 | $this->diffs[$n] = $info['diff']; |
| 526 | 526 | } |
| 527 | 527 | $info['diffn'] = $n; |
| 528 | 528 | } |
| 529 | - if(!empty($info['file'])) |
|
| 529 | + if ( ! empty($info['file'])) |
|
| 530 | 530 | {
|
| 531 | 531 | // Embedded font |
| 532 | - if($info['type']=='TrueType') { |
|
| 532 | + if ($info['type'] == 'TrueType') { |
|
| 533 | 533 | $this->FontFiles[$info['file']] = array('length1'=>$info['originalsize']); |
| 534 | 534 | } else { |
| 535 | 535 | $this->FontFiles[$info['file']] = array('length1'=>$info['size1'], 'length2'=>$info['size2']); |
@@ -541,48 +541,48 @@ discard block |
||
| 541 | 541 | /** |
| 542 | 542 | * @param string $family |
| 543 | 543 | */ |
| 544 | -function SetFont($family, $style='', $size=0) |
|
| 544 | +function SetFont($family, $style = '', $size = 0) |
|
| 545 | 545 | {
|
| 546 | 546 | // Select a font; size given in points |
| 547 | - if($family=='') { |
|
| 547 | + if ($family == '') { |
|
| 548 | 548 | $family = $this->FontFamily; |
| 549 | 549 | } else { |
| 550 | 550 | $family = strtolower($family); |
| 551 | 551 | } |
| 552 | 552 | $style = strtoupper($style); |
| 553 | - if(strpos($style,'U')!==false) |
|
| 553 | + if (strpos($style, 'U') !== false) |
|
| 554 | 554 | {
|
| 555 | 555 | $this->underline = true; |
| 556 | - $style = str_replace('U','',$style);
|
|
| 556 | + $style = str_replace('U', '', $style);
|
|
| 557 | 557 | } else { |
| 558 | 558 | $this->underline = false; |
| 559 | 559 | } |
| 560 | - if($style=='IB') { |
|
| 560 | + if ($style == 'IB') { |
|
| 561 | 561 | $style = 'BI'; |
| 562 | 562 | } |
| 563 | - if($size==0) { |
|
| 563 | + if ($size == 0) { |
|
| 564 | 564 | $size = $this->FontSizePt; |
| 565 | 565 | } |
| 566 | 566 | // Test if font is already selected |
| 567 | - if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) { |
|
| 567 | + if ($this->FontFamily == $family && $this->FontStyle == $style && $this->FontSizePt == $size) { |
|
| 568 | 568 | return; |
| 569 | 569 | } |
| 570 | 570 | // Test if font is already loaded |
| 571 | 571 | $fontkey = $family.$style; |
| 572 | - if(!isset($this->fonts[$fontkey])) |
|
| 572 | + if ( ! isset($this->fonts[$fontkey])) |
|
| 573 | 573 | {
|
| 574 | 574 | // Test if one of the core fonts |
| 575 | - if($family=='arial') { |
|
| 575 | + if ($family == 'arial') { |
|
| 576 | 576 | $family = 'helvetica'; |
| 577 | 577 | } |
| 578 | - if(in_array($family,$this->CoreFonts)) |
|
| 578 | + if (in_array($family, $this->CoreFonts)) |
|
| 579 | 579 | {
|
| 580 | - if($family=='symbol' || $family=='zapfdingbats') { |
|
| 580 | + if ($family == 'symbol' || $family == 'zapfdingbats') { |
|
| 581 | 581 | $style = ''; |
| 582 | 582 | } |
| 583 | 583 | $fontkey = $family.$style; |
| 584 | - if(!isset($this->fonts[$fontkey])) { |
|
| 585 | - $this->AddFont($family,$style); |
|
| 584 | + if ( ! isset($this->fonts[$fontkey])) { |
|
| 585 | + $this->AddFont($family, $style); |
|
| 586 | 586 | } |
| 587 | 587 | } else { |
| 588 | 588 | $this->Error('Undefined font: '.$family.' '.$style); |
@@ -654,79 +654,79 @@ discard block |
||
| 654 | 654 | return $this->AutoPageBreak; |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | -function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') |
|
| 657 | +function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '') |
|
| 658 | 658 | {
|
| 659 | 659 | // Output a cell |
| 660 | 660 | $k = $this->k; |
| 661 | - if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) |
|
| 661 | + if ($this->y + $h > $this->PageBreakTrigger && ! $this->InHeader && ! $this->InFooter && $this->AcceptPageBreak()) |
|
| 662 | 662 | {
|
| 663 | 663 | // Automatic page break |
| 664 | 664 | $x = $this->x; |
| 665 | 665 | $ws = $this->ws; |
| 666 | - if($ws>0) |
|
| 666 | + if ($ws > 0) |
|
| 667 | 667 | {
|
| 668 | 668 | $this->ws = 0; |
| 669 | 669 | $this->_out('0 Tw');
|
| 670 | 670 | } |
| 671 | - $this->AddPage($this->CurOrientation,$this->CurPageSize); |
|
| 671 | + $this->AddPage($this->CurOrientation, $this->CurPageSize); |
|
| 672 | 672 | $this->x = $x; |
| 673 | - if($ws>0) |
|
| 673 | + if ($ws > 0) |
|
| 674 | 674 | {
|
| 675 | 675 | $this->ws = $ws; |
| 676 | - $this->_out(sprintf('%.3F Tw',$ws*$k));
|
|
| 676 | + $this->_out(sprintf('%.3F Tw', $ws * $k));
|
|
| 677 | 677 | } |
| 678 | 678 | } |
| 679 | - if($w==0) |
|
| 680 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 679 | + if ($w == 0) |
|
| 680 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 681 | 681 | $s = ''; |
| 682 | - if($fill || $border==1) |
|
| 682 | + if ($fill || $border == 1) |
|
| 683 | 683 | {
|
| 684 | - if($fill) |
|
| 685 | - $op = ($border==1) ? 'B' : 'f'; |
|
| 684 | + if ($fill) |
|
| 685 | + $op = ($border == 1) ? 'B' : 'f'; |
|
| 686 | 686 | else |
| 687 | 687 | $op = 'S'; |
| 688 | - $s = sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
|
|
| 688 | + $s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op);
|
|
| 689 | 689 | } |
| 690 | - if(is_string($border)) |
|
| 690 | + if (is_string($border)) |
|
| 691 | 691 | {
|
| 692 | 692 | $x = $this->x; |
| 693 | 693 | $y = $this->y; |
| 694 | - if(strpos($border,'L')!==false) |
|
| 695 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
|
|
| 696 | - if(strpos($border,'T')!==false) |
|
| 697 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
|
|
| 698 | - if(strpos($border,'R')!==false) |
|
| 699 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
|
|
| 700 | - if(strpos($border,'B')!==false) |
|
| 701 | - $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
|
|
| 694 | + if (strpos($border, 'L') !== false) |
|
| 695 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k);
|
|
| 696 | + if (strpos($border, 'T') !== false) |
|
| 697 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k);
|
|
| 698 | + if (strpos($border, 'R') !== false) |
|
| 699 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', ($x + $w) * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
|
|
| 700 | + if (strpos($border, 'B') !== false) |
|
| 701 | + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - ($y + $h)) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
|
|
| 702 | 702 | } |
| 703 | - if($txt!=='') |
|
| 703 | + if ($txt !== '') |
|
| 704 | 704 | {
|
| 705 | - if($align=='R') |
|
| 706 | - $dx = $w-$this->cMargin-$this->GetStringWidth($txt); |
|
| 707 | - elseif($align=='C') |
|
| 708 | - $dx = ($w-$this->GetStringWidth($txt))/2; |
|
| 705 | + if ($align == 'R') |
|
| 706 | + $dx = $w - $this->cMargin - $this->GetStringWidth($txt); |
|
| 707 | + elseif ($align == 'C') |
|
| 708 | + $dx = ($w - $this->GetStringWidth($txt)) / 2; |
|
| 709 | 709 | else |
| 710 | 710 | $dx = $this->cMargin; |
| 711 | - if($this->ColorFlag) |
|
| 711 | + if ($this->ColorFlag) |
|
| 712 | 712 | $s .= 'q '.$this->TextColor.' '; |
| 713 | - $txt2 = str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
|
|
| 714 | - $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
|
|
| 715 | - if($this->underline) |
|
| 716 | - $s .= ' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); |
|
| 717 | - if($this->ColorFlag) |
|
| 713 | + $txt2 = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $txt)));
|
|
| 714 | + $s .= sprintf('BT %.2F %.2F Td (%s) Tj ET', ($this->x + $dx) * $k, ($this->h - ($this->y + .5 * $h + .3 * $this->FontSize)) * $k, $txt2);
|
|
| 715 | + if ($this->underline) |
|
| 716 | + $s .= ' '.$this->_dounderline($this->x + $dx, $this->y + .5 * $h + .3 * $this->FontSize, $txt); |
|
| 717 | + if ($this->ColorFlag) |
|
| 718 | 718 | $s .= ' Q'; |
| 719 | - if($link) |
|
| 720 | - $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); |
|
| 719 | + if ($link) |
|
| 720 | + $this->Link($this->x + $dx, $this->y + .5 * $h - .5 * $this->FontSize, $this->GetStringWidth($txt), $this->FontSize, $link); |
|
| 721 | 721 | } |
| 722 | - if($s) |
|
| 722 | + if ($s) |
|
| 723 | 723 | $this->_out($s); |
| 724 | 724 | $this->lasth = $h; |
| 725 | - if($ln>0) |
|
| 725 | + if ($ln > 0) |
|
| 726 | 726 | {
|
| 727 | 727 | // Go to next line |
| 728 | 728 | $this->y += $h; |
| 729 | - if($ln==1) |
|
| 729 | + if ($ln == 1) |
|
| 730 | 730 | $this->x = $this->lMargin; |
| 731 | 731 | } |
| 732 | 732 | else |
@@ -737,21 +737,21 @@ discard block |
||
| 737 | 737 | * @param integer $w |
| 738 | 738 | * @param integer $h |
| 739 | 739 | */ |
| 740 | -function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false) |
|
| 740 | +function MultiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false) |
|
| 741 | 741 | {
|
| 742 | 742 | // Output text with automatic or explicit line breaks |
| 743 | 743 | $cw = &$this->CurrentFont['cw']; |
| 744 | - if($w==0) |
|
| 745 | - $w = $this->w-$this->rMargin-$this->x; |
|
| 746 | - $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; |
|
| 747 | - $s = str_replace("\r",'',$txt);
|
|
| 744 | + if ($w == 0) |
|
| 745 | + $w = $this->w - $this->rMargin - $this->x; |
|
| 746 | + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; |
|
| 747 | + $s = str_replace("\r", '', $txt);
|
|
| 748 | 748 | $nb = strlen($s); |
| 749 | - if($nb>0 && $s[$nb-1]=="\n") |
|
| 749 | + if ($nb > 0 && $s[$nb - 1] == "\n") |
|
| 750 | 750 | $nb--; |
| 751 | 751 | $b = 0; |
| 752 | - if($border) |
|
| 752 | + if ($border) |
|
| 753 | 753 | {
|
| 754 | - if($border==1) |
|
| 754 | + if ($border == 1) |
|
| 755 | 755 | {
|
| 756 | 756 | $border = 'LTRB'; |
| 757 | 757 | $b = 'LRT'; |
@@ -461,6 +461,7 @@ |
||
| 461 | 461 | * @param string the file path |
| 462 | 462 | * @param string the permissions |
| 463 | 463 | * @param integer $perm |
| 464 | + * @param string $path |
|
| 464 | 465 | * @return bool |
| 465 | 466 | */ |
| 466 | 467 | function chmod($path, $perm) |