Project

General

Profile

« Previous | Next » 

Revision 47598ec2

Added by Francisco Revilla almost 14 years ago

added "et al." to descriptions references

View differences:

modules/cdm_dataportal/theme/cdm_dataportal.references.theme
41 41

  
42 42
	if($style == "zoology"){
43 43
		$year = partialToYear($reference->datePublished->start);
44
		$citation = $author_team->titleCache . ($year ? ', '.$year : '');
44
		$citation = $author_team->titleCache . ($year ? '. '.$year : '');
45 45
	} else {
46
		$citation = $reference->titleCache;
46
		//$citation = $reference->titleCache;
47
		$year = partialToYear($reference->datePublished->start);
48
		$citation = short_form_of_author_team ($author_team->titleCache) . ($year ? '. '.$year : '');
49
		$citation = str_replace('..', '.', $citation);
47 50
	}
51

  
48 52
	if($doLink){
49 53
		$out = l('<span class="reference">'.$citation.'</span>'
50 54
          , path_to_reference($reference->uuid)
......
59 63
     
60 64
    return $out;
61 65
}
66

  
67
function short_form_of_author_team ($author_team){
68
	$number_of_authors = substr_count($author_team, ' & ') + 1;
69
	switch ($number_of_authors) {
70
		case 1:
71
			break;
72
		case 2:
73
			$result = str_replace(' & ', ' and ', $author_team);
74
			break;
75
		default:
76
			$result_parts = explode(' & ', $author_team);
77
      $result = $result_parts[0] . ' et al.';	  
78
	}
79
	return $result;
80
}

Also available in: Unified diff