@@ -346,7 +346,7 @@ |
||
| 346 | 346 | |
| 347 | 347 | /** |
| 348 | 348 | * @param string $filepath |
| 349 | - * @return bool|string |
|
| 349 | + * @return null|string |
|
| 350 | 350 | */ |
| 351 | 351 | function getFileContent($filepath) |
| 352 | 352 | { |
@@ -72,6 +72,10 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | public $cdelim; |
| 74 | 74 | |
| 75 | + /** |
|
| 76 | + * @param null|string $id |
|
| 77 | + * @param string $ds |
|
| 78 | + */ |
|
| 75 | 79 | public function __construct($id, $ds, $pageSize = 20, $pageNumber = -1) |
| 76 | 80 | { |
| 77 | 81 | global $__DataGridCnt; |
@@ -212,6 +216,9 @@ discard block |
||
| 212 | 216 | |
| 213 | 217 | // format column values |
| 214 | 218 | |
| 219 | + /** |
|
| 220 | + * @param integer $n |
|
| 221 | + */ |
|
| 215 | 222 | public function RenderRowFnc($n, $row) |
| 216 | 223 | { |
| 217 | 224 | if ($this->_alt == 0) { |
@@ -31,6 +31,9 @@ discard block |
||
| 31 | 31 | public $renderPagerFnc; |
| 32 | 32 | public $renderPagerFncArgs; |
| 33 | 33 | |
| 34 | + /** |
|
| 35 | + * @param boolean|string $id |
|
| 36 | + */ |
|
| 34 | 37 | public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) |
| 35 | 38 | { |
| 36 | 39 | global $_PAGE; // use view state object |
@@ -82,6 +85,9 @@ discard block |
||
| 82 | 85 | $this->pageSize = $ps; |
| 83 | 86 | } |
| 84 | 87 | |
| 88 | + /** |
|
| 89 | + * @param DataGrid $fncName |
|
| 90 | + */ |
|
| 85 | 91 | public function setRenderRowFnc($fncName, $args = "") |
| 86 | 92 | { |
| 87 | 93 | $this->renderRowFnc = &$fncName; |
@@ -412,6 +412,9 @@ discard block |
||
| 412 | 412 | } |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | + /** |
|
| 416 | + * @param string $table |
|
| 417 | + */ |
|
| 415 | 418 | public function save($fields, $table, $where = '') |
| 416 | 419 | { |
| 417 | 420 | if ($where === '') { |
@@ -441,6 +444,7 @@ discard block |
||
| 441 | 444 | /** |
| 442 | 445 | * @name: freeResult |
| 443 | 446 | * |
| 447 | + * @param mysqli_result $rs |
|
| 444 | 448 | */ |
| 445 | 449 | public function freeResult($rs) |
| 446 | 450 | { |
@@ -551,6 +555,7 @@ discard block |
||
| 551 | 555 | * @name: getColumn |
| 552 | 556 | * @desc: returns an array of the values found on colun $name |
| 553 | 557 | * @param: $dsq - dataset or query string |
| 558 | + * @param string $name |
|
| 554 | 559 | */ |
| 555 | 560 | public function getColumn($name, $dsq) |
| 556 | 561 | { |
@@ -716,6 +721,9 @@ discard block |
||
| 716 | 721 | return $result; |
| 717 | 722 | } |
| 718 | 723 | |
| 724 | + /** |
|
| 725 | + * @param string $table_name |
|
| 726 | + */ |
|
| 719 | 727 | public function optimize($table_name) |
| 720 | 728 | { |
| 721 | 729 | $rs = $this->query("OPTIMIZE TABLE {$table_name}"); |
@@ -726,6 +734,9 @@ discard block |
||
| 726 | 734 | return $rs; |
| 727 | 735 | } |
| 728 | 736 | |
| 737 | + /** |
|
| 738 | + * @param string $table_name |
|
| 739 | + */ |
|
| 729 | 740 | public function truncate($table_name) |
| 730 | 741 | { |
| 731 | 742 | $rs = $this->query("TRUNCATE {$table_name}"); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** |
| 102 | 102 | * @param string $mode |
| 103 | 103 | * @param string $modifiers |
| 104 | - * @return bool|string |
|
| 104 | + * @return false|string |
|
| 105 | 105 | */ |
| 106 | 106 | public function _getDelim($mode, $modifiers) |
| 107 | 107 | { |
@@ -149,6 +149,14 @@ discard block |
||
| 149 | 149 | return $opt; |
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * @param string $mode |
|
| 155 | + * @param false|string $delim |
|
| 156 | + * @param string $modifiers |
|
| 157 | + * |
|
| 158 | + * @return string |
|
| 159 | + */ |
|
| 152 | 160 | public function _getRemainModifiers($mode, $delim, $modifiers) |
| 153 | 161 | { |
| 154 | 162 | if ($delim) { |
@@ -182,6 +190,9 @@ discard block |
||
| 182 | 190 | return substr($string, strpos($string, $delim)+$len); |
| 183 | 191 | } |
| 184 | 192 | |
| 193 | + /** |
|
| 194 | + * @param string $modifiers |
|
| 195 | + */ |
|
| 185 | 196 | public function splitEachModifiers($modifiers) |
| 186 | 197 | { |
| 187 | 198 | $modx = evolutionCMS(); |
@@ -253,6 +264,10 @@ discard block |
||
| 253 | 264 | return $result; |
| 254 | 265 | } |
| 255 | 266 | |
| 267 | + /** |
|
| 268 | + * @param string $key |
|
| 269 | + * @param string $value |
|
| 270 | + */ |
|
| 256 | 271 | public function parsePhx($key, $value, $modifiers) |
| 257 | 272 | { |
| 258 | 273 | $modx = evolutionCMS(); |
@@ -332,6 +347,10 @@ discard block |
||
| 332 | 347 | } |
| 333 | 348 | } |
| 334 | 349 | |
| 350 | + /** |
|
| 351 | + * @param string $cmd |
|
| 352 | + * @param string $opt |
|
| 353 | + */ |
|
| 335 | 354 | public function getValueFromPreset($key, $value, $cmd, $opt) |
| 336 | 355 | { |
| 337 | 356 | $modx = evolutionCMS(); |
@@ -1185,6 +1204,9 @@ discard block |
||
| 1185 | 1204 | return $value; |
| 1186 | 1205 | } |
| 1187 | 1206 | |
| 1207 | + /** |
|
| 1208 | + * @param string $cmd |
|
| 1209 | + */ |
|
| 1188 | 1210 | public function includeMdfFile($cmd) |
| 1189 | 1211 | { |
| 1190 | 1212 | $modx = evolutionCMS(); |
@@ -1374,6 +1396,10 @@ discard block |
||
| 1374 | 1396 | } |
| 1375 | 1397 | |
| 1376 | 1398 | // Sets a placeholder variable which can only be access by Modifiers |
| 1399 | + |
|
| 1400 | + /** |
|
| 1401 | + * @param string $value |
|
| 1402 | + */ |
|
| 1377 | 1403 | public function setModifiersVariable($key, $value) |
| 1378 | 1404 | { |
| 1379 | 1405 | if ($key != 'phx' && $key != 'dummy') { |
@@ -382,7 +382,7 @@ |
||
| 382 | 382 | } // end renderFormElement function |
| 383 | 383 | |
| 384 | 384 | /** |
| 385 | - * @param string|array|mysqli_result $v |
|
| 385 | + * @param string $v |
|
| 386 | 386 | * @return array |
| 387 | 387 | */ |
| 388 | 388 | function ParseIntputOptions($v) |
@@ -783,6 +783,9 @@ discard block |
||
| 783 | 783 | } |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | + /** |
|
| 787 | + * @param string $dir |
|
| 788 | + */ |
|
| 786 | 789 | protected function moveUploadFile($file, $dir) |
| 787 | 790 | { |
| 788 | 791 | $message = $this->checkUploadedFile($file); |
@@ -817,6 +820,9 @@ discard block |
||
| 817 | 820 | return "/" . basename($target); |
| 818 | 821 | } |
| 819 | 822 | |
| 823 | + /** |
|
| 824 | + * @param string $file |
|
| 825 | + */ |
|
| 820 | 826 | protected function sendDefaultThumb($file=null) |
| 821 | 827 | { |
| 822 | 828 | if ($file !== null) { |
@@ -1028,6 +1034,9 @@ discard block |
||
| 1028 | 1034 | return ""; |
| 1029 | 1035 | } |
| 1030 | 1036 | |
| 1037 | + /** |
|
| 1038 | + * @param string $message |
|
| 1039 | + */ |
|
| 1031 | 1040 | protected function errorMsg($message, array $data=null) |
| 1032 | 1041 | { |
| 1033 | 1042 | if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) { |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Browser actions class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Browser actions class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class browser extends uploader |
| 16 | 16 | { |
@@ -427,6 +427,9 @@ discard block |
||
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | |
| 430 | + /** |
|
| 431 | + * @return string |
|
| 432 | + */ |
|
| 430 | 433 | protected function normalizeFilename($filename) |
| 431 | 434 | { |
| 432 | 435 | if ($this->getTransaliasSettings()) { |
@@ -437,6 +440,9 @@ discard block |
||
| 437 | 440 | return $filename; |
| 438 | 441 | } |
| 439 | 442 | |
| 443 | + /** |
|
| 444 | + * @param string $dirname |
|
| 445 | + */ |
|
| 440 | 446 | protected function normalizeDirname($dirname) |
| 441 | 447 | { |
| 442 | 448 | return $this->modx->stripAlias($dirname); |
@@ -566,6 +572,9 @@ discard block |
||
| 566 | 572 | return (is_dir($path) && is_readable($path)) ? $return : false; |
| 567 | 573 | } |
| 568 | 574 | |
| 575 | + /** |
|
| 576 | + * @param string $ext |
|
| 577 | + */ |
|
| 569 | 578 | protected function validateExtension($ext, $type) |
| 570 | 579 | { |
| 571 | 580 | $ext = trim(strtolower($ext)); |
@@ -595,12 +604,18 @@ discard block |
||
| 595 | 604 | return in_array($ext, $exts); |
| 596 | 605 | } |
| 597 | 606 | |
| 607 | + /** |
|
| 608 | + * @return string |
|
| 609 | + */ |
|
| 598 | 610 | protected function getTypeFromPath($path) |
| 599 | 611 | { |
| 600 | 612 | return preg_match('/^([^\/]*)\/.*$/', $path, $patt) |
| 601 | 613 | ? $patt[1] : $path; |
| 602 | 614 | } |
| 603 | 615 | |
| 616 | + /** |
|
| 617 | + * @param string $path |
|
| 618 | + */ |
|
| 604 | 619 | protected function removeTypeFromPath($path) |
| 605 | 620 | { |
| 606 | 621 | return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) |
@@ -811,6 +826,9 @@ discard block |
||
| 811 | 826 | die; |
| 812 | 827 | } |
| 813 | 828 | |
| 829 | + /** |
|
| 830 | + * @param string $url |
|
| 831 | + */ |
|
| 814 | 832 | protected function callBack($url, $message="") |
| 815 | 833 | { |
| 816 | 834 | $message = text::jsValue($message); |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Uploader class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Uploader class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class uploader |
| 16 | 16 | { |
@@ -19,92 +19,92 @@ discard block |
||
| 19 | 19 | const VERSION = "2.54"; |
| 20 | 20 | |
| 21 | 21 | /** Config session-overrided settings |
| 22 | - * @var array */ |
|
| 22 | + * @var array */ |
|
| 23 | 23 | protected $config = array(); |
| 24 | 24 | |
| 25 | 25 | /** Default image driver |
| 26 | - * @var string */ |
|
| 26 | + * @var string */ |
|
| 27 | 27 | protected $imageDriver = "gd"; |
| 28 | 28 | |
| 29 | 29 | /** Opener applocation properties |
| 30 | - * $opener['name'] Got from $_GET['opener']; |
|
| 31 | - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) |
|
| 32 | - * $opener['TinyMCE'] Boolean |
|
| 33 | - * @var array */ |
|
| 30 | + * $opener['name'] Got from $_GET['opener']; |
|
| 31 | + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) |
|
| 32 | + * $opener['TinyMCE'] Boolean |
|
| 33 | + * @var array */ |
|
| 34 | 34 | protected $opener = array(); |
| 35 | 35 | |
| 36 | 36 | /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant |
| 37 | - * @var string */ |
|
| 37 | + * @var string */ |
|
| 38 | 38 | protected $type; |
| 39 | 39 | |
| 40 | 40 | /** Helper property. Local filesystem path to the Type Directory |
| 41 | - * Equivalent: $config['uploadDir'] . "/" . $type |
|
| 42 | - * @var string */ |
|
| 41 | + * Equivalent: $config['uploadDir'] . "/" . $type |
|
| 42 | + * @var string */ |
|
| 43 | 43 | protected $typeDir; |
| 44 | 44 | |
| 45 | 45 | /** Helper property. Web URL to the Type Directory |
| 46 | - * Equivalent: $config['uploadURL'] . "/" . $type |
|
| 47 | - * @var string */ |
|
| 46 | + * Equivalent: $config['uploadURL'] . "/" . $type |
|
| 47 | + * @var string */ |
|
| 48 | 48 | protected $typeURL; |
| 49 | 49 | |
| 50 | 50 | /** Linked to $config['types'] |
| 51 | - * @var array */ |
|
| 51 | + * @var array */ |
|
| 52 | 52 | protected $types = array(); |
| 53 | 53 | |
| 54 | 54 | /** Settings which can override default settings if exists as keys in $config['types'][$type] array |
| 55 | - * @var array */ |
|
| 55 | + * @var array */ |
|
| 56 | 56 | protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); |
| 57 | 57 | |
| 58 | 58 | /** Got from language file |
| 59 | - * @var string */ |
|
| 59 | + * @var string */ |
|
| 60 | 60 | protected $charset; |
| 61 | 61 | |
| 62 | 62 | /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property |
| 63 | - * @var string */ |
|
| 63 | + * @var string */ |
|
| 64 | 64 | protected $lang = 'en'; |
| 65 | 65 | |
| 66 | 66 | /** Possible language $_GET keys |
| 67 | - * @var array */ |
|
| 67 | + * @var array */ |
|
| 68 | 68 | protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); |
| 69 | 69 | |
| 70 | 70 | /** Uploaded file(s) info. Linked to first $_FILES element |
| 71 | - * @var array */ |
|
| 71 | + * @var array */ |
|
| 72 | 72 | protected $file; |
| 73 | 73 | |
| 74 | 74 | /** Next three properties are got from the current language file |
| 75 | - * @var string */ |
|
| 75 | + * @var string */ |
|
| 76 | 76 | protected $dateTimeFull; // Currently not used |
| 77 | 77 | protected $dateTimeMid; // Currently not used |
| 78 | 78 | protected $dateTimeSmall; |
| 79 | 79 | |
| 80 | 80 | /** Contain Specified language labels |
| 81 | - * @var array */ |
|
| 81 | + * @var array */ |
|
| 82 | 82 | protected $labels = array(); |
| 83 | 83 | |
| 84 | 84 | /** Contain unprocessed $_GET array. Please use this instead of $_GET |
| 85 | - * @var array */ |
|
| 85 | + * @var array */ |
|
| 86 | 86 | protected $get; |
| 87 | 87 | |
| 88 | 88 | /** Contain unprocessed $_POST array. Please use this instead of $_POST |
| 89 | - * @var array */ |
|
| 89 | + * @var array */ |
|
| 90 | 90 | protected $post; |
| 91 | 91 | |
| 92 | 92 | /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE |
| 93 | - * @var array */ |
|
| 93 | + * @var array */ |
|
| 94 | 94 | protected $cookie; |
| 95 | 95 | |
| 96 | 96 | /** Session array. Please use this property instead of $_SESSION |
| 97 | - * @var array */ |
|
| 97 | + * @var array */ |
|
| 98 | 98 | protected $session; |
| 99 | 99 | |
| 100 | 100 | /** CMS integration attribute (got from $_GET['cms']) |
| 101 | - * @var string */ |
|
| 101 | + * @var string */ |
|
| 102 | 102 | protected $cms = ""; |
| 103 | 103 | |
| 104 | 104 | protected $modx = null; |
| 105 | 105 | /** Magic method which allows read-only access to protected or private class properties |
| 106 | - * @param string $property |
|
| 107 | - * @return mixed */ |
|
| 106 | + * @param string $property |
|
| 107 | + * @return mixed */ |
|
| 108 | 108 | public function __get($property) |
| 109 | 109 | { |
| 110 | 110 | return property_exists($this, $property) ? $this->$property : null; |
@@ -177,6 +177,9 @@ discard block |
||
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| 180 | + /** |
|
| 181 | + * @param integer $n |
|
| 182 | + */ |
|
| 180 | 183 | private function getChars($n) |
| 181 | 184 | { |
| 182 | 185 | $response = null; |
@@ -214,6 +217,9 @@ discard block |
||
| 214 | 217 | } |
| 215 | 218 | |
| 216 | 219 | |
| 220 | + /** |
|
| 221 | + * @param false|string $str |
|
| 222 | + */ |
|
| 217 | 223 | private function readInt($str) |
| 218 | 224 | { |
| 219 | 225 | $size = unpack("C*", $str); |