Project

General

Profile

« Previous | Next » 

Revision 54e498e3

Added by Andreas Kohlbecker over 12 years ago

fixing #2568 (CICHORIEAE: Multiple Citation enties should be shown in separate lines)

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
1103 1103
  $secref_cache = array();
1104 1104
}
1105 1105

  
1106
/**
1107
 * Validates if the given string is a uuid.
1108
 *
1109
 * @param unknown_type $str
1110
 */
1106 1111
function is_uuid($str){
1107 1112
  return is_string($str) && strlen($str) == 36 && strpos($str, '-');
1108 1113
}
1109 1114

  
1115
/**
1116
 * Checks if the given $object is a valid cdm entity. An object is consirered
1117
 * cdm entity if it has a string field $object->class with at least 3 characters and
1118
 * if it has a valid uuid in $object->uuid.
1119
 *
1120
 * @author a.kohlbecker
1121
 * @param unknown_type $object
1122
 */
1123
function is_cdm_entity($object){
1124
  return is_string($object->class) && strlen($object->class) > 2 && is_string($object->uuid) && is_uuid($object->uuid);
1125
}
1126

  
1110 1127
function _cdm_api_secref_cache_add($secUuidsStr){
1111 1128
  global $secref_cache;
1112 1129
  $ref = cdm_ws_get(CDM_WS_REFERENCE, $secUuidsStr);
......
1121 1138
  $secref_cache[$ref->uuid] = $ref;
1122 1139
}
1123 1140

  
1141
/**
1142
 * Checks if the given $uri starts with the cdm webservice url stored in the
1143
 * Drupal variable 'cdm_webservice_url'. The 'cdm_webservice_url' can be set in the
1144
 * admins section of the portal.
1145
 *
1146
 * @param $uri the URI to test
1147
 */
1124 1148
function _is_cdm_ws_uri($uri){
1125 1149
  return str_beginsWith($uri, variable_get('cdm_webservice_url', '#EMPTY#'));
1126 1150
}

Also available in: Unified diff