You are here

function _oauthconnector_object_to_qp in OAuth Connector 6

Same name and namespace in other branches
  1. 7 oauthconnector.module \_oauthconnector_object_to_qp()

File

./oauthconnector.module, line 513
OAuth Connector module

Code

function _oauthconnector_object_to_qp($qp, $values) {
  foreach ($values as $key => $val) {
    if (is_object($val)) {
      $val = get_object_vars($val);
    }
    $key = check_plain(str_replace(' ', '_', $key));
    if (is_array($val)) {
      $qp
        ->append(_oauthconnector_object_to_qp(qp('<?xml version="1.0"?><' . $key . '/>'), $val));
    }
    else {
      $qp
        ->append(qp('<?xml version="1.0"?><' . $key . '>' . check_plain($val) . '</' . $key . '>'));
    }
  }
  return $qp;
}