Project

General

Profile

Download (47.6 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/**
3
 * @file
4
 * Provides external links for sources to taxa information.
5
 *
6
 * @copyright
7
 *   (C) 2007-2012 EDIT
8
 *   European Distributed Institute of Taxonomy
9
 *   http://www.e-taxonomy.eu
10
 *
11
 *   The contents of this module are subject to the Mozilla
12
 *   Public License Version 1.1.
13
 * @see http://www.mozilla.org/MPL/MPL-1.1.html
14
 *
15
 * @author
16
 *   - Andreas Kohlbecker <a.kohlbecker@BGBM.org>
17
 *   - Wouter Addink <w.addink@eti.uva.nl> (migration from Drupal 5 to Drupal7)
18
 */
19

    
20
/**
21
 * Display help and module information.
22
 *
23
 * @param string $path
24
 *   For which path of the site we're displaying help.
25
 * @param array $arg
26
 *   Array that holds the current path as would be returned from arg() function.
27
 *
28
 * @return string
29
 *   Help text for the path.
30
 */
31
function ext_links_help($path, $arg) {
32
  switch ($path) {
33
    case 'admin/help#ext_links':
34
      $output = '<p>' . t("Link to external sources like ## for taxa.") . '</p>';
35
      return $output;
36
    case 'admin/config/cdm_dataportal/ext_links':
37
      $output = '<p>' . t('The external links module allows to configure URL templates for links to external data sources.');
38
      return $output;
39
    case 'admin/config/cdm_dataportal/ext_links/%':
40
      $output = '<p>' . t('An external link template.');
41
      return $output;
42
  }
43
}
44

    
45
/**
46
 * Implements hook_menu().
47
 */
48
function ext_links_menu() {
49
  $items = [];
50

    
51
  $items['admin/config/cdm_dataportal/ext_links'] = [
52
    'title' => 'External links',
53
    'description' => 'Configure external links templates.',
54
    'page callback' => 'drupal_get_form',
55
    'page arguments' => ['ext_links_admin_overview'],
56
    'access arguments' => ['access administration pages'],
57
    'file' => 'ext_links.admin.inc'
58
  ];
59
  $items['admin/config/cdm_dataportal/ext_links/list'] = [
60
    'title' => 'List',
61
    'type' => MENU_DEFAULT_LOCAL_TASK,
62
  ];
63
  $items['admin/config/cdm_dataportal/ext_links/add'] = [
64
    'title' => 'Add external link',
65
    'page callback' => 'ext_links_admin_link_template_page',
66
    'access arguments' => ['access administration pages'],
67
    'type' => MENU_LOCAL_ACTION,
68
    'weight' => 1,
69
    'file' => 'ext_links.admin.inc',
70
  ];
71
  $items['admin/config/cdm_dataportal/ext_links/%ext_links'] = [ // %ext_links refers to ext_links_load
72
    'title' => 'Edit external link',
73
    'page callback' => 'ext_links_admin_link_template_page',
74
    'page arguments' => [4],
75
    'access arguments' => ['access administration pages'],
76
    'file' => 'ext_links.admin.inc',
77
  ];
78
  return $items;
79
}
80

    
81
/**
82
 * Retrieves a list of External Link templates, ordered by weight.
83
 *
84
 * @return
85
 *   An array of external link template objects, keyed by the format ID and ordered by
86
 *   weight.
87
 *
88
 */
89
function ext_links_templates() {
90
  global $language;
91
  $link_templates = &drupal_static(__FUNCTION__, array());
92

    
93
  // cache_clear_all("ext_links_templates:{$language->language}");
94
  // All available link_templates are cached for performance.
95
  if (!is_array($link_templates) || !count($link_templates)) {
96
    if ($cache = cache_get("ext_links_templates:{$language->language}")) {
97
      $link_templates = $cache->data;
98
    }
99
    else {
100
      $test = true;
101
      if($test){
102
        $link_templates = [];
103
        $link_templates_arrays = ext_links_template_defaults();
104
        foreach($link_templates_arrays as $a){
105
          $link_templates[] = (object)$a;
106
        }
107
      } else {
108
        $link_templates = db_select('ext_links', 'elt')
109
          ->addTag('translatable')
110
          ->fields('elt')
111
          ->condition('status', 1)
112
          ->orderBy('weight')
113
          ->execute();
114
      }
115
      // cache_set("ext_links_templates:{$language->language}", $link_templates);
116
    }
117
  }
118
  return $link_templates;
119
}
120

    
121
/**
122
 * Resets the text format caches.
123
 *
124
 * @see filter_formats()
125
 */
126
function ext_links_templates_reset() {
127
  cache_clear_all('ext_links_templates', 'cache', TRUE);
128
  drupal_static_reset('ext_links_templates');
129
}
130

    
131
/**
132
 * Loads a text format object from the database.
133
 *
134
 * @param $extlink_id
135
 *   The external link ID. ($link->id)
136
 *
137
 * @return
138
 *   A fully-populated text format object, if the requested format exists and
139
 *   is enabled. If the format does not exist, or exists in the database but
140
 *   has been marked as disabled, FALSE is returned.
141
 *
142
 * @see ext_links_exists()
143
 */
144
function ext_links_load($extlink_id) {
145
  $test = TRUE;
146
  if($test) {
147
    $defaults = ext_links_template_defaults();
148
    return isset($defaults[$extlink_id]) ? (object)$defaults[$extlink_id] : FALSE;
149
  }
150
  else {
151
   $formats = ext_links_templates();
152
    return isset($formats[$extlink_id]) ? $formats[$extlink_id] : FALSE;
153
  }
154
}
155

    
156
/**
157
 * Saves a text format object to the database.
158
 *
159
 * @param $link_template
160
 *   A link template object having the properties:
161
 *   - id: The machine name of the external link. If this corresponds
162
 *     to an existing external link, this one will be updated;
163
 *     otherwise, a new external link will be created.
164
 *   - title: The link title
165
 *   - link: The link url template.
166
 *   - glue: The string to concatenate name parts in the URL query string.
167
 *   - status: (optional) An integer indicating whether the ext link is
168
 *     enabled (1) or not (0). Defaults to 1.
169
 *   - weight: (optional) The weight of the external link, which controls its
170
 *     placement in external link block. If omitted, the weight is set to 0.
171
 *     Defaults to NULL.
172
 *
173
 * @return
174
 *   SAVED_NEW or SAVED_UPDATED.
175
 */
176
function ext_links_save($link_template) {
177
  $link_template->title = trim($link_template->title);
178
  $link_template->cache = true;
179
  if (!isset($link_template->status)) {
180
    $link_template->status = 1;
181
  }
182
  if (!isset($link_template->weight)) {
183
    $link_template->weight = 0;
184
  }
185

    
186
  // Insert or update the text format.
187
  $return = db_merge('ext_links')
188
    ->key(array('format' => $link_template->title))
189
    ->fields(array(
190
      'id' => $link_template->id,
191
      'title' => $link_template->title,
192
      'link' => $link_template->link,
193
      'glue' => $link_template->glue,
194
      'status' => (int) $link_template->status,
195
      'weight' => (int) $link_template->weight,
196
    ))
197
    ->execute();
198

    
199
  if ($return != SAVED_NEW) {
200
    // Clear the filter cache whenever an external link is updated.
201
    cache_clear_all($link_template->format . ':', 'cache_filter', TRUE);
202
  }
203
  ext_links_templates_reset();
204
  return $return;
205
}
206

    
207
/**
208
 * Determines if a external link exists.
209
 *
210
 * @param $ext_link_name
211
 *   The ID of the external link to check.
212
 *
213
 * @return
214
 *   TRUE if the external link exists, FALSE otherwise.
215
 *
216
 * @see ext_links_load()
217
 */
218
function ext_links_exists($ext_link_name) {
219
  return (bool) db_query_range('SELECT 1 FROM {ext_links} WHERE name = :name', 0, 1, array(':name' => $ext_link_name))->fetchField();
220
}
221

    
222

    
223
/**
224
 * Returns the genus and the first epithet from the object taxon.
225
 *
226
 * @param $taxon
227
 *   A CDM Taxon instance object
228
 * @return array
229
 *  An associate array with two elements:
230
 *     - genus: the uninomial
231
 *     - species: the species epithet
232
 */
233
function ext_link_species_name($taxon) {
234
  $speciesName = array();
235
  $i = 0;
236
  while (isset($taxon->name->taggedName[$i]) && !isset($speciesName['species'])) {
237
    if ($taxon->name->taggedName[$i]->type == "name") {
238
      if (!isset($speciesName['genus'])) {
239
        $speciesName['genus'] = $taxon->name->taggedName[$i]->text;
240
      }
241
      else {
242
        $speciesName['species'] = $taxon->name->taggedName[$i]->text;
243
      }
244
    }
245
    $i++;
246
  }
247
  return $speciesName;
248
}
249

    
250
/**
251
 * Implements hook_block_info().
252
 */
253
function ext_links_block_info() {
254
  if (TRUE) {
255
    $block[0]["info"] = t("External Taxon Links");
256
    return $block;
257
  }
258
}
259

    
260
/**
261
 * Implements hook_block_view().
262
 */
263
function ext_links_block_view($delta) {
264
  // TODO Rename block deltas (e.g. '0') to readable strings.
265
  switch ($delta) {
266
    case '0':
267
      $block['subject'] = 'External links';
268

    
269
      $uuid = get_current_taxon_uuid();
270
      if ($uuid) {
271
        $taxon = cdm_ws_get(CDM_WS_PORTAL_TAXON, $uuid);
272

    
273
        // $taxon->titleCache;
274
        // var_export()
275
        if (!empty($taxon)) {
276
          drupal_add_js(drupal_get_path('module', 'ext_links') . '/ext_links.js');
277
          $speciesName = ext_link_species_name($taxon);
278

    
279
          $genus = $taxon->name->taggedName[0]->text;
280
          $species = null;
281
          if(isset($taxon->name->taggedName[1])){
282
            $species = $taxon->name->taggedName[1]->text;
283
          }
284
          $block_content = '';
285
          $listOption = variable_get("ext_links_options", 0);
286
          if (isset($listOption)) {
287
            $block['content'] = theme('ext_links_list_grouped', array('speciesName' => $speciesName, 'genus' => $genus, 'species' => $species));
288
          }
289
          else {
290
            $block['content'] = theme('ext_links_list_plain', array('speciesName' => $speciesName, 'genus' => $genus, 'species' => $species ));
291
          }
292

    
293
          // if(variable_get('ext_links_gbif_check', TRUE)) {
294
          // $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 />';
295
          /*
296
           $block_content .=
297
           /* TODO
298
           Please manually fix the parameters on the l() or url() function on the next line.
299
           Typically, this was not changed because of a function call inside an array call like
300
           array('title' => t('View user profile.')).
301
           l(variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]),
302
           '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],
303
           array(), null, null, true);
304
           */
305
          /*}
306
           if(variable_get('ext_links_biocase_check', 1)) {
307
           $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 />';
308
           }
309
           if(variable_get('ext_links_nybg_check', 1)) {
310
           $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 />';
311
           }
312
           if(variable_get('ext_links_tropicos_check', 1)) {
313
           $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 />';
314
           }
315
           if(variable_get('ext_links_ncbi_check', 1)) {
316
           $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 />';
317
           }
318
           if(variable_get('ext_links_google_check', 1)) {
319
           $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 />';
320
           }
321
           if(variable_get('ext_links_flickr_check', 1)) {
322
           $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 />';
323
           }
324
           if(variable_get('ext_links_scholar_check', 1)) {
325
           $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 />';
326
           }
327
           if(variable_get('ext_links_bhl_check', 1)) {
328
           $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 />';
329
           }
330

    
331
           $block['content'] = $block_content;
332
           $block['content'] = theme('ext_links_list_plain');
333

    
334
           }
335

    
336
           }*/
337
          // if taxon
338
        }
339
      }
340
      // If path.
341
      return $block;
342
  } /* switch */
343

    
344
}
345

    
346
/**
347
 * @todo Please document this function.
348
 * @see http://drupal.org/node/1354
349
 */
350
function theme_ext_links_list_grouped($variables) {
351
  // comment @WA: perhaps this function could be merged with ext_list_plain
352
  // into one function?
353
  $speciesName = $variables['speciesName'];
354
  if(!isset($speciesName['genus'])) {
355
    $speciesName['genus'] = '';
356
  }
357
  if(!isset($speciesName['species'])) {
358
    $speciesName['species'] = '';
359
  }
360
  $genus = $variables['genus'];
361
  $species = $variables['species'];
362
  $block_content = '';
363
  $categories = NULL;
364
  $ext_links_default = ext_links_templates();
365

    
366

    
367
  /*
368
  foreach ($ext_links_default as $ext_link) {
369

    
370
   //$block_content .= $ext_link['ext_links_bhl_category'];
371
   $category[] = variable_get('ext_links_bhl_category', $ext_links_default[][text_default_value]);
372
   $block_content .= variable_get('ext_links_bhl_category', $ext_links_default[][text_default_value]);
373
   }
374
   */
375

    
376
  // Images section.
377
  if (variable_get('ext_links_google_check', 1)) {
378
    $categoryTitles[] = variable_get('ext_links_google_category', $ext_links_default['google']['category_default_value']);
379
    $categories['google']['title'] = variable_get('ext_links_google_category', $ext_links_default['google']['category_default_value']);
380
    $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 />';
381

    
382
  }
383
  if (variable_get('ext_links_flickr_check', 1)) {
384
    $categoryTitles[] = variable_get('ext_links_flickr_category', $ext_links_default['flickr']['category_default_value']);
385
    $categories['flickr']['title'] = variable_get('ext_links_flickr_category', $ext_links_default['flickr']['category_default_value']);
386
    $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 />';
387
  }
388

    
389
  // Specimen/occurences section.
390
  if (variable_get('ext_links_gbif_check', TRUE)) {
391
    $categoryTitles[] = variable_get('ext_links_gbif_category', $ext_links_default['gbif']['category_default_value']);
392
    $categories['gbif']['title'] = variable_get('ext_links_gbif_category', $ext_links_default['gbif']['category_default_value']);
393
    $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 />';
394
  }
395
  if (variable_get('ext_links_biocase_check', 1)) {
396
    $categoryTitles[] = variable_get('ext_links_biocase_category', $ext_links_default['biocase']['category_default_value']);
397
    $categories['biocase']['title'] = variable_get('ext_links_biocase_category', $ext_links_default['biocase']['category_default_value']);
398
    $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 />';
399
  }
400
  if (variable_get('ext_links_nybg_check', 1)) {
401
    $query = '';
402
    $genusQuery = '';
403
    $speciesQuery = '';
404
    if ($speciesName['genus'] != NULL) {
405
      $query .= 'DetFiledAsGenusLocal+%3D+\%27'. $speciesName['genus']. '\%27';
406
    }
407
    if ($speciesName['species'] != NULL) {
408
      $query .= variable_get('ext_links_nybg_concat', '+AND+'). 'DetFiledAsSpeciesLocal+%3D+\%27'. $speciesName['species'] . '\%27';
409
    }
410
    $categoryTitles[] = variable_get('ext_links_nybg_category', $ext_links_default['nybg']['category_default_value']);
411
    $categories['nybg']['title'] = variable_get('ext_links_nybg_category', $ext_links_default['nybg']['category_default_value']);
412
    $categories['nybg']['content'] = '<a href="JavaScript:popupExternalLinks(\''.variable_get('ext_links_nybg_link', $ext_links_default['nybg']['link_default_value']).$query.'\')">'.variable_get('ext_links_nybg_text', $ext_links_default['nybg']['text_default_value']).'</a><br />';
413
  }
414
  if (variable_get('ext_links_tropicos_check', 1)) {
415
    $categoryTitles[] = variable_get('ext_links_tropicos_category', $ext_links_default['tropicos']['category_default_value']);
416
    $categories['tropicos']['title'] = variable_get('ext_links_tropicos_category', $ext_links_default['tropicos']['category_default_value']);
417
    $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 />';
418
  }
419

    
420
  // Literature.
421
  if (variable_get('ext_links_scholar_check', 1)) {
422
    $categoryTitles[] = variable_get('ext_links_scholar_category', $ext_links_default['scholar']['category_default_value']);
423
    $categories['scholar']['title'] = variable_get('ext_links_scholar_category', $ext_links_default['scholar']['category_default_value']);
424
    $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 />';
425
  }
426
  if (variable_get('ext_links_bhl_check', 1)) {
427
    $categoryTitles[] = variable_get('ext_links_bhl_category', $ext_links_default['bhl']['category_default_value']);
428
    $categories['bhl']['title'] = variable_get('ext_links_bhl_category', $ext_links_default['bhl']['category_default_value']);
429
    $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 />';
430
  }
431

    
432
  // Molecular resources.
433
  if (variable_get('ext_links_ncbi_check', 1)) {
434
    $categoryTitles[] = variable_get('ext_links_ncbi_category', $ext_links_default['ncbi']['category_default_value']);
435
    $categories['ncbi']['title'] = variable_get('ext_links_ncbi_category', $ext_links_default['ncbi']['category_default_value']);
436
    $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 />';
437
  }
438
  if (variable_get('ext_links_arkive_check', 1)) {
439
    $postURL = '&output=xml_no_dtd&client=arkive-images&site=arkive-images&ie=utf8&oe=utf8&num=20&proxystylesheet=tng-search&filter=0&getfields=*';
440
    $categoryTitles[] = variable_get('ext_links_arkive_category', $ext_links_default['arkive']['category_default_value']);
441
    $categories['arkive']['title'] = variable_get('ext_links_arkive_category', $ext_links_default['arkive']['category_default_value']);
442
    $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 />';
443
  }
444
  if (variable_get('ext_links_herbcat_check', 1)) {
445
    $postURL = '&x=11&y=13&homePageSearchOption=scientific_name&nameOfSearchPage=home_page';
446
    $categoryTitles[] = variable_get('ext_links_herbcat_category', $ext_links_default['herbcat']['category_default_value']);
447
    $categories['herbcat']['title'] = variable_get('ext_links_herbcat_category', $ext_links_default['herbcat']['category_default_value']);
448
    $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 />';
449
  }
450
  if (variable_get('ext_links_iucn_check', 1)) {
451
    $categoryTitles[] = variable_get('ext_links_iucn_category', $ext_links_default['iucn']['category_default_value']);
452
    $categories['iucn']['title'] = variable_get('ext_links_iucn_category', $ext_links_default['iucn']['category_default_value']);
453
    $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 />';
454
  }
455
  if (variable_get('ext_links_ipni_check', 1)) {
456
    $genusQuery = 'find_genus=' . $speciesName['genus'];
457
    $speciesQuery = 'find_species=' . $speciesName['species'];
458
    $categoryTitles[] = variable_get('ext_links_ipni_category', $ext_links_default['ipni']['category_default_value']);
459
    $categories['ipni']['title'] = variable_get('ext_links_ipni_category', $ext_links_default['ipni']['category_default_value']);
460
    $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 />';
461
  }
462
  if (variable_get('ext_links_wcsp_check', 1)) {
463
    $categoryTitles[] = variable_get('ext_links_wcsp_category', $ext_links_default['wcsp']['category_default_value']);
464
    $categories['wcsp']['title'] = variable_get('ext_links_wcsp_category', $ext_links_default['wcsp']['category_default_value']);
465
    $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 />';
466
  }
467
  if (variable_get('ext_links_tpl_check', 1)) {
468
    $categoryTitles[] = variable_get('ext_links_tpl_category', $ext_links_default['tpl']['category_default_value']);
469
    $categories['tpl']['title'] = variable_get('ext_links_tpl_category', $ext_links_default['tpl']['category_default_value']);
470
    $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 />';
471
  }
472
  if (variable_get('ext_links_eol_check', 1)) {
473
    $categoryTitles[] = variable_get('ext_links_eol_category', $ext_links_default['eol']['category_default_value']);
474
    $categories['eol']['title'] = variable_get('ext_links_eol_category', $ext_links_default['eol']['category_default_value']);
475
    $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 />';
476
  }
477
  if (variable_get('ext_links_jstor_check', 1)) {
478
    $categoryTitles[] = variable_get('ext_links_jstor_category', $ext_links_default['jstor']['category_default_value']);
479
    $categories['jstor']['title'] = variable_get('ext_links_jstor_category', $ext_links_default['jstor']['category_default_value']);
480
    $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 />';
481
  }
482
  if (variable_get('ext_links_epic_check', 1)) {
483
    $postURL = '&searchAll=true&categories=names&categories=bibl&categories=colln&categories=taxon&categories=flora&Submit.x=0&Submit.y=0';
484
    $categoryTitles[] = variable_get('ext_links_epic_category', $ext_links_default['epic']['category_default_value']);
485
    $categories['epic']['title'] = variable_get('ext_links_epic_category', $ext_links_default['epic']['category_default_value']);
486
    $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 />';
487
  }
488
//  if (variable_get('ext_links_fairchild_check', 1)) {
489
//    $categoryTitles[] = variable_get('ext_links_fairchild_category', $ext_links_default['fairchild']['category_default_value']);
490
//    $categories['fairchild']['title'] = variable_get('ext_links_fairchild_category', $ext_links_default['fairchild']['category_default_value']);
491
//    $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 />';
492
//  }
493
  if (variable_get('ext_links_ggbn_check', 1)) {
494
    $categoryTitles[] = variable_get('ext_links_ggbn_category', $ext_links_default['ggbn']['category_default_value']);
495
    $categories['ggbn']['title'] = variable_get('ext_links_ggnb_category', $ext_links_default['ggbn']['category_default_value']);
496
    $categories['ggbn']['content'] = '<a href="JavaScript:popupExternalLinks(\'' . variable_get('ext_links_ggbn_link', $ext_links_default['ggbn']['link_default_value']) . str_replace('"', '%22', $speciesName['genus']) . variable_get('ext_links_ggbn_concat', ' ') . str_replace('"', '%22', $speciesName['species']) . '\')">' . variable_get('ext_links_ggbn_text', $ext_links_default['ggbn']['text_default_value']) . '</a><br />';
497
  }
498

    
499
  $categoryTitles = array_unique($categoryTitles);
500
  foreach ($categoryTitles as $categoryTitle) {
501
    // $block_content .= "specName" . $speciesName;
502
    $block_content .= "<div class=\"category\"><h5>" . $categoryTitle . "</h5>";
503
    foreach ($categories as $category) {
504
      if ($category['title'] == $categoryTitle) {
505
        $block_content .= $category['content'];
506
      }
507
    }
508
    $block_content .= "</div>";
509
  }
510

    
511

    
512
  return $block_content;
513
}
514

    
515
/**
516
 * @todo Please document this function.
517
 * @see http://drupal.org/node/1354
518
 */
519
function theme_ext_links_list_plain($variables) {
520
  $speciesName = $variables['speciesName'];
521
  if (!isset($speciesName['genus'])) {
522
    $speciesName['genus'] = '';
523
  }
524
  if (!isset($speciesName['species'])) {
525
    $speciesName['species'] = '';
526
  }
527
  $genus = $variables['genus'];
528
  $species = $variables['species'];
529
  $ext_links_default = ext_links_get_default();
530
  $block_content = '';
531
  if (variable_get('ext_links_gbif_check', TRUE)) {
532
    $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 />';
533
    /*
534
     $block_content .= /* TODO
535
     Please manually fix the parameters on the l() or url() function on the next line.
536
     Typically, this was not changed because of a function call inside an array call like
537
     array('title' => t('View user profile.')).*/
538
    /*
539
     l(variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]),
540
     '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],
541
     array(), null, null, true);
542
     */
543
  }
544
  if (variable_get('ext_links_biocase_check', 1)) {
545
    $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 />';
546
  }
547
  if (variable_get('ext_links_nybg_check', 1)) {
548
    // $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 />';
549
    $genusQuery = '';
550
    $speciesQuery = '';
551
    if ($speciesName['genus'] != NULL) {
552
      $genusQuery = 'DetFiledAsGenusLocal+%3D+\%27' . $speciesName['genus'] . '\%27';
553
    }
554
    if ($speciesName['species'] != NULL) {
555
      $speciesQuery = 'DetFiledAsSpeciesLocal+%3D+\%27' . $speciesName['species'] . '\%27';
556
    }
557
    $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 />';
558
  }
559
  if (variable_get('ext_links_tropicos_check', 1)) {
560
    $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 />';
561
  }
562
  if (variable_get('ext_links_ncbi_check', 1)) {
563
    $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 />';
564
  }
565
  if (variable_get('ext_links_google_check', 1)) {
566
    $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 />';
567
  }
568
  if (variable_get('ext_links_flickr_check', 1)) {
569
    $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 />';
570
  }
571
  if (variable_get('ext_links_scholar_check', 1)) {
572
    $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 />';
573
  }
574
  if (variable_get('ext_links_bhl_check', 1)) {
575
    $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 />';
576
  }
577
//  if (variable_get('ext_links_fairchild_check', 1)) {
578
//    $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 />';
579
//  }
580
  if (variable_get('ext_links_ggbn_check', 1)) {
581
    $block_content .= '<a href="JavaScript:popupExternalLinks(\'' . variable_get('ext_links_ggbn_link', $ext_links_default['ggbn']['link_default_value']) . str_replace('"', '%22', $speciesName['genus']) . variable_get('ext_links_ggbn_concat', ' ') . str_replace('"', '%22', $speciesName['species']) . '\')">' . variable_get('ext_links_ggbn_text', $ext_links_default['ggbn']['text_default_value']) . '</a><br />';
582
  }
583
  if (variable_get('ext_links_arkive_check', 1)) {
584
    $postURL = '&output=xml_no_dtd&client=arkive-images&site=arkive-images&ie=utf8&oe=utf8&num=20&proxystylesheet=tng-search&filter=0&getfields=*';
585
    $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 />';
586
  }
587
  if (variable_get('ext_links_herbcat_check', 1)) {
588
    $postURL = '&x=11&y=13&homePageSearchOption=scientific_name&nameOfSearchPage=home_page';
589
    $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 />';
590
  }
591
  if (variable_get('ext_links_iucn_check', 1)) {
592
    $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 />';
593

    
594
  }
595
  if (variable_get('ext_links_ipni_check', 1)) {
596
    $genusQuery = 'find_genus=' . $speciesName['genus'];
597
    $speciesQuery = 'find_species=' . $speciesName['species'];
598
    $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 />';
599
  }
600
  if (variable_get('ext_links_wcsp_check', 1)) {
601
    $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 />';
602

    
603
  }
604
  if (variable_get('ext_links_tpl_check', 1)) {
605
    $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 />';
606
  }
607
  if (variable_get('ext_links_eol_check', 1)) {
608
    $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 />';
609
  }
610
  if (variable_get('ext_links_jstor_check', 1)) {
611
    $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 />';
612
  }
613
  if (variable_get('ext_links_epic_check', 1)) {
614
    $postURL = '&searchAll=true&categories=names&categories=bibl&categories=colln&categories=taxon&categories=flora&Submit.x=0&Submit.y=0';
615
    $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 />';
616
  }
617

    
618
  return $block_content;
619
}
620

    
621
// Include the admin form if we really want it to use.
622
/*
623
if (arg(0) === 'admin' AND arg(1) === 'user' AND arg(2) === 'ext_link') {
624
  module_load_include('inc', 'ext_links', 'xt_link_admin');
625
}
626
*/
627

    
628
/**
629
 * @todo Please document this function.
630
 * @see http://drupal.org/node/1354
631
 */
632
function ext_links_theme() {
633
  return array(
634
    'ext_links_list_grouped' => array('variables' => array(
635
      'speciesName' => NULL,
636
      'genus' => NULL,
637
      'species' => NULL,
638
      )),
639
    'ext_links_list_plain' => array('variables' => array(
640
      'speciesName' => NULL,
641
      'genus' => NULL,
642
      'species' => NULL,
643
      )),
644
    // theme_ext_links_admin_overview
645
    'ext_links_admin_overview' => array(
646
      'render element' => 'form',
647
      'file' => 'ext_links.admin.inc',
648
    ),
649
//    'ext_links_link_template_filter_order' => array(
650
//      'render element' => 'element',
651
//      'file' => 'ext_links.admin.inc',
652
//    ),
653
  );
654
}
655

    
656
/**
657
 * Get the default external links.
658
 *
659
 * @return array
660
 *   Returns an array with default external links values.
661
 */
662
function ext_links_template_defaults() {
663
  $ext_links_default["gbif"] = array(
664
    'id' => "gbif",
665
    'link' => 'http://www.gbif.org/species/search?q=',
666
    'title' => 'Search GBIF...',
667
    'glue' => ' ',
668
    'weight' => 0,
669
    'status' => 1,
670
    'category' => 'Specimens/Occurrences',
671
  );
672
  $ext_links_default["biocase"] = array(
673
    'id' => "biocase",
674
    'link' => 'http://search.biocase.org/edit/search/units/simpleSearch/query1?unitName=',
675
    'title' => 'Search BioCASE...',
676
    'glue' => ' ',
677
    'weight' => 0,
678
    'status' => 1,
679
    'category' => 'Specimens/Occurrences',
680
  );
681
  $ext_links_default["nybg"] = array(
682
    'id' => "nybg",
683
    'link' => 'http://sweetgum.nybg.org/science/vh/specimen_list.php?SummaryData=',
684
    'title' => 'Search NYBG...',
685
    'glue' => '+AND+',
686
    'weight' => 0,
687
    'status' => 1,
688
    'category' => 'Specimens/Occurrences',
689
  );
690
  $ext_links_default["tropicos"] = array(
691
    'id' => "tropicos",
692
    'link' => 'http://www.tropicos.org/NameSearch.aspx?name=',
693
    'title' => 'Search Tropicos...',
694
    'glue' => '+',
695
    'weight' => 0,
696
    'status' => 1,
697
    'category' => 'Specimens/Occurrences',
698
  );
699
  $ext_links_default["ncbi"] = array(
700
    'id' => "ncbi",
701
    'link' => 'http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi?term=',
702
    'title' => 'Search NCBI...',
703
    'glue' => '+AND+',
704
    'weight' => 0,
705
    'status' => 1,
706
    'category' => 'Molecular Resources',
707
  );
708
  $ext_links_default["google"] = array(
709
    'id' => "google",
710
    'link' => 'http://images.google.com/images?q=',
711
    'title' => 'Search Google Images...',
712
    'glue' => '+',
713
    'weight' => 0,
714
    'status' => 1,
715
    'category' => 'Images',
716
  );
717
  $ext_links_default["flickr"] = array(
718
    'id' => "flickr",
719
    'link' => 'http://www.flickr.com/search/?w=all&q=',
720
    'title' => 'Search flickr...',
721
    'glue' => '+',
722
    'weight' => 0,
723
    'status' => 1,
724
    'category' => 'Images',
725
  );
726
  $ext_links_default["scholar"] = array(
727
    'id' => "scholar",
728
    'link' => 'http://scholar.google.de/scholar?hl=de&btnG=Suche&lr=&as_ylo=&as_vis=0&q=',
729
    'title' => 'Search Google scholar...',
730
    'glue' => '+',
731
    'weight' => 0,
732
    'status' => 1,
733
    'category' => 'Literature',
734
  );
735
  $ext_links_default["bhl"] = array(
736
    'id' => "bhl",
737
    'link' => 'http://www.biodiversitylibrary.org/Search.aspx?searchCat=&searchTerm=',
738
    'title' => 'Search BHL...',
739
    'glue' => ' ',
740
    'weight' => 0,
741
    'status' => 1,
742
    'category' => 'Literature',
743
  );
744
  $ext_links_default["arkive"] = array(
745
    'id' => "arkive",
746
    'link' => 'http://www.arkive.org/search.html?q=',
747
    'title' => 'Search ARKive...',
748
    'glue' => '+',
749
    'weight' => 0,
750
    'status' => 1,
751
    'category' => 'Images',
752
  );
753
  $ext_links_default["herbcat"] = array(
754
    'id' => "herbcat",
755
    'link' => 'http://apps.kew.org/herbcat/getHomePageResults.do?homePageSearchText=',
756
    'title' => 'Search Kew Herbarium Catalogue...',
757
    'glue' => '+',
758
    'weight' => 0,
759
    'status' => 1,
760
    'category' => 'Specimens/Occurrences',
761
  );
762
  $ext_links_default["iucn"] = array(
763
    'id' => "iucn",
764
    'link' => 'http://www.iucnredlist.org/',
765
    'title' => 'Go to IUCN Red List...',
766
    'glue' => ' ',
767
    'weight' => 0,
768
    'status' => 1,
769
    'category' => 'Conservation',
770
  );
771
  $ext_links_default["ipni"] = array(
772
    'id' => "ipni",
773
    'link' => 'http://www.ipni.org/ipni/advPlantNameSearch.do?',
774
    'title' => 'Search IPNI...',
775
    'glue' => '&',
776
    'weight' => 0,
777
    'status' => 1,
778
    'category' => 'Classification',
779
  );
780
  $ext_links_default["wcsp"] = array(
781
    'id' => "wcsp",
782
    'link' => 'http://wcsp.science.kew.org/qsearch.do?plantName=',
783
    'title' => 'Search World Checklist Monocots...',
784
    'glue' => ' ',
785
    'weight' => 0,
786
    'status' => 1,
787
    'category' => 'Classification',
788
  );
789
  $ext_links_default["tpl"] = array(
790
    'id' => "tpl",
791
    'link' => 'http://www.theplantlist.org/tpl/search?q=',
792
    'title' => 'Search The Plant List...',
793
    'glue' => '+',
794
    'weight' => 0,
795
    'status' => 1,
796
    'category' => 'Classification',
797
  );
798
  $ext_links_default["eol"] = array(
799
    'id' => "eol",
800
    'link' => 'http://eol.org/search/?q=',
801
    'title' => 'Search Encyclopaedia of Life...',
802
    'glue' => '+',
803
    'weight' => 0,
804
    'status' => 1,
805
    'category' => 'General',
806
  );
807
  $ext_links_default["jstor"] = array(
808
    'id' => "jstor",
809
    'link' => 'https://plants.jstor.org/search?filter=name&so=ps_group_by_genus_species+asc&Query=',
810
    'title' => 'Search JSTOR Plant Science...',
811
    'glue' => ' ',
812
    'weight' => 0,
813
    'status' => 1,
814
    'category' => 'General',
815
  );
816
  $ext_links_default["epic"] = array(
817
    'id' => "epic",
818
    'link' => 'http://epic.kew.org/searchepic/summaryquery.do?scientificName=',
819
    'title' => 'Search ePIC...',
820
    'glue' => '+',
821
    'weight' => 0,
822
    'status' => 1,
823
    'category' => 'General',
824
  );
825
  $ext_links_default["fairchild"] = array(
826
    'id' => "fairchild",
827
    'link' => 'http://palmguide.org/palmsearch.php?query=',
828
    'title' => 'Search Fairchild Guide To Palms...',
829
    'glue' => '+',
830
    'weight' => 0,
831
    'status' => 0, //disabled since Fairchild Guide To Palms seems to be down
832
    'category' => 'Specimens/Occurrences',
833
  );
834
  $ext_links_default["ggbn"] = array(
835
    'id' => "ggbn",
836
    'link' => 'http://www.ggbn.org/ggbn_portal/search/result?fullScientificName=',
837
    'title' => 'Search GGBN...',
838
    'glue' => '+',
839
    'weight' => 0,
840
    'status' => 1,
841
    'category' => 'Molecular Resources',
842
  );
843
  return $ext_links_default;
844
}
(7-7/7)