1 |
6961228f
|
n.hoffmann
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* The description page is supposed to be the front page for a taxon.
|
5 |
|
|
*
|
6 |
|
|
* @param TaxonTO $taxonTO
|
7 |
|
|
* @return
|
8 |
|
|
*/
|
9 |
f49828bb
|
Andreas Kohlbecker
|
function palmweb_2_cdm_taxon_page_description($taxon, $mergedTrees, $media, $hideImages = false){
|
10 |
|
|
|
11 |
0bd0589a
|
f.revilla
|
|
12 |
f49828bb
|
Andreas Kohlbecker
|
if(!$hideImages){
|
13 |
|
|
// preferred image
|
14 |
|
|
// hardcoded for testing;
|
15 |
46c6e199
|
Andreas Kohlbecker
|
$defaultRepresentationPart = false;
|
16 |
|
|
$defaultRepresentationPart->width = 184;
|
17 |
|
|
$defaultRepresentationPart->height = 144;
|
18 |
|
|
$defaultRepresentationPart->uri = drupal_get_path('theme', 'palmweb_2').'/images/no_picture.png';
|
19 |
|
|
|
20 |
d4c47227
|
Andreas Kohlbecker
|
// preferred image size 184px × 144
|
21 |
|
|
$imageMaxExtend = 184;
|
22 |
dc62aa28
|
Andreas Kohlbecker
|
$out .= '<div class="preferredImage">'.theme('cdm_preferredImage', $media, $defaultRepresentationPart, $imageMaxExtend).'</div>';
|
23 |
f49828bb
|
Andreas Kohlbecker
|
}
|
24 |
0bd0589a
|
f.revilla
|
|
25 |
|
|
// description TOC
|
26 |
24b09d7c
|
Andreas Kohlbecker
|
$out .= theme('cdm_featureTreeTOCs', $mergedTrees);
|
27 |
|
|
// description
|
28 |
|
|
$out .= theme('cdm_featureTrees', $mergedTrees, $taxon);
|
29 |
6961228f
|
n.hoffmann
|
|
30 |
|
|
return $out;
|
31 |
|
|
}
|
32 |
|
|
|
33 |
d4c47227
|
Andreas Kohlbecker
|
function _disabled_palmweb_2_cdm_taxon_page_images($taxon, $media){
|
34 |
856350fd
|
Andreas Kohlbecker
|
|
35 |
|
|
$flashLink = isset($media[0]);
|
36 |
6961228f
|
n.hoffmann
|
|
37 |
|
|
if($flashLink){
|
38 |
|
|
|
39 |
24b09d7c
|
Andreas Kohlbecker
|
$taggedName = $taxon->name->taggedName;
|
40 |
856350fd
|
Andreas Kohlbecker
|
|
41 |
6961228f
|
n.hoffmann
|
$nameArray = array();
|
42 |
|
|
foreach($taggedName as $taggedText){
|
43 |
856350fd
|
Andreas Kohlbecker
|
if($taggedText->type == 'name'){
|
44 |
24b09d7c
|
Andreas Kohlbecker
|
$nameArray[] = $taggedText->text;
|
45 |
6961228f
|
n.hoffmann
|
}
|
46 |
|
|
}
|
47 |
856350fd
|
Andreas Kohlbecker
|
|
48 |
fc20c836
|
Andreas Kohlbecker
|
$query = join("%5F", $nameArray) . '%20AND%20EditWP6%20AND%20jpg';
|
49 |
6961228f
|
n.hoffmann
|
|
50 |
|
|
$out = '
|
51 |
|
|
|
52 |
|
|
<script type="text/javascript" src="http://media.bgbm.org/erez/js/fsiwriter.js"></script>
|
53 |
|
|
|
54 |
|
|
<script type="text/javascript">
|
55 |
|
|
<!--
|
56 |
|
|
writeFlashCode( "http://media.bgbm.org/erez/fsi/fsi.swf?&cfg=showcase_presets/showcase_info.fsi&effects=%26quality%3D95&showcase_query='.$query.'&skin=silver&showcase_labeltextheight=50&textbox_textfrom=IPTC_WP6&textbox_height=50¶m_backgroundcolor=454343&publishwmode=opaque&showcase_hscroll=true&showcase_basecolor=454343&plugins=PrintSave,textbox",
|
57 |
|
|
"http://media.bgbm.org/erez/erez?src=erez-private/flashrequired.svg&tmp=Large&quality=97&width=500&height=323",
|
58 |
|
|
"width=500;height=323;bgcolor=454343;wmode=opaque");
|
59 |
|
|
// -->
|
60 |
|
|
</script>
|
61 |
|
|
<noscript>
|
62 |
|
|
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,65,0" width="500" height="323">
|
63 |
|
|
<param name="movie" value="http://media.bgbm.org/erez/fsi/fsi.swf?&cfg=showcase_presets/showcase_info.fsi&effects=%26quality%3D95&showcase_query='.$query.'&skin=silver&showcase_labeltextheight=50&textbox_textfrom=IPTC_WP6&textbox_height=50¶m_backgroundcolor=454343&publishwmode=opaque&showcase_hscroll=true&showcase_basecolor=454343plugins=PrintSave,textbox"/>
|
64 |
|
|
<param name="bgcolor" value="454343" />
|
65 |
|
|
<param name="wmode" value="opaque" />
|
66 |
|
|
<param name="allowscriptaccess" value="always" />
|
67 |
|
|
<param name="allowfullscreen" value="true" />
|
68 |
|
|
<param name="quality" value="high" />
|
69 |
|
|
<embed src="http://media.bgbm.org/erez/fsi/fsi.swf?&cfg=showcase_presets/showcase_info.fsi&effects=%26quality%3D95&showcase_query='.$query.'&skin=silver&showcase_labeltextheight=50&textbox_textfrom=IPTC_WP6&textbox_height=50¶m_backgroundcolor=454343&publishwmode=opaque&showcase_hscroll=true&showcase_basecolor=454343plugins=PrintSave,textbox"
|
70 |
|
|
width="500"
|
71 |
|
|
height="323"
|
72 |
|
|
bgcolor="454343"
|
73 |
|
|
wmode="opaque"
|
74 |
|
|
allowscriptaccess="always"
|
75 |
|
|
allowfullscreen="true"
|
76 |
|
|
quality="high"
|
77 |
|
|
type="application/x-shockwave-flash"
|
78 |
|
|
pluginspage="http://www.adobe.com/go/getflashplayer">
|
79 |
|
|
</embed>
|
80 |
|
|
</object>
|
81 |
|
|
|
82 |
|
|
</noscript>';
|
83 |
|
|
|
84 |
|
|
}else{
|
85 |
|
|
$out = 'No images available.';
|
86 |
|
|
|
87 |
|
|
}
|
88 |
|
|
return $out;
|
89 |
|
|
|
90 |
|
|
|
91 |
|
|
}
|
92 |
|
|
|
93 |
fbde64c6
|
Andreas Kohlbecker
|
function palmweb_2_cdm_descriptionElementDistribution($descriptionElements) {
|
94 |
|
|
|
95 |
|
|
$descriptions = '';
|
96 |
|
|
$separator = ', ';
|
97 |
b5e773ef
|
Andreas Kohlbecker
|
|
98 |
|
|
RenderHints::pushToRenderStack('descriptionElementDistribution');
|
99 |
|
|
RenderHints::setFootnoteListKey(UUID_DISTRIBUTION);
|
100 |
|
|
foreach($descriptionElements as $descriptionElement){
|
101 |
|
|
// annotations as footnotes
|
102 |
|
|
$annotationFootnoteKeys = theme('cdm_annotations_as_footnotekeys', $descriptionElement);
|
103 |
|
|
// // source references as footnotes
|
104 |
|
|
// $sourcesFootnoteKeyList = '';
|
105 |
|
|
// foreach($descriptionElement->sources as $source){
|
106 |
|
|
// $_fkey = FootnoteManager::addNewFootnote(UUID_DISTRIBUTION, theme('cdm_DescriptionElementSource', $source, false));
|
107 |
|
|
// $sourcesFootnoteKeyList .= theme('cdm_footnote_key', $_fkey, UUID_DISTRIBUTION, ($sourcesFootnoteKeyList ? $separator : ''));
|
108 |
|
|
// }
|
109 |
|
|
if($annotationFootnoteKeys && $sourcesFootnoteKeyList){
|
110 |
|
|
$annotationFootnoteKeys .= $separator;
|
111 |
|
|
}
|
112 |
|
|
$out .= $descriptionElement->area->representation_L10n . $annotationFootnoteKeys . $sourcesFootnoteKeyList . ' ';
|
113 |
|
|
}
|
114 |
|
|
|
115 |
fbde64c6
|
Andreas Kohlbecker
|
$descriptions = substr($descriptions, 0, strlen($descriptions)-2);
|
116 |
80e0aa8e
|
Andreas Kohlbecker
|
$taxonTrees = cdm_ws_get(CDM_WS_PORTAL_TAXONOMY);
|
117 |
fbde64c6
|
Andreas Kohlbecker
|
foreach($taxonTrees as $taxonTree){
|
118 |
|
|
if ($taxonTree -> uuid == variable_get('cdm_taxonomictree_uuid', FALSE)){
|
119 |
|
|
$reference = $taxonTree-> reference;
|
120 |
|
|
break;
|
121 |
|
|
}
|
122 |
|
|
}
|
123 |
|
|
$out = substr($out, 0, strlen($out)-strlen($separator) );
|
124 |
|
|
|
125 |
|
|
$referenceCitation = '('.l('<span class="reference">World Checklist of Monocotyledons</span>', path_to_reference($reference->uuid), array("class"=>"reference"), NULL, NULL, FALSE ,TRUE).')';
|
126 |
|
|
|
127 |
|
|
if($descriptions && strlen($descriptions) > 0 ){
|
128 |
|
|
$sourceRefs .= ' '.$referenceCitation;
|
129 |
|
|
}
|
130 |
|
|
|
131 |
|
|
if(strlen($sourceRefs) > 0){
|
132 |
|
|
$sourceRefs = '<span class="sources">' . $sourceRefs . '</span>';
|
133 |
|
|
}
|
134 |
b5e773ef
|
Andreas Kohlbecker
|
|
135 |
|
|
RenderHints::popFromRenderStack();
|
136 |
fbde64c6
|
Andreas Kohlbecker
|
return $descriptions. $sourceRefs ;
|
137 |
|
|
|
138 |
|
|
}
|
139 |
|
|
|
140 |
6961228f
|
n.hoffmann
|
|
141 |
|
|
/**
|
142 |
|
|
* Sets the body-tag class attribute.
|
143 |
|
|
*
|
144 |
|
|
* Adds 'sidebar-left', 'sidebar-right' or 'sidebars' classes as needed.
|
145 |
|
|
*/
|
146 |
|
|
function phptemplate_body_class($sidebar_left, $sidebar_right) {
|
147 |
|
|
if ($sidebar_left != '' && $sidebar_right != '') {
|
148 |
|
|
$class = 'sidebars';
|
149 |
|
|
}
|
150 |
|
|
else {
|
151 |
|
|
if ($sidebar_left != '') {
|
152 |
|
|
$class = 'sidebar-left';
|
153 |
|
|
}
|
154 |
|
|
if ($sidebar_right != '') {
|
155 |
|
|
$class = 'sidebar-right';
|
156 |
|
|
}
|
157 |
|
|
}
|
158 |
|
|
|
159 |
|
|
if (isset($class)) {
|
160 |
|
|
print ' class="'. $class .'"';
|
161 |
|
|
}
|
162 |
|
|
}
|
163 |
|
|
|
164 |
|
|
/**
|
165 |
|
|
* Return a themed breadcrumb trail.
|
166 |
|
|
*
|
167 |
|
|
* @param $breadcrumb
|
168 |
|
|
* An array containing the breadcrumb links.
|
169 |
|
|
* @return a string containing the breadcrumb output.
|
170 |
|
|
*/
|
171 |
|
|
function phptemplate_breadcrumb($breadcrumb) {
|
172 |
|
|
if (!empty($breadcrumb)) {
|
173 |
|
|
return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
|
174 |
|
|
}
|
175 |
|
|
}
|
176 |
|
|
|
177 |
|
|
/**
|
178 |
|
|
* Allow themable wrapping of all comments.
|
179 |
|
|
*/
|
180 |
|
|
function phptemplate_comment_wrapper($content, $type = null) {
|
181 |
|
|
static $node_type;
|
182 |
|
|
if (isset($type)) $node_type = $type;
|
183 |
|
|
|
184 |
|
|
if (!$content || $node_type == 'forum') {
|
185 |
|
|
return '<div id="comments">'. $content . '</div>';
|
186 |
|
|
}
|
187 |
|
|
else {
|
188 |
|
|
return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>';
|
189 |
|
|
}
|
190 |
|
|
}
|
191 |
|
|
|
192 |
|
|
/**
|
193 |
|
|
* Override or insert PHPTemplate variables into the templates.
|
194 |
|
|
*/
|
195 |
|
|
function _phptemplate_variables($hook, $vars) {
|
196 |
|
|
if ($hook == 'page') {
|
197 |
|
|
|
198 |
|
|
if ($secondary = menu_secondary_local_tasks()) {
|
199 |
|
|
$output = '<span class="clear"></span>';
|
200 |
|
|
$output .= "<ul class=\"tabs secondary\">\n". $secondary ."</ul>\n";
|
201 |
|
|
$vars['tabs2'] = $output;
|
202 |
|
|
}
|
203 |
|
|
|
204 |
|
|
// Hook into color.module
|
205 |
|
|
if (module_exists('color')) {
|
206 |
|
|
_color_page_alter($vars);
|
207 |
|
|
}
|
208 |
|
|
return $vars;
|
209 |
|
|
}
|
210 |
|
|
return array();
|
211 |
|
|
}
|
212 |
|
|
|
213 |
|
|
/**
|
214 |
|
|
* Returns the rendered local tasks. The default implementation renders
|
215 |
|
|
* them as tabs.
|
216 |
|
|
*
|
217 |
|
|
* @ingroup themeable
|
218 |
|
|
*/
|
219 |
|
|
function phptemplate_menu_local_tasks() {
|
220 |
|
|
$output = '';
|
221 |
|
|
|
222 |
|
|
if ($primary = menu_primary_local_tasks()) {
|
223 |
|
|
$output .= "<ul class=\"tabs primary\">\n". $primary ."</ul>\n";
|
224 |
|
|
}
|
225 |
|
|
|
226 |
|
|
return $output;
|
227 |
|
|
}
|
228 |
24b09d7c
|
Andreas Kohlbecker
|
|
229 |
9834a411
|
Andreas Kohlbecker
|
function palmweb_2_get_partDefinition($nameType){
|
230 |
24b09d7c
|
Andreas Kohlbecker
|
if($nameType == 'BotanicalName'){
|
231 |
|
|
return array(
|
232 |
|
|
'namePart' => array(
|
233 |
8a60c8fc
|
Andreas Kohlbecker
|
'name' => true,
|
234 |
f49828bb
|
Andreas Kohlbecker
|
'authors' => true,
|
235 |
24b09d7c
|
Andreas Kohlbecker
|
),
|
236 |
8a60c8fc
|
Andreas Kohlbecker
|
'authorshipPart' => array(
|
237 |
|
|
),
|
238 |
24b09d7c
|
Andreas Kohlbecker
|
'referencePart' => array(
|
239 |
f49828bb
|
Andreas Kohlbecker
|
'reference' => true,
|
240 |
|
|
'microreference' => true
|
241 |
24b09d7c
|
Andreas Kohlbecker
|
),
|
242 |
|
|
'statusPart' => array(
|
243 |
|
|
'status' => true,
|
244 |
|
|
),
|
245 |
|
|
'descriptionPart' => array(
|
246 |
|
|
'description' => true,
|
247 |
|
|
),
|
248 |
|
|
);
|
249 |
|
|
}
|
250 |
|
|
return false;
|
251 |
|
|
}
|
252 |
|
|
|
253 |
9834a411
|
Andreas Kohlbecker
|
function palmweb_2_get_nameRenderTemplate($renderPath){
|
254 |
24b09d7c
|
Andreas Kohlbecker
|
|
255 |
|
|
switch($renderPath) {
|
256 |
|
|
case 'acceptedFor':
|
257 |
|
|
$template = array(
|
258 |
8a60c8fc
|
Andreas Kohlbecker
|
'namePart' => array('#uri'=>true),
|
259 |
24b09d7c
|
Andreas Kohlbecker
|
);
|
260 |
|
|
break;
|
261 |
a7285d8e
|
Andreas Kohlbecker
|
case 'typedesignations':
|
262 |
|
|
$template = array(
|
263 |
|
|
'namePart' => array('#uri'=>true),
|
264 |
|
|
'referencePart' => true
|
265 |
|
|
);
|
266 |
24b09d7c
|
Andreas Kohlbecker
|
case 'taxon_page_title':
|
267 |
|
|
case 'list_of_taxa':
|
268 |
|
|
case 'taxon_page_synonymy':
|
269 |
434d8550
|
Andreas Kohlbecker
|
case 'related_taxon':
|
270 |
80e0aa8e
|
Andreas Kohlbecker
|
case '#DEFAULT':
|
271 |
24b09d7c
|
Andreas Kohlbecker
|
$template = array(
|
272 |
8a60c8fc
|
Andreas Kohlbecker
|
'namePart' => array('#uri'=>true),
|
273 |
a7285d8e
|
Andreas Kohlbecker
|
'referencePart' => true,
|
274 |
24b09d7c
|
Andreas Kohlbecker
|
'descriptionPart' => true
|
275 |
|
|
);
|
276 |
|
|
}
|
277 |
|
|
return $template;
|
278 |
|
|
}
|
279 |
a5c9b2cf
|
f.revilla
|
|
280 |
|
|
function palmweb_2_cdm_feature_name($feature_name){
|
281 |
|
|
switch($feature_name){
|
282 |
|
|
case "Protologue": return t("Original Publication");
|
283 |
|
|
default: return t(ucfirst($feature_name));
|
284 |
|
|
}
|
285 |
|
|
}
|