Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdm-dataportal / modules / cdm_dataportal / theme / cdm_dataportal.references.theme @ 806baeb2

History | View | Annotate | Download (1.5 KB)

1
<?php
2
// $Id$
3

    
4
/**
5
* Copyright (C) 2007 EDIT
6
* European Distributed Institute of Taxonomy 
7
* http://www.e-taxonomy.eu
8
* 
9
* The contents of this file are subject to the Mozilla Public License Version 1.1
10
* See http://www.mozilla.org/MPL/MPL-1.1.html for the full license terms.
11
*/
12

    
13
function theme_cdm_reference_pager($referencePager, $path, $parameters = array()){
14
	drupal_set_title(t('Bibliographic Index'));
15
	$out = '';
16
	if(count($referencePager->records) > 0){
17
		$out .= '<ul>';
18
		foreach($referencePager->records as $reference){
19
			$reference->fullCitation = $reference->titleCache; //FIXME remove hack for matching cdm entity to STO
20
			$out .= '<li>'.theme('cdm_reference', $reference, TRUE).'</li>';
21
		}
22
		$out .= '</ul>';
23
		$out .= theme('cdm_pager', $referencePager,  $path, $parameters);
24
	} else {
25
		$out = '<h4 class="error">Sorry, this page contains not entries.</h4>';
26
	}
27
	return $out;
28
}
29

    
30

    
31
/**
32
 * @deprecated ??
33
 */
34
function theme_cdm_reference($reference, $linkToReference = FALSE, $style = NULL ){
35

    
36
	if($style == "ZoologicalName"){
37
		$year = partialToYear($reference->datePublished->start);
38
		$citation = $reference->authorTeam->titleCache.($year ? ', '.$year : '');
39
	} else {
40
		$citation = $reference->titleCache;
41
	}
42
	if($linkToReference){
43
		return l('<span class="reference">'.$citation.'</span>', "/cdm_dataportal/reference/".$reference->uuid, array("class"=>"reference"), NULL, NULL, FALSE ,TRUE);
44
	} else {
45
		return '<span class="reference">'.$citation.'</span>';
46
	}
47
}
Add picture from clipboard (Maximum size: 40 MB)