Project

General

Profile

« Previous | Next » 

Revision f79ad3b5

Added by Alex Theys over 11 years ago

AT: committing latest changes to the dataportal to work from home and fix some outstanding issues

View differences:

5.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
1219 1219
  return $out;
1220 1220
}
1221 1221

  
1222

  
1222 1223
//this theming function formats the use description and use record list for these descriptions 
1223 1224
function theme_cdm_format_Uses ($descriptions = null, $pageSize, $pageNumber) {
1224 1225
	$out = '<div id="content"><ul id="Description" class ="description">';
......
1228 1229
	$descriptionSynonyms;
1229 1230
	$descriptionOut = "";
1230 1231
	$synonymOut = "";
1232
	$useSummary = "";
1231 1233
	foreach($descriptions as $description) {
1232
		//$out .= print_r($description);
1233
		//$taxonName = cdm_ws_get(CDM_WS_NAME_NAMECAHE, $description->taxon->uuid);
1234
		//$out .= print_r($taxonName);
1235
		//$taxonnameName = cdm_ws_get(CDM_WS_PORTAL_NAME_NAMESBYNAME, $taxonName . ".");
1236 1234
		$synonyms = cdm_ws_get(CDM_WS_PORTAL_TAXON_SYNONYMY,$description->taxon->uuid);
1237
		//$out .= print_r($synonyms);
1238
		//$out .= print_r($taxonnameName); 
1239
		
1240
		//$out .= '<li class="descriptionText DescriptionElement">';
1235
		$serializedSynonyms = serialize($synonyms);
1236
		foreach ($description->elements as $element) {
1237
			
1238
			if($element->feature->uuid == UUID_USE_SUMMARY && !(strlen($useSummary)> 0)){
1239
				$useSummary = $element->multilanguageText_L10n->text;
1240
			}
1241
		}
1241 1242
		foreach ($description->sources as $source) {
1242 1243
			$isSynonym = false;
1243 1244
			if($source->originalNameString) {
1244 1245
				$originalTaxonUsedInSource = cdm_ws_get(CDM_WS_PORTAL_NAME_NAMESBYNAME, array($description->taxon->uuid, $source->originalNameString . "."));
1245 1246
				
1246
				foreach($synonyms as $heteroSynonym) {
1247
					foreach ($heteroSynonym as $synonym)
1248
					//$out .= print_r($synonym);
1249
					foreach ($synonym as $toto) {
1250
						//$out .= print_r($toto);
1251
						//$out .= $toto->name->specificEpithet;
1252
						//$out .= $toto->name->uuid;
1253
						if($toto->name->uuid == $originalTaxonUsedInSource->uuid) {
1254
							$isSynonym = true;
1255
							//$descriptionSynonyms[] = $description;
1256
						}
1257
						else {
1258
							
1259
						}
1260
						
1261
					}
1262
					//$out .= $synonym->name->uuid;
1263
					
1247
				if (strpos($serializedSynonyms, $originalTaxonUsedInSource->uuid)) {
1248
					$isSynonym = true;
1264 1249
				}
1250
				
1265 1251
				if (!$isSynonym) {
1266 1252
					$descriptionOut .='<li class="descriptionText DescriptionElement">';
1267 1253
					$name_used_in_source_link_to_show_use = l($source->originalNameString, path_to_name($originalTaxonUsedInSource->uuid),array(), NULL, NULL, FALSE ,TRUE);
1268
					
1269
					//$out .= $source->originalNameString . ': ';
1270 1254
					$descriptionOut .= $name_used_in_source_link_to_show_use . ': ';
1271
					$descriptionOut .= $description->titleCache;
1255
					$descriptionOut .= $useSummary;
1272 1256
					foreach ($description->sources as $source) {
1273 1257
						if($source->originalNameString) {
1274 1258
							//$out = $source->originalNameString . ':' . $out;
......
1277 1261
					}
1278 1262
					$descriptionOut .= '<ul>';
1279 1263
					foreach ($description->elements as $descriptionElement) {
1280
						$useRecordTags = explode(';', $descriptionElement->modifyingText->English->text);
1281
						$descriptionOut .= '<li class="use_record_list">- ' . $useRecordTags[0] . '[' . $useRecordTags[1] . ']' . ' - ' . $useRecordTags[2] . ' - ' . $useRecordTags[3]. '[' .$useRecordTags[4]. ']' . ' - ' .   $useRecordTags[5] . '</li>';
1264
						if($descriptionElement->feature->uuid == UUID_USE_RECORD){
1265
							$useRecordTags = explode(';', $descriptionElement->modifyingText->English->text);
1266
							$descriptionOut .= '<li class="use_record_list">- ' . $useRecordTags[0] . '[' . $useRecordTags[1] . ']' . ' - ' . $useRecordTags[2] . ' - ' . $useRecordTags[3]. '[' .$useRecordTags[4]. ']' . ' - ' .   $useRecordTags[5] . '</li>';
1267
						}
1282 1268
					}
1283 1269
					$descriptionOut .= '</ul></li>';
1284 1270
					
1285 1271
					
1286 1272
				}
1287 1273
				else {
1274
					
1288 1275
					$synonymOut .='<li class="descriptionText DescriptionElement">';
1289 1276
					$name_used_in_source_link_to_show_use = l($source->originalNameString, path_to_name($originalTaxonUsedInSource->uuid),array(), NULL, NULL, FALSE ,TRUE);
1290 1277
						
1291 1278
					//$out .= $source->originalNameString . ': ';
1292 1279
					$synonymOut .= $name_used_in_source_link_to_show_use . ': ';
1293
					$synonymOut .= $description->titleCache;
1280
					$synonymOut .= $useSummary;
1294 1281
					foreach ($description->sources as $source) {
1295 1282
						if($source->originalNameString) {
1296 1283
							//$out = $source->originalNameString . ':' . $out;
......
1299 1286
					}
1300 1287
					$synonymOut .= '<ul>';
1301 1288
					foreach ($description->elements as $descriptionElement) {
1302
						$useRecordTags = explode(';', $descriptionElement->modifyingText->English->text);
1303
						$synonymOut .= '<li class="use_record_list">- ' . $useRecordTags[0] . '[' . $useRecordTags[1] . ']' . ' - ' . $useRecordTags[2] . ' - ' . $useRecordTags[3]. '[' .$useRecordTags[4]. ']' . ' - ' .   $useRecordTags[5] . '</li>';
1289
						//print_r($descriptionElement);
1290
						if($descriptionElement->feature->uuid == UUID_USE_RECORD){
1291
							$useRecordTags = explode(';', $descriptionElement->modifyingText->English->text);
1292
							$synonymOut .= '<li class="use_record_list">- ' . $useRecordTags[0] . '[' . $useRecordTags[1] . ']' . ' - ' . $useRecordTags[2] . ' - ' . $useRecordTags[3]. '[' .$useRecordTags[4]. ']' . ' - ' .   $useRecordTags[5] . '</li>';
1293
						}
1304 1294
					}
1305 1295
					$synonymOut .= '</ul></li>';
1306 1296
					
1307 1297
				}
1308
				
1309
				
1310
				
1311
				//$out .=print_r($originalTaxonUsedInSource);
1312
				//$name_used_in_source_link_to_show_use = l($source->originalNameString, path_to_name($originalTaxonUsedInSource->uuid),array(), NULL, NULL, FALSE ,TRUE);
1313
				
1314
				//$out .= $source->originalNameString . ': ';
1315
				//$out .= $name_used_in_source_link_to_show_use . ': ';
1298

  
1316 1299
			}
1317 1300
		}
1318
		//$out .= "</li>";
1319
		//$out .= print_r($descriptionSynonyms);
1320
		//$out .= $description->titleCache;
1321
		//foreach ($description->sources as $source) {
1322
		//	if($source->originalNameString) {
1323
				//$out = $source->originalNameString . ':' . $out;
1324
		//	}
1325
		//	$out .= " (" . theme('cdm_DescriptionElementSource', $source, true) . ")";
1326
		//}
1327
		//$out .= '<ul>';
1328
		//foreach ($description->elements as $descriptionElement) {
1329
		//	$useRecordTags = explode(';', $descriptionElement->modifyingText->English->text);
1330
		//	$out .= '<li class="use_record_list">- ' . $useRecordTags[0] . '[' . $useRecordTags[1] . ']' . ' - ' . $useRecordTags[2] . ' - ' . $useRecordTags[3]. '[' .$useRecordTags[4]. ']' . ' - ' .   $useRecordTags[5] . '</li>';
1331
		//}
1332
		//$out .= '</ul>';
1333

  
1334
		//$out .= "</li>";
1335
		
1336 1301
	}
1337 1302
	$out .= $descriptionOut . $synonymOut;
1338
	//$out .= "</ul></div>";
1339 1303
	$out .= "</ul></div>";
1340 1304
	return $out;
1341 1305
}
......
1351 1315
	$markerTypes = array();
1352 1316
	$markerTypes['markerTypes'] = UUID_MARKERTYPE_USE;
1353 1317
	$useDescriptions = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS, $taxonUuid, queryString($markerTypes));
1318
	//$out .=  print_r($useDescriptions);
1354 1319
	if(!empty($useDescriptions)) {
1355 1320
		//$out .= print_r($useDescriptions);
1356 1321
  		//$out .= print_r($useDescriptions);

Also available in: Unified diff