Project

General

Profile

Download (1.88 KB) Statistics
| Branch: | Tag: | Revision:
1 806baeb2 Andreas Kohlbecker
<?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 48650990 Andreas Kohlbecker
			$out .= '<li>'.theme('cdm_reference', $reference, null, TRUE).'</li>';
21 806baeb2 Andreas Kohlbecker
		}
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 48650990 Andreas Kohlbecker
 * used by 
33
 *  - theme_cdm_typedesignations
34
 *  - theme_cdm_reference_pager
35
 *  - theme_cdm_taxonRelationships
36
 *  
37 806baeb2 Andreas Kohlbecker
 */
38 48650990 Andreas Kohlbecker
function theme_cdm_reference($reference, $microReference = null, $doLink = FALSE, $referenceStyle = NULL ){
39 806baeb2 Andreas Kohlbecker
40 15f11e83 f.revilla
  $author_team = cdm_ws_get(CDM_WS_REFERENCE_AUTHORTEAM, $reference->uuid);
41
42 48650990 Andreas Kohlbecker
	if($style == "zoology"){
43 806baeb2 Andreas Kohlbecker
		$year = partialToYear($reference->datePublished->start);
44 3147f061 f.revilla
		$citation = $author_team->titleCache . ($year ? ', '.$year : '');
45 806baeb2 Andreas Kohlbecker
	} else {
46 48650990 Andreas Kohlbecker
		$citation = $reference->titleCache;
47 806baeb2 Andreas Kohlbecker
	}
48 48650990 Andreas Kohlbecker
	if($doLink){
49
		$out = l('<span class="reference">'.$citation.'</span>'
50
          , path_to_reference($reference->uuid)
51
          , array("class"=>"reference")
52
          , NULL, NULL, FALSE ,TRUE);
53
    } else {
54
		$out = '<span class="reference">'.$citation.'</span>';
55 806baeb2 Andreas Kohlbecker
	}
56 48650990 Andreas Kohlbecker
    if(!empty($descriptionElementSource->citationMicroReference)){
57
        $out .= ': '. $descriptionElementSource->citationMicroReference;
58
     }
59 b5e773ef Andreas Kohlbecker
     
60
    return $out;
61 806baeb2 Andreas Kohlbecker
}