| | |
| | | $is_iso_8859_1 = true; |
| | | } |
| | | if (!$enctype) |
| | | $enctype = $GLOBALS['OUTPUT_TYPE']; |
| | | $enctype = $OUTPUT->type; |
| | | |
| | | // encode for plaintext |
| | | if ($enctype=='text') |
| | |
| | | return ''; |
| | | |
| | | // get user's timezone |
| | | $tz = $CONFIG['timezone']; |
| | | if ($CONFIG['dst_active']) |
| | | $tz++; |
| | | if ($CONFIG['timezone'] === 'auto') |
| | | $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600; |
| | | else { |
| | | $tz = $CONFIG['timezone']; |
| | | if ($CONFIG['dst_active']) |
| | | $tz++; |
| | | } |
| | | |
| | | // convert time to user's timezone |
| | | $timestamp = $ts - date('Z', $ts) + ($tz * 3600); |
| | |
| | | * |
| | | * @param mixed Debug message or data |
| | | */ |
| | | function console($msg) |
| | | function console() |
| | | { |
| | | if (!is_string($msg)) |
| | | $msg = var_export($msg, true); |
| | | $msg = array(); |
| | | foreach (func_get_args() as $arg) |
| | | $msg[] = !is_string($arg) ? var_export($arg, true) : $arg; |
| | | |
| | | if (!($GLOBALS['CONFIG']['debug_level'] & 4)) |
| | | write_log('console', $msg); |
| | | write_log('console', join(";\n", $msg)); |
| | | else if ($GLOBALS['OUTPUT']->ajax_call) |
| | | print "/*\n $msg \n*/\n"; |
| | | print "/*\n " . join(";\n", $msg) . " \n*/\n"; |
| | | else |
| | | { |
| | | print '<div style="background:#eee; border:1px solid #ccc; margin-bottom:3px; padding:6px"><pre>'; |
| | | print $msg; |
| | | print join(";<br/>\n", $msg); |
| | | print "</pre></div>\n"; |
| | | } |
| | | } |