@@ -268,6 +268,7 @@ discard block |
||
268 | 268 | /** |
269 | 269 | * @name: delete |
270 | 270 | * |
271 | + * @param string $from |
|
271 | 272 | */ |
272 | 273 | public function delete($from, $where = '', $orderby = '', $limit = '') |
273 | 274 | { |
@@ -414,6 +415,9 @@ discard block |
||
414 | 415 | } |
415 | 416 | } |
416 | 417 | |
418 | + /** |
|
419 | + * @param string $table |
|
420 | + */ |
|
417 | 421 | public function save($fields, $table, $where = '') |
418 | 422 | { |
419 | 423 | |
@@ -444,6 +448,7 @@ discard block |
||
444 | 448 | /** |
445 | 449 | * @name: freeResult |
446 | 450 | * |
451 | + * @param mysqli_result $rs |
|
447 | 452 | */ |
448 | 453 | public function freeResult($rs) |
449 | 454 | { |
@@ -554,6 +559,7 @@ discard block |
||
554 | 559 | * @name: getColumn |
555 | 560 | * @desc: returns an array of the values found on colun $name |
556 | 561 | * @param: $dsq - dataset or query string |
562 | + * @param string $name |
|
557 | 563 | */ |
558 | 564 | public function getColumn($name, $dsq) |
559 | 565 | { |
@@ -720,6 +726,9 @@ discard block |
||
720 | 726 | return $result; |
721 | 727 | } |
722 | 728 | |
729 | + /** |
|
730 | + * @param string $table_name |
|
731 | + */ |
|
723 | 732 | public function optimize($table_name) |
724 | 733 | { |
725 | 734 | $rs = $this->query("OPTIMIZE TABLE {$table_name}"); |
@@ -730,6 +739,9 @@ discard block |
||
730 | 739 | return $rs; |
731 | 740 | } |
732 | 741 | |
742 | + /** |
|
743 | + * @param string $table_name |
|
744 | + */ |
|
733 | 745 | public function truncate($table_name) |
734 | 746 | { |
735 | 747 | $rs = $this->query("TRUNCATE {$table_name}"); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @param string $param |
174 | 174 | * @param array $tvsArray |
175 | - * @return mixed |
|
175 | + * @return string |
|
176 | 176 | */ |
177 | 177 | function parseTvValues($param, $tvsArray) |
178 | 178 | { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | /** |
567 | 567 | * returns an array if a delimiter is present. returns array is a recordset is present |
568 | 568 | * |
569 | - * @param $src |
|
569 | + * @param string $src |
|
570 | 570 | * @param string $delim |
571 | 571 | * @param string $type |
572 | 572 | * @param bool $columns |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | |
1023 | 1023 | if (! function_exists('ParseIntputOptions')) { |
1024 | 1024 | /** |
1025 | - * @param string|array|mysqli_result $v |
|
1025 | + * @param string $v |
|
1026 | 1026 | * @return array |
1027 | 1027 | */ |
1028 | 1028 | function ParseIntputOptions($v) |
@@ -573,7 +573,8 @@ |
||
573 | 573 | * @return array|string |
574 | 574 | */ |
575 | 575 | function parseInput($src, $delim = "||", $type = "string", $columns = true) |
576 | - { // type can be: string, array |
|
576 | + { |
|
577 | +// type can be: string, array |
|
577 | 578 | $modx = evolutionCMS(); |
578 | 579 | if ($modx->db->isResult($src)) { |
579 | 580 | // must be a recordset |
@@ -63,7 +63,7 @@ |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | - * @return mixed |
|
66 | + * @return string |
|
67 | 67 | */ |
68 | 68 | public function getOutput() |
69 | 69 | { |
@@ -5,7 +5,8 @@ |
||
5 | 5 | * @deprecated EvolutionCMS\Legacy\ErrorHandler |
6 | 6 | * @todo could be unnecessary |
7 | 7 | */ |
8 | -class errorHandler extends EvolutionCMS\Legacy\ErrorHandler { |
|
8 | +class errorHandler extends EvolutionCMS\Legacy\ErrorHandler |
|
9 | +{ |
|
9 | 10 | public function include_lang($context = 'common') |
10 | 11 | { |
11 | 12 | parent::includeLang($context); |
@@ -3,4 +3,6 @@ |
||
3 | 3 | /** |
4 | 4 | * @deprecated use EvolutionCMS\Legacy\LogHandler |
5 | 5 | */ |
6 | -class logHandler extends EvolutionCMS\Legacy\LogHandler{} |
|
6 | +class logHandler extends EvolutionCMS\Legacy\LogHandler |
|
7 | +{ |
|
8 | +} |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php namespace EvolutionCMS\Legacy; |
2 | 2 | |
3 | -class mgrResources { |
|
3 | +class mgrResources |
|
4 | +{ |
|
4 | 5 | /** |
5 | 6 | * @var array |
6 | 7 | */ |
@@ -21,7 +22,8 @@ discard block |
||
21 | 22 | /** |
22 | 23 | * mgrResources constructor. |
23 | 24 | */ |
24 | - public function __construct() { |
|
25 | + public function __construct() |
|
26 | + { |
|
25 | 27 | $this->setTypes(); |
26 | 28 | $this->queryItemsFromDB(); |
27 | 29 | $this->prepareCategoryArrays(); |
@@ -30,7 +32,8 @@ discard block |
||
30 | 32 | /** |
31 | 33 | * @return void |
32 | 34 | */ |
33 | - public function setTypes() { |
|
35 | + public function setTypes() |
|
36 | + { |
|
34 | 37 | global $_lang; |
35 | 38 | $this->types['site_templates'] = array( |
36 | 39 | 'title'=>$_lang["manage_templates"], |
@@ -68,7 +71,8 @@ discard block |
||
68 | 71 | /** |
69 | 72 | * @return void |
70 | 73 | */ |
71 | - public function queryItemsFromDB() { |
|
74 | + public function queryItemsFromDB() |
|
75 | + { |
|
72 | 76 | foreach($this->types as $resourceTable=>$type) { |
73 | 77 | if($this->hasAnyPermissions($type['permissions'])) { |
74 | 78 | $nameField = isset($type['name']) ? $type['name'] : 'name'; |
@@ -81,11 +85,13 @@ discard block |
||
81 | 85 | * @param array $permissions |
82 | 86 | * @return bool |
83 | 87 | */ |
84 | - public function hasAnyPermissions($permissions) { |
|
88 | + public function hasAnyPermissions($permissions) |
|
89 | + { |
|
85 | 90 | $modx = evolutionCMS(); |
86 | 91 | |
87 | - foreach($permissions as $p) |
|
88 | - if($modx->hasPermission($p)) return true; |
|
92 | + foreach($permissions as $p) { |
|
93 | + if($modx->hasPermission($p)) return true; |
|
94 | + } |
|
89 | 95 | |
90 | 96 | return false; |
91 | 97 | } |
@@ -95,7 +101,8 @@ discard block |
||
95 | 101 | * @param string $nameField |
96 | 102 | * @return array|bool |
97 | 103 | */ |
98 | - public function queryResources($resourceTable, $nameField = 'name') { |
|
104 | + public function queryResources($resourceTable, $nameField = 'name') |
|
105 | + { |
|
99 | 106 | $modx = evolutionCMS(); global $_lang; |
100 | 107 | |
101 | 108 | $allowed = array( |
@@ -112,8 +119,9 @@ discard block |
||
112 | 119 | $tvsql = 'site_tmplvars.caption, '; |
113 | 120 | $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
114 | 121 | $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
122 | + } else { |
|
123 | + $sttfield = ''; |
|
115 | 124 | } |
116 | - else $sttfield = ''; |
|
117 | 125 | |
118 | 126 | $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
119 | 127 | |
@@ -126,7 +134,9 @@ discard block |
||
126 | 134 | ); |
127 | 135 | $limit = $modx->db->getRecordCount($rs); |
128 | 136 | |
129 | - if($limit < 1) return false; |
|
137 | + if($limit < 1) { |
|
138 | + return false; |
|
139 | + } |
|
130 | 140 | |
131 | 141 | $result = array(); |
132 | 142 | while ($row = $modx->db->getRow($rs)) { |
@@ -138,7 +148,8 @@ discard block |
||
138 | 148 | /** |
139 | 149 | * @return void |
140 | 150 | */ |
141 | - public function prepareCategoryArrays() { |
|
151 | + public function prepareCategoryArrays() |
|
152 | + { |
|
142 | 153 | foreach($this->items as $type=>$items) { |
143 | 154 | foreach((array)$items as $item) { |
144 | 155 | $catid = $item['catid'] ? $item['catid'] : 0; |
@@ -154,7 +165,7 @@ discard block |
||
154 | 165 | |
155 | 166 | // Now sort by name |
156 | 167 | foreach($this->itemsPerCategory as $catid=>$items) { |
157 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
168 | + usort($this->itemsPerCategory[$catid], function ($a, $b){ |
|
158 | 169 | return strcasecmp($a['name'], $b['name']); |
159 | 170 | }); |
160 | 171 | } |
@@ -8,7 +8,8 @@ discard block |
||
8 | 8 | * @param array $data |
9 | 9 | * @return string |
10 | 10 | */ |
11 | - public function output($config = array(), $data = array()) { |
|
11 | + public function output($config = array(), $data = array()) |
|
12 | + { |
|
12 | 13 | $modx = evolutionCMS(); |
13 | 14 | |
14 | 15 | $output = ''; |
@@ -64,7 +65,8 @@ discard block |
||
64 | 65 | * @param array $data |
65 | 66 | * @return string |
66 | 67 | */ |
67 | - private function render($data) { |
|
68 | + private function render($data) |
|
69 | + { |
|
68 | 70 | $modx = evolutionCMS(); global $_lang, $_country_lang; |
69 | 71 | |
70 | 72 | $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']); |
@@ -43,7 +43,8 @@ discard block |
||
43 | 43 | public $im_height = 0; |
44 | 44 | public $im; |
45 | 45 | |
46 | - public function __construct($w=200, $h=80) { |
|
46 | + public function __construct($w=200, $h=80) |
|
47 | + { |
|
47 | 48 | /* create session to set word for verification */ |
48 | 49 | $this->setVeriword(); |
49 | 50 | $this->dir_font = MODX_BASE_PATH . 'assets/' . $this->dir_font; |
@@ -51,21 +52,24 @@ discard block |
||
51 | 52 | $this->im_height = $h; |
52 | 53 | } |
53 | 54 | |
54 | - public function setVeriword() { |
|
55 | + public function setVeriword() |
|
56 | + { |
|
55 | 57 | /* create session variable for verification, |
56 | 58 | you may change the session variable name */ |
57 | 59 | $this->word = $this->makeText(); |
58 | 60 | $_SESSION['veriword'] = $this->word; |
59 | 61 | } |
60 | 62 | |
61 | - public function output() { |
|
63 | + public function output() |
|
64 | + { |
|
62 | 65 | /* output the image as jpeg */ |
63 | 66 | $this->drawImage(); |
64 | 67 | header("Content-type: image/jpeg"); |
65 | 68 | imagejpeg($this->im); |
66 | 69 | } |
67 | 70 | |
68 | - public function makeText() { |
|
71 | + public function makeText() |
|
72 | + { |
|
69 | 73 | $modx = evolutionCMS(); |
70 | 74 | // set default words |
71 | 75 | $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote"; |
@@ -76,7 +80,8 @@ discard block |
||
76 | 80 | return (string) $arr_words[array_rand($arr_words)].rand(10,999); |
77 | 81 | } |
78 | 82 | |
79 | - public function drawText() { |
|
83 | + public function drawText() |
|
84 | + { |
|
80 | 85 | $dir = dir($this->dir_font); |
81 | 86 | $fontstmp = array(); |
82 | 87 | while (false !== ($file = $dir->read())) { |
@@ -131,7 +136,8 @@ discard block |
||
131 | 136 | } |
132 | 137 | |
133 | 138 | |
134 | - public function drawImage() { |
|
139 | + public function drawImage() |
|
140 | + { |
|
135 | 141 | |
136 | 142 | /* pick one background image randomly from image directory */ |
137 | 143 | $img_file = MODX_BASE_PATH . 'assets/' . $this->dir_noise."noise".rand(1,4).".jpg"; |
@@ -162,7 +168,8 @@ discard block |
||
162 | 168 | return $this->im; |
163 | 169 | } |
164 | 170 | |
165 | - public function destroy() { |
|
171 | + public function destroy() |
|
172 | + { |
|
166 | 173 | imagedestroy($this->im); |
167 | 174 | } |
168 | 175 | } |
@@ -8,8 +8,8 @@ |
||
8 | 8 | * @todo could be unnecessary |
9 | 9 | * |
10 | 10 | */ |
11 | -Class TemplateParser extends EvolutionCMS\Legacy\TemplateParser |
|
12 | -{ |
|
11 | +Class TemplateParser extends EvolutionCMS\Legacy\TemplateParser |
|
12 | +{ |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | ?> |