Revision 2ffe4d59
Added by Andreas Kohlbecker almost 5 years ago
modules/cdm_dataportal/theme/cdm_dataportal.references.theme | ||
---|---|---|
26 | 26 |
* An associative array containing: |
27 | 27 |
* - reference |
28 | 28 |
* - microReference |
29 |
* - doLink: |
|
30 |
* Whether to create a link to the reference page, links to the reference URI or DOI are always |
|
29 |
* - doTextLink: |
|
30 |
* Show the citation string as link to the reference page. This option does not affect links to the reference URI or DOI. |
|
31 |
* These links are always created when this data is available |
|
32 |
* - doIconLink: |
|
33 |
* Append an icon to the citation string which links to the reference page, links to the reference URI or DOI are always |
|
31 | 34 |
* created when this data is available |
32 | 35 |
* - referenceStyle: the value "zoology" will cause a specific rendeting of the |
33 | 36 |
* reference suitable for zoological publications. |
... | ... | |
40 | 43 |
function theme_cdm_reference($variables) { |
41 | 44 |
$reference = $variables['reference']; |
42 | 45 |
$microReference = $variables['microReference']; |
43 |
$doLink = $variables['doLink']; |
|
46 |
$doTextLink = $variables['doTextLink']; |
|
47 |
$doIconLink = $variables['doIconLink']; |
|
44 | 48 |
$referenceStyle = $variables['referenceStyle']; |
45 | 49 |
|
46 | 50 |
if (!isset($reference->authorship)) { |
... | ... | |
61 | 65 |
} |
62 | 66 |
|
63 | 67 |
$citation = trim($citation); |
64 |
if (isset($doLink) && $doLink === TRUE) {
|
|
68 |
if (isset($doTextLink) && $doTextLink === TRUE) {
|
|
65 | 69 |
$out = '<span class="reference">'; |
66 | 70 |
$out .= l($citation, path_to_reference($reference->uuid), array( |
67 | 71 |
'attributes' => array( |
... | ... | |
75 | 79 |
else { |
76 | 80 |
$out = '<span class="reference">' . $citation . '</span>'; |
77 | 81 |
} |
82 |
if((isset($doIconLink) && $doIconLink === TRUE)) { |
|
83 |
$out .= custom_icon_font_markup('e903'); |
|
84 |
} |
|
78 | 85 |
|
79 | 86 |
if (!empty($microReference)) { |
80 | 87 |
$out .= ": " . $microReference; |
... | ... | |
166 | 173 |
$out = theme('cdm_reference', array( |
167 | 174 |
'reference' => $source->citation, |
168 | 175 |
'microReference' => $source->citationMicroReference, |
169 |
'doLink' => $do_link_to_reference, |
|
176 |
'doIconLink' => $do_link_to_reference,
|
|
170 | 177 |
)); |
171 | 178 |
|
172 | 179 |
$name_in_source_render_array = compose_name_in_source($source, $do_link_to_name_used_in_source); |
Also available in: Unified diff
fix #8320 links to references as appended icon & custom icon font set