Revision 5885d957
Added by Andreas Kohlbecker over 11 years ago
7.x/themes/palmweb_2/template.php | ||
---|---|---|
18 | 18 |
* |
19 | 19 |
* @ingroup themeable |
20 | 20 |
*/ |
21 |
function palmweb_2_cdm_taxon_page_profile($variables) {
|
|
21 |
function palmweb_2_cdm_taxon_page_profile($variables){ |
|
22 | 22 |
|
23 | 23 |
$taxon = $variables['taxon']; |
24 | 24 |
$mergedTrees = $variables['mergedTrees']; |
... | ... | |
85 | 85 |
$annotationFootnoteKeys .= $separator; |
86 | 86 |
} |
87 | 87 |
*/ |
88 |
$out .= '<' . $enclosingTag . ' class="DescriptionElement DescriptionElement-' . $descriptionElement->class . '">'; |
|
89 |
// $out .= $descriptionElement->area->representation_L10n . $annotationFootnoteKeys . $sourcesFootnoteKeyList; |
|
90 |
$out .= $descriptionElement->area->representation_L10n; |
|
91 |
if (++$itemCnt < count($descriptionElements)) { |
|
92 |
$out .= $separator; |
|
93 |
} |
|
94 |
$out .= "</" . $enclosingTag . ">"; |
|
88 |
$out .= '<' . $enclosingTag . ' class="DescriptionElement DescriptionElement-' . $descriptionElement->class . '">';
|
|
89 |
// $out .= $descriptionElement->area->representation_L10n . $annotationFootnoteKeys . $sourcesFootnoteKeyList;
|
|
90 |
$out .= $descriptionElement->area->representation_L10n;
|
|
91 |
if (++$itemCnt < count($descriptionElements)) {
|
|
92 |
$out .= $separator;
|
|
93 |
}
|
|
94 |
$out .= "</" . $enclosingTag . ">";
|
|
95 | 95 |
} |
96 | 96 |
$taxonTrees = cdm_ws_get(CDM_WS_PORTAL_TAXONOMY); |
97 | 97 |
$reference = new stdClass(); |
... | ... | |
135 | 135 |
* @todo Please document this function. |
136 | 136 |
* @see http://drupal.org/node/1354 |
137 | 137 |
*/ |
138 |
function palmweb_2_cdm_feature_nodesTOC($variables) {
|
|
138 |
function palmweb_2_cdm_feature_nodesTOC($variables){ |
|
139 | 139 |
$featureNodes = $variables['featureNodes']; |
140 | 140 |
$out = ''; |
141 | 141 |
|
... | ... | |
143 | 143 |
|
144 | 144 |
$out .= '<ul>'; |
145 | 145 |
$countFeatures = 0; |
146 |
$numberOfChildren = count(cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON, array( |
|
146 |
$numberOfChildren = count(cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON, array (
|
|
147 | 147 |
get_taxonomictree_uuid_selected(), |
148 |
arg(2),
|
|
148 |
substr(strrchr($_GET["q"],'/'), 1),
|
|
149 | 149 |
))); |
150 | 150 |
if ($numberOfChildren != 0) { |
151 | 151 |
$out .= '<li>'; |
... | ... | |
172 | 172 |
$show_bibliography = variable_get('cdm_show_bibliography', 1); |
173 | 173 |
|
174 | 174 |
$markerTypes['markerTypes'] = UUID_MARKERTYPE_USE; |
175 |
$useDescriptions = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS, arg(2), queryString($markerTypes));
|
|
175 |
$useDescriptions = cdm_ws_get(CDM_WS_PORTAL_TAXON_DESCRIPTIONS, substr(strrchr($_GET["q"], '/'), 1), queryString($markerTypes));
|
|
176 | 176 |
if (!empty($useDescriptions)) { |
177 | 177 |
$out .= '<li>'; |
178 | 178 |
$out .= l(t(theme('cdm_feature_name', array('feature_name' => 'Uses'))), $_GET['q'], array( |
... | ... | |
193 | 193 |
* @todo Please document this function. |
194 | 194 |
* @see http://drupal.org/node/1354 |
195 | 195 |
*/ |
196 |
function palmweb_2_cdm_feature_nodes($variables) {
|
|
196 |
function palmweb_2_cdm_feature_nodes($variables){ |
|
197 | 197 |
$mergedFeatureNodes = $variables['mergedFeatureNodes']; |
198 | 198 |
$taxon = $variables['taxon']; |
199 | 199 |
|
... | ... | |
204 | 204 |
// Creating an array to place the description elements in. |
205 | 205 |
$bibliographyOut = array(); |
206 | 206 |
$countFeatures = 0; |
207 |
$numberOfChildren = count(cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON, array(get_taxonomictree_uuid_selected(), $taxon->uuid))); |
|
207 |
$numberOfChildren = count(cdm_ws_get(CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON, array (get_taxonomictree_uuid_selected(), $taxon->uuid)));
|
|
208 | 208 |
if ($taxon->name->rank->titleCache == "Genus") { |
209 | 209 |
$subRank = "species"; |
210 | 210 |
} |
... | ... | |
233 | 233 |
$countFeatures++; |
234 | 234 |
$countFeatures++; |
235 | 235 |
$block->delta = generalizeString($featureRepresentation); |
236 |
$block->subject = '<span class="' . html_class_atttibute_ref($node->feature) . '">' . theme('cdm_feature_name', array('feature_name' => $featureRepresentation)) . '</span>'; |
|
236 |
$block->subject = '<span class="' . html_class_atttibute_ref($node->feature) . '">' . theme('cdm_feature_name', array('feature_name' => $featureRepresentation)) . '</span>';
|
|
237 | 237 |
$block->module = "cdm_dataportal-feature"; |
238 | 238 |
$block->content = ''; |
239 | 239 |
|
... | ... | |
281 | 281 |
// TODO why is theme_cdm_descriptionElement_CommonTaxonName |
282 | 282 |
// not beeing used??? |
283 | 283 |
$block->content .= theme('cdm_common_names', array('elements' => $node->descriptionElements)); |
284 |
/* Disabled
|
|
285 |
}else if($node->feature->uuid == UUID_IMAGE_SOURCES) {
|
|
286 |
$block->content .= theme('cdm_image_sources', $node->descriptionElements);
|
|
287 |
*/
|
|
284 |
/*
|
|
285 |
}else if($node->feature->uuid == UUID_IMAGE_SOURCES) { |
|
286 |
$block->content .= theme('cdm_image_sources', $node->descriptionElements); |
|
287 |
*/ |
|
288 | 288 |
} |
289 | 289 |
|
290 | 290 |
/* |
... | ... | |
314 | 314 |
// @see http://dev.e-taxonomy.eu/trac/ticket/2393/ |
315 | 315 |
$text = ''; |
316 | 316 |
foreach ($node->children as $child) { |
317 |
if (is_array($child->descriptionElements)) {
|
|
318 |
foreach ($child->descriptionElements as $element) {
|
|
319 |
|
|
320 |
if (is_array($element->media)) {
|
|
321 |
// Append media of subordinate elements to the list of
|
|
322 |
// main features.
|
|
323 |
$media_list = array_merge($media_list, $element->media);
|
|
324 |
}
|
|
325 |
|
|
326 |
$description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text);
|
|
327 |
// TODO use localized version of feature name, the locale must
|
|
328 |
// match the locale of the multilanguage text
|
|
329 |
// (http://dev.e-taxonomy.eu/trac/ticket/2394).
|
|
330 |
$description = str_replace($element->feature->titleCache, '<em>' . $element->feature->titleCache . '</em>', $description);
|
|
331 |
}
|
|
332 |
$text .= " " . $description;
|
|
333 |
$description = '';
|
|
334 |
}
|
|
317 |
if (is_array($child->descriptionElements)) { |
|
318 |
foreach ($child->descriptionElements as $element) { |
|
319 |
|
|
320 |
if (is_array($element->media)) { |
|
321 |
// Append media of subordinate elements to the list of |
|
322 |
// main features. |
|
323 |
$media_list = array_merge($media_list, $element->media); |
|
324 |
} |
|
325 |
|
|
326 |
$description = str_replace("\n", "<br/>", $element->multilanguageText_L10n->text); |
|
327 |
// TODO use localized version of feature name, the locale must |
|
328 |
// match the locale of the multilanguage text |
|
329 |
// (http://dev.e-taxonomy.eu/trac/ticket/2394). |
|
330 |
$description = str_replace($element->feature->titleCache, '<em>' . $element->feature->titleCache . '</em>', $description); |
|
331 |
} |
|
332 |
$text .= " " . $description; |
|
333 |
$description = ''; |
|
334 |
} |
|
335 | 335 |
} |
336 | 336 |
$block->content .= $text; |
337 | 337 |
} |
... | ... | |
360 | 360 |
$block->subject = '<a name="' . $block->delta . '"></a>' . $block->subject; |
361 | 361 |
|
362 | 362 |
$block->region = FALSE; |
363 |
$out .= theme('block', array( |
|
364 |
'elements' => array( |
|
365 |
'#block' => $block, |
|
366 |
'#children' => $block->content, |
|
367 |
))); |
|
363 |
$out .= theme('block', array('elements' => array( |
|
364 |
'#block' => $block, |
|
365 |
'#children' => $block->content, |
|
366 |
))); |
|
368 | 367 |
} |
369 | 368 |
} |
370 | 369 |
} |
... | ... | |
391 | 390 |
$query_parameters = $variables['query_parameters']; |
392 | 391 |
$out = ''; |
393 | 392 |
|
394 |
// the $query_parameters must not conhatin the 'q' parameter |
|
395 |
// since this would conflict with the desired target $path |
|
396 |
unset($search_params['q']); |
|
397 |
|
|
398 |
// if the pager contains records of SearchResults, extract the taxa and use them a records instead |
|
399 |
if(isset($pager->records[0]) && $pager->records[0]->class=="SearchResult"){ |
|
400 |
$freetextSearchResults = $pager->records; |
|
401 |
$taxa = array(); |
|
402 |
foreach ($pager->records as $searchResult) { |
|
403 |
$taxa[] = &$searchResult->entity; |
|
404 |
} |
|
405 |
$pager->records = $taxa; |
|
406 |
} |
|
407 |
|
|
408 | 393 |
$showThumbnails = isset($_SESSION['pageoption']['searchtaxa']['showThumbnails']) ? $_SESSION['pageoption']['searchtaxa']['showThumbnails'] : 0; |
409 | 394 |
if (!is_numeric($showThumbnails)) { |
410 | 395 |
// AT RBG KEW - 14/11/2011 - Set the show thumbnails to 0 by default. |
... | ... | |
440 | 425 |
// AT RBG KEW - 14/11/2011 - Changed the wording of the Show Thumbnails |
441 | 426 |
// tickbox text. |
442 | 427 |
$out .= '<div class="page_options">'; |
443 |
if($_REQUEST['ws'] && cdm_dataportal_search_form_path_for_ws($_REQUEST['ws'])){ |
|
444 |
$out .= '<div id="backButton">' . l("Modify search", cdm_dataportal_search_form_path_for_ws($_REQUEST['ws'])) . '</div>'; |
|
445 |
} |
|
446 | 428 |
$out .= '<form name="pageoptions">'; |
447 | 429 |
$out .= '<input id="showThumbnails" type="checkbox" name="showThumbnails" '; |
448 | 430 |
$out .= $showThumbnails == 1 ? 'checked="checked"' : ''; |
449 | 431 |
$out .= '> ' . t('Show Image Thumbnails') . '</form></div>'; |
450 | 432 |
if (!empty($pager) && count($pager->records) > 0) { |
451 | 433 |
$out .= '<div id="search_results">'; |
452 |
$out .= theme('cdm_list_of_taxa', $pager->records, $freetextSearchResults);
|
|
453 |
$out .= '</div>';
|
|
454 |
$out .= theme('cdm_pager', array(
|
|
455 |
'pager' => $pager,
|
|
456 |
'path' => $path,
|
|
457 |
'parameters' => $query_parameters,
|
|
434 |
$out .= theme('cdm_list_of_taxa', array('records' => $pager->records));
|
|
435 |
$out .= '</div>'; |
|
436 |
$out .= theme('cdm_pager', array( |
|
437 |
'pager' => $pager, |
|
438 |
'path' => $path, |
|
439 |
'parameters' => $query_parameters, |
|
458 | 440 |
)); |
459 | 441 |
} |
460 | 442 |
else { |
Also available in: Unified diff
recovering palmweb template.php from broken merge and reintregrate