| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- if (!function_exists('debug')) {
-
- function debug($structure=null, $html=true) {
-
- global $config;
-
- if ($config['settings']['debug']) {
-
- $nl = !$html ? "\n" : "<br>";
-
- if (is_array($structure) || is_object($structure)) {
-
- if (!$html) {
- print "\n"; print_r($structure);
- } else {
- print '<pre>'; print_r($structure); print '</pre>';
- }
-
- return;
- }
-
- if (is_bool($structure)) {
- echo $structure === true ? "\n".'Bool: true'.$nl : "\n".'Bool: false'.$nl;
- return;
- }
-
- if (is_numeric($structure)) {
- echo "\n".'Numeric: ', $structure.$nl;
- return;
- }
-
- if (is_string($structure)) {
- echo "\n".'String: ', $structure.$nl;
- return;
- }
-
- if (is_null($structure)) {
- echo "null\n";
- return;
- }
-
- echo "\n".$structure;
-
- } else {
- return null;
- }
-
- } //function
- } //if
-
- function _t($textId) {
- //return utf8_encode(_($textId));
- }
-
- function leadingZeros($number) {
- return (int)$number<10 ? "0$number" : $number;
- }
-
- function optionSelected($value) {
- if ($value === true) return 'selected="selected"';
- return null;
- }
|