Project

General

Profile

« Previous | Next » 

Revision 4a3c5865

Added by Francisco Revilla over 13 years ago

Ticket #1935

View differences:

modules/cdm_dataportal/cdm_dataportal.module
48 48
 * @var unknown_type
49 49
 */
50 50
define('CDM_DATAPORTAL_GALLERY_SETTINGS', serialize($gallery_settings));
51

  
52 51
define('CDM_DATAPORTAL_SPECIMEN_GALLERY_NAME', 'specimen_gallery');
53 52
define('CDM_DATAPORTAL_DESCRIPTION_GALLERY_NAME', "description_gallery");
54 53
define('CDM_DATAPORTAL_MEDIA_GALLERY_NAME', "media_gallery");
......
1383 1382
		return false;
1384 1383
	}
1385 1384
	$taxonpage->title = theme('cdm_taxon_page_title', $taxon);
1386

  
1385
	
1387 1386
	// check if the taxon id contained in the currently selected tree
1387
	$taxon_in_current_tree = taxon_in_current_tree($uuid);
1388 1388
	$taxon_nodes = cdm_ws_get(CDM_WS_PORTAL_TAXON_TAXONNODES, $uuid);
1389
	$taxon_in_current_tree = false;
1390
	foreach($taxon_nodes as $node){
1391
		if(get_taxonomictree_uuid_selected() == $node->taxonomicTree->uuid){
1392
			$taxon_in_current_tree = true; 
1393
			break;
1394
		}
1395
	}
1396 1389
	if(!$taxon_in_current_tree){
1397 1390
		if(count($taxon_nodes) == 0){
1398 1391
			drupal_set_message('This concept of the taxon '.theme('cdm_taxonName', $taxon->name).' is not contained any classification.'
......
1404 1397

  
1405 1398
			}
1406 1399
			drupal_set_message('This concept of the taxon '.theme('cdm_taxonName', $taxon->name).' is not contained in the currently chosen classification, but in '
1407
			.(count($taxon_nodes) > 1? ' one of these: ' : ' this one: ') . $trees
1400
			.(count($taxon_nodes) > 1? ' one of these: ' : ' this one: ') . $trees . '. The classification has been changed, however the current taxon page does not belong to it.'
1408 1401
			, 'warning');
1409 1402
		}
1410 1403
	}
modules/cdm_dataportal/cdm_taxontree/cdm_taxontree.module
467 467
	}
468 468

  
469 469
	// build the the branch for the focused node and merge it with the root
470
	// TODO only add brancht to taxon if taxon is in current classification!!!
471
	// hint: $viewUuid = get_taxonomictree_uuid_selected();
472
	if($taxonUuid){
470
	$taxon_in_current_tree = taxon_in_current_tree($taxonUuid);
471
	if($taxonUuid && $taxon_in_current_tree){
473 472
		$branch = cdm_taxontree_build_path($taxonUuid, NULL, (cdm_taxontree_filters_active() ? NULL : TRUE), TRUE);
474 473
		$root_tree = _cdm_taxontree_merge($root_tree, $branch);
475 474
	}
......
882 881
		$out .= theme($tree_node_callback, $node);
883 882
	}
884 883

  
885
/*
886
	foreach ($node->children as $element){
887
		$nameStr = '';
888
		foreach($element->taggedTitle as $tagtxt){
889
			if($tagtxt->type == 'name' || $tagtxt->type == 'rank'){
890
				$nameStr .= ($nameStr ? ' ' : '').$tagtxt->text;
891
			}
892
		}
893
		$nameStr = trim($nameStr);
894
		if (stristr(strtolower($tagtxt->text), 'incertae sedis') !== FALSE ||
895
		    stristr(strtolower($tagtxt->text), 'nomina excludenda') !== FALSE){
896
			var_dump('PREMIO');
897
			var_dump($element);
898
		}
899
	}
900
	*/
901

  
902 884
	if($node->children && is_array($node->children)){
903 885
		$out .= theme('cdm_taxontree', $node->children, $nextLevelIncluded, $show_filter_switch, $tree_node_callback);
904 886
	}
modules/cdm_dataportal/theme/cdm_dataportal.common.theme
12 12

  
13 13
define(FOOTNOTE_ANNOTATIONS, 'annotations');
14 14

  
15
function taxon_in_current_tree ($taxon_uuid) {
16
	$taxon_nodes = cdm_ws_get(CDM_WS_PORTAL_TAXON_TAXONNODES, $taxon_uuid);
17
	$taxon_in_current_tree = false;
18
	foreach($taxon_nodes as $node){
19
		if(get_taxonomictree_uuid_selected() == $node->taxonomicTree->uuid){
20
			$taxon_in_current_tree = true;
21
			break;
22
		}
23
	}
24
	return $taxon_in_current_tree;
25
}
15 26
/**
16 27
 * TODO if getting fragment from request is possible remove $_REQUEST['highlite'] HACK
17 28
 * NOT WORKING since fragments are not available to the server

Also available in: Unified diff