@@ -32,6 +32,9 @@ discard block |
||
| 32 | 32 | ErrorHandler::initialize(); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 35 | 38 | public static function getVersion() |
| 36 | 39 | { |
| 37 | 40 | if (!isset(static::$version)) { |
@@ -117,6 +120,9 @@ discard block |
||
| 117 | 120 | return $OSCOM_Site->hasPage() && $OSCOM_Site->getPage()->isRPC(); |
| 118 | 121 | } |
| 119 | 122 | |
| 123 | + /** |
|
| 124 | + * @param string $parameters |
|
| 125 | + */ |
|
| 120 | 126 | public static function link($page, $parameters = null, $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) |
| 121 | 127 | { |
| 122 | 128 | global $request_type; |
@@ -324,6 +330,10 @@ discard block |
||
| 324 | 330 | } |
| 325 | 331 | } |
| 326 | 332 | |
| 333 | + /** |
|
| 334 | + * @param string $file |
|
| 335 | + * @param string $group |
|
| 336 | + */ |
|
| 327 | 337 | public static function loadConfigFile($file, $group) |
| 328 | 338 | { |
| 329 | 339 | $cfg = []; |
@@ -354,6 +364,9 @@ discard block |
||
| 354 | 364 | return static::$cfg['global'][$key]; |
| 355 | 365 | } |
| 356 | 366 | |
| 367 | + /** |
|
| 368 | + * @param string $key |
|
| 369 | + */ |
|
| 357 | 370 | public static function configExists($key, $group = null) |
| 358 | 371 | { |
| 359 | 372 | if (!isset($group)) { |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | |
| 11 | 11 | use OSC\OM\DateTime; |
| 12 | 12 | use OSC\OM\ErrorHandler; |
| 13 | -use OSC\OM\FileSystem; |
|
| 14 | 13 | use OSC\OM\HTML; |
| 15 | 14 | use OSC\OM\HTTP; |
| 16 | 15 | use OSC\OM\Registry; |
@@ -12,7 +12,6 @@ |
||
| 12 | 12 | |
| 13 | 13 | use OSC\OM\HTML; |
| 14 | 14 | use OSC\OM\OSCOM; |
| 15 | - use OSC\OM\Registry; |
|
| 16 | 15 | |
| 17 | 16 | require('includes/application_top.php'); |
| 18 | 17 | |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | Released under the GNU General Public License |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | - use OSC\OM\HTML; |
|
| 14 | 13 | use OSC\OM\OSCOM; |
| 15 | 14 | use OSC\OM\Registry; |
| 16 | 15 | |
@@ -10,7 +10,6 @@ |
||
| 10 | 10 | Released under the GNU General Public License |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | - use OSC\OM\HTML; |
|
| 14 | 13 | use OSC\OM\OSCOM; |
| 15 | 14 | use OSC\OM\Registry; |
| 16 | 15 | |
@@ -32,6 +32,9 @@ |
||
| 32 | 32 | return MODULE_SECURITY_CHECK_EXTENDED_EXT_DIRECTORY_LISTING_HTTP_200; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $url |
|
| 37 | + */ |
|
| 35 | 38 | function getHttpRequest($url) { |
| 36 | 39 | $server = parse_url($url); |
| 37 | 40 | |
@@ -32,6 +32,9 @@ |
||
| 32 | 32 | return MODULE_SECURITY_CHECK_EXTENDED_EXT_DIRECTORY_LISTING_HTTP_200; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $url |
|
| 37 | + */ |
|
| 35 | 38 | function getHttpRequest($url) { |
| 36 | 39 | $server = parse_url($url); |
| 37 | 40 | |
@@ -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']; |
@@ -124,6 +124,9 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $raw_datetime |
|
| 129 | + */ |
|
| 127 | 130 | function tep_datetime_short($raw_datetime) { |
| 128 | 131 | if ( ($raw_datetime == '0000-00-00 00:00:00') || ($raw_datetime == '') ) return false; |
| 129 | 132 | |
@@ -261,6 +264,9 @@ discard block |
||
| 261 | 264 | return $image; |
| 262 | 265 | } |
| 263 | 266 | |
| 267 | + /** |
|
| 268 | + * @param integer $len |
|
| 269 | + */ |
|
| 264 | 270 | function tep_break_string($string, $len, $break_char = '-') { |
| 265 | 271 | $l = 0; |
| 266 | 272 | $output = ''; |
@@ -373,6 +379,11 @@ discard block |
||
| 373 | 379 | return $geo_zone_id; |
| 374 | 380 | } |
| 375 | 381 | |
| 382 | + /** |
|
| 383 | + * @param boolean $html |
|
| 384 | + * @param string $boln |
|
| 385 | + * @param string $eoln |
|
| 386 | + */ |
|
| 376 | 387 | function tep_address_format($address_format_id, $address, $html, $boln, $eoln) { |
| 377 | 388 | $Qaddress = Registry::get('Db')->get('address_format', 'address_format', ['address_format_id' => (int)$address_format_id]); |
| 378 | 389 | |
@@ -469,6 +480,9 @@ discard block |
||
| 469 | 480 | return $def_state; |
| 470 | 481 | } |
| 471 | 482 | |
| 483 | + /** |
|
| 484 | + * @param string $params |
|
| 485 | + */ |
|
| 472 | 486 | function tep_get_uprid($prid, $params) { |
| 473 | 487 | $uprid = $prid; |
| 474 | 488 | if ( (is_array($params)) && (!strstr($prid, '{')) ) { |
@@ -576,6 +590,9 @@ discard block |
||
| 576 | 590 | //// |
| 577 | 591 | // Wrapper for class_exists() function |
| 578 | 592 | // This function is not available in all PHP versions so we test it before using it. |
| 593 | + /** |
|
| 594 | + * @param string $class_name |
|
| 595 | + */ |
|
| 579 | 596 | function tep_class_exists($class_name) { |
| 580 | 597 | if (function_exists('class_exists')) { |
| 581 | 598 | return class_exists($class_name); |
@@ -771,6 +788,9 @@ discard block |
||
| 771 | 788 | |
| 772 | 789 | //// |
| 773 | 790 | // Sets the status of a banner |
| 791 | + /** |
|
| 792 | + * @param integer $status |
|
| 793 | + */ |
|
| 774 | 794 | function tep_set_banner_status($banners_id, $status) { |
| 775 | 795 | $OSCOM_Db = Registry::get('Db'); |
| 776 | 796 | |
@@ -845,6 +865,9 @@ discard block |
||
| 845 | 865 | |
| 846 | 866 | //// |
| 847 | 867 | // Sets the status of a product on special |
| 868 | + /** |
|
| 869 | + * @param integer $status |
|
| 870 | + */ |
|
| 848 | 871 | function tep_set_specials_status($specials_id, $status) { |
| 849 | 872 | $OSCOM_Db = Registry::get('Db'); |
| 850 | 873 | |
@@ -1261,6 +1284,11 @@ discard block |
||
| 1261 | 1284 | return $value; |
| 1262 | 1285 | } |
| 1263 | 1286 | |
| 1287 | + /** |
|
| 1288 | + * @param string $to_name |
|
| 1289 | + * @param string $email_subject |
|
| 1290 | + * @param string $email_text |
|
| 1291 | + */ |
|
| 1264 | 1292 | function tep_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) { |
| 1265 | 1293 | if (SEND_EMAILS != 'true') return false; |
| 1266 | 1294 | |
@@ -1312,6 +1340,9 @@ discard block |
||
| 1312 | 1340 | |
| 1313 | 1341 | //// |
| 1314 | 1342 | // Wrapper function for round() for php3 compatibility |
| 1343 | + /** |
|
| 1344 | + * @return double |
|
| 1345 | + */ |
|
| 1315 | 1346 | function tep_round($value, $precision) { |
| 1316 | 1347 | return round($value, $precision); |
| 1317 | 1348 | } |
@@ -1454,6 +1485,10 @@ discard block |
||
| 1454 | 1485 | |
| 1455 | 1486 | //// |
| 1456 | 1487 | // Return a random value |
| 1488 | + /** |
|
| 1489 | + * @param integer $min |
|
| 1490 | + * @param integer $max |
|
| 1491 | + */ |
|
| 1457 | 1492 | function tep_rand($min = null, $max = null) { |
| 1458 | 1493 | static $seeded; |
| 1459 | 1494 | |
@@ -1469,6 +1504,9 @@ discard block |
||
| 1469 | 1504 | } |
| 1470 | 1505 | |
| 1471 | 1506 | // nl2br() prior PHP 4.2.0 did not convert linefeeds on all OSs (it only converted \n) |
| 1507 | + /** |
|
| 1508 | + * @param string[] $from |
|
| 1509 | + */ |
|
| 1472 | 1510 | function tep_convert_linefeeds($from, $to, $string) { |
| 1473 | 1511 | return str_replace($from, $to, $string); |
| 1474 | 1512 | } |
@@ -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 | } |