Revision 27b71dd0
Added by Francisco Revilla over 13 years ago
modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
15 | 15 |
|
16 | 16 |
require_once('node_types.php'); |
17 | 17 |
require_once('settings.php'); |
18 |
require_once('help.php'); |
|
18 | 19 |
|
19 | 20 |
require_once('theme/cdm_dataportal.common.theme'); |
20 | 21 |
require_once('theme/cdm_dataportal.descriptions.theme'); |
... | ... | |
30 | 31 |
require_once('classes/footnotekey.php'); |
31 | 32 |
require_once('classes/renderhints.php'); |
32 | 33 |
|
33 |
|
|
34 |
|
|
35 | 34 |
function _add_js_progressbar(){ |
36 | 35 |
drupal_add_js(drupal_get_path('module', 'cdm_dataportal').'/js/jquery.progressbar/js/jquery.progressbar.js'); |
37 | 36 |
} |
... | ... | |
125 | 124 |
|
126 | 125 |
/* ====================== hook implementations ====================== */ |
127 | 126 |
|
128 |
/** |
|
129 |
* Implementation of hook_help() |
|
130 |
* |
|
131 |
* Display help and module information |
|
132 |
* @param section which section of the site we're displaying help |
|
133 |
* @return help text for section |
|
134 |
*/ |
|
135 |
function cdm_dataportal_help($section='') { |
|
136 |
|
|
137 |
$out = ''; |
|
138 |
switch ($section) { |
|
139 |
case "admin/modules#description": |
|
140 |
$out = t("The dataportal publishes CDM data hosted in a CommunityStore on the web."); |
|
141 |
break; |
|
142 |
} |
|
143 |
return $out; |
|
144 |
} |
|
145 |
|
|
146 | 127 |
|
147 | 128 |
/** |
148 | 129 |
* Implementation of hook_perm() |
... | ... | |
166 | 147 |
$items = array(); |
167 | 148 |
|
168 | 149 |
cdm_dataportal_menu_admin($may_cache, $items); |
150 |
cdm_dataportal_menu_help($may_cache, $items); |
|
169 | 151 |
|
170 | 152 |
if ($may_cache) { |
171 | 153 |
|
... | ... | |
291 | 273 |
'callback' => 'cdm_dataportal_taxon_page_view', |
292 | 274 |
'access' => true, |
293 | 275 |
'type' => MENU_LOCAL_TASK, |
294 |
'weight' => 3,
|
|
295 |
'callback arguments' => array(arg(2), "synonymy") |
|
276 |
'weight' => 4,
|
|
277 |
'callback arguments' => array(arg(2), "synonymy", arg(4))
|
|
296 | 278 |
// expected callback arguments: name_uuid |
297 | 279 |
); |
298 |
|
|
299 | 280 |
$items[] = array( |
300 | 281 |
'path' => 'cdm_dataportal/taxon/'.arg(2).'/images', |
301 | 282 |
'title' => theme('cdm_taxonpage_tab', 'Images'), |
302 | 283 |
'callback' => 'cdm_dataportal_taxon_page_view', |
303 | 284 |
'access' => true, |
304 | 285 |
'type' => MENU_LOCAL_TASK, |
305 |
'weight' => 4,
|
|
286 |
'weight' => 5,
|
|
306 | 287 |
'callback arguments' => array(arg(2), "images") |
307 | 288 |
// expected callback arguments: name_uuid |
308 | 289 |
); |
... | ... | |
312 | 293 |
'callback' => 'cdm_dataportal_taxon_page_view', |
313 | 294 |
'access' => true, |
314 | 295 |
'type' => MENU_LOCAL_TASK, |
315 |
'weight' => 5,
|
|
296 |
'weight' => 6,
|
|
316 | 297 |
'callback arguments' => array(arg(2), "specimens") |
317 | 298 |
// expected callback arguments: name_uuid |
318 | 299 |
); |
319 |
|
|
320 | 300 |
} |
321 | 301 |
} |
322 | 302 |
|
... | ... | |
812 | 792 |
* valid values are: 'description', 'images', 'synonymy', 'specimens', 'all' |
813 | 793 |
* @return unknown_type |
814 | 794 |
*/ |
815 |
function cdm_dataportal_taxon_page_view($uuid, $chapter = 'all'){ |
|
795 |
function cdm_dataportal_taxon_page_view($uuid, $chapter = 'all', $synonym_uuid = null){
|
|
816 | 796 |
// display the page for the taxon defined by $uuid |
817 | 797 |
set_last_taxon_page_tab(arg(3)); |
818 |
$taxonpage = cdm_dataportal_taxon_view($uuid, $chapter); |
|
798 |
$taxonpage = cdm_dataportal_taxon_view($uuid, $chapter, $synonym_uuid);
|
|
819 | 799 |
return cdm_node_show(NODETYPE_TAXON, $uuid, $taxonpage->title , $taxonpage->content); |
820 | 800 |
} |
821 | 801 |
|
... | ... | |
825 | 805 |
* valid values are: 'description', 'images', 'synonymy', 'all' |
826 | 806 |
* @return unknown_type |
827 | 807 |
*/ |
828 |
function cdm_dataportal_taxon_view($uuid, $chapter = 'all'){ |
|
829 |
|
|
808 |
function cdm_dataportal_taxon_view($uuid, $chapter = 'all', $synonym_uuid = null){ |
|
830 | 809 |
$taxon = cdm_ws_get(CDM_WS_PORTAL_TAXON, $uuid); |
831 | 810 |
if(!$taxon){ |
832 | 811 |
drupal_set_title(t('Taxon does not exist')); |
833 | 812 |
return false; |
834 | 813 |
} |
835 |
$taxonpage->title = theme('cdm_taxon_page_title', $taxon); |
|
814 |
|
|
815 |
$taxonpage->title = theme('cdm_taxon_page_title', $taxon, $uuid, $synonym_uuid); |
|
836 | 816 |
|
837 | 817 |
// check if the taxon id contained in the currently selected tree |
838 | 818 |
$taxon_in_current_tree = taxon_in_current_tree($uuid); |
... | ... | |
1035 | 1015 |
return $result->Integer; |
1036 | 1016 |
} |
1037 | 1017 |
|
1038 |
function uri_to_synonym($synonymUuid, $acceptedUuid, $pagePart = null){ |
|
1018 |
function theme_cdm_uri_to_synonym($synonymUuid, $acceptedUuid, $pagePart = null){
|
|
1039 | 1019 |
$acceptedPath = path_to_taxon($acceptedUuid); |
1040 | 1020 |
return url($acceptedPath.($pagePart ? '/'.$pagePart : ''), 'highlite='.$synonymUuid.'&acceptedFor='.$synonymUuid, $synonymUuid); |
1041 | 1021 |
} |
Also available in: Unified diff
adding palmae synonymy highlites, palame synonym of at the heading and moudle help system