Revision 80e0aa8e
Added by Andreas Kohlbecker about 14 years ago
modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
26 | 26 |
|
27 | 27 |
require_once('classes/footnotemanager.php'); |
28 | 28 |
require_once('classes/footnote.php'); |
29 |
require_once('classes/renderhints.php'); |
|
29 | 30 |
|
30 | 31 |
define('CDM_DATAPORTAL_SEARCH_ITEMS_ON_PAGE', 25); |
31 | 32 |
define('CDM_DATAPORTAL_NOMREF_IN_TITLE', 1); |
... | ... | |
661 | 662 |
// '#multiple' => false |
662 | 663 |
// ); |
663 | 664 |
|
664 |
$taxonTrees = cdm_ws_get(CDM_WS_TAXONOMY); |
|
665 |
$taxonTrees = cdm_ws_get(CDM_WS_PORTAL_TAXONOMY);
|
|
665 | 666 |
foreach($taxonTrees as $tree){ |
666 | 667 |
$taxonomicTreeOptions[$tree->uuid] = $tree->titleCache; |
667 | 668 |
} |
... | ... | |
991 | 992 |
'#description' => t('Select a taxonomic view for this webservice.') |
992 | 993 |
); |
993 | 994 |
|
994 |
$taxonTrees = cdm_ws_get(CDM_WS_TAXONOMY); |
|
995 |
$taxonTrees = cdm_ws_get(CDM_WS_PORTAL_TAXONOMY);
|
|
995 | 996 |
foreach($taxonTrees as $tree){ |
996 | 997 |
$taxonomicTreeOptions[$tree->uuid] = $tree->titleCache; |
997 | 998 |
} |
... | ... | |
1026 | 1027 |
$request_params['doTaxa'] = 1; |
1027 | 1028 |
$request_params['doSynonyms'] = 0; |
1028 | 1029 |
$request_params['doTaxaByCommonNames'] = 0; |
1029 |
$search_url = cdm_compose_url(CDM_WS_FIND_TAXA, null, queryString($request_params));
|
|
1030 |
$search_url = cdm_compose_url(CDM_WS_PORTAL_TAXON_FIND, null, queryString($request_params));
|
|
1030 | 1031 |
$search_url = uri_uriByProxy($search_url); |
1031 | 1032 |
$taxon_page_url = url('cdm_dataportal/taxon/'); |
1032 | 1033 |
|
... | ... | |
1114 | 1115 |
'onlyAccepted' => $onlyAccepted, |
1115 | 1116 |
'pagesize' => 20 /*$_SESSION['cdm']['namelist_pagesize'] */); |
1116 | 1117 |
|
1117 |
$taxonPager = cdm_ws_find(CDM_WS_FIND_TAXA, $request_params);
|
|
1118 |
$taxonPager = cdm_ws_find(CDM_WS_PORTAL_TAXON_FIND, $request_params);
|
|
1118 | 1119 |
/* |
1119 | 1120 |
* FIXME the filter for accepted names will be a form element, thus this widget |
1120 | 1121 |
* should be generated via form api preferably as block |
... | ... | |
1136 | 1137 |
} |
1137 | 1138 |
|
1138 | 1139 |
function cdm_dataportal_view_media($mediaUuid, $mediarepresentation_uuid = false, $part = 0){ |
1139 |
$media = cdm_ws_get(CDM_WS_MEDIA, $mediaUuid); |
|
1140 |
$media = cdm_ws_get(CDM_WS_PORTAL_MEDIA, $mediaUuid);
|
|
1140 | 1141 |
return theme('cdm_media_page', $media, $mediarepresentation_uuid, $part); |
1141 | 1142 |
} |
1142 | 1143 |
|
... | ... | |
1168 | 1169 |
*/ |
1169 | 1170 |
function cdm_dataportal_taxon_view($uuid, $chapter = 'all'){ |
1170 | 1171 |
|
1171 |
$taxon = cdm_ws_get(CDM_WS_TAXON, $uuid); |
|
1172 |
$taxon = cdm_ws_get(CDM_WS_PORTAL_TAXON, $uuid);
|
|
1172 | 1173 |
if(!$taxon){ |
1173 | 1174 |
drupal_set_title(t('Taxon does not exist')); |
1174 | 1175 |
return false; |
... | ... | |
1249 | 1250 |
$_SESSION['cdm']['last_search'] = $_SERVER['REQUEST_URI']; |
1250 | 1251 |
|
1251 | 1252 |
$request_params = cdm_dataportal_search_form_request(); |
1252 |
$taxonPager = cdm_ws_get(CDM_WS_FIND_TAXA, null, queryString($request_params));
|
|
1253 |
$taxonPager = cdm_ws_get(CDM_WS_PORTAL_TAXON_FIND, null, queryString($request_params));
|
|
1253 | 1254 |
|
1254 | 1255 |
$search_params = $_REQUEST; |
1255 | 1256 |
unset($search_params['q']); |
... | ... | |
1522 | 1523 |
//TODO implement admin user interface to replace swicth statement |
1523 | 1524 |
// preliminar solution: using themes |
1524 | 1525 |
|
1525 |
$template = theme('get_nameRenderTemplate', $renderPath); |
|
1526 |
|
|
1526 |
$template = null; |
|
1527 |
// find best matching default RenderTemplate in theme |
|
1528 |
//echo "<br/><br/>".$renderPath; |
|
1529 |
while(!is_array($template) && strlen($renderPath) > 0){ |
|
1530 |
$template = theme('get_nameRenderTemplate', $renderPath); |
|
1531 |
$renderPath = substr($renderPath, 0, strrpos($renderPath, '.')); |
|
1532 |
// if(!is_array($template)){ |
|
1533 |
// echo "<br/>->".$renderPath; |
|
1534 |
// } |
|
1535 |
} |
|
1536 |
|
|
1537 |
// otherwise get default RenderTemplate from theme |
|
1538 |
if(!is_array($template)){ |
|
1539 |
$template = theme('get_nameRenderTemplate', '#DEFAULT'); |
|
1540 |
} |
|
1541 |
// otherwise get system default RenderTemplate |
|
1527 | 1542 |
if(!is_array($template)){ |
1528 | 1543 |
switch($renderPath){ |
1529 | 1544 |
case 'list_of_taxa': |
... | ... | |
1532 | 1547 |
case 'typedesignations': |
1533 | 1548 |
case 'taxon_page_title': |
1534 | 1549 |
case 'na': $template = array( |
1535 |
'namePart' => array('#uri'=>true),
|
|
1536 |
//'authorshipPart' => true, |
|
1537 |
); |
|
1538 |
break; |
|
1550 |
'namePart' => array('#uri'=>true),
|
|
1551 |
//'authorshipPart' => true,
|
|
1552 |
);
|
|
1553 |
break;
|
|
1539 | 1554 |
case 'nar': $template = array( |
1540 |
'namePart' => array('#uri'=>true),
|
|
1541 |
//'authorshipPart' => true, |
|
1542 |
'referencePart' => array('#uri'=>true),
|
|
1543 |
'microreferencePart' => true,
|
|
1544 |
); |
|
1545 |
break; |
|
1555 |
'namePart' => array('#uri'=>true),
|
|
1556 |
//'authorshipPart' => true,
|
|
1557 |
'referencePart' => array('#uri'=>true),
|
|
1558 |
'microreferencePart' => true,
|
|
1559 |
);
|
|
1560 |
break;
|
|
1546 | 1561 |
default: $template = array( |
1547 | 1562 |
'namePart' => array('#uri'=>true), |
1548 | 1563 |
'authorshipPart' => true, |
Also available in: Unified diff
improved general render mechanism + footnotes