fields('tb') ->execute(); $terms = array(); while ($bundle = $bundles->fetchObject()) { $cvterm_id = preg_replace('/^bio-data_/', '', $bundle->bundle); if ($cvterm_id) { $cvterm = chado_generate_var('cvterm', array('cvterm_id' => $cvterm_id)); $terms[$cvterm->name] = $cvterm; } } ksort($terms); $result['content_types'] = array(); foreach ($terms as $name => $cvterm) { $result['content_types'][$name] = array( 'vocabulary' => $cvterm->cv_id->name, 'namespace' => $cvterm->dbxref_id->db_id->name, ); } } catch (Exception $e) { watchdog('tripal_ws', $e->getMessage(), array(), WATCHDOG_ERROR); $message = $e->getMessage(); $status = 'error'; $result = array(); } // The responses follow the same format as the AGAVE API with a // status, message, version and all data in the "result" object. $response['status'] = $status; $response['message'] = $message; $response['version'] = $version; $response['source'] = array( 'site_name' => variable_get('site_name', "Unspecified"), 'site_url' => $base_url, 'site_slogan' => variable_get('site_slogan', "Unspecified"), 'site_email' => variable_get('site_mail', "Unspecified"), ); $response['result'] = $result; print drupal_json_output($response); }