1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Functions which are required or useful when accessing and processing CDM Data Store Webservices
|
6
|
*
|
7
|
* Naming conventions:
|
8
|
* ----------------------
|
9
|
*
|
10
|
* - all webservice access methods are prefixed with cdm_ws
|
11
|
*/
|
12
|
|
13
|
/**
|
14
|
* Enter description here...
|
15
|
*
|
16
|
* @param unknown_type $tag
|
17
|
* @return unknown
|
18
|
*/
|
19
|
function cdm_taggedtext2html(array $taggedText, $tag = 'span'){
|
20
|
foreach($taggedText as $class=>$value){
|
21
|
$out .= '<'.$tag.' class="'.$class.'">'.$value.'</ '.$tag.'>';
|
22
|
}
|
23
|
return $out;
|
24
|
}
|
25
|
|
26
|
/**
|
27
|
* load a name from the CDM Webservice
|
28
|
*
|
29
|
* @param String $uuid
|
30
|
* @return a NameTO instance or false
|
31
|
*/
|
32
|
function cdm_ws_get_nameTO($uuid){
|
33
|
|
34
|
$url = variable_get('cdm_webservice_url', '')."name/?uuid=$uuid";
|
35
|
$name = simplexml_load_file(url);
|
36
|
if(!$name){
|
37
|
watchdog('CDM', "cdm_get_nameTO() - failed to load $url", WATCHDOG_ERROR);
|
38
|
}
|
39
|
return $name;
|
40
|
}
|
41
|
|
42
|
/**
|
43
|
* load a list of names from the CDM Webservice
|
44
|
*
|
45
|
* @param unknown_type $page
|
46
|
* @param unknown_type $hide_unaccepted
|
47
|
*/
|
48
|
function cdm_ws_list_names($page = 1, $hide_unaccepted){
|
49
|
|
50
|
}
|