Revision 7ea461ec
Added by Alex Theys over 11 years ago
5.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme | ||
---|---|---|
1227 | 1227 |
|
1228 | 1228 |
|
1229 | 1229 |
//this theming function formats the use description and use record list for these descriptions |
1230 |
function theme_cdm_UseDescription($descriptions = null, $pageSize, $pageNumber) { |
|
1230 |
function theme_cdm_UseDescription($descriptions = null, $taxonUuid = null, $pageSize, $pageNumber) {
|
|
1231 | 1231 |
$out = '<div id="content"><ul id="Description" class ="description">'; |
1232 | 1232 |
if ($descriptions == null) { |
1233 | 1233 |
return; |
... | ... | |
1235 | 1235 |
$descriptionSynonyms; |
1236 | 1236 |
$descriptionOut = ""; |
1237 | 1237 |
$synonymOut = ""; |
1238 |
$currentTaxon = cdm_ws_get(CDM_WS_PORTAL_TAXON, $taxonUuid); |
|
1238 | 1239 |
foreach($descriptions as $description) { |
1239 | 1240 |
$useSummary = ""; |
1240 |
$synonyms = cdm_ws_get(CDM_WS_PORTAL_TAXON_SYNONYMY,$description->taxon->uuid); |
|
1241 | 1241 |
$serializedSynonyms = serialize($synonyms); |
1242 | 1242 |
foreach ($description->elements as $element) { |
1243 | 1243 |
|
... | ... | |
1247 | 1247 |
} |
1248 | 1248 |
foreach ($description->sources as $source) { |
1249 | 1249 |
$isSynonym = false; |
1250 |
$originalTaxonUsedInSource = null; |
|
1250 | 1251 |
if($source->originalNameString) { |
1251 |
$originalTaxonUsedInSource = cdm_ws_get(CDM_WS_PORTAL_NAME_NAMESBYNAME, $source->originalNameString . "."); |
|
1252 | 1252 |
|
1253 |
if (strpos($serializedSynonyms, $originalTaxonUsedInSource->uuid)) { |
|
1253 |
$originalTaxonUsedInSource = cdm_ws_get(CDM_WS_PORTAL_NAME_NAMESBYNAME, $source->originalNameString . "."); |
|
1254 |
if($currentTaxon->name->uuid != $originalTaxonUsedInSource->uuid){ |
|
1254 | 1255 |
$isSynonym = true; |
1255 | 1256 |
} |
1256 | 1257 |
|
... | ... | |
1301 | 1302 |
} |
1302 | 1303 |
} |
1303 | 1304 |
$synonymOut .= '</ul></li>'; |
1305 |
$isSynonym = false; |
|
1304 | 1306 |
|
1305 | 1307 |
} |
1306 | 1308 |
|
... | ... | |
1328 | 1330 |
//$out .= print_r($useDescriptions); |
1329 | 1331 |
//$out .= print_r($useDescriptions); |
1330 | 1332 |
$out .= '<div id="block-cdm_dataportal-feature-description" class="clear-block block block-cdm_dataportal-feature"><H2><a name="userecords"> </a> Uses </H2>'; |
1331 |
$formatUseDescriptions = theme('cdm_UseDescription', $useDescriptions, $pageSize, $pageNumber); |
|
1333 |
$formatUseDescriptions = theme('cdm_UseDescription', $useDescriptions, $taxonUuid, $pageSize, $pageNumber);
|
|
1332 | 1334 |
$out .= $formatUseDescriptions; |
1333 | 1335 |
$out .="</div>"; |
1334 | 1336 |
} |
Also available in: Unified diff
AT: Committing Uses dataportal interface changes