function _fillpdf_xmlrpc_request in FillPDF 7.2
Same name and namespace in other branches
- 6 fillpdf.module \_fillpdf_xmlrpc_request()
- 7 fillpdf.module \_fillpdf_xmlrpc_request()
File
- ./
fillpdf.module, line 970 - Allows mappings of PDFs to site content
Code
function _fillpdf_xmlrpc_request($url, $method) {
$args = func_get_args();
array_shift($args);
// $url
// Fix up the array for Drupal 7 xmlrpc() function style
$args = array(
$args[0] => array_slice($args, 1),
);
$result = xmlrpc($url, $args);
$ret = new stdClass();
if (isset($result['error'])) {
drupal_set_message($result['error'], 'error');
$ret->error = TRUE;
}
elseif ($result == FALSE || xmlrpc_error()) {
$error = xmlrpc_error();
$ret->error = TRUE;
drupal_set_message(t('There was a problem contacting the FillPDF Service.
It may be down, or you may not have internet access. [ERROR @code: @message]', array(
'@code' => $error->code,
'@message' => $error->message,
)), 'error');
}
else {
$ret->data = $result['data'];
$ret->error = FALSE;
}
return $ret;
}