X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=debugger%2Fcontroller.php;h=4db999096081522e5db1a7f1b2a9e9c454783d35;hb=b825566f55fd1aa4dab6b09145848e7d6e957fe5;hp=965b2efadadcbd2f069ea5e6cea6feea2cbfe043;hpb=df6a966781af900b11587a408665936e91132c4c;p=plcapi.git
diff --git a/debugger/controller.php b/debugger/controller.php
index 965b2ef..4db9990 100644
--- a/debugger/controller.php
+++ b/debugger/controller.php
@@ -8,314 +8,424 @@
* @todo switch params for http compression from 0,1,2 to values to be used directly
* @todo add a little bit more CSS formatting: we broke IE box model getting a width > 100%...
* @todo add support for more options, such as ntlm auth to proxy, or request charset encoding
- *
* @todo parse content of payload textarea to be fed to visual editor
* @todo add http no-cache headers
**/
- include(__DIR__.'/common.php');
- if ($action == '')
+include __DIR__ . '/common.php';
+if ($action == '') {
$action = 'list';
+}
- // relative path to the visual xmlrpc editing dialog
- $editorpath = '../../javascript/debugger/';
- $editorlibs = '../../javascript/lib/';
+// relative path to the visual xmlrpc editing dialog
+$editorpath = '../../javascript/debugger/';
+$editorlibs = '../../javascript/lib/';
?>
-XMLRPC Debugger
-
-
-
-
-
-
-
+
+
+
+
+
+ function displaydialogeditorbtn(show) {
+ if (show && ((typeof base64_decode) == 'function')) {
+ document.getElementById('methodpayloadbtn').innerHTML = '[Edit]';
+ }
+ else {
+ document.getElementById('methodpayloadbtn').innerHTML = '';
+ }
+ }
+
+ function activateeditor() {
+ var url = 'visualeditor.php?params=';
+ if (document.frmaction.wstype.value == "1")
+ url += '&type=jsonrpc';
+ var wnd = window.open(url, '_blank', 'width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=1');
+ }
+
+ // if javascript version of the lib is found, allow it to send us params
+ function buildparams(base64data) {
+ if (typeof base64_decode == 'function') {
+ if (base64data == '0') // workaround for bug in base64_encode...
+ document.getElementById('methodpayload').value = '';
+ else
+ document.getElementById('methodpayload').value = base64_decode(base64data);
+ }
+ }
+
+ // use GET for ease of refresh, switch to POST when payload is too big to fit in url (in IE: 2048 bytes! see http://support.microsoft.com/kb/q208427/)
+ function switchFormMethod() {
+ /// @todo use a more precise calculation, adding the rest of the fields to the actual generated url lenght
+ if (document.frmaction.methodpayload.value.length > 1536) {
+ document.frmaction.action = 'action.php?usepost=true';
+ document.frmaction.method = 'post';
+ }
+ }
+
+ //-->
+
-
-XMLRPC
-/JSONRPC Debugger (based on the PHP-XMLRPC library)
+
+XMLRPC
+
+ /
+
+ JSONRPC Debugger (based on the PHP-XMLRPC library)
+
-
\ No newline at end of file
+