@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -89,12 +91,10 @@ discard block |
||
89 | 91 | if ($item == 'excerpt') |
90 | 92 | { |
91 | 93 | $$item = $this->convert_ascii($$item); |
92 | - } |
|
93 | - elseif ($item == 'title') |
|
94 | + } elseif ($item == 'title') |
|
94 | 95 | { |
95 | 96 | $$item = $this->convert_ascii($$item); |
96 | - } |
|
97 | - elseif ($item == 'blog_name') |
|
97 | + } elseif ($item == 'blog_name') |
|
98 | 98 | { |
99 | 99 | $$item = $this->convert_ascii($$item); |
100 | 100 | } |
@@ -368,8 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | $tb_array = explode('=', $tb_end); |
370 | 370 | $tb_id = $tb_array[count($tb_array)-1]; |
371 | - } |
|
372 | - else |
|
371 | + } else |
|
373 | 372 | { |
374 | 373 | $url = rtrim($url, '/'); |
375 | 374 | |
@@ -385,8 +384,7 @@ discard block |
||
385 | 384 | if ( ! preg_match ("/^([0-9]+)$/", $tb_id)) |
386 | 385 | { |
387 | 386 | return FALSE; |
388 | - } |
|
389 | - else |
|
387 | + } else |
|
390 | 388 | { |
391 | 389 | return $tb_id; |
392 | 390 | } |
@@ -481,8 +479,7 @@ discard block |
||
481 | 479 | if ($ordinal < 128) |
482 | 480 | { |
483 | 481 | $out .= $str[$i]; |
484 | - } |
|
485 | - else |
|
482 | + } else |
|
486 | 483 | { |
487 | 484 | if (count($temp) == 0) |
488 | 485 | { |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -116,13 +118,11 @@ discard block |
||
116 | 118 | if (method_exists($this, $method)) |
117 | 119 | { |
118 | 120 | $this->$method($config[$key]); |
119 | - } |
|
120 | - else |
|
121 | + } else |
|
121 | 122 | { |
122 | 123 | $this->$key = $config[$key]; |
123 | 124 | } |
124 | - } |
|
125 | - else |
|
125 | + } else |
|
126 | 126 | { |
127 | 127 | $this->$key = $val; |
128 | 128 | } |
@@ -416,8 +416,7 @@ discard block |
||
416 | 416 | { |
417 | 417 | $this->set_error('upload_bad_filename'); |
418 | 418 | return FALSE; |
419 | - } |
|
420 | - else |
|
419 | + } else |
|
421 | 420 | { |
422 | 421 | return $new_filename; |
423 | 422 | } |
@@ -625,8 +624,7 @@ discard block |
||
625 | 624 | { |
626 | 625 | return TRUE; |
627 | 626 | } |
628 | - } |
|
629 | - elseif ($mime == $this->file_type) |
|
627 | + } elseif ($mime == $this->file_type) |
|
630 | 628 | { |
631 | 629 | return TRUE; |
632 | 630 | } |
@@ -646,8 +644,7 @@ discard block |
||
646 | 644 | if ($this->max_size != 0 AND $this->file_size > $this->max_size) |
647 | 645 | { |
648 | 646 | return FALSE; |
649 | - } |
|
650 | - else |
|
647 | + } else |
|
651 | 648 | { |
652 | 649 | return TRUE; |
653 | 650 | } |
@@ -852,9 +849,12 @@ discard block |
||
852 | 849 | |
853 | 850 | if (function_exists('getimagesize') && @getimagesize($file) !== FALSE) |
854 | 851 | { |
855 | - if (($file = @fopen($file, 'rb')) === FALSE) // "b" to force binary |
|
852 | + if (($file = @fopen($file, 'rb')) === FALSE) { |
|
853 | + // "b" to force binary |
|
856 | 854 | { |
857 | - return FALSE; // Couldn't open the file, return FALSE |
|
855 | + return FALSE; |
|
856 | + } |
|
857 | + // Couldn't open the file, return FALSE |
|
858 | 858 | } |
859 | 859 | |
860 | 860 | $opening_bytes = fread($file, 256); |
@@ -900,8 +900,7 @@ discard block |
||
900 | 900 | $this->error_msg[] = $msg; |
901 | 901 | log_message('error', $msg); |
902 | 902 | } |
903 | - } |
|
904 | - else |
|
903 | + } else |
|
905 | 904 | { |
906 | 905 | $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); |
907 | 906 | $this->error_msg[] = $msg; |
@@ -949,12 +948,10 @@ discard block |
||
949 | 948 | if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) |
950 | 949 | { |
951 | 950 | include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'); |
952 | - } |
|
953 | - elseif (is_file(APPPATH.'config/mimes.php')) |
|
951 | + } elseif (is_file(APPPATH.'config/mimes.php')) |
|
954 | 952 | { |
955 | 953 | include(APPPATH.'config//mimes.php'); |
956 | - } |
|
957 | - else |
|
954 | + } else |
|
958 | 955 | { |
959 | 956 | return FALSE; |
960 | 957 | } |
@@ -993,8 +990,7 @@ discard block |
||
993 | 990 | if ( ! in_array(strtolower($part), $this->allowed_types) OR $this->mimes_types(strtolower($part)) === FALSE) |
994 | 991 | { |
995 | 992 | $filename .= '.'.$part.'_'; |
996 | - } |
|
997 | - else |
|
993 | + } else |
|
998 | 994 | { |
999 | 995 | $filename .= '.'.$part; |
1000 | 996 | } |
@@ -1022,9 +1018,11 @@ discard block |
||
1022 | 1018 | if ( (float) substr(phpversion(), 0, 3) >= 5.3 && function_exists('finfo_file')) |
1023 | 1019 | { |
1024 | 1020 | $finfo = new finfo(FILEINFO_MIME_TYPE); |
1025 | - if ($finfo !== FALSE) // This is possible, if there is no magic MIME database file found on the system |
|
1021 | + if ($finfo !== FALSE) { |
|
1022 | + // This is possible, if there is no magic MIME database file found on the system |
|
1026 | 1023 | { |
1027 | 1024 | $file_type = $finfo->file($file['tmp_name']); |
1025 | + } |
|
1028 | 1026 | |
1029 | 1027 | /* According to the comments section of the PHP manual page, |
1030 | 1028 | * it is possible that this function returns an empty string |
@@ -1056,9 +1054,11 @@ discard block |
||
1056 | 1054 | { |
1057 | 1055 | $output = array(); |
1058 | 1056 | @exec('file --brief --mime-type ' . escapeshellarg($file['tmp_path']), $output, $return_code); |
1059 | - if ($return_code === 0 && strlen($output[0]) > 0) // A return status code != 0 would mean failed execution |
|
1057 | + if ($return_code === 0 && strlen($output[0]) > 0) { |
|
1058 | + // A return status code != 0 would mean failed execution |
|
1060 | 1059 | { |
1061 | 1060 | $this->file_type = rtrim($output[0]); |
1061 | + } |
|
1062 | 1062 | return; |
1063 | 1063 | } |
1064 | 1064 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -88,8 +90,7 @@ discard block |
||
88 | 90 | if (count($config) > 0) |
89 | 91 | { |
90 | 92 | $this->initialize($config); |
91 | - } |
|
92 | - else |
|
93 | + } else |
|
93 | 94 | { |
94 | 95 | $this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE; |
95 | 96 | $this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE; |
@@ -118,8 +119,7 @@ discard block |
||
118 | 119 | if (method_exists($this, $method)) |
119 | 120 | { |
120 | 121 | $this->$method($val); |
121 | - } |
|
122 | - else |
|
122 | + } else |
|
123 | 123 | { |
124 | 124 | $this->$key = $val; |
125 | 125 | } |
@@ -197,8 +197,7 @@ discard block |
||
197 | 197 | { |
198 | 198 | // add slashes for non-printing characters, slashes, and double quotes, and surround it in double quotes |
199 | 199 | $name = '"'.addcslashes($name, "\0..\37\177'\"\\").'"'; |
200 | - } |
|
201 | - else |
|
200 | + } else |
|
202 | 201 | { |
203 | 202 | $name = $this->_prep_q_encoding($name, TRUE); |
204 | 203 | } |
@@ -344,8 +343,7 @@ discard block |
||
344 | 343 | if (($this->_get_protocol() == "smtp") OR ($this->bcc_batch_mode && count($bcc) > $this->bcc_batch_size)) |
345 | 344 | { |
346 | 345 | $this->_bcc_array = $bcc; |
347 | - } |
|
348 | - else |
|
346 | + } else |
|
349 | 347 | { |
350 | 348 | $this->_set_header('Bcc', implode(", ", $bcc)); |
351 | 349 | } |
@@ -444,8 +442,7 @@ discard block |
||
444 | 442 | if (strpos($email, ',') !== FALSE) |
445 | 443 | { |
446 | 444 | $email = preg_split('/[\s,]/', $email, -1, PREG_SPLIT_NO_EMPTY); |
447 | - } |
|
448 | - else |
|
445 | + } else |
|
449 | 446 | { |
450 | 447 | $email = trim($email); |
451 | 448 | settype($email, "array"); |
@@ -676,16 +673,13 @@ discard block |
||
676 | 673 | if ($this->mailtype == 'html' && count($this->_attach_name) == 0) |
677 | 674 | { |
678 | 675 | return 'html'; |
679 | - } |
|
680 | - elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) |
|
676 | + } elseif ($this->mailtype == 'html' && count($this->_attach_name) > 0) |
|
681 | 677 | { |
682 | 678 | return 'html-attach'; |
683 | - } |
|
684 | - elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) |
|
679 | + } elseif ($this->mailtype == 'text' && count($this->_attach_name) > 0) |
|
685 | 680 | { |
686 | 681 | return 'plain-attach'; |
687 | - } |
|
688 | - else |
|
682 | + } else |
|
689 | 683 | { |
690 | 684 | return 'plain'; |
691 | 685 | } |
@@ -781,8 +775,7 @@ discard block |
||
781 | 775 | if (preg_match('/\<(.*)\>/', $email, $match)) |
782 | 776 | { |
783 | 777 | return $match['1']; |
784 | - } |
|
785 | - else |
|
778 | + } else |
|
786 | 779 | { |
787 | 780 | return $email; |
788 | 781 | } |
@@ -795,8 +788,7 @@ discard block |
||
795 | 788 | if (preg_match( '/\<(.*)\>/', $addy, $match)) |
796 | 789 | { |
797 | 790 | $clean_email[] = $match['1']; |
798 | - } |
|
799 | - else |
|
791 | + } else |
|
800 | 792 | { |
801 | 793 | $clean_email[] = $addy; |
802 | 794 | } |
@@ -828,8 +820,7 @@ discard block |
||
828 | 820 | if (preg_match('/\<body.*?\>(.*)\<\/body\>/si', $this->_body, $match)) |
829 | 821 | { |
830 | 822 | $body = $match['1']; |
831 | - } |
|
832 | - else |
|
823 | + } else |
|
833 | 824 | { |
834 | 825 | $body = $this->_body; |
835 | 826 | } |
@@ -928,8 +919,7 @@ discard block |
||
928 | 919 | if ($temp != '') |
929 | 920 | { |
930 | 921 | $output .= $temp.$this->newline.$line; |
931 | - } |
|
932 | - else |
|
922 | + } else |
|
933 | 923 | { |
934 | 924 | $output .= $line; |
935 | 925 | } |
@@ -1034,8 +1024,7 @@ discard block |
||
1034 | 1024 | { |
1035 | 1025 | $this->_header_str .= $hdr; |
1036 | 1026 | $this->_finalbody = $this->_body; |
1037 | - } |
|
1038 | - else |
|
1027 | + } else |
|
1039 | 1028 | { |
1040 | 1029 | $this->_finalbody = $hdr . $this->newline . $this->newline . $this->_body; |
1041 | 1030 | } |
@@ -1049,8 +1038,7 @@ discard block |
||
1049 | 1038 | { |
1050 | 1039 | $hdr .= "Content-Type: text/html; charset=" . $this->charset . $this->newline; |
1051 | 1040 | $hdr .= "Content-Transfer-Encoding: quoted-printable"; |
1052 | - } |
|
1053 | - else |
|
1041 | + } else |
|
1054 | 1042 | { |
1055 | 1043 | $hdr .= "Content-Type: multipart/alternative; boundary=\"" . $this->_alt_boundary . "\"" . $this->newline . $this->newline; |
1056 | 1044 | |
@@ -1071,8 +1059,7 @@ discard block |
||
1071 | 1059 | if ($this->_get_protocol() == 'mail') |
1072 | 1060 | { |
1073 | 1061 | $this->_header_str .= $hdr; |
1074 | - } |
|
1075 | - else |
|
1062 | + } else |
|
1076 | 1063 | { |
1077 | 1064 | $this->_finalbody = $hdr . $this->_finalbody; |
1078 | 1065 | } |
@@ -1173,8 +1160,7 @@ discard block |
||
1173 | 1160 | if ($this->_get_protocol() == 'mail') |
1174 | 1161 | { |
1175 | 1162 | $this->_finalbody = $body; |
1176 | - } |
|
1177 | - else |
|
1163 | + } else |
|
1178 | 1164 | { |
1179 | 1165 | $this->_finalbody = $hdr . $body; |
1180 | 1166 | } |
@@ -1374,8 +1360,9 @@ discard block |
||
1374 | 1360 | |
1375 | 1361 | if ($this->bcc_batch_mode AND count($this->_bcc_array) > 0) |
1376 | 1362 | { |
1377 | - if (count($this->_bcc_array) > $this->bcc_batch_size) |
|
1378 | - return $this->batch_bcc_send(); |
|
1363 | + if (count($this->_bcc_array) > $this->bcc_batch_size) { |
|
1364 | + return $this->batch_bcc_send(); |
|
1365 | + } |
|
1379 | 1366 | } |
1380 | 1367 | |
1381 | 1368 | $this->_build_message(); |
@@ -1383,8 +1370,7 @@ discard block |
||
1383 | 1370 | if ( ! $this->_spool_email()) |
1384 | 1371 | { |
1385 | 1372 | return FALSE; |
1386 | - } |
|
1387 | - else |
|
1373 | + } else |
|
1388 | 1374 | { |
1389 | 1375 | return TRUE; |
1390 | 1376 | } |
@@ -1437,8 +1423,7 @@ discard block |
||
1437 | 1423 | if ($this->protocol != 'smtp') |
1438 | 1424 | { |
1439 | 1425 | $this->_set_header('Bcc', implode(", ", $bcc)); |
1440 | - } |
|
1441 | - else |
|
1426 | + } else |
|
1442 | 1427 | { |
1443 | 1428 | $this->_bcc_array = $bcc; |
1444 | 1429 | } |
@@ -1539,13 +1524,11 @@ discard block |
||
1539 | 1524 | if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str)) |
1540 | 1525 | { |
1541 | 1526 | return FALSE; |
1542 | - } |
|
1543 | - else |
|
1527 | + } else |
|
1544 | 1528 | { |
1545 | 1529 | return TRUE; |
1546 | 1530 | } |
1547 | - } |
|
1548 | - else |
|
1531 | + } else |
|
1549 | 1532 | { |
1550 | 1533 | // most documentation of sendmail using the "-f" flag lacks a space after it, however |
1551 | 1534 | // we've encountered servers that seem to require it to be in place. |
@@ -1553,8 +1536,7 @@ discard block |
||
1553 | 1536 | if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From']))) |
1554 | 1537 | { |
1555 | 1538 | return FALSE; |
1556 | - } |
|
1557 | - else |
|
1539 | + } else |
|
1558 | 1540 | { |
1559 | 1541 | return TRUE; |
1560 | 1542 | } |
@@ -1680,8 +1662,9 @@ discard block |
||
1680 | 1662 | protected function _smtp_connect() |
1681 | 1663 | { |
1682 | 1664 | $ssl = NULL; |
1683 | - if ($this->smtp_crypto == 'ssl') |
|
1684 | - $ssl = 'ssl://'; |
|
1665 | + if ($this->smtp_crypto == 'ssl') { |
|
1666 | + $ssl = 'ssl://'; |
|
1667 | + } |
|
1685 | 1668 | $this->_smtp_connect = fsockopen($ssl.$this->smtp_host, |
1686 | 1669 | $this->smtp_port, |
1687 | 1670 | $errno, |
@@ -1722,10 +1705,11 @@ discard block |
||
1722 | 1705 | { |
1723 | 1706 | case 'hello' : |
1724 | 1707 | |
1725 | - if ($this->_smtp_auth OR $this->_get_encoding() == '8bit') |
|
1726 | - $this->_send_data('EHLO '.$this->_get_hostname()); |
|
1727 | - else |
|
1728 | - $this->_send_data('HELO '.$this->_get_hostname()); |
|
1708 | + if ($this->_smtp_auth OR $this->_get_encoding() == '8bit') { |
|
1709 | + $this->_send_data('EHLO '.$this->_get_hostname()); |
|
1710 | + } else { |
|
1711 | + $this->_send_data('HELO '.$this->_get_hostname()); |
|
1712 | + } |
|
1729 | 1713 | |
1730 | 1714 | $resp = 250; |
1731 | 1715 | break; |
@@ -1847,8 +1831,7 @@ discard block |
||
1847 | 1831 | { |
1848 | 1832 | $this->_set_error_message('lang:email_smtp_data_failure', $data); |
1849 | 1833 | return FALSE; |
1850 | - } |
|
1851 | - else |
|
1834 | + } else |
|
1852 | 1835 | { |
1853 | 1836 | return TRUE; |
1854 | 1837 | } |
@@ -1911,10 +1894,15 @@ discard block |
||
1911 | 1894 | $rip = (isset($_SERVER['REMOTE_ADDR']) AND $_SERVER['REMOTE_ADDR'] != "") ? $_SERVER['REMOTE_ADDR'] : FALSE; |
1912 | 1895 | $fip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] != "") ? $_SERVER['HTTP_X_FORWARDED_FOR'] : FALSE; |
1913 | 1896 | |
1914 | - if ($cip && $rip) $this->_IP = $cip; |
|
1915 | - elseif ($rip) $this->_IP = $rip; |
|
1916 | - elseif ($cip) $this->_IP = $cip; |
|
1917 | - elseif ($fip) $this->_IP = $fip; |
|
1897 | + if ($cip && $rip) { |
|
1898 | + $this->_IP = $cip; |
|
1899 | + } elseif ($rip) { |
|
1900 | + $this->_IP = $rip; |
|
1901 | + } elseif ($cip) { |
|
1902 | + $this->_IP = $cip; |
|
1903 | + } elseif ($fip) { |
|
1904 | + $this->_IP = $fip; |
|
1905 | + } |
|
1918 | 1906 | |
1919 | 1907 | if (strpos($this->_IP, ',') !== FALSE) |
1920 | 1908 | { |
@@ -1975,8 +1963,7 @@ discard block |
||
1975 | 1963 | if (substr($msg, 0, 5) != 'lang:' || FALSE === ($line = $CI->lang->line(substr($msg, 5)))) |
1976 | 1964 | { |
1977 | 1965 | $this->_debug_msg[] = str_replace('%s', $val, $msg)."<br />"; |
1978 | - } |
|
1979 | - else |
|
1966 | + } else |
|
1980 | 1967 | { |
1981 | 1968 | $this->_debug_msg[] = str_replace('%s', $val, $line)."<br />"; |
1982 | 1969 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -62,8 +64,7 @@ discard block |
||
62 | 64 | if ($this->CI->session->userdata('cart_contents') !== FALSE) |
63 | 65 | { |
64 | 66 | $this->_cart_contents = $this->CI->session->userdata('cart_contents'); |
65 | - } |
|
66 | - else |
|
67 | + } else |
|
67 | 68 | { |
68 | 69 | // No cart exists so we'll set some base values |
69 | 70 | $this->_cart_contents['cart_total'] = 0; |
@@ -103,8 +104,7 @@ discard block |
||
103 | 104 | { |
104 | 105 | $save_cart = TRUE; |
105 | 106 | } |
106 | - } |
|
107 | - else |
|
107 | + } else |
|
108 | 108 | { |
109 | 109 | foreach ($items as $val) |
110 | 110 | { |
@@ -218,8 +218,7 @@ discard block |
||
218 | 218 | if (isset($items['options']) AND count($items['options']) > 0) |
219 | 219 | { |
220 | 220 | $rowid = md5($items['id'].implode('', $items['options'])); |
221 | - } |
|
222 | - else |
|
221 | + } else |
|
223 | 222 | { |
224 | 223 | // No options were submitted so we simply MD5 the product ID. |
225 | 224 | // Technically, we don't need to MD5 the ID in this case, but it makes |
@@ -281,8 +280,7 @@ discard block |
||
281 | 280 | { |
282 | 281 | $save_cart = TRUE; |
283 | 282 | } |
284 | - } |
|
285 | - else |
|
283 | + } else |
|
286 | 284 | { |
287 | 285 | foreach ($items as $val) |
288 | 286 | { |
@@ -349,8 +347,7 @@ discard block |
||
349 | 347 | if ($items['qty'] == 0) |
350 | 348 | { |
351 | 349 | unset($this->_cart_contents[$items['rowid']]); |
352 | - } |
|
353 | - else |
|
350 | + } else |
|
354 | 351 | { |
355 | 352 | $this->_cart_contents[$items['rowid']]['qty'] = $items['qty']; |
356 | 353 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -228,8 +230,7 @@ discard block |
||
228 | 230 | if ($reduce_linebreaks === TRUE) |
229 | 231 | { |
230 | 232 | $table['#<p>\n*</p>#'] = ''; |
231 | - } |
|
232 | - else |
|
233 | + } else |
|
233 | 234 | { |
234 | 235 | // If we have empty paragraph tags we add a non-breaking space |
235 | 236 | // otherwise most browsers won't treat them as true paragraphs |
@@ -390,14 +391,14 @@ discard block |
||
390 | 391 | if (($i % 2) == 0) |
391 | 392 | { |
392 | 393 | $newstr .= nl2br($ex[$i]); |
393 | - } |
|
394 | - else |
|
394 | + } else |
|
395 | 395 | { |
396 | 396 | $newstr .= $ex[$i]; |
397 | 397 | } |
398 | 398 | |
399 | - if ($ct - 1 != $i) |
|
400 | - $newstr .= "pre>"; |
|
399 | + if ($ct - 1 != $i) { |
|
400 | + $newstr .= "pre>"; |
|
401 | + } |
|
401 | 402 | } |
402 | 403 | |
403 | 404 | return $newstr; |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -133,8 +135,7 @@ discard block |
||
133 | 135 | if ($this->use_page_numbers) |
134 | 136 | { |
135 | 137 | $base_page = 1; |
136 | - } |
|
137 | - else |
|
138 | + } else |
|
138 | 139 | { |
139 | 140 | $base_page = 0; |
140 | 141 | } |
@@ -151,8 +152,7 @@ discard block |
||
151 | 152 | // Prep the current page - no funny business! |
152 | 153 | $this->cur_page = (int) $this->cur_page; |
153 | 154 | } |
154 | - } |
|
155 | - else |
|
155 | + } else |
|
156 | 156 | { |
157 | 157 | if ($CI->uri->segment($this->uri_segment) != $base_page) |
158 | 158 | { |
@@ -189,8 +189,7 @@ discard block |
||
189 | 189 | { |
190 | 190 | $this->cur_page = $num_pages; |
191 | 191 | } |
192 | - } |
|
193 | - else |
|
192 | + } else |
|
194 | 193 | { |
195 | 194 | if ($this->cur_page > $this->total_rows) |
196 | 195 | { |
@@ -215,8 +214,7 @@ discard block |
||
215 | 214 | if ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE) |
216 | 215 | { |
217 | 216 | $this->base_url = rtrim($this->base_url).'&'.$this->query_string_segment.'='; |
218 | - } |
|
219 | - else |
|
217 | + } else |
|
220 | 218 | { |
221 | 219 | $this->base_url = rtrim($this->base_url, '/') .'/'; |
222 | 220 | } |
@@ -237,8 +235,7 @@ discard block |
||
237 | 235 | if ($this->use_page_numbers) |
238 | 236 | { |
239 | 237 | $i = $uri_page_number - 1; |
240 | - } |
|
241 | - else |
|
238 | + } else |
|
242 | 239 | { |
243 | 240 | $i = $uri_page_number - $this->per_page; |
244 | 241 | } |
@@ -246,8 +243,7 @@ discard block |
||
246 | 243 | if ($i == 0 && $this->first_url != '') |
247 | 244 | { |
248 | 245 | $output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$this->prev_link.'</a>'.$this->prev_tag_close; |
249 | - } |
|
250 | - else |
|
246 | + } else |
|
251 | 247 | { |
252 | 248 | $i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix; |
253 | 249 | $output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close; |
@@ -264,8 +260,7 @@ discard block |
||
264 | 260 | if ($this->use_page_numbers) |
265 | 261 | { |
266 | 262 | $i = $loop; |
267 | - } |
|
268 | - else |
|
263 | + } else |
|
269 | 264 | { |
270 | 265 | $i = ($loop * $this->per_page) - $this->per_page; |
271 | 266 | } |
@@ -275,16 +270,14 @@ discard block |
||
275 | 270 | if ($this->cur_page == $loop) |
276 | 271 | { |
277 | 272 | $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page |
278 | - } |
|
279 | - else |
|
273 | + } else |
|
280 | 274 | { |
281 | 275 | $n = ($i == $base_page) ? '' : $i; |
282 | 276 | |
283 | 277 | if ($n == '' && $this->first_url != '') |
284 | 278 | { |
285 | 279 | $output .= $this->num_tag_open.'<a '.$this->anchor_class.'href="'.$this->first_url.'">'.$loop.'</a>'.$this->num_tag_close; |
286 | - } |
|
287 | - else |
|
280 | + } else |
|
288 | 281 | { |
289 | 282 | $n = ($n == '') ? '' : $this->prefix.$n.$this->suffix; |
290 | 283 | |
@@ -301,8 +294,7 @@ discard block |
||
301 | 294 | if ($this->use_page_numbers) |
302 | 295 | { |
303 | 296 | $i = $this->cur_page + 1; |
304 | - } |
|
305 | - else |
|
297 | + } else |
|
306 | 298 | { |
307 | 299 | $i = ($this->cur_page * $this->per_page); |
308 | 300 | } |
@@ -316,8 +308,7 @@ discard block |
||
316 | 308 | if ($this->use_page_numbers) |
317 | 309 | { |
318 | 310 | $i = $num_pages; |
319 | - } |
|
320 | - else |
|
311 | + } else |
|
321 | 312 | { |
322 | 313 | $i = (($num_pages * $this->per_page) - $this->per_page); |
323 | 314 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -176,8 +178,7 @@ discard block |
||
176 | 178 | if (function_exists('realpath') AND @realpath($this->source_image) !== FALSE) |
177 | 179 | { |
178 | 180 | $full_source_path = str_replace("\\", "/", realpath($this->source_image)); |
179 | - } |
|
180 | - else |
|
181 | + } else |
|
181 | 182 | { |
182 | 183 | $full_source_path = $this->source_image; |
183 | 184 | } |
@@ -205,21 +206,18 @@ discard block |
||
205 | 206 | { |
206 | 207 | $this->dest_image = $this->source_image; |
207 | 208 | $this->dest_folder = $this->source_folder; |
208 | - } |
|
209 | - else |
|
209 | + } else |
|
210 | 210 | { |
211 | 211 | if (strpos($this->new_image, '/') === FALSE) |
212 | 212 | { |
213 | 213 | $this->dest_folder = $this->source_folder; |
214 | 214 | $this->dest_image = $this->new_image; |
215 | - } |
|
216 | - else |
|
215 | + } else |
|
217 | 216 | { |
218 | 217 | if (function_exists('realpath') AND @realpath($this->new_image) !== FALSE) |
219 | 218 | { |
220 | 219 | $full_dest_path = str_replace("\\", "/", realpath($this->new_image)); |
221 | - } |
|
222 | - else |
|
220 | + } else |
|
223 | 221 | { |
224 | 222 | $full_dest_path = $this->new_image; |
225 | 223 | } |
@@ -229,8 +227,7 @@ discard block |
||
229 | 227 | { |
230 | 228 | $this->dest_folder = $full_dest_path.'/'; |
231 | 229 | $this->dest_image = $this->source_image; |
232 | - } |
|
233 | - else |
|
230 | + } else |
|
234 | 231 | { |
235 | 232 | $x = explode('/', $full_dest_path); |
236 | 233 | $this->dest_image = end($x); |
@@ -283,17 +280,20 @@ discard block |
||
283 | 280 | * from the actual file |
284 | 281 | * |
285 | 282 | */ |
286 | - if ($this->width == '') |
|
287 | - $this->width = $this->orig_width; |
|
283 | + if ($this->width == '') { |
|
284 | + $this->width = $this->orig_width; |
|
285 | + } |
|
288 | 286 | |
289 | - if ($this->height == '') |
|
290 | - $this->height = $this->orig_height; |
|
287 | + if ($this->height == '') { |
|
288 | + $this->height = $this->orig_height; |
|
289 | + } |
|
291 | 290 | |
292 | 291 | // Set the quality |
293 | 292 | $this->quality = trim(str_replace("%", "", $this->quality)); |
294 | 293 | |
295 | - if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) |
|
296 | - $this->quality = 90; |
|
294 | + if ($this->quality == '' OR $this->quality == 0 OR ! is_numeric($this->quality)) { |
|
295 | + $this->quality = 90; |
|
296 | + } |
|
297 | 297 | |
298 | 298 | // Set the x/y coordinates |
299 | 299 | $this->x_axis = ($this->x_axis == '' OR ! is_numeric($this->x_axis)) ? 0 : $this->x_axis; |
@@ -407,8 +407,7 @@ discard block |
||
407 | 407 | { |
408 | 408 | $this->width = $this->orig_height; |
409 | 409 | $this->height = $this->orig_width; |
410 | - } |
|
411 | - else |
|
410 | + } else |
|
412 | 411 | { |
413 | 412 | $this->width = $this->orig_width; |
414 | 413 | $this->height = $this->orig_height; |
@@ -426,8 +425,7 @@ discard block |
||
426 | 425 | if ($this->rotation_angle == 'hor' OR $this->rotation_angle == 'vrt') |
427 | 426 | { |
428 | 427 | return $this->image_mirror_gd(); |
429 | - } |
|
430 | - else |
|
428 | + } else |
|
431 | 429 | { |
432 | 430 | return $this->image_rotate_gd(); |
433 | 431 | } |
@@ -479,8 +477,7 @@ discard block |
||
479 | 477 | $gd_version = str_replace('0', '', $this->gd_version()); |
480 | 478 | $v2_override = ($gd_version == 2) ? TRUE : FALSE; |
481 | 479 | } |
482 | - } |
|
483 | - else |
|
480 | + } else |
|
484 | 481 | { |
485 | 482 | // If resizing the x/y axis must be zero |
486 | 483 | $this->x_axis = 0; |
@@ -504,8 +501,7 @@ discard block |
||
504 | 501 | { |
505 | 502 | $create = 'imagecreatetruecolor'; |
506 | 503 | $copy = 'imagecopyresampled'; |
507 | - } |
|
508 | - else |
|
504 | + } else |
|
509 | 505 | { |
510 | 506 | $create = 'imagecreate'; |
511 | 507 | $copy = 'imagecopyresized'; |
@@ -513,9 +509,11 @@ discard block |
||
513 | 509 | |
514 | 510 | $dst_img = $create($this->width, $this->height); |
515 | 511 | |
516 | - if ($this->image_type == 3) // png we can actually preserve transparency |
|
512 | + if ($this->image_type == 3) { |
|
513 | + // png we can actually preserve transparency |
|
517 | 514 | { |
518 | 515 | imagealphablending($dst_img, FALSE); |
516 | + } |
|
519 | 517 | imagesavealpha($dst_img, TRUE); |
520 | 518 | } |
521 | 519 | |
@@ -525,8 +523,7 @@ discard block |
||
525 | 523 | if ($this->dynamic_output == TRUE) |
526 | 524 | { |
527 | 525 | $this->image_display_gd($dst_img); |
528 | - } |
|
529 | - else |
|
526 | + } else |
|
530 | 527 | { |
531 | 528 | // Or save it |
532 | 529 | if ( ! $this->image_save_gd($dst_img)) |
@@ -578,8 +575,7 @@ discard block |
||
578 | 575 | if ($action == 'crop') |
579 | 576 | { |
580 | 577 | $cmd .= " -crop ".$this->width."x".$this->height."+".$this->x_axis."+".$this->y_axis." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; |
581 | - } |
|
582 | - elseif ($action == 'rotate') |
|
578 | + } elseif ($action == 'rotate') |
|
583 | 579 | { |
584 | 580 | switch ($this->rotation_angle) |
585 | 581 | { |
@@ -592,8 +588,7 @@ discard block |
||
592 | 588 | } |
593 | 589 | |
594 | 590 | $cmd .= " ".$angle." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; |
595 | - } |
|
596 | - else // Resize |
|
591 | + } else // Resize |
|
597 | 592 | { |
598 | 593 | $cmd .= " -resize ".$this->width."x".$this->height." \"$this->full_src_path\" \"$this->full_dst_path\" 2>&1"; |
599 | 594 | } |
@@ -654,8 +649,7 @@ discard block |
||
654 | 649 | if ($action == 'crop') |
655 | 650 | { |
656 | 651 | $cmd_inner = 'pnmcut -left '.$this->x_axis.' -top '.$this->y_axis.' -width '.$this->width.' -height '.$this->height; |
657 | - } |
|
658 | - elseif ($action == 'rotate') |
|
652 | + } elseif ($action == 'rotate') |
|
659 | 653 | { |
660 | 654 | switch ($this->rotation_angle) |
661 | 655 | { |
@@ -672,8 +666,7 @@ discard block |
||
672 | 666 | } |
673 | 667 | |
674 | 668 | $cmd_inner = 'pnmflip -'.$angle.' '; |
675 | - } |
|
676 | - else // Resize |
|
669 | + } else // Resize |
|
677 | 670 | { |
678 | 671 | $cmd_inner = 'pnmscale -xysize '.$this->width.' '.$this->height; |
679 | 672 | } |
@@ -731,8 +724,7 @@ discard block |
||
731 | 724 | if ($this->dynamic_output == TRUE) |
732 | 725 | { |
733 | 726 | $this->image_display_gd($dst_img); |
734 | - } |
|
735 | - else |
|
727 | + } else |
|
736 | 728 | { |
737 | 729 | // Or save it |
738 | 730 | if ( ! $this->image_save_gd($dst_img)) |
@@ -791,8 +783,7 @@ discard block |
||
791 | 783 | $right--; |
792 | 784 | } |
793 | 785 | } |
794 | - } |
|
795 | - else |
|
786 | + } else |
|
796 | 787 | { |
797 | 788 | for ($i = 0; $i < $width; $i++) |
798 | 789 | { |
@@ -817,8 +808,7 @@ discard block |
||
817 | 808 | if ($this->dynamic_output == TRUE) |
818 | 809 | { |
819 | 810 | $this->image_display_gd($src_img); |
820 | - } |
|
821 | - else |
|
811 | + } else |
|
822 | 812 | { |
823 | 813 | // Or save it |
824 | 814 | if ( ! $this->image_save_gd($src_img)) |
@@ -853,8 +843,7 @@ discard block |
||
853 | 843 | if ($this->wm_type == 'overlay') |
854 | 844 | { |
855 | 845 | return $this->overlay_watermark(); |
856 | - } |
|
857 | - else |
|
846 | + } else |
|
858 | 847 | { |
859 | 848 | return $this->text_watermark(); |
860 | 849 | } |
@@ -899,11 +888,13 @@ discard block |
||
899 | 888 | $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); |
900 | 889 | $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); |
901 | 890 | |
902 | - if ($this->wm_vrt_alignment == 'B') |
|
903 | - $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
891 | + if ($this->wm_vrt_alignment == 'B') { |
|
892 | + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
893 | + } |
|
904 | 894 | |
905 | - if ($this->wm_hor_alignment == 'R') |
|
906 | - $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
895 | + if ($this->wm_hor_alignment == 'R') { |
|
896 | + $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
897 | + } |
|
907 | 898 | |
908 | 899 | // Set the base x and y axis values |
909 | 900 | $x_axis = $this->wm_hor_offset + $this->wm_padding; |
@@ -946,8 +937,7 @@ discard block |
||
946 | 937 | { |
947 | 938 | // copy the image directly, the image's alpha transparency being the sole determinant of blending |
948 | 939 | imagecopy($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height); |
949 | - } |
|
950 | - else |
|
940 | + } else |
|
951 | 941 | { |
952 | 942 | // set our RGB value from above to be transparent and merge the images with the specified opacity |
953 | 943 | imagecolortransparent($wm_img, imagecolorat($wm_img, $this->wm_x_transp, $this->wm_y_transp)); |
@@ -958,8 +948,7 @@ discard block |
||
958 | 948 | if ($this->dynamic_output == TRUE) |
959 | 949 | { |
960 | 950 | $this->image_display_gd($src_img); |
961 | - } |
|
962 | - else |
|
951 | + } else |
|
963 | 952 | { |
964 | 953 | if ( ! $this->image_save_gd($src_img)) |
965 | 954 | { |
@@ -1019,25 +1008,27 @@ discard block |
||
1019 | 1008 | // invert the offset. Note: The horizontal |
1020 | 1009 | // offset flips itself automatically |
1021 | 1010 | |
1022 | - if ($this->wm_vrt_alignment == 'B') |
|
1023 | - $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
1011 | + if ($this->wm_vrt_alignment == 'B') { |
|
1012 | + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
1013 | + } |
|
1024 | 1014 | |
1025 | - if ($this->wm_hor_alignment == 'R') |
|
1026 | - $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
1015 | + if ($this->wm_hor_alignment == 'R') { |
|
1016 | + $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
1017 | + } |
|
1027 | 1018 | |
1028 | 1019 | // Set font width and height |
1029 | 1020 | // These are calculated differently depending on |
1030 | 1021 | // whether we are using the true type font or not |
1031 | 1022 | if ($this->wm_use_truetype == TRUE) |
1032 | 1023 | { |
1033 | - if ($this->wm_font_size == '') |
|
1034 | - $this->wm_font_size = '17'; |
|
1024 | + if ($this->wm_font_size == '') { |
|
1025 | + $this->wm_font_size = '17'; |
|
1026 | + } |
|
1035 | 1027 | |
1036 | 1028 | $fontwidth = $this->wm_font_size-($this->wm_font_size/4); |
1037 | 1029 | $fontheight = $this->wm_font_size; |
1038 | 1030 | $this->wm_vrt_offset += $this->wm_font_size; |
1039 | - } |
|
1040 | - else |
|
1031 | + } else |
|
1041 | 1032 | { |
1042 | 1033 | $fontwidth = imagefontwidth($this->wm_font_size); |
1043 | 1034 | $fontheight = imagefontheight($this->wm_font_size); |
@@ -1048,8 +1039,9 @@ discard block |
||
1048 | 1039 | $y_axis = $this->wm_vrt_offset + $this->wm_padding; |
1049 | 1040 | |
1050 | 1041 | // Set verticle alignment |
1051 | - if ($this->wm_use_drop_shadow == FALSE) |
|
1052 | - $this->wm_shadow_distance = 0; |
|
1042 | + if ($this->wm_use_drop_shadow == FALSE) { |
|
1043 | + $this->wm_shadow_distance = 0; |
|
1044 | + } |
|
1053 | 1045 | |
1054 | 1046 | $this->wm_vrt_alignment = strtoupper(substr($this->wm_vrt_alignment, 0, 1)); |
1055 | 1047 | $this->wm_hor_alignment = strtoupper(substr($this->wm_hor_alignment, 0, 1)); |
@@ -1073,13 +1065,15 @@ discard block |
||
1073 | 1065 | case "L": |
1074 | 1066 | break; |
1075 | 1067 | case "R": |
1076 | - if ($this->wm_use_drop_shadow) |
|
1077 | - $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); |
|
1068 | + if ($this->wm_use_drop_shadow) { |
|
1069 | + $x_shad += ($this->orig_width - $fontwidth*strlen($this->wm_text)); |
|
1070 | + } |
|
1078 | 1071 | $x_axis += ($this->orig_width - $fontwidth*strlen($this->wm_text)); |
1079 | 1072 | break; |
1080 | 1073 | case "C": |
1081 | - if ($this->wm_use_drop_shadow) |
|
1082 | - $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); |
|
1074 | + if ($this->wm_use_drop_shadow) { |
|
1075 | + $x_shad += floor(($this->orig_width - $fontwidth*strlen($this->wm_text))/2); |
|
1076 | + } |
|
1083 | 1077 | $x_axis += floor(($this->orig_width -$fontwidth*strlen($this->wm_text))/2); |
1084 | 1078 | break; |
1085 | 1079 | } |
@@ -1087,14 +1081,15 @@ discard block |
||
1087 | 1081 | // Add the text to the source image |
1088 | 1082 | if ($this->wm_use_truetype) |
1089 | 1083 | { |
1090 | - if ($this->wm_use_drop_shadow) |
|
1091 | - imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); |
|
1084 | + if ($this->wm_use_drop_shadow) { |
|
1085 | + imagettftext($src_img, $this->wm_font_size, 0, $x_shad, $y_shad, $drp_color, $this->wm_font_path, $this->wm_text); |
|
1086 | + } |
|
1092 | 1087 | imagettftext($src_img, $this->wm_font_size, 0, $x_axis, $y_axis, $txt_color, $this->wm_font_path, $this->wm_text); |
1093 | - } |
|
1094 | - else |
|
1088 | + } else |
|
1095 | 1089 | { |
1096 | - if ($this->wm_use_drop_shadow) |
|
1097 | - imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); |
|
1090 | + if ($this->wm_use_drop_shadow) { |
|
1091 | + imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); |
|
1092 | + } |
|
1098 | 1093 | imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); |
1099 | 1094 | } |
1100 | 1095 | |
@@ -1102,8 +1097,7 @@ discard block |
||
1102 | 1097 | if ($this->dynamic_output == TRUE) |
1103 | 1098 | { |
1104 | 1099 | $this->image_display_gd($src_img); |
1105 | - } |
|
1106 | - else |
|
1100 | + } else |
|
1107 | 1101 | { |
1108 | 1102 | $this->image_save_gd($src_img); |
1109 | 1103 | } |
@@ -1127,11 +1121,13 @@ discard block |
||
1127 | 1121 | */ |
1128 | 1122 | function image_create_gd($path = '', $image_type = '') |
1129 | 1123 | { |
1130 | - if ($path == '') |
|
1131 | - $path = $this->full_src_path; |
|
1124 | + if ($path == '') { |
|
1125 | + $path = $this->full_src_path; |
|
1126 | + } |
|
1132 | 1127 | |
1133 | - if ($image_type == '') |
|
1134 | - $image_type = $this->image_type; |
|
1128 | + if ($image_type == '') { |
|
1129 | + $image_type = $this->image_type; |
|
1130 | + } |
|
1135 | 1131 | |
1136 | 1132 | |
1137 | 1133 | switch ($image_type) |
@@ -1280,11 +1276,13 @@ discard block |
||
1280 | 1276 | */ |
1281 | 1277 | function image_reproportion() |
1282 | 1278 | { |
1283 | - if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) |
|
1284 | - return; |
|
1279 | + if ( ! is_numeric($this->width) OR ! is_numeric($this->height) OR $this->width == 0 OR $this->height == 0) { |
|
1280 | + return; |
|
1281 | + } |
|
1285 | 1282 | |
1286 | - if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) |
|
1287 | - return; |
|
1283 | + if ( ! is_numeric($this->orig_width) OR ! is_numeric($this->orig_height) OR $this->orig_width == 0 OR $this->orig_height == 0) { |
|
1284 | + return; |
|
1285 | + } |
|
1288 | 1286 | |
1289 | 1287 | $new_width = ceil($this->orig_width*$this->height/$this->orig_height); |
1290 | 1288 | $new_height = ceil($this->width*$this->orig_height/$this->orig_width); |
@@ -1301,8 +1299,7 @@ discard block |
||
1301 | 1299 | if ($this->master_dim == 'height') |
1302 | 1300 | { |
1303 | 1301 | $this->width = $new_width; |
1304 | - } |
|
1305 | - else |
|
1302 | + } else |
|
1306 | 1303 | { |
1307 | 1304 | $this->height = $new_height; |
1308 | 1305 | } |
@@ -1325,8 +1322,9 @@ discard block |
||
1325 | 1322 | // For now we require GD but we should |
1326 | 1323 | // find a way to determine this using IM or NetPBM |
1327 | 1324 | |
1328 | - if ($path == '') |
|
1329 | - $path = $this->full_src_path; |
|
1325 | + if ($path == '') { |
|
1326 | + $path = $this->full_src_path; |
|
1327 | + } |
|
1330 | 1328 | |
1331 | 1329 | if ( ! file_exists($path)) |
1332 | 1330 | { |
@@ -1391,8 +1389,9 @@ discard block |
||
1391 | 1389 | |
1392 | 1390 | foreach ($allowed as $item) |
1393 | 1391 | { |
1394 | - if ( ! isset($vals[$item]) OR $vals[$item] == '') |
|
1395 | - $vals[$item] = 0; |
|
1392 | + if ( ! isset($vals[$item]) OR $vals[$item] == '') { |
|
1393 | + $vals[$item] = 0; |
|
1394 | + } |
|
1396 | 1395 | } |
1397 | 1396 | |
1398 | 1397 | if ($vals['width'] == 0 OR $vals['height'] == 0) |
@@ -1403,8 +1402,7 @@ discard block |
||
1403 | 1402 | if ($vals['new_width'] == 0) |
1404 | 1403 | { |
1405 | 1404 | $vals['new_width'] = ceil($vals['width']*$vals['new_height']/$vals['height']); |
1406 | - } |
|
1407 | - elseif ($vals['new_height'] == 0) |
|
1405 | + } elseif ($vals['new_height'] == 0) |
|
1408 | 1406 | { |
1409 | 1407 | $vals['new_height'] = ceil($vals['new_width']*$vals['height']/$vals['width']); |
1410 | 1408 | } |
@@ -1501,8 +1499,7 @@ discard block |
||
1501 | 1499 | $this->error_msg[] = $msg; |
1502 | 1500 | log_message('error', $msg); |
1503 | 1501 | } |
1504 | - } |
|
1505 | - else |
|
1502 | + } else |
|
1506 | 1503 | { |
1507 | 1504 | $msg = ($CI->lang->line($msg) == FALSE) ? $msg : $CI->lang->line($msg); |
1508 | 1505 | $this->error_msg[] = $msg; |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * CodeIgniter |
4 | 6 | * |
@@ -185,15 +187,13 @@ discard block |
||
185 | 187 | if (is_array($val) && isset($val['data'])) |
186 | 188 | { |
187 | 189 | $args[$key] = $val; |
188 | - } |
|
189 | - else |
|
190 | + } else |
|
190 | 191 | { |
191 | 192 | $args[$key] = array('data' => $val); |
192 | 193 | } |
193 | 194 | } |
194 | 195 | } |
195 | - } |
|
196 | - else |
|
196 | + } else |
|
197 | 197 | { |
198 | 198 | foreach ($args as $key => $val) |
199 | 199 | { |
@@ -239,8 +239,7 @@ discard block |
||
239 | 239 | if (is_object($table_data)) |
240 | 240 | { |
241 | 241 | $this->_set_from_object($table_data); |
242 | - } |
|
243 | - elseif (is_array($table_data)) |
|
242 | + } elseif (is_array($table_data)) |
|
244 | 243 | { |
245 | 244 | $set_heading = (count($this->heading) == 0 AND $this->auto_heading == FALSE) ? FALSE : TRUE; |
246 | 245 | $this->_set_from_array($table_data, $set_heading); |
@@ -341,14 +340,12 @@ discard block |
||
341 | 340 | if ($cell === "" OR $cell === NULL) |
342 | 341 | { |
343 | 342 | $out .= $this->empty_cells; |
344 | - } |
|
345 | - else |
|
343 | + } else |
|
346 | 344 | { |
347 | 345 | if ($function !== FALSE && is_callable($function)) |
348 | 346 | { |
349 | 347 | $out .= call_user_func($function, $cell); |
350 | - } |
|
351 | - else |
|
348 | + } else |
|
352 | 349 | { |
353 | 350 | $out .= $cell; |
354 | 351 | } |
@@ -449,8 +446,7 @@ discard block |
||
449 | 446 | if ($i == 0 AND count($data) > 1 AND count($this->heading) == 0 AND $set_heading == TRUE) |
450 | 447 | { |
451 | 448 | $this->heading = $this->_prep_args($row); |
452 | - } |
|
453 | - else |
|
449 | + } else |
|
454 | 450 | { |
455 | 451 | $this->rows[] = $this->_prep_args($row); |
456 | 452 | } |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('BASEPATH')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | |
3 | 5 | /** |
4 | 6 | * CodeIgniter |
@@ -716,8 +718,7 @@ discard block |
||
716 | 718 | if ($this->CI->config->item('javascript_ajax_img') == '') |
717 | 719 | { |
718 | 720 | $loading_notifier = "Loading..."; |
719 | - } |
|
720 | - else |
|
721 | + } else |
|
721 | 722 | { |
722 | 723 | $loading_notifier = '<img src=\'' . $this->CI->config->slash_item('base_url') . $this->CI->config->item('javascript_ajax_img') . '\' alt=\'Loading\' />'; |
723 | 724 | } |
@@ -874,8 +875,7 @@ discard block |
||
874 | 875 | $sort_options[] = "\n\t\t".$k.': '.$v.""; |
875 | 876 | } |
876 | 877 | $sort_options = implode(",", $sort_options); |
877 | - } |
|
878 | - else |
|
878 | + } else |
|
879 | 879 | { |
880 | 880 | $sort_options = ''; |
881 | 881 | } |
@@ -1056,8 +1056,7 @@ discard block |
||
1056 | 1056 | if (in_array($speed, array('slow', 'normal', 'fast'))) |
1057 | 1057 | { |
1058 | 1058 | $speed = '"'.$speed.'"'; |
1059 | - } |
|
1060 | - elseif (preg_match("/[^0-9]/", $speed)) |
|
1059 | + } elseif (preg_match("/[^0-9]/", $speed)) |
|
1061 | 1060 | { |
1062 | 1061 | $speed = ''; |
1063 | 1062 | } |