Revision b625ecad
Added by Andreas Kohlbecker over 2 years ago
modules/cdm_dataportal/cdm_api/tagged_text.inc | ||
---|---|---|
84 | 84 |
$tagged_text_expanded = array(); |
85 | 85 |
foreach ($taggedtxt as $tt) { |
86 | 86 |
if (isset($tt->entityReference) && !in_array($tt->type, $skiptags)) { |
87 |
if(!cdm_type_has_tagged_text($tt->entityReference->type)) { |
|
88 |
continue; |
|
89 |
} |
|
90 |
$base_uri = cdm_ws_base_uri($tt->entityReference->type); |
|
91 |
if($base_uri){ |
|
92 |
if(str_endsWith($base_uri, '$0')){ |
|
93 |
// sanitize placeholders at the end |
|
94 |
$base_uri = substr($base_uri, 0, strlen($base_uri) - 2); |
|
95 |
} |
|
96 |
$tagged_text_method = "/taggedText"; |
|
97 |
if($base_uri == CDM_WS_NAME){ |
|
98 |
$tagged_text_method = "/taggedName"; |
|
99 |
} |
|
100 |
if(!str_endsWith($base_uri, '/')){ |
|
101 |
$base_uri .= '/'; |
|
87 |
$referenced_tt = null; |
|
88 |
if(cdm_type_has_tagged_text($tt->entityReference->type)) { |
|
89 |
$base_uri = cdm_ws_base_uri($tt->entityReference->type); |
|
90 |
if($base_uri){ |
|
91 |
if(str_endsWith($base_uri, '$0')){ |
|
92 |
// sanitize placeholders at the end |
|
93 |
$base_uri = substr($base_uri, 0, strlen($base_uri) - 2); |
|
102 | 94 |
} |
103 |
$referenced_tt = cdm_ws_get($base_uri . $tt->entityReference->uuid . $tagged_text_method); |
|
95 |
$tagged_text_method = "/taggedText"; |
|
96 |
if($base_uri == CDM_WS_NAME){ |
|
97 |
$tagged_text_method = "/taggedName"; |
|
98 |
} |
|
99 |
if(!str_endsWith($base_uri, '/')){ |
|
100 |
$base_uri .= '/'; |
|
101 |
} |
|
102 |
$referenced_tt = cdm_ws_get($base_uri . $tt->entityReference->uuid . $tagged_text_method); |
|
103 |
} |
|
104 | 104 |
if($referenced_tt){ |
105 | 105 |
if(isset($tt->attributes)){ |
106 | 106 |
foreach($referenced_tt as $reftt){ |
Also available in: Unified diff
avoiding invalid calls to ./{cdm-entity-uuid}/taggedText.json - 2