@@ -103,6 +103,10 @@ discard block |
||
103 | 103 | return $image; |
104 | 104 | } |
105 | 105 | |
106 | + /** |
|
107 | + * @param string $name |
|
108 | + * @param string $action |
|
109 | + */ |
|
106 | 110 | public static function form($name, $action, $method = 'post', $parameters = '', array $flags = []) |
107 | 111 | { |
108 | 112 | if (!isset($flags['tokenize']) || !is_bool($flags['tokenize'])) { |
@@ -175,6 +179,9 @@ discard block |
||
175 | 179 | return static::inputField($name, null, $parameters, 'file', false); |
176 | 180 | } |
177 | 181 | |
182 | + /** |
|
183 | + * @param string $type |
|
184 | + */ |
|
178 | 185 | protected static function selectionField($name, $type, $value = '', $checked = false, $parameters = '') |
179 | 186 | { |
180 | 187 | $selection = '<input type="' . static::output($type) . '" name="' . static::output($name) . '"'; |
@@ -196,6 +203,9 @@ discard block |
||
196 | 203 | return $selection; |
197 | 204 | } |
198 | 205 | |
206 | + /** |
|
207 | + * @param string $name |
|
208 | + */ |
|
199 | 209 | public static function checkboxField($name, $value = '', $checked = false, $parameters = '') |
200 | 210 | { |
201 | 211 | return static::selectionField($name, 'checkbox', $value, $checked, $parameters); |
@@ -206,6 +216,11 @@ discard block |
||
206 | 216 | return static::selectionField($name, 'radio', $value, $checked, $parameters); |
207 | 217 | } |
208 | 218 | |
219 | + /** |
|
220 | + * @param string $name |
|
221 | + * @param integer $width |
|
222 | + * @param integer $height |
|
223 | + */ |
|
209 | 224 | public static function textareaField($name, $width, $height, $text = '', $parameters = '', $reinsert_value = true, $class = 'form-control') |
210 | 225 | { |
211 | 226 | $field = '<textarea name="' . static::output($name) . '" cols="' . static::output($width) . '" rows="' . static::output($height) . '"'; |
@@ -325,6 +340,11 @@ discard block |
||
325 | 340 | return $field; |
326 | 341 | } |
327 | 342 | |
343 | + /** |
|
344 | + * @param string $title |
|
345 | + * @param string $icon |
|
346 | + * @param string $link |
|
347 | + */ |
|
328 | 348 | public static function button($title = null, $icon = null, $link = null, $params = null, $class = null) |
329 | 349 | { |
330 | 350 | $types = ['submit', 'button', 'reset']; |
@@ -78,6 +78,9 @@ discard block |
||
78 | 78 | |
79 | 79 | //// |
80 | 80 | // Break a word in a string if it is longer than a specified length ($len) |
81 | + /** |
|
82 | + * @param integer $len |
|
83 | + */ |
|
81 | 84 | function tep_break_string($string, $len, $break_char = '-') { |
82 | 85 | $l = 0; |
83 | 86 | $output = ''; |
@@ -245,6 +248,9 @@ discard block |
||
245 | 248 | |
246 | 249 | //// |
247 | 250 | // Wrapper function for round() |
251 | + /** |
|
252 | + * @return double |
|
253 | + */ |
|
248 | 254 | function tep_round($number, $precision) { |
249 | 255 | if (strpos($number, '.') && (strlen(substr($number, strpos($number, '.')+1)) > $precision)) { |
250 | 256 | $number = substr($number, 0, strpos($number, '.') + 1 + $precision + 1); |
@@ -424,6 +430,11 @@ discard block |
||
424 | 430 | //// |
425 | 431 | // Return a formatted address |
426 | 432 | // TABLES: address_format |
433 | + /** |
|
434 | + * @param boolean $html |
|
435 | + * @param string $boln |
|
436 | + * @param string $eoln |
|
437 | + */ |
|
427 | 438 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
428 | 439 | $OSCOM_Db = Registry::get('Db'); |
429 | 440 | |
@@ -952,6 +963,9 @@ discard block |
||
952 | 963 | |
953 | 964 | //// |
954 | 965 | // Return a product ID with attributes |
966 | + /** |
|
967 | + * @param string $params |
|
968 | + */ |
|
955 | 969 | function tep_get_uprid($prid, $params) { |
956 | 970 | if (is_numeric($prid)) { |
957 | 971 | $uprid = (int)$prid; |
@@ -1033,6 +1047,11 @@ discard block |
||
1033 | 1047 | // $from_email_adress The eMail address of the sender, |
1034 | 1048 | // e.g. [email protected] |
1035 | 1049 | |
1050 | + /** |
|
1051 | + * @param string $to_name |
|
1052 | + * @param string $email_subject |
|
1053 | + * @param string $email_text |
|
1054 | + */ |
|
1036 | 1055 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
1037 | 1056 | if (SEND_EMAILS != 'true') return false; |
1038 | 1057 | |
@@ -1092,6 +1111,9 @@ discard block |
||
1092 | 1111 | return tep_count_modules(MODULE_SHIPPING_INSTALLED); |
1093 | 1112 | } |
1094 | 1113 | |
1114 | + /** |
|
1115 | + * @param integer $length |
|
1116 | + */ |
|
1095 | 1117 | function tep_create_random_value($length, $type = 'mixed') { |
1096 | 1118 | if ( ($type != 'mixed') && ($type != 'chars') && ($type != 'digits')) $type = 'mixed'; |
1097 | 1119 | |
@@ -1247,6 +1269,10 @@ discard block |
||
1247 | 1269 | |
1248 | 1270 | //// |
1249 | 1271 | // Return a random value |
1272 | + /** |
|
1273 | + * @param integer $min |
|
1274 | + * @param integer $max |
|
1275 | + */ |
|
1250 | 1276 | function tep_rand($min = null, $max = null) { |
1251 | 1277 | |
1252 | 1278 | if (isset($min) && isset($max)) { |
@@ -1366,6 +1392,9 @@ discard block |
||
1366 | 1392 | } |
1367 | 1393 | |
1368 | 1394 | // Convert linefeeds |
1395 | + /** |
|
1396 | + * @param string[] $from |
|
1397 | + */ |
|
1369 | 1398 | function tep_convert_linefeeds($from, $to, $string) { |
1370 | 1399 | return str_replace($from, $to, $string); |
1371 | 1400 | } |
@@ -121,6 +121,9 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param string $data |
|
126 | + */ |
|
124 | 127 | public function get($data = null, $language_code = null) |
125 | 128 | { |
126 | 129 | if (!isset($data)) { |
@@ -246,6 +249,9 @@ discard block |
||
246 | 249 | $this->injectDefinitions($defs, $scope); |
247 | 250 | } |
248 | 251 | |
252 | + /** |
|
253 | + * @param string $pathname |
|
254 | + */ |
|
249 | 255 | public function getDefinitions($group, $language_code, $pathname) |
250 | 256 | { |
251 | 257 | $defs = []; |
@@ -331,6 +337,9 @@ discard block |
||
331 | 337 | } |
332 | 338 | } |
333 | 339 | |
340 | + /** |
|
341 | + * @param boolean $flag |
|
342 | + */ |
|
334 | 343 | public function setUseCache($flag) |
335 | 344 | { |
336 | 345 | $this->use_cache = ($flag === true); |
@@ -50,6 +50,9 @@ discard block |
||
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
53 | + /** |
|
54 | + * @param integer $expire |
|
55 | + */ |
|
53 | 56 | public function exists($expire = null) |
54 | 57 | { |
55 | 58 | $filename = static::$path . $this->key . '.cache'; |
@@ -139,6 +142,9 @@ discard block |
||
139 | 142 | return static::$path; |
140 | 143 | } |
141 | 144 | |
145 | + /** |
|
146 | + * @param string $key |
|
147 | + */ |
|
142 | 148 | public static function clear($key) |
143 | 149 | { |
144 | 150 | if (!static::hasSafeName($key)) { |
@@ -37,6 +37,7 @@ |
||
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @param array $parameters url, headers, parameters, method, verify_ssl, cafile, certificate, proxy |
40 | + * @return string |
|
40 | 41 | */ |
41 | 42 | |
42 | 43 | public static function getResponse(array $parameters) |
@@ -221,6 +221,9 @@ discard block |
||
221 | 221 | return $image; |
222 | 222 | } |
223 | 223 | |
224 | + /** |
|
225 | + * @param integer $len |
|
226 | + */ |
|
224 | 227 | function tep_break_string($string, $len, $break_char = '-') { |
225 | 228 | $l = 0; |
226 | 229 | $output = ''; |
@@ -333,6 +336,11 @@ discard block |
||
333 | 336 | return $geo_zone_id; |
334 | 337 | } |
335 | 338 | |
339 | + /** |
|
340 | + * @param boolean $html |
|
341 | + * @param string $boln |
|
342 | + * @param string $eoln |
|
343 | + */ |
|
336 | 344 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
337 | 345 | $Qaddress = Registry::get('Db')->get('address_format', 'address_format', ['address_format_id' => (int)$address_format_id]); |
338 | 346 | |
@@ -429,6 +437,9 @@ discard block |
||
429 | 437 | return $def_state; |
430 | 438 | } |
431 | 439 | |
440 | + /** |
|
441 | + * @param string $params |
|
442 | + */ |
|
432 | 443 | function tep_get_uprid($prid, $params) { |
433 | 444 | $uprid = $prid; |
434 | 445 | if ( (is_array($params)) && (!strstr($prid, '{')) ) { |
@@ -545,6 +556,9 @@ discard block |
||
545 | 556 | //// |
546 | 557 | // Wrapper for class_exists() function |
547 | 558 | // This function is not available in all PHP versions so we test it before using it. |
559 | + /** |
|
560 | + * @param string $class_name |
|
561 | + */ |
|
548 | 562 | function tep_class_exists($class_name) { |
549 | 563 | if (function_exists('class_exists')) { |
550 | 564 | return class_exists($class_name); |
@@ -740,6 +754,9 @@ discard block |
||
740 | 754 | |
741 | 755 | //// |
742 | 756 | // Sets the status of a banner |
757 | + /** |
|
758 | + * @param integer $status |
|
759 | + */ |
|
743 | 760 | function tep_set_banner_status($banners_id, $status) { |
744 | 761 | $OSCOM_Db = Registry::get('Db'); |
745 | 762 | |
@@ -814,6 +831,9 @@ discard block |
||
814 | 831 | |
815 | 832 | //// |
816 | 833 | // Sets the status of a product on special |
834 | + /** |
|
835 | + * @param integer $status |
|
836 | + */ |
|
817 | 837 | function tep_set_specials_status($specials_id, $status) { |
818 | 838 | $OSCOM_Db = Registry::get('Db'); |
819 | 839 | |
@@ -1231,6 +1251,11 @@ discard block |
||
1231 | 1251 | return $value; |
1232 | 1252 | } |
1233 | 1253 | |
1254 | + /** |
|
1255 | + * @param string $to_name |
|
1256 | + * @param string $email_subject |
|
1257 | + * @param string $email_text |
|
1258 | + */ |
|
1234 | 1259 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
1235 | 1260 | if (SEND_EMAILS != 'true') return false; |
1236 | 1261 | |
@@ -1282,6 +1307,9 @@ discard block |
||
1282 | 1307 | |
1283 | 1308 | //// |
1284 | 1309 | // Wrapper function for round() for php3 compatibility |
1310 | + /** |
|
1311 | + * @return double |
|
1312 | + */ |
|
1285 | 1313 | function tep_round($value, $precision) { |
1286 | 1314 | return round($value, $precision); |
1287 | 1315 | } |
@@ -1430,6 +1458,10 @@ discard block |
||
1430 | 1458 | |
1431 | 1459 | //// |
1432 | 1460 | // Return a random value |
1461 | + /** |
|
1462 | + * @param integer $min |
|
1463 | + * @param integer $max |
|
1464 | + */ |
|
1433 | 1465 | function tep_rand($min = null, $max = null) { |
1434 | 1466 | static $seeded; |
1435 | 1467 | |
@@ -1445,6 +1477,9 @@ discard block |
||
1445 | 1477 | } |
1446 | 1478 | |
1447 | 1479 | // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) |
1480 | + /** |
|
1481 | + * @param string[] $from |
|
1482 | + */ |
|
1448 | 1483 | function tep_convert_linefeeds($from, $to, $string) { |
1449 | 1484 | return str_replace($from, $to, $string); |
1450 | 1485 | } |