Project

General

Profile

« Previous | Next » 

Revision 3d526ffb

Added by Andreas Kohlbecker over 12 years ago

fixing #2679 (Improve Concept Relationships for Dataportal)

View differences:

5.x/modules/cdm_dataportal/theme/cdm_dataportal.references.theme
36 36
 *
37 37
 */
38 38
function theme_cdm_reference($reference, $microReference = null, $doLink = FALSE, $referenceStyle = NULL ){
39
  global $theme_key; //TODO: implement in the palmae theme the concrete case
40
  $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $reference->uuid);
41 39

  
42
	if($style == "zoology"){
43
		$year = partialToYear($reference->datePublished->start);
44
		$citation = $author_team->titleCache . ($year ? '. '.$year : '');
45
	}else
46
	  //FIXME move palmweb specific lines to palweb theme !!!!
47
	if ($theme_key == 'palmweb_2') {
48
		$year = partialToYear($reference->datePublished->start);
49
    	$citation = short_form_of_author_team ($author_team->titleCache) . ($year ? '. '.$year : '');
50
    	$citation = str_replace('..', '.', $citation);
51
	} else {
52
		$citation = $reference->titleCache;
40
  $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $reference->uuid);
53 41

  
54
		//$year = partialToYear($reference->datePublished->start);
55
		//$citation = short_form_of_author_team ($author_team->titleCache) . ($year ? '. '.$year : '');
56
		//$citation = str_replace('..', '.', $citation);
57
	}
42
  if($referenceStyle == "zoology"){
43
  	$year = partialToYear($reference->datePublished->start);
44
  	$citation = $author_team->titleCache . ($year ? '. '.$year : '');
45
  } else {
46
  	$citation = $reference->titleCache;
47
  }
58 48

  
59
	if($doLink){
60
		$out = l('<span class="reference">'.$citation.'</span>'
49
  if($doLink){
50
  	$out = l('<span class="reference">'.$citation.'</span>'
61 51
          , path_to_reference($reference->uuid)
62 52
          , array("class"=>"reference")
63 53
          , NULL, NULL, FALSE ,TRUE);
64 54
    } else {
65
		$out = '<span class="reference">'.$citation.'</span>';
66
	}
67
    if(!empty($descriptionElementSource->citationMicroReference)){
68
        $out .= ': '. $descriptionElementSource->citationMicroReference;
69
     }
55
  	$out = '<span class="reference">'.$citation.'</span>';
56
  }
57

  
58
  //FIXME use microreference webservice instead
59
  if(!empty($descriptionElementSource->citationMicroReference)){
60
      $out .= ': '. $descriptionElementSource->citationMicroReference;
61
  }
70 62

  
71
    return $out;
63
  return $out;
72 64
}
73 65

  
74
function short_form_of_author_team ($author_team){
66
function _short_form_of_author_team ($author_team){
75 67

  
76 68
	$number_of_authors = substr_count($author_team, ' & ') + 1;
77 69
	//var_dump($author_team);

Also available in: Unified diff