From 982255503a8762ce3b083a85747f9beb307f6b4d Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 1 Mar 2007 15:59:53 +0000 Subject: [PATCH] Added some ability to test searching. --- .../storageServer/var/xmlrpc/xr_web_test.php | 58 +++++++++++++++++-- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/campcaster/src/modules/storageServer/var/xmlrpc/xr_web_test.php b/campcaster/src/modules/storageServer/var/xmlrpc/xr_web_test.php index 30de7abe7..c6786534f 100644 --- a/campcaster/src/modules/storageServer/var/xmlrpc/xr_web_test.php +++ b/campcaster/src/modules/storageServer/var/xmlrpc/xr_web_test.php @@ -213,8 +213,23 @@ if (isset($_REQUEST['go_button'])) { $methodParams = $methodDefs[$f_selectedMethod]['p']; foreach ($methodParams as $methodParamName) { $inputParamName = "param_".$methodParamName; - $xmlParameters[$methodParamName] = $_REQUEST[$inputParamName]; - $_SESSION[$inputParamName] = $_REQUEST[$inputParamName]; + if ($methodParamName == "criteria") { + $catInputName = $inputParamName."_condition_cat"; + $valInputName = $inputParamName."_condition_val"; + $conditions = array(); + $conditions[0]["cat"] = $_REQUEST[$catInputName]; + $conditions[0]["op"] = "="; + $conditions[0]["val"] = $_REQUEST[$valInputName]; + $criteriaArray = array( + "filetype" => "audioclip", + "conditions" => $conditions); + $xmlParameters[$methodParamName] = $criteriaArray; + $_SESSION[$catInputName] = $_REQUEST[$catInputName]; + $_SESSION[$valInputName] = $_REQUEST[$valInputName]; + } else { + $xmlParameters[$methodParamName] = $_REQUEST[$inputParamName]; + $_SESSION[$inputParamName] = $_REQUEST[$inputParamName]; + } } // Create the XML-RPC message @@ -230,6 +245,11 @@ if (isset($_REQUEST['go_button'])) { // If successful $xmlResponse = XML_RPC_decode($sendResult->value()); + if (isset($xmlResponse['token'])) { + $_SESSION['xmlrpc_token'] = $xmlResponse['token']; + $errorMsg .= "
*** Token saved
"; + } + // Special case state handling switch ($f_selectedMethod) { case "login": @@ -242,7 +262,6 @@ if (isset($_REQUEST['go_button'])) { unset($_SESSION['xmlrpc_session_id']); break; case "storeAudioClipOpen": - $_SESSION['xmlrpc_token'] = $xmlResponse['token']; $_SESSION['xmlrpc_put_url'] = $xmlResponse['url']; break; } @@ -322,17 +341,46 @@ if (!is_array($methodParams) || count($methodParams) == 0) { } else { echo ""; foreach ($methodParams as $methodParamName) { + // Get the value for the field $value = ""; if ($methodParamName == "sessid" && isset($_SESSION['xmlrpc_session_id'])) { $value = $_SESSION['xmlrpc_session_id']; } elseif ($methodParamName == "token" && isset($_SESSION['xmlrpc_token'])) { $value = $_SESSION['xmlrpc_token']; + } elseif ($methodParamName == "criteria") { + $value_cond_cat = $_SESSION["param_".$methodParamName."_condition_cat"]; + $value_cond_val = $_SESSION["param_".$methodParamName."_condition_val"]; } elseif (isset($_SESSION["param_".$methodParamName])) { $value = $_SESSION["param_".$methodParamName]; } + + // Display the input boxes for the given field echo ""; - echo ""; ?> - + + + + +
$methodParamName
+ + + + +
+ + = +
+
+ "; } echo "
"; }