summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-03-22 10:28:07 +0100
committerAleksander Machniak <alec@alec.pl>2012-03-22 10:28:07 +0100
commit5d0cf20bd602428c5ed79f2807ebf12f9d15c19d (patch)
treee61c9ec2c9315f01c7774fc9b677b5ad3d0ab9f4
parent4d901b663d456917c163e4968383e1b99ad96e18 (diff)
downloadwebadmin-5d0cf20bd602428c5ed79f2807ebf12f9d15c19d.tar.gz
Unified debug information in edit forms
-rw-r--r--lib/client/kolab_client_task_group.php6
-rw-r--r--lib/kolab_client_task.php12
-rw-r--r--lib/locale/en_US.php1
-rw-r--r--public_html/skins/default/style.css13
4 files changed, 26 insertions, 6 deletions
diff --git a/lib/client/kolab_client_task_group.php b/lib/client/kolab_client_task_group.php
index dd6e0e4..2882163 100644
--- a/lib/client/kolab_client_task_group.php
+++ b/lib/client/kolab_client_task_group.php
@@ -268,12 +268,6 @@ class kolab_client_task_group extends kolab_client_task
}
}
-$fields['debug'] = array(
- 'label' => 'debug',
- 'section' => 'system',
- 'value' => '<pre>'.kolab_html::escape(print_r($data, true)).'</pre>',
-);
-
// Create form object and populate with fields
$form = $this->form_create('group', $attribs, $sections, $fields, $fields_map, $data);
diff --git a/lib/kolab_client_task.php b/lib/kolab_client_task.php
index 6ee696f..a9c835e 100644
--- a/lib/kolab_client_task.php
+++ b/lib/kolab_client_task.php
@@ -744,6 +744,18 @@ class kolab_client_task
$data = array_merge((array)$data, (array)$resp->get());
}
}
+ else {
+ // Add debug information
+ $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);
}
diff --git a/lib/locale/en_US.php b/lib/locale/en_US.php
index ca1ecde..aaaee08 100644
--- a/lib/locale/en_US.php
+++ b/lib/locale/en_US.php
@@ -9,6 +9,7 @@ $LANG['loginerror'] = 'Incorrect username or password!';
$LANG['internalerror'] = 'Internal system error!';
$LANG['welcome'] = 'Welcome to the Kolab Groupware Server Maintenance';
$LANG['reqtime'] = 'Request time: $1 sec.';
+$LANG['debug'] = 'Debug info';
$LANG['login.username'] = 'Username:';
$LANG['login.password'] = 'Password:';
diff --git a/public_html/skins/default/style.css b/public_html/skins/default/style.css
index 74cca9c..beddecc 100644
--- a/public_html/skins/default/style.css
+++ b/public_html/skins/default/style.css
@@ -495,6 +495,19 @@ input.maxsize {
width: 368px; /* span.listarea width - 2px */
}
+pre.debug {
+ border: 1px solid #d0d0d0;
+ border-radius: 3px;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ background-color: white;
+ padding: 2px;
+ width: 500px;
+ height: 200px;
+ margin: 0;
+ overflow: auto;
+}
+
/********* Form smart inputs *********/
span.listarea {