summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-03-22 15:34:58 +0100
committerAleksander Machniak <alec@alec.pl>2012-03-22 15:34:58 +0100
commitcd8ba3a60e5dead35ea0e004e629a06f4858c56c (patch)
treefb85b811d0155df6094ffebd888e1f59fe30fc6a
parent4d8989bae8a72f74e85bbca28a6d85f243d7de05 (diff)
downloadwebadmin-cd8ba3a60e5dead35ea0e004e629a06f4858c56c.tar.gz
Make debug information optional, provide devel_mode config option
-rw-r--r--lib/kolab_client_task.php22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 25443f2..59d39f4 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -799,16 +799,18 @@ class kolab_client_task
}
// Add debug information
- ksort($data);
- $debug = kolab_html::escape(print_r($data, true));
- $debug = preg_replace('/(^Array\n\(|\n*\)$|\t)/', '', $debug);
- $debug = str_replace("\n ", "\n", $debug);
- $debug = '<pre class="debug">' . $debug . '</pre>';
- $fields['debug'] = array(
- 'label' => 'debug',
- 'section' => 'system',
- 'value' => $debug,
- );
+ if ($this->config_get('devel_mode')) {
+ ksort($data);
+ $debug = kolab_html::escape(print_r($data, true));
+ $debug = preg_replace('/(^Array\n\(|\n*\)$|\t)/', '', $debug);
+ $debug = str_replace("\n ", "\n", $debug);
+ $debug = '<pre class="debug">' . $debug . '</pre>';
+ $fields['debug'] = array(
+ 'label' => 'debug',
+ 'section' => 'system',
+ 'value' => $debug,
+ );
+ }
}
return array($fields, $types, $type);