1
|
<?php
|
2
|
// $Id: ext_links.module,v 1.3.4.5.2.10.2.5 2008/09/26 11:58:24 niif Exp $
|
3
|
|
4
|
/**
|
5
|
* @file
|
6
|
* Provides external links for sources to taxa information
|
7
|
*/
|
8
|
|
9
|
/**
|
10
|
* Display help and module information
|
11
|
* @param path which path of the site we're displaying help
|
12
|
* @param arg array that holds the current path as would be returned from arg() function
|
13
|
* @return help text for the path
|
14
|
*/
|
15
|
function ext_links_help($section) {
|
16
|
$output = '';
|
17
|
switch ($section) {
|
18
|
case 'admin/help#ext_links':
|
19
|
//TODO
|
20
|
$output = '<p>'. t("Link to external sources like ## for taxa.") .'</p>';
|
21
|
break;
|
22
|
}
|
23
|
return $output;
|
24
|
} // function ext_links_help
|
25
|
|
26
|
/**
|
27
|
* Generate the HTML text for the ext_link login block
|
28
|
* @param op the operation from the URL
|
29
|
* @param delta offset
|
30
|
* @returns block HTML
|
31
|
*/
|
32
|
function ext_links_admin() {
|
33
|
global $ext_links_default;
|
34
|
$ext_links[0] = array(
|
35
|
'form' => 'gbif',
|
36
|
'form_title' => 'GBIF',
|
37
|
'check_title' => 'GBIF',
|
38
|
'link_title' => 'GBIF link',
|
39
|
'link_description' => 'The link to GBIF without the taxon name.',
|
40
|
'concat_default_value' => ' ',
|
41
|
'text_title' => 'GBIF text',
|
42
|
'text_description' => 'The text of the link that is displayed..',
|
43
|
'category' => 'Category',
|
44
|
);
|
45
|
$ext_links[1] = array(
|
46
|
'form' => 'biocase',
|
47
|
'form_title' => 'BioCASE',
|
48
|
'check_title' => 'Display BioCASE link?',
|
49
|
'link_title' => 'BioCASE link',
|
50
|
'link_description' => 'The link to BioCASE without the taxon name.',
|
51
|
'concat_default_value' => ' ',
|
52
|
'text_title' => 'BioCASE text',
|
53
|
'text_description' => 'The text of the link that is displayed..',
|
54
|
'category' => 'Category',
|
55
|
);
|
56
|
$ext_links[2] = array(
|
57
|
'form' => 'nybg',
|
58
|
'form_title' => 'The New York Botanical Garden',
|
59
|
'check_title' => 'Display NYBG link?',
|
60
|
'link_title' => 'NYBG link',
|
61
|
'link_description' => 'The link to NCBI without the taxon name.',
|
62
|
'concat_default_value' => ' ',
|
63
|
'text_title' => 'NYBG text',
|
64
|
'text_description' => 'The text of the link that is displayed..',
|
65
|
'category' => 'Category',
|
66
|
);
|
67
|
$ext_links[3] = array(
|
68
|
'form' => 'tropicos',
|
69
|
'form_title' => 'Tropicos',
|
70
|
'check_title' => 'Display Tropicos link?',
|
71
|
'link_title' => 'Tropicos link',
|
72
|
'link_description' => 'The link to Tropicos without the taxon name.',
|
73
|
'concat_default_value' => '+',
|
74
|
'text_title' => 'Tropicos text',
|
75
|
'text_description' => 'The text of the link that is displayed..',
|
76
|
'category' => 'Category',
|
77
|
);
|
78
|
$ext_links[4] = array(
|
79
|
'form' => 'ncbi',
|
80
|
'form_title' => 'NCBI',
|
81
|
'check_title' => 'Display NCBI link?',
|
82
|
'link_title' => 'NCBI link',
|
83
|
'link_description' => 'The link to NCBI without the taxon name.',
|
84
|
'concat_default_value' => '+AND+',
|
85
|
'text_title' => 'NCBI text',
|
86
|
'text_description' => 'The text of the link that is displayed..',
|
87
|
'category' => 'Category',
|
88
|
);
|
89
|
$ext_links[5] = array(
|
90
|
'form' => 'google',
|
91
|
'form_title' => 'Google Images',
|
92
|
'check_title' => 'Display Google Images link?',
|
93
|
'link_title' => 'Google Images link',
|
94
|
'link_description' => 'The link to Google Images without the taxon name.',
|
95
|
'concat_default_value' => '+',
|
96
|
'text_title' => 'Google Images text',
|
97
|
'text_description' => 'The text of the link that is displayed..',
|
98
|
'category' => 'Category',
|
99
|
);
|
100
|
$ext_links[6] = array(
|
101
|
'form' => 'flickr',
|
102
|
'form_title' => 'flickr',
|
103
|
'check_title' => 'Display flickr link?',
|
104
|
'link_title' => 'flickr link',
|
105
|
'link_description' => 'The link to flickr without the taxon name.',
|
106
|
'concat_default_value' => '+',
|
107
|
'text_title' => 'flickr text',
|
108
|
'text_description' => 'The text of the link that is displayed..',
|
109
|
'category' => 'Category',
|
110
|
);
|
111
|
$ext_links[7] = array(
|
112
|
'form' => 'scholar',
|
113
|
'form_title' => 'Google scholar',
|
114
|
'check_title' => 'Display Google scholar link?',
|
115
|
'link_title' => 'Google scholar link',
|
116
|
'link_description' => 'The link to Google scholar without the taxon name.',
|
117
|
'concat_default_value' => '+',
|
118
|
'text_title' => 'Google scholar text',
|
119
|
'text_description' => 'The text of the link that is displayed..',
|
120
|
'category' => 'Category',
|
121
|
);
|
122
|
$ext_links[8] = array(
|
123
|
'form' => 'bhl',
|
124
|
'form_title' => 'Biodiversity Heritage Library (BHL)',
|
125
|
'check_title' => 'Display BHL link?',
|
126
|
'link_title' => 'BHL link',
|
127
|
'link_description' => 'The link to BHL without the taxon name.',
|
128
|
'concat_default_value' => ' ',
|
129
|
'text_title' => 'BHL text',
|
130
|
'text_description' => 'The text of the link that is displayed..',
|
131
|
'category' => 'Category',
|
132
|
);
|
133
|
$ext_links[9] = array(
|
134
|
'form' => 'arkive',
|
135
|
'form_title' => 'ARKive',
|
136
|
'check_title' => 'Display ARKive link?',
|
137
|
'link_title' => 'ARKive link',
|
138
|
'link_description' => 'The link to ARKive without the taxon name.',
|
139
|
'concat_default_value' => '+',
|
140
|
'text_title' => 'ARKive text',
|
141
|
'text_description' => 'The text of the link that is displayed..',
|
142
|
'category' => 'Category',
|
143
|
);
|
144
|
$ext_links[10] = array(
|
145
|
'form' => 'herbcat',
|
146
|
'form_title' => 'Kew Herbarium Catalogue',
|
147
|
'check_title' => 'Display Kew Herbarium Catalogue link?',
|
148
|
'link_title' => 'Kew Herbarium Catalogue link',
|
149
|
'link_description' => 'The link to Kew Herbarium Catalogue without the taxon name.',
|
150
|
'concat_default_value' => '+',
|
151
|
'text_title' => 'Kew Herbarium Catalogue text',
|
152
|
'text_description' => 'The text of the link that is displayed..',
|
153
|
'category' => 'Category',
|
154
|
);
|
155
|
$ext_links[11] = array(
|
156
|
'form' => 'iucn',
|
157
|
'form_title' => 'IUCN Red List',
|
158
|
'check_title' => 'Display IUCN Red List link?',
|
159
|
'link_title' => 'IUCN Red List link',
|
160
|
'link_description' => 'The link to IUCN Red List without the taxon name.',
|
161
|
'concat_default_value' => ' ',
|
162
|
'text_title' => 'IUCN Red List text',
|
163
|
'text_description' => 'The text of the link that is displayed..',
|
164
|
'category' => 'Category',
|
165
|
);
|
166
|
$ext_links[12] = array(
|
167
|
'form' => 'ipni',
|
168
|
'form_title' => 'IPNI',
|
169
|
'check_title' => 'Display IPNI link?',
|
170
|
'link_title' => 'IPNI link',
|
171
|
'link_description' => 'The link to IPNI without the taxon name.',
|
172
|
'concat_default_value' => '&',
|
173
|
'text_title' => 'IPNI text',
|
174
|
'text_description' => 'The text of the link that is displayed..',
|
175
|
'category' => 'Category',
|
176
|
);
|
177
|
$ext_links[13] = array(
|
178
|
'form' => 'wcsp',
|
179
|
'form_title' => 'World Checklist of Monocots',
|
180
|
'check_title' => 'Display World Checklist of Monocots link?',
|
181
|
'link_title' => 'World Checklist of Monocots link',
|
182
|
'link_description' => 'The link to World Checklist of Monocots without the taxon name.',
|
183
|
'concat_default_value' => ' ',
|
184
|
'text_title' => 'World Checklist of Monocots text',
|
185
|
'text_description' => 'The text of the link that is displayed..',
|
186
|
'category' => 'Category',
|
187
|
);
|
188
|
$ext_links[14] = array(
|
189
|
'form' => 'tpl',
|
190
|
'form_title' => 'The Plant List',
|
191
|
'check_title' => 'Display The Plant List link?',
|
192
|
'link_title' => 'The Plant List link',
|
193
|
'link_description' => 'The link to The Plant List without the taxon name.',
|
194
|
'concat_default_value' => '+',
|
195
|
'text_title' => 'The Plant List text',
|
196
|
'text_description' => 'The text of the link that is displayed..',
|
197
|
'category' => 'Category',
|
198
|
);
|
199
|
$ext_links[15] = array(
|
200
|
'form' => 'eol',
|
201
|
'form_title' => 'Encyclopaedia of Life',
|
202
|
'check_title' => 'Display Encyclopaedia of Life link?',
|
203
|
'link_title' => 'Encyclopaedia of Life link',
|
204
|
'link_description' => 'The link to Encyclopaedia of Life without the taxon name.',
|
205
|
'concat_default_value' => '+',
|
206
|
'text_title' => 'Encyclopaedia of Life text',
|
207
|
'text_description' => 'The text of the link that is displayed..',
|
208
|
'category' => 'Category',
|
209
|
);
|
210
|
$ext_links[16] = array(
|
211
|
'form' => 'jstor',
|
212
|
'form_title' => 'JSTOR Plant Science',
|
213
|
'check_title' => 'Display JSTOR Plant Science link?',
|
214
|
'link_title' => 'JSTOR Plant Science link',
|
215
|
'link_description' => 'The link to JSTOR Plant Science without the taxon name.',
|
216
|
'concat_default_value' => ' ',
|
217
|
'text_title' => 'JSTOR Plant Science text',
|
218
|
'text_description' => 'The text of the link that is displayed..',
|
219
|
'category' => 'Category',
|
220
|
);
|
221
|
$ext_links[17] = array(
|
222
|
'form' => 'epic',
|
223
|
'form_title' => 'ePIC',
|
224
|
'check_title' => 'Display ePIC link?',
|
225
|
'link_title' => 'ePIC link',
|
226
|
'link_description' => 'The link to ePIC without the taxon name.',
|
227
|
'concat_default_value' => '+',
|
228
|
'text_title' => 'ePIC text',
|
229
|
'text_description' => 'The text of the link that is displayed..',
|
230
|
'category' => 'Category',
|
231
|
);
|
232
|
$ext_links[18] = array(
|
233
|
'form' => 'fairchild',
|
234
|
'form_title' => 'Fairchild Guide To Palms',
|
235
|
'check_title' => 'Display Fairchild Guide To Palms link?',
|
236
|
'link_title' => 'Fairchild Guide To Palms link',
|
237
|
'link_description' => 'The link to Fairchild Guide To Palms without the taxon name.',
|
238
|
'concat_default_value' => '+',
|
239
|
'text_title' => 'Fairchild Guide To Palms text',
|
240
|
'text_description' => 'The text of the link that is displayed..',
|
241
|
'category' => 'Category',
|
242
|
);
|
243
|
|
244
|
|
245
|
for($i=0; $i<sizeof($ext_links); $i++){
|
246
|
$form[$ext_links[$i][form]] = array(
|
247
|
'#type' => 'fieldset',
|
248
|
'#title' => t($ext_links[$i][form_title]),
|
249
|
'#collapsible' => TRUE,
|
250
|
'#collapsed' => TRUE,
|
251
|
);
|
252
|
$form[$ext_links[$i][form]]['ext_links_'.$ext_links[$i][form].'_check'] = array(
|
253
|
'#type' => 'checkbox',
|
254
|
'#title' => t($ext_links[$i][check_title]),
|
255
|
'#default_value' => variable_get('ext_links_'.$ext_links[$i][form].'_check', 1),
|
256
|
);
|
257
|
$form[$ext_links[$i][form]]['ext_links_'.$ext_links[$i][form].'_link'] = array(
|
258
|
'#type' => 'textfield',
|
259
|
'#title' => t($ext_links[$i][link_title]),
|
260
|
'#default_value' => variable_get('ext_links_'.$ext_links[$i][form].'_link', $ext_links_default[$ext_links[$i][form]][link_default_value]),
|
261
|
'#size' => 70,
|
262
|
'#maxlength' => 255,
|
263
|
'#description' => t($ext_links[$i][link_description])
|
264
|
);
|
265
|
$form[$ext_links[$i][form]]['ext_links_'.$ext_links[$i][form].'_concat'] = array(
|
266
|
'#type' => 'textfield',
|
267
|
'#title' => t('Concatenate string'),
|
268
|
'#default_value' => variable_get('ext_links_'.$ext_links[$i][form].'_concat', $ext_links[$i][concat_default_value]),
|
269
|
'#size' => 70,
|
270
|
'#maxlength' => 255,
|
271
|
'#description' => t('Concatenate string between genus and species')
|
272
|
);
|
273
|
$form[$ext_links[$i][form]]['ext_links_'.$ext_links[$i][form].'_text'] = array(
|
274
|
'#type' => 'textfield',
|
275
|
'#title' => t($ext_links[$i][text_title]),
|
276
|
'#default_value' => variable_get('ext_links_'.$ext_links[$i][form].'_text', $ext_links_default[$ext_links[$i][form]][text_default_value]),
|
277
|
'#size' => 70,
|
278
|
'#maxlength' => 255,
|
279
|
'#description' => t($ext_links[$i][text_description])
|
280
|
);
|
281
|
$form[$ext_links[$i][form]]['ext_links_'.$ext_links[$i][form].'_category'] = array(
|
282
|
'#type' => 'textfield',
|
283
|
'#title' => t($ext_links[$i][category]),
|
284
|
'#default_value' => variable_get('ext_links_'.$ext_links[$i][form].'_category', $ext_links_default[$ext_links[$i][form]][category_default_value]),
|
285
|
'#size' => 70,
|
286
|
'#maxlength' => 255,
|
287
|
'#description' => t($ext_links[$i][category])
|
288
|
);
|
289
|
}
|
290
|
$form['ext_links_options'] = array(
|
291
|
'#type' => 'checkbox',
|
292
|
'#title' => t('Enable sorted list with headings'),
|
293
|
'#default_value' => variable_get('ext_links_options', 0),
|
294
|
'#prefix' => "<div class = \"sorted_list_option\"",
|
295
|
'#suffix' => "</div>",
|
296
|
);
|
297
|
|
298
|
return system_settings_form($form);
|
299
|
} // function ext_links_admin()
|
300
|
|
301
|
function ext_links_perm() {
|
302
|
|
303
|
return array('access extlinks content', 'administer extlinks');
|
304
|
|
305
|
} // function onthisdate_perm
|
306
|
|
307
|
/**
|
308
|
* Implementation of hook_menu().
|
309
|
*/
|
310
|
function ext_links_menu() {
|
311
|
|
312
|
// default values for the external links defined as global variables
|
313
|
global $ext_links_default;
|
314
|
$ext_links_default["gbif"] = array(
|
315
|
'link_default_value' => 'http://data.gbif.org/species/',
|
316
|
'text_default_value' => 'Search GBIF...',
|
317
|
'category_default_value' => 'Specimens/Occurrences',
|
318
|
);
|
319
|
$ext_links_default["biocase"] = array(
|
320
|
'link_default_value' => 'http://search.biocase.org/edit/search/units/simpleSearch/query1?unitName=',
|
321
|
'text_default_value' => 'Search BioCASE...',
|
322
|
'category_default_value' => 'Specimens/Occurrences',
|
323
|
);
|
324
|
$ext_links_default["nybg"] = array(
|
325
|
'link_default_value' => 'http://rbg-web2.rbge.org.uk/cgi-bin/nph-readbtree.pl/dataset=NYBG/filename=names3/firstval=1/multiaddr=/multiform=multisite3.php?ETI=',
|
326
|
'text_default_value' => 'Search NYBG...',
|
327
|
'category_default_value' => 'Specimens/Occurrences',
|
328
|
);
|
329
|
$ext_links_default["tropicos"] = array(
|
330
|
'link_default_value' => 'http://www.tropicos.org/NameSearch.aspx?name=',
|
331
|
'text_default_value' => 'Search Tropicos...',
|
332
|
'category_default_value' => 'Specimens/Occurrences',
|
333
|
);
|
334
|
$ext_links_default["ncbi"] = array(
|
335
|
'link_default_value' => 'http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi?term=',
|
336
|
'text_default_value' => 'Search NCBI...',
|
337
|
'category_default_value' => 'Molecular Resources',
|
338
|
);
|
339
|
$ext_links_default["google"] = array(
|
340
|
'link_default_value' => 'http://images.google.com/images?q=',
|
341
|
'text_default_value' => 'Search Google Images...',
|
342
|
'category_default_value' => 'Images',
|
343
|
);
|
344
|
$ext_links_default["flickr"] = array(
|
345
|
'link_default_value' => 'http://www.flickr.com/search/?w=all&q=',
|
346
|
'text_default_value' => 'Search flickr...',
|
347
|
'category_default_value' => 'Images',
|
348
|
);
|
349
|
$ext_links_default["scholar"] = array(
|
350
|
'link_default_value' => 'http://scholar.google.de/scholar?hl=de&btnG=Suche&lr=&as_ylo=&as_vis=0&q=',
|
351
|
'text_default_value' => 'Search Google scholar...',
|
352
|
'category_default_value' => 'Literature',
|
353
|
);
|
354
|
$ext_links_default["bhl"] = array(
|
355
|
'link_default_value' => 'http://www.biodiversitylibrary.org/Search.aspx?searchCat=&searchTerm=',
|
356
|
'text_default_value' => 'Search BHL...',
|
357
|
'category_default_value' => 'Literature',
|
358
|
);
|
359
|
$ext_links_default["arkive"] = array(
|
360
|
'link_default_value' => 'http://www.arkive.org/search.html?q=',
|
361
|
'text_default_value' => 'Search ARKive...',
|
362
|
'category_default_value' => 'Images',
|
363
|
);
|
364
|
$ext_links_default["herbcat"] = array(
|
365
|
'link_default_value' => 'http://apps.kew.org/herbcat/getHomePageResults.do?homePageSearchText=',
|
366
|
'text_default_value' => 'Search Kew Herbarium Catalogue...',
|
367
|
'category_default_value' => 'Specimens/Occurrences',
|
368
|
);
|
369
|
$ext_links_default["iucn"] = array(
|
370
|
'link_default_value' => 'http://www.iucnredlist.org/',
|
371
|
'text_default_value' => 'Go to IUCN Red List...',
|
372
|
'category_default_value' => 'Conservation',
|
373
|
);
|
374
|
$ext_links_default["ipni"] = array(
|
375
|
'link_default_value' => 'http://www.ipni.org/ipni/advPlantNameSearch.do?',
|
376
|
'text_default_value' => 'Search IPNI...',
|
377
|
'category_default_value' => 'Classification',
|
378
|
);
|
379
|
|
380
|
$ext_links_default["wcsp"] = array(
|
381
|
'link_default_value' => 'http://apps.kew.org/wcsp/prepareChecklist.do?checklist=monocots%40%40150290520121019541',
|
382
|
'text_default_value' => 'Search World Checklist Monocots...',
|
383
|
'category_default_value' => 'Classification',
|
384
|
);
|
385
|
$ext_links_default["tpl"] = array(
|
386
|
'link_default_value' => 'http://www.theplantlist.org/tpl/search?q=',
|
387
|
'text_default_value' => 'Search The Plant List...',
|
388
|
'category_default_value' => 'Classification',
|
389
|
);
|
390
|
$ext_links_default["eol"] = array(
|
391
|
'link_default_value' => 'http://eol.org/search/?q=',
|
392
|
'text_default_value' => 'Search Encyclopaedia of Life...',
|
393
|
'category_default_value' => 'General',
|
394
|
);
|
395
|
$ext_links_default["jstor"] = array(
|
396
|
'link_default_value' => 'http://plants.jstor.org/search?searchText=',
|
397
|
'text_default_value' => 'Search JSTOR Plant Science...',
|
398
|
'category_default_value' => 'General',
|
399
|
);
|
400
|
$ext_links_default["epic"] = array(
|
401
|
'link_default_value' => 'http://epic.kew.org/searchepic/summaryquery.do?scientificName=',
|
402
|
'text_default_value' => 'Search ePIC...',
|
403
|
'category_default_value' => 'General',
|
404
|
);
|
405
|
$ext_links_default["fairchild"] = array(
|
406
|
'link_default_value' => 'http://palmguide.org/palmsearch.php?query=',
|
407
|
'text_default_value' => 'Search Fairchild Guide To Palms...',
|
408
|
'category_default_value' => 'Specimens/Occurrences',
|
409
|
);
|
410
|
$items = array();
|
411
|
|
412
|
$items[] = array(
|
413
|
'path' => 'admin/settings/extlinks',
|
414
|
'title' => t('External links'),
|
415
|
'description' => t('Description of your External links'),
|
416
|
'callback' => 'drupal_get_form',
|
417
|
'callback arguments' => 'ext_links_admin',
|
418
|
'access' => user_access('access administration pages'),
|
419
|
'type' => MENU_NORMAL_ITEM,
|
420
|
);
|
421
|
|
422
|
return $items;
|
423
|
} // function ext_links_menu()
|
424
|
|
425
|
/**
|
426
|
* returns the genus and the first epithet from the object taxon
|
427
|
* @param $taxon
|
428
|
* @return unknown_type
|
429
|
*/
|
430
|
function getSpeciesName($taxon){
|
431
|
$speciesName = array();
|
432
|
$i = 0;
|
433
|
while(isset($taxon->name->taggedName[$i]) && !$speciesName[species]){
|
434
|
if($taxon->name->taggedName[$i]->type == "name"){
|
435
|
if(!isset($speciesName[genus]))
|
436
|
$speciesName[genus] = $taxon->name->taggedName[$i]->text;
|
437
|
else
|
438
|
$speciesName[species] = $taxon->name->taggedName[$i]->text;
|
439
|
}
|
440
|
$i++;
|
441
|
}
|
442
|
return $speciesName;
|
443
|
}
|
444
|
/**
|
445
|
* Generate the HTML text for the ext_link login block
|
446
|
* @param op the operation from the URL
|
447
|
* @param delta offset
|
448
|
* @returns block HTML
|
449
|
*/
|
450
|
function ext_links_block($op='list', $delta=0) {
|
451
|
// listing of blocks, such as on the admin/block page
|
452
|
global $ext_links_default;
|
453
|
$listOption = variable_get("ext_links_options", 0);
|
454
|
|
455
|
if ($op == "list"){
|
456
|
$block[0]["info"] = t("External Taxon Links");
|
457
|
return $block;
|
458
|
} else if ($op == 'view') {
|
459
|
switch($delta){
|
460
|
case 0:
|
461
|
$block['subject'] = 'External links';
|
462
|
|
463
|
if (arg(0)=="cdm_dataportal" && arg(1)=="taxon" && arg(2)!== 0){
|
464
|
$uuid = arg(2);
|
465
|
$taxon = cdm_ws_get(CDM_WS_PORTAL_TAXON, $uuid);
|
466
|
//var_dump($taxon);
|
467
|
//$taxon->titleCache;
|
468
|
//var_export()
|
469
|
if($taxon){
|
470
|
|
471
|
drupal_add_js(drupal_get_path('module', 'ext_links') . '/ext_links.js');
|
472
|
$speciesName = getSpeciesName($taxon);
|
473
|
$genus = $taxon->name->taggedName[0]->text;
|
474
|
$species = $taxon->name->taggedName[1]->text;
|
475
|
$block_content = '';
|
476
|
if($listOption) {
|
477
|
$block['content'] = theme('ext_links_list_grouped', $speciesName, $genus, $species);
|
478
|
}
|
479
|
else {
|
480
|
$block['content'] = theme('ext_links_list_plain', $speciesName, $genus, $species );
|
481
|
}
|
482
|
|
483
|
//if(variable_get('ext_links_gbif_check', true)) {
|
484
|
//$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_gbif_link', $ext_links_default[gbif][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_gbif_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]).'</a><br />';
|
485
|
/*
|
486
|
$block_content .= l(variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]),
|
487
|
'JavaScript:popupExternalLinks('.variable_get('ext_links_gbif_link', $ext_links_default[gbif][link_default_value]).$speciesName[genus].variable_get('ext_links_gbif_concat', ' ').$speciesName[species],
|
488
|
array(), null, null, true);
|
489
|
*/
|
490
|
/*}
|
491
|
if(variable_get('ext_links_biocase_check', 1)) {
|
492
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_biocase_link', $ext_links_default[biocase][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_biocase_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_biocase_text', $ext_links_default[biocase][text_default_value]).'</a><br />';
|
493
|
}
|
494
|
if(variable_get('ext_links_nybg_check', 1)) {
|
495
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_nybg_link', $ext_links_default[nybg][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_nybg_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_nybg_text', $ext_links_default[nybg][text_default_value]).'</a><br />';
|
496
|
}
|
497
|
if(variable_get('ext_links_tropicos_check', 1)) {
|
498
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_tropicos_link', $ext_links_default[tropicos][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_tropicos_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_tropicos_text', $ext_links_default[tropicos][text_default_value]).'</a><br />';
|
499
|
}
|
500
|
if(variable_get('ext_links_ncbi_check', 1)) {
|
501
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_ncbi_link', $ext_links_default[ncbi][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_ncbi_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_ncbi_text', $ext_links_default[ncbi][text_default_value]).'</a><br />';
|
502
|
}
|
503
|
if(variable_get('ext_links_google_check', 1)) {
|
504
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_google_link', $ext_links_default[google][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_google_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_google_text', $ext_links_default[google][text_default_value]).'</a><br />';
|
505
|
}
|
506
|
if(variable_get('ext_links_flickr_check', 1)) {
|
507
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_flickr_link', $ext_links_default[flickr][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_flickr_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_flickr_text', $ext_links_default[flickr][text_default_value]).'</a><br />';
|
508
|
}
|
509
|
if(variable_get('ext_links_scholar_check', 1)) {
|
510
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_scholar_link', $ext_links_default[scholar][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_scholar_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_scholar_text', $ext_links_default[scholar][text_default_value]).'</a><br />';
|
511
|
}
|
512
|
if(variable_get('ext_links_bhl_check', 1)) {
|
513
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_bhl_link', $ext_links_default[bhl][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_bhl_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_bhl_text', $ext_links_default[bhl][text_default_value]).'</a><br />';
|
514
|
}
|
515
|
|
516
|
$block['content'] = $block_content;
|
517
|
$block['content'] = theme('ext_links_list_plain');
|
518
|
|
519
|
|
520
|
|
521
|
}
|
522
|
|
523
|
}*/ // if taxon
|
524
|
}
|
525
|
}
|
526
|
return $block; // if path
|
527
|
} // switch
|
528
|
} // op ?
|
529
|
} // function ext_link_block()
|
530
|
|
531
|
function theme_ext_links_list_grouped($speciesName = null, $genus = null, $species=null) {
|
532
|
global $ext_links_default;
|
533
|
$block_content = '';
|
534
|
$categories = null;
|
535
|
|
536
|
|
537
|
|
538
|
/*foreach ($ext_links_default as $ext_link) {
|
539
|
|
540
|
//$block_content .= $ext_link['ext_links_bhl_category'];
|
541
|
$category[] = variable_get('ext_links_bhl_category', $ext_links_default[][text_default_value]);
|
542
|
$block_content .= variable_get('ext_links_bhl_category', $ext_links_default[][text_default_value]);
|
543
|
}*/
|
544
|
|
545
|
//images section
|
546
|
if(variable_get('ext_links_google_check', 1)) {
|
547
|
$categoryTitles[] = variable_get('ext_links_google_category', $ext_links_default[google][category_default_value]);
|
548
|
$categories['google']['title'] = variable_get('ext_links_google_category', $ext_links_default[google][category_default_value]);
|
549
|
$categories['google']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_google_link', $ext_links_default[google][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_google_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_google_text', $ext_links_default[google][text_default_value]).'</a><br />';
|
550
|
|
551
|
}
|
552
|
if(variable_get('ext_links_flickr_check', 1)) {
|
553
|
$categoryTitles[] = variable_get('ext_links_flickr_category', $ext_links_default[flickr][category_default_value]);
|
554
|
$categories['flickr']['title'] = variable_get('ext_links_flickr_category', $ext_links_default[flickr][category_default_value]);
|
555
|
$categories['flickr']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_flickr_link', $ext_links_default[flickr][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_flickr_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_flickr_text', $ext_links_default[flickr][text_default_value]).'</a><br />';
|
556
|
}
|
557
|
|
558
|
//Specimen/pccurences section
|
559
|
if(variable_get('ext_links_gbif_check', true)) {
|
560
|
$categoryTitles[] = variable_get('ext_links_gbif_category', $ext_links_default[gbif][category_default_value]);
|
561
|
$categories['gbif']['title'] = variable_get('ext_links_gbif_category', $ext_links_default[gbif][category_default_value]);
|
562
|
$categories['gbif']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_gbif_link', $ext_links_default[gbif][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_gbif_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]).'</a><br />';
|
563
|
}
|
564
|
if(variable_get('ext_links_biocase_check', 1)) {
|
565
|
$categoryTitles[] = variable_get('ext_links_biocase_category', $ext_links_default[biocase][category_default_value]);
|
566
|
$categories['biocase']['title'] = variable_get('ext_links_biocase_category', $ext_links_default[biocase][category_default_value]);
|
567
|
$categories['biocase']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_biocase_link', $ext_links_default[biocase][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_biocase_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_biocase_text', $ext_links_default[biocase][text_default_value]).'</a><br />';
|
568
|
}
|
569
|
if(variable_get('ext_links_nybg_check', 1)) {
|
570
|
$genusQuery = '';
|
571
|
$speciesQuery = '';
|
572
|
if($speciesName[genus] != null) {
|
573
|
$genusQuery = 'DetFiledAsGenusLocal+%3D+\%27'. $speciesName[genus]. '\%27';
|
574
|
}
|
575
|
if($speciesName[species] != null) {
|
576
|
$speciesQuery = 'DetFiledAsSpeciesLocal+%3D+\%27'. $speciesName[species] . '\%27';
|
577
|
}
|
578
|
$categoryTitles[] = variable_get('ext_links_nybg_category', $ext_links_default[nybg][category_default_value]);
|
579
|
$categories['nybg']['title'] = variable_get('ext_links_nybg_category', $ext_links_default[nybg][category_default_value]);
|
580
|
$categories['nybg']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_nybg_link', $ext_links_default[nybg][link_default_value]).$genusQuery.variable_get('ext_links_nybg_concat', '+AND+').$speciesQuery.'\')">'.variable_get('ext_links_nybg_text', $ext_links_default[nybg][text_default_value]).'</a><br />';
|
581
|
|
582
|
}
|
583
|
if(variable_get('ext_links_tropicos_check', 1)) {
|
584
|
$categoryTitles[] = variable_get('ext_links_tropicos_category', $ext_links_default[tropicos][category_default_value]);
|
585
|
$categories['tropicos']['title'] = variable_get('ext_links_tropicos_category', $ext_links_default[tropicos][category_default_value]);
|
586
|
$categories['tropicos']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_tropicos_link', $ext_links_default[tropicos][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_tropicos_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_tropicos_text', $ext_links_default[tropicos][text_default_value]).'</a><br />';
|
587
|
}
|
588
|
|
589
|
|
590
|
//Literature
|
591
|
if(variable_get('ext_links_scholar_check', 1)) {
|
592
|
$categoryTitles[] = variable_get('ext_links_scholar_category', $ext_links_default[scholar][category_default_value]);
|
593
|
$categories['scholar']['title'] = variable_get('ext_links_scholar_category', $ext_links_default[scholar][category_default_value]);
|
594
|
$categories['scholar']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_scholar_link', $ext_links_default[scholar][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_scholar_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_scholar_text', $ext_links_default[scholar][text_default_value]).'</a><br />';
|
595
|
}
|
596
|
if(variable_get('ext_links_bhl_check', 1)) {
|
597
|
$categoryTitles[] = variable_get('ext_links_bhl_category', $ext_links_default[bhl][category_default_value]);
|
598
|
$categories['bhl']['title'] = variable_get('ext_links_bhl_category', $ext_links_default[bhl][category_default_value]);
|
599
|
$categories['bhl']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_bhl_link', $ext_links_default[bhl][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_bhl_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_bhl_text', $ext_links_default[bhl][text_default_value]).'</a><br />';
|
600
|
}
|
601
|
|
602
|
|
603
|
//Molecular resources
|
604
|
if(variable_get('ext_links_ncbi_check', 1)) {
|
605
|
$categoryTitles[] = variable_get('ext_links_ncbi_category', $ext_links_default[ncbi][category_default_value]);
|
606
|
$categories['ncbi']['title'] = variable_get('ext_links_ncbi_category', $ext_links_default[ncbi][category_default_value]);
|
607
|
$categories['ncbi']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_ncbi_link', $ext_links_default[ncbi][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_ncbi_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_ncbi_text', $ext_links_default[ncbi][text_default_value]).'</a><br />';
|
608
|
|
609
|
}
|
610
|
if(variable_get('ext_links_arkive_check', 1)) {
|
611
|
$postURL = '&output=xml_no_dtd&client=arkive-images&site=arkive-images&ie=utf8&oe=utf8&num=20&proxystylesheet=tng-search&filter=0&getfields=*';
|
612
|
$categoryTitles[] = variable_get('ext_links_arkive_category', $ext_links_default[arkive][category_default_value]);
|
613
|
$categories['arkive']['title'] = variable_get('ext_links_arkive_category', $ext_links_default[arkive][category_default_value]);
|
614
|
$categories['arkive']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_arkive_link', $ext_links_default[arkive][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_arkive_concat', '+').str_replace('"','%22',$speciesName[species]). $postURL .'\')">'.variable_get('ext_links_arkive_text', $ext_links_default[arkive][text_default_value]).'</a><br />';
|
615
|
|
616
|
}
|
617
|
if(variable_get('ext_links_herbcat_check', 1)) {
|
618
|
$postURL = '&x=11&y=13&homePageSearchOption=scientific_name&nameOfSearchPage=home_page';
|
619
|
$categoryTitles[] = variable_get('ext_links_herbcat_category', $ext_links_default[herbcat][category_default_value]);
|
620
|
$categories['herbcat']['title'] = variable_get('ext_links_herbcat_category', $ext_links_default[herbcat][category_default_value]);
|
621
|
$categories['herbcat']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_herbcat_link', $ext_links_default[herbcat][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_herbcat_concat', '+').str_replace('"','%22',$speciesName[species]). $postURL .'\')">'.variable_get('ext_links_herbcat_text', $ext_links_default[herbcat][text_default_value]).'</a><br />';
|
622
|
|
623
|
}
|
624
|
if(variable_get('ext_links_iucn_check', 1)) {
|
625
|
$categoryTitles[] = variable_get('ext_links_iucn_category', $ext_links_default[iucn][category_default_value]);
|
626
|
$categories['iucn']['title'] = variable_get('ext_links_iucn_category', $ext_links_default[iucn][category_default_value]);
|
627
|
$categories['iucn']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_iucn_link', $ext_links_default[iucn][link_default_value]).'\')">'.variable_get('ext_links_iucn_text', $ext_links_default[iucn][text_default_value]).'</a><br />';
|
628
|
|
629
|
}
|
630
|
if(variable_get('ext_links_ipni_check', 1)) {
|
631
|
$genusQuery= 'find_genus=' . $speciesName[genus];
|
632
|
$speciesQuery='find_species=' . $speciesName[species];
|
633
|
$categoryTitles[] = variable_get('ext_links_ipni_category', $ext_links_default[ipni][category_default_value]);
|
634
|
$categories['ipni']['title'] = variable_get('ext_links_ipni_category', $ext_links_default[ipni][category_default_value]);
|
635
|
$categories['ipni']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_ipni_link', $ext_links_default[ipni][link_default_value]).$genusQuery.variable_get('ext_links_ipni_concat', '&').$speciesQuery . '\')">'.variable_get('ext_links_ipni_text', $ext_links_default[ipni][text_default_value]).'</a><br />';
|
636
|
}
|
637
|
if(variable_get('ext_links_wcsp_check', 1)) {
|
638
|
$categoryTitles[] = variable_get('ext_links_wcsp_category', $ext_links_default[wcsp][category_default_value]);
|
639
|
$categories['wcsp']['title'] = variable_get('ext_links_wcsp_category', $ext_links_default[wcsp][category_default_value]);
|
640
|
$categories['wcsp']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_wcsp_link', $ext_links_default[wcsp][link_default_value]).'\')">'.variable_get('ext_links_wcsp_text', $ext_links_default[wcsp][text_default_value]).'</a><br />';
|
641
|
|
642
|
}
|
643
|
if(variable_get('ext_links_tpl_check', 1)) {
|
644
|
$categoryTitles[] = variable_get('ext_links_tpl_category', $ext_links_default[tpl][category_default_value]);
|
645
|
$categories['tpl']['title'] = variable_get('ext_links_tpl_category', $ext_links_default[tpl][category_default_value]);
|
646
|
$categories['tpl']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_tpl_link', $ext_links_default[tpl][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_tpl_concat', '+').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_tpl_text', $ext_links_default[tpl][text_default_value]).'</a><br />';
|
647
|
}
|
648
|
if(variable_get('ext_links_eol_check', 1)) {
|
649
|
$categoryTitles[] = variable_get('ext_links_eol_category', $ext_links_default[eol][category_default_value]);
|
650
|
$categories['eol']['title'] = variable_get('ext_links_eol_category', $ext_links_default[eol][category_default_value]);
|
651
|
$categories['eol']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_eol_link', $ext_links_default[eol][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_eol_concat', '+').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_eol_text', $ext_links_default[eol][text_default_value]).'</a><br />';
|
652
|
}
|
653
|
if(variable_get('ext_links_jstor_check', 1)) {
|
654
|
$categoryTitles[] = variable_get('ext_links_jstor_category', $ext_links_default[jstor][category_default_value]);
|
655
|
$categories['jstor']['title'] = variable_get('ext_links_jstor_category', $ext_links_default[jstor][category_default_value]);
|
656
|
$categories['jstor']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_jstor_link', $ext_links_default[jstor][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_jstor_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_jstor_text', $ext_links_default[jstor][text_default_value]).'</a><br />';
|
657
|
}
|
658
|
if(variable_get('ext_links_epic_check', 1)) {
|
659
|
$postURL = '&searchAll=true&categories=names&categories=bibl&categories=colln&categories=taxon&categories=flora&Submit.x=0&Submit.y=0';
|
660
|
$categoryTitles[] = variable_get('ext_links_epic_category', $ext_links_default[epic][category_default_value]);
|
661
|
$categories['epic']['title'] = variable_get('ext_links_epic_category', $ext_links_default[epic][category_default_value]);
|
662
|
$categories['epic']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_epic_link', $ext_links_default[epic][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_epic_concat', '+').str_replace('"','%22',$speciesName[species]). $postURL . '\')">'.variable_get('ext_links_epic_text', $ext_links_default[epic][text_default_value]).'</a><br />';
|
663
|
}
|
664
|
if(variable_get('ext_links_fairchild_check', 1)) {
|
665
|
$categoryTitles[] = variable_get('ext_links_fairchild_category', $ext_links_default[fairchild][category_default_value]);
|
666
|
$categories['fairchild']['title'] = variable_get('ext_links_fairchild_category', $ext_links_default[fairchild][category_default_value]);
|
667
|
$categories['fairchild']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_fairchild_link', $ext_links_default[fairchild][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_fairchild_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_fairchild_text', $ext_links_default[fairchild][text_default_value]).'</a><br />';
|
668
|
|
669
|
}
|
670
|
|
671
|
$categoryTitles = array_unique($categoryTitles);
|
672
|
foreach ($categoryTitles as $categoryTitle) {
|
673
|
//$block_content .= "specName" . $speciesName;
|
674
|
$block_content .= "<div class=\"category\"><h5>" . $categoryTitle . "</h5>";
|
675
|
foreach ($categories as $category) {
|
676
|
if ($category['title'] == $categoryTitle){
|
677
|
$block_content .= $category['content'];
|
678
|
}
|
679
|
}
|
680
|
$block_content .= "</div>";
|
681
|
}
|
682
|
|
683
|
|
684
|
return $block_content;
|
685
|
}
|
686
|
|
687
|
function theme_ext_links_list_plain($speciesName = null, $genus = null, $species=null) {
|
688
|
global $ext_links_default;
|
689
|
$block_content = '';
|
690
|
if(variable_get('ext_links_gbif_check', true)) {
|
691
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_gbif_link', $ext_links_default[gbif][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_gbif_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]).'</a><br />';
|
692
|
/*
|
693
|
$block_content .= l(variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]),
|
694
|
'JavaScript:popupExternalLinks('.variable_get('ext_links_gbif_link', $ext_links_default[gbif][link_default_value]).$speciesName[genus].variable_get('ext_links_gbif_concat', ' ').$speciesName[species],
|
695
|
array(), null, null, true);
|
696
|
*/
|
697
|
}
|
698
|
if(variable_get('ext_links_biocase_check', 1)) {
|
699
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_biocase_link', $ext_links_default[biocase][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_biocase_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_biocase_text', $ext_links_default[biocase][text_default_value]).'</a><br />';
|
700
|
}
|
701
|
if(variable_get('ext_links_nybg_check', 1)) {
|
702
|
//$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_nybg_link', $ext_links_default[nybg][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_nybg_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_nybg_text', $ext_links_default[nybg][text_default_value]).'</a><br />';
|
703
|
$genusQuery = '';
|
704
|
$speciesQuery = '';
|
705
|
if($speciesName[genus] != null) {
|
706
|
$genusQuery = 'DetFiledAsGenusLocal+%3D+\%27'. $speciesName[genus]. '\%27';
|
707
|
}
|
708
|
if($speciesName[species] != null) {
|
709
|
$speciesQuery = 'DetFiledAsSpeciesLocal+%3D+\%27'. $speciesName[species] . '\%27';
|
710
|
}
|
711
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_nybg_link', $ext_links_default[nybg][link_default_value]).$genusQuery.variable_get('ext_links_nybg_concat', '+AND+').$speciesQuery.'\')">'.variable_get('ext_links_nybg_text', $ext_links_default[nybg][text_default_value]).'</a><br />';
|
712
|
}
|
713
|
if(variable_get('ext_links_tropicos_check', 1)) {
|
714
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_tropicos_link', $ext_links_default[tropicos][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_tropicos_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_tropicos_text', $ext_links_default[tropicos][text_default_value]).'</a><br />';
|
715
|
}
|
716
|
if(variable_get('ext_links_ncbi_check', 1)) {
|
717
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_ncbi_link', $ext_links_default[ncbi][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_ncbi_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_ncbi_text', $ext_links_default[ncbi][text_default_value]).'</a><br />';
|
718
|
}
|
719
|
if(variable_get('ext_links_google_check', 1)) {
|
720
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_google_link', $ext_links_default[google][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_google_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_google_text', $ext_links_default[google][text_default_value]).'</a><br />';
|
721
|
}
|
722
|
if(variable_get('ext_links_flickr_check', 1)) {
|
723
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_flickr_link', $ext_links_default[flickr][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_flickr_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_flickr_text', $ext_links_default[flickr][text_default_value]).'</a><br />';
|
724
|
}
|
725
|
if(variable_get('ext_links_scholar_check', 1)) {
|
726
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_scholar_link', $ext_links_default[scholar][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_scholar_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_scholar_text', $ext_links_default[scholar][text_default_value]).'</a><br />';
|
727
|
}
|
728
|
if(variable_get('ext_links_bhl_check', 1)) {
|
729
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_bhl_link', $ext_links_default[bhl][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_bhl_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_bhl_text', $ext_links_default[bhl][text_default_value]).'</a><br />';
|
730
|
}
|
731
|
if(variable_get('ext_links_fairchild_check', 1)) {
|
732
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_fairchild_link', $ext_links_default[fairchild][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_fairchild_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_fairchild_text', $ext_links_default[fairchild][text_default_value]).'</a><br />';
|
733
|
}
|
734
|
if(variable_get('ext_links_arkive_check', 1)) {
|
735
|
$postURL = '&output=xml_no_dtd&client=arkive-images&site=arkive-images&ie=utf8&oe=utf8&num=20&proxystylesheet=tng-search&filter=0&getfields=*';
|
736
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_arkive_link', $ext_links_default[arkive][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_arkive_concat', ' ').str_replace('"','%22',$speciesName[species]). $postURL .'\')">'.variable_get('ext_links_arkive_text', $ext_links_default[arkive][text_default_value]).'</a><br />';
|
737
|
}
|
738
|
if(variable_get('ext_links_herbcat_check', 1)) {
|
739
|
$postURL = '&x=11&y=13&homePageSearchOption=scientific_name&nameOfSearchPage=home_page';
|
740
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_herbcat_link', $ext_links_default[herbcat][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_herbcat_concat', '+').str_replace('"','%22',$speciesName[species]). $postURL .'\')">'.variable_get('ext_links_herbcat_text', $ext_links_default[herbcat][text_default_value]).'</a><br />';
|
741
|
}
|
742
|
if(variable_get('ext_links_iucn_check', 1)) {
|
743
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_iucn_link', $ext_links_default[iucn][link_default_value]).'\')">'.variable_get('ext_links_iucn_text', $ext_links_default[iucn][text_default_value]).'</a><br />';
|
744
|
|
745
|
}
|
746
|
if(variable_get('ext_links_ipni_check', 1)) {
|
747
|
$genusQuery= 'find_genus=' . $speciesName[genus];
|
748
|
$speciesQuery='find_species=' . $speciesName[species];
|
749
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_ipni_link', $ext_links_default[ipni][link_default_value]).$genusQuery.variable_get('ext_links_ipni_concat', '&').$speciesQuery . '\')">'.variable_get('ext_links_ipni_text', $ext_links_default[ipni][text_default_value]).'</a><br />';
|
750
|
}
|
751
|
if(variable_get('ext_links_wcsp_check', 1)) {
|
752
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_wcsp_link', $ext_links_default[wcsp][link_default_value]).'\')">'.variable_get('ext_links_wcsp_text', $ext_links_default[wcsp][text_default_value]).'</a><br />';
|
753
|
|
754
|
}
|
755
|
if(variable_get('ext_links_tpl_check', 1)) {
|
756
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_tpl_link', $ext_links_default[tpl][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_tpl_concat', '+').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_tpl_text', $ext_links_default[tpl][text_default_value]).'</a><br />';
|
757
|
}
|
758
|
if(variable_get('ext_links_eol_check', 1)) {
|
759
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_eol_link', $ext_links_default[eol][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_eol_concat', '+').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_eol_text', $ext_links_default[eol][text_default_value]).'</a><br />';
|
760
|
}
|
761
|
if(variable_get('ext_links_jstor_check', 1)) {
|
762
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_jstor_link', $ext_links_default[jstor][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_jstor_concat', ' ').str_replace('"','%22',$speciesName[species]).'\')">'.variable_get('ext_links_jstor_text', $ext_links_default[jstor][text_default_value]).'</a><br />';
|
763
|
}
|
764
|
if(variable_get('ext_links_epic_check', 1)) {
|
765
|
$postURL = '&searchAll=true&categories=names&categories=bibl&categories=colln&categories=taxon&categories=flora&Submit.x=0&Submit.y=0';
|
766
|
$block_content .= '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_epic_link', $ext_links_default[epic][link_default_value]).str_replace('"','%22',$speciesName[genus]).variable_get('ext_links_epic_concat', '+').str_replace('"','%22',$speciesName[species]). $postURL .'\')">'.variable_get('ext_links_epic_text', $ext_links_default[epic][text_default_value]).'</a><br />';
|
767
|
}
|
768
|
|
769
|
return $block_content;
|
770
|
}
|
771
|
|
772
|
// include the admin form if it really want to use
|
773
|
//if (arg(0) === 'admin' AND arg(1) === 'user' AND arg(2) === 'ext_link') {
|
774
|
// include_once('ext_link_admin.inc');
|
775
|
//}
|