Project

General

Profile

Download (25 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/appearance'] = [
72
    'title' => 'Appearance',
73
    'page callback' => 'drupal_get_form',
74
    'page arguments' => ['ext_links_admin_appearance_page'],
75
    'access arguments' => ['access administration pages'],
76
    'type' => MENU_LOCAL_TASK,
77
    'weight' => 2,
78
    'file' => 'ext_links.admin.inc',
79
  ];
80
  $items['admin/config/cdm_dataportal/ext_links/%ext_links'] = [ // %ext_links refers to ext_links_load
81
    'title' => 'Edit external link',
82
    'page callback' => 'ext_links_admin_link_template_page',
83
    'page arguments' => [4],
84
    'access arguments' => ['access administration pages'],
85
    'file' => 'ext_links.admin.inc',
86
  ];
87
  $items['admin/config/cdm_dataportal/ext_links/%ext_links/status/%'] = [
88
    'title' => 'Enable or disable external link',
89
    'page callback' => 'ext_links_admin_link_template_set_status',
90
    'page arguments' => [4, 6],
91
    'access arguments' => ['access administration pages'],
92
 //   'type' => MENU_CALLBACK,
93
    'file' => 'ext_links.admin.inc',
94
  ];
95
  return $items;
96
}
97

    
98
/**
99
 * Retrieves a list of External Link templates, ordered by weight.
100
 *
101
 * Empty 'ext_links' tables will be initialized with the default templates.
102
 *
103
 * @see ext_links_template_defaults()
104
 *
105
 * @param $enabled_only boolean
106
 *   When TRUE external link templates with status != null are excluded from the list.
107
 * @return array
108
 *   An array of external link template objects, keyed by the format ID and ordered by
109
 *   weight.
110
 *
111
 */
112
function ext_links_templates($enabled_only = FALSE) {
113
  global $language;
114
  $link_templates = &drupal_static(__FUNCTION__, array());
115

    
116
  // cache_clear_all("ext_links_templates:{$language->language}");
117
  // All available link_templates are cached for performance.
118
  if (!is_array($link_templates) || !count($link_templates)) {
119
    if ($cache = cache_get("ext_links:{$language->language}")) {
120
      $link_templates = $cache->data;
121
    }
122
    else {
123
      $test = false;
124
      if($test){
125
        $link_templates = [];
126
        $link_templates_arrays = ext_links_template_defaults();
127
        foreach($link_templates_arrays as $a){
128
          $link_templates[] = (object)$a;
129
        }
130
      } else {
131
        $query = db_select('ext_links', 'elt')
132
          ->addTag('translatable')
133
          ->fields('elt');
134
        if($enabled_only){
135
          $query = $query->condition('status', '1');
136
        }
137
        $link_templates =
138
          $query->orderBy('weight')
139
          ->execute()
140
          ->fetchAllAssoc('id');
141
      }
142
      if(!count($link_templates)) {
143
        $link_templates_arrays = ext_links_template_defaults();
144
        $query = db_insert('ext_links')
145
          ->fields(array_keys(array_values($link_templates_arrays)[0]));
146
        foreach($link_templates_arrays as $a){
147
          $query->values($a);
148
        }
149
        try {
150
          $query->execute();
151
        } catch (Exception $e) {
152
          drupal_set_message("Error while initializing ext_links database: " . $e->getMessage(), "error");
153
        }
154
        $link_templates = [];
155
        foreach($link_templates_arrays as $a){
156
          $link_templates[] = (object)$a;
157
        }
158
      }
159
      // cache_set("ext_links:{$language->language}", $link_templates);
160
    }
161
  }
162
  return $link_templates;
163
}
164

    
165
/**
166
 * Resets the text format caches.
167
 *
168
 * @see filter_formats()
169
 */
170
function ext_links_templates_reset() {
171
  cache_clear_all('ext_links', 'cache', TRUE);
172
  drupal_static_reset('ext_links');
173
}
174

    
175
/**
176
 * Loads a text format object from the database.
177
 *
178
 * @param $extlink_id
179
 *   The external link ID. ($link->id)
180
 *
181
 * @return
182
 *   A fully-populated text format object, if the requested format exists and
183
 *   is enabled. If the format does not exist, or exists in the database but
184
 *   has been marked as disabled, FALSE is returned.
185
 *
186
 * @see ext_links_exists()
187
 */
188
function ext_links_load($extlink_id) {
189
  $test = false;
190
  if($test) {
191
    $defaults = ext_links_template_defaults();
192
    return isset($defaults[$extlink_id]) ? (object)$defaults[$extlink_id] : FALSE;
193
  }
194
  else {
195
   $link_templates = ext_links_templates();
196
    return isset($link_templates[$extlink_id]) ? $link_templates[$extlink_id] : FALSE;
197
  }
198
}
199

    
200
/**
201
 * Saves a text format object to the database.
202
 *
203
 * @param $link_template
204
 *   A link template object having the properties:
205
 *   - id: The machine name of the external link. If this corresponds
206
 *     to an existing external link, this one will be updated;
207
 *     otherwise, a new external link will be created.
208
 *   - title: The link title
209
 *   - link: The link url template.
210
 *   - glue: The string to concatenate name parts in the URL query string.
211
 *   - status: (optional) An integer indicating whether the ext link is
212
 *     enabled (1) or not (0). Defaults to 1.
213
 *   - weight: (optional) The weight of the external link, which controls its
214
 *     placement in external link block. If omitted, the weight is set to 0.
215
 *     Defaults to NULL.
216
 *
217
 * @return
218
 *   SAVED_NEW or SAVED_UPDATED.
219
 */
220
function ext_links_save($link_template) {
221

    
222
  $link_template->title = trim($link_template->title);
223
  $link_template->cache = true;
224
  if (!isset($link_template->status)) {
225
    $link_template->status = 1;
226
  }
227
  if (!isset($link_template->weight)) {
228
    $link_template->weight = 0;
229
  }
230

    
231
  // Insert or update the text format.
232
  $return = db_merge('ext_links')
233
    ->key(array('id' => $link_template->id))
234
    ->fields(array(
235
      'id' => $link_template->id,
236
      'title' => $link_template->title,
237
      'link' => $link_template->link,
238
      'glue' => $link_template->glue,
239
      'status' => (int) $link_template->status,
240
      'weight' => (int) $link_template->weight,
241
    ))
242
    ->execute();
243

    
244
  ext_links_templates_reset();
245
  return $return;
246
}
247

    
248
/**
249
 * Determines if a external link exists.
250
 *
251
 * @param $ext_link_name
252
 *   The ID of the external link to check.
253
 *
254
 * @return
255
 *   TRUE if the external link exists, FALSE otherwise.
256
 *
257
 * @see ext_links_load()
258
 */
259
function ext_links_exists($ext_link_name) {
260
  return (bool) db_query_range('SELECT 1 FROM {ext_links} WHERE name = :name', 0, 1, array(':name' => $ext_link_name))->fetchField();
261
}
262

    
263

    
264
/**
265
 * Returns the genus and the first epithet from the object taxon.
266
 *
267
 * @param $taxon
268
 *   A CDM Taxon instance object
269
 * @return array
270
 *  An associate array with two elements:
271
 *     - genus: the uninomial
272
 *     - species: the species epithet
273
 */
274
function ext_link_species_name($taxon) {
275
  $speciesName = array();
276
  $i = 0;
277
  while (isset($taxon->name->taggedName[$i]) && !isset($speciesName['species'])) {
278
    if ($taxon->name->taggedName[$i]->type == "name") {
279
      if (!isset($speciesName['genus'])) {
280
        $speciesName['genus'] = $taxon->name->taggedName[$i]->text;
281
      }
282
      else {
283
        $speciesName['species'] = $taxon->name->taggedName[$i]->text;
284
      }
285
    }
286
    $i++;
287
  }
288
  return $speciesName;
289
}
290

    
291
/**
292
 * Implements hook_block_info().
293
 */
294
function ext_links_block_info() {
295
  if (TRUE) {
296
    $block[0]["info"] = t("CDM - External Links");
297
    return $block;
298
  }
299
}
300

    
301
/**
302
 * Implements hook_block_view().
303
 */
304
function ext_links_block_view($delta) {
305
  // TODO Rename block deltas (e.g. '0') to readable strings.
306
  switch ($delta) {
307
    case '0':
308
      $block['subject'] = 'External links';
309

    
310
      $uuid = get_current_taxon_uuid();
311
      if ($uuid) {
312
        $taxon = cdm_ws_get(CDM_WS_PORTAL_TAXON, $uuid);
313

    
314
        // $taxon->titleCache;
315
        // var_export()
316
        if (!empty($taxon)) {
317
          drupal_add_js(drupal_get_path('module', 'ext_links') . '/ext_links.js');
318
          $speciesName = ext_link_species_name($taxon);
319

    
320
          $genus = $taxon->name->taggedName[0]->text;
321
          $species = null;
322
          if(isset($taxon->name->taggedName[1])){
323
            $species = $taxon->name->taggedName[1]->text;
324
          }
325
          $block_content = '';
326
          $grouped = variable_get('ext_links_appearance_grouped', 1);
327
          if ($grouped) {
328
            $block['content'] = theme('ext_links_list_grouped', array('speciesName' => $speciesName, 'genus' => $genus, 'species' => $species));
329
          }
330
          else {
331
            $block['content'] = theme('ext_links_list_plain', array('speciesName' => $speciesName, 'genus' => $genus, 'species' => $species ));
332
          }
333

    
334
          // if(variable_get('ext_links_gbif_check', TRUE)) {
335
          // $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 />';
336
          /*
337
           $block_content .=
338
           /* TODO
339
           Please manually fix the parameters on the l() or url() function on the next line.
340
           Typically, this was not changed because of a function call inside an array call like
341
           array('title' => t('View user profile.')).
342
           l(variable_get('ext_links_gbif_text', $ext_links_default[gbif][text_default_value]),
343
           '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],
344
           array(), null, null, true);
345
           */
346
          /*}
347
           if(variable_get('ext_links_biocase_check', 1)) {
348
           $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 />';
349
           }
350
           if(variable_get('ext_links_nybg_check', 1)) {
351
           $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 />';
352
           }
353
           if(variable_get('ext_links_tropicos_check', 1)) {
354
           $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 />';
355
           }
356
           if(variable_get('ext_links_ncbi_check', 1)) {
357
           $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 />';
358
           }
359
           if(variable_get('ext_links_google_check', 1)) {
360
           $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 />';
361
           }
362
           if(variable_get('ext_links_flickr_check', 1)) {
363
           $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 />';
364
           }
365
           if(variable_get('ext_links_scholar_check', 1)) {
366
           $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 />';
367
           }
368
           if(variable_get('ext_links_bhl_check', 1)) {
369
           $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 />';
370
           }
371

    
372
           $block['content'] = $block_content;
373
           $block['content'] = theme('ext_links_list_plain');
374

    
375
           }
376

    
377
           }*/
378
          // if taxon
379
        }
380
      }
381
      // If path.
382
      return $block;
383
  } /* switch */
384

    
385
}
386

    
387
/**
388
 * Applies the name tokens to the external link templates.
389
 *
390
 * @param $ext_link
391
 * @param $species_name
392
 *
393
 * @return array
394
 *  Array with the keys:
395
 *     - title: the title of the link
396
 *     - url: the url of the link
397
 */
398
function make_ext_link($ext_link, $species_name) {
399
  switch ($ext_link->id) {
400
    case 'nybg':
401
      if ($species_name['genus'] != NULL) {
402
        $query = 'DetFiledAsGenusLocal+%3D+\%27' . $species_name['genus'] . '\%27';
403
      }
404
      if ($species_name['species'] != NULL) {
405
        $query .= $ext_link->glue . 'DetFiledAsSpeciesLocal+%3D+\%27' . $species_name['species'] . '\%27';
406
      }
407
      break;
408
    case 'arkive':
409
      $postURL = '&output=xml_no_dtd&client=arkive-images&site=arkive-images&ie=utf8&oe=utf8&num=20&proxystylesheet=tng-search&filter=0&getfields=*';
410
      $query = str_replace('"', '%22', $species_name['genus']) . variable_get('ext_links_arkive_concat', '+') . str_replace('"', '%22', $species_name['species']) . $postURL;
411
      break;
412
    case 'herbcat':
413
      $postURL = '&x=11&y=13&homePageSearchOption=scientific_name&nameOfSearchPage=home_page';
414
      $query = str_replace('"', '%22', $species_name['genus']) . variable_get('ext_links_herbcat_concat', '+') . str_replace('"', '%22', $species_name['species']) . $postURL;
415
      break;
416
    case 'iucn':
417
    case 'wcsp':
418
      // apparently no search api, thus plain link without genus and species
419
      $query = '';
420
      break;
421
    case 'ipni':
422
      $query = 'find_genus=' . $species_name['genus'] . '&find_species=' . $species_name['species'];
423
      break;
424
    default:
425
      $query = rawurlencode($species_name['genus']) . $ext_link->glue . rawurlencode($species_name['species']);
426
  }
427
  $ext_link_array = [
428
    'title' => $ext_link->title,
429
    'url' => token_replace($ext_link->link) /* . $query */
430
  ];
431
  return $ext_link_array;
432
}
433

    
434
/**
435
 * @todo Please document this function.
436
 * @see http://drupal.org/node/1354
437
 */
438
function theme_ext_links_list_grouped($variables) {
439

    
440
  $species_name = $variables['speciesName'];
441
  if(!isset($species_name['genus'])) {
442
    $species_name['genus'] = '';
443
  }
444
  if(!isset($species_name['species'])) {
445
    $species_name['species'] = '';
446
  }
447

    
448
  $ext_links = ext_links_templates(true);
449

    
450
  $ext_links_by_category = [];
451

    
452
  foreach ($ext_links as $ext_link) {
453
    if(!array_key_exists($ext_link->category, $ext_links_by_category)){
454
      $ext_links_by_category[$ext_link->category] = [];
455
    }
456
    $ext_link_render_array = make_ext_link($ext_link, $species_name);
457
    $ext_links_by_category[$ext_link->category][] = $ext_link_render_array;
458
  }
459

    
460
  $block_content = '';
461
  foreach ($ext_links_by_category as $categoryTitle => $ext_links) {
462
    $block_content .= "<div class=\"category\"><h5>" . $categoryTitle . "</h5>\n";
463
    foreach($ext_links as $ext_link){
464
      $block_content .= l($ext_link['title'], 'JavaScript:popupExternalLinks(\'' . $ext_link['url'] . '\')', ['external' => TRUE]) .'<br />';
465
    }
466
    $block_content .= "</div>";
467
  }
468

    
469
  return $block_content;
470
}
471

    
472
/**
473
 * @todo Please document this function.
474
 * @see http://drupal.org/node/1354
475
 */
476
function theme_ext_links_list_plain($variables) {
477
  $speciesName = $variables['speciesName'];
478
  if (!isset($speciesName['genus'])) {
479
    $speciesName['genus'] = '';
480
  }
481
  if (!isset($speciesName['species'])) {
482
    $speciesName['species'] = '';
483
  }
484

    
485
  $ext_links_templates = ext_links_templates(true);
486
  $block_content = '';
487
  foreach ($ext_links_templates as $ext_link) {
488
    $ext_link = make_ext_link($ext_link, $speciesName);
489
    $block_content .= l($ext_link['title'], 'JavaScript:popupExternalLinks(\'' . $ext_link['url'] . '\')', ['external' => TRUE]) .'<br />';
490
  }
491
  return $block_content;
492
}
493

    
494
/**
495
 * @todo Please document this function.
496
 * @see http://drupal.org/node/1354
497
 */
498
function ext_links_theme() {
499
  return array(
500
    'ext_links_list_grouped' => array('variables' => array(
501
      'speciesName' => NULL,
502
      'genus' => NULL,
503
      'species' => NULL,
504
      )),
505
    'ext_links_list_plain' => array('variables' => array(
506
      'speciesName' => NULL,
507
      'genus' => NULL,
508
      'species' => NULL,
509
      )),
510
    // theme_ext_links_admin_overview
511
    'ext_links_admin_overview' => array(
512
      'render element' => 'form',
513
      'file' => 'ext_links.admin.inc',
514
    ),
515
//    'ext_links_link_template_filter_order' => array(
516
//      'render element' => 'element',
517
//      'file' => 'ext_links.admin.inc',
518
//    ),
519
  );
520
}
521

    
522
/**
523
 * Get the default external links.
524
 *
525
 * @return array
526
 *   Returns an array with default external links values.
527
 */
528
function ext_links_template_defaults() {
529
  $ext_links_default["gbif"] = array(
530
    'id' => "gbif",
531
    'link' => 'http://www.gbif.org/species/search?q=',
532
    'title' => 'Search GBIF...',
533
    'glue' => ' ',
534
    'weight' => 0,
535
    'status' => 1,
536
    'category' => 'Specimens/Occurrences',
537
  );
538
  $ext_links_default["biocase"] = array(
539
    'id' => "biocase",
540
    'link' => 'http://search.biocase.org/edit/search/units/simpleSearch/query1?unitName=',
541
    'title' => 'Search BioCASE...',
542
    'glue' => ' ',
543
    'weight' => 0,
544
    'status' => 1,
545
    'category' => 'Specimens/Occurrences',
546
  );
547
  $ext_links_default["nybg"] = array(
548
    'id' => "nybg",
549
    'link' => 'http://sweetgum.nybg.org/science/vh/specimen_list.php?SummaryData=',
550
    'title' => 'Search NYBG...',
551
    'glue' => '+AND+',
552
    'weight' => 0,
553
    'status' => 1,
554
    'category' => 'Specimens/Occurrences',
555
  );
556
  $ext_links_default["tropicos"] = array(
557
    'id' => "tropicos",
558
    'link' => 'http://www.tropicos.org/NameSearch.aspx?name=',
559
    'title' => 'Search Tropicos...',
560
    'glue' => '+',
561
    'weight' => 0,
562
    'status' => 1,
563
    'category' => 'Specimens/Occurrences',
564
  );
565
  $ext_links_default["ncbi"] = array(
566
    'id' => "ncbi",
567
    'link' => 'http://www.ncbi.nlm.nih.gov/gquery/gquery.fcgi?term=',
568
    'title' => 'Search NCBI...',
569
    'glue' => '+AND+',
570
    'weight' => 0,
571
    'status' => 1,
572
    'category' => 'Molecular Resources',
573
  );
574
  $ext_links_default["google"] = array(
575
    'id' => "google",
576
    'link' => 'http://images.google.com/images?q=',
577
    'title' => 'Search Google Images...',
578
    'glue' => '+',
579
    'weight' => 0,
580
    'status' => 1,
581
    'category' => 'Images',
582
  );
583
  $ext_links_default["flickr"] = array(
584
    'id' => "flickr",
585
    'link' => 'http://www.flickr.com/search/?w=all&q=',
586
    'title' => 'Search flickr...',
587
    'glue' => '+',
588
    'weight' => 0,
589
    'status' => 1,
590
    'category' => 'Images',
591
  );
592
  $ext_links_default["scholar"] = array(
593
    'id' => "scholar",
594
    'link' => 'http://scholar.google.de/scholar?hl=de&btnG=Suche&lr=&as_ylo=&as_vis=0&q=',
595
    'title' => 'Search Google scholar...',
596
    'glue' => '+',
597
    'weight' => 0,
598
    'status' => 1,
599
    'category' => 'Literature',
600
  );
601
  $ext_links_default["bhl"] = array(
602
    'id' => "bhl",
603
    'link' => 'http://www.biodiversitylibrary.org/Search.aspx?searchCat=&searchTerm=',
604
    'title' => 'Search BHL...',
605
    'glue' => ' ',
606
    'weight' => 0,
607
    'status' => 1,
608
    'category' => 'Literature',
609
  );
610
  $ext_links_default["arkive"] = array(
611
    'id' => "arkive",
612
    'link' => 'http://www.arkive.org/search.html?q=',
613
    'title' => 'Search ARKive...',
614
    'glue' => '+',
615
    'weight' => 0,
616
    'status' => 0,
617
    'category' => 'Images',
618
  );
619
  $ext_links_default["herbcat"] = array(
620
    'id' => "herbcat",
621
    'link' => 'http://apps.kew.org/herbcat/getHomePageResults.do?homePageSearchText=',
622
    'title' => 'Search Kew Herbarium Catalogue...',
623
    'glue' => '+',
624
    'weight' => 0,
625
    'status' => 1,
626
    'category' => 'Specimens/Occurrences',
627
  );
628
  $ext_links_default["iucn"] = array(
629
    'id' => "iucn",
630
    'link' => 'http://www.iucnredlist.org/',
631
    'title' => 'Go to IUCN Red List...',
632
    'glue' => ' ',
633
    'weight' => 0,
634
    'status' => 1,
635
    'category' => 'Conservation',
636
  );
637
  $ext_links_default["ipni"] = array(
638
    'id' => "ipni",
639
    'link' => 'http://www.ipni.org/ipni/advPlantNameSearch.do?',
640
    'title' => 'Search IPNI...',
641
    'glue' => '&',
642
    'weight' => 0,
643
    'status' => 1,
644
    'category' => 'Classification',
645
  );
646
  $ext_links_default["wcsp"] = array(
647
    'id' => "wcsp",
648
    'link' => 'http://wcsp.science.kew.org/qsearch.do?plantName=',
649
    'title' => 'Search World Checklist Monocots...',
650
    'glue' => ' ',
651
    'weight' => 0,
652
    'status' => 1,
653
    'category' => 'Classification',
654
  );
655
  $ext_links_default["tpl"] = array(
656
    'id' => "tpl",
657
    'link' => 'http://www.theplantlist.org/tpl/search?q=',
658
    'title' => 'Search The Plant List...',
659
    'glue' => '+',
660
    'weight' => 0,
661
    'status' => 1,
662
    'category' => 'Classification',
663
  );
664
  $ext_links_default["eol"] = array(
665
    'id' => "eol",
666
    'link' => 'http://eol.org/search/?q=',
667
    'title' => 'Search Encyclopaedia of Life...',
668
    'glue' => '+',
669
    'weight' => 0,
670
    'status' => 1,
671
    'category' => 'General',
672
  );
673
  $ext_links_default["jstor"] = array(
674
    'id' => "jstor",
675
    'link' => 'https://plants.jstor.org/search?filter=name&so=ps_group_by_genus_species+asc&Query=',
676
    'title' => 'Search JSTOR Plant Science...',
677
    'glue' => ' ',
678
    'weight' => 0,
679
    'status' => 1,
680
    'category' => 'General',
681
  );
682
  $ext_links_default["epic"] = array(
683
    'id' => "epic",
684
    'link' => 'http://epic.kew.org/searchepic/summaryquery.do?scientificName=',
685
    'title' => 'Search ePIC...',
686
    'glue' => '+',
687
    'weight' => 0,
688
    'status' => 1,
689
    'category' => 'General',
690
  );
691
  $ext_links_default["fairchild"] = array(
692
    'id' => "fairchild",
693
    'link' => 'http://palmguide.org/palmsearch.php?query=',
694
    'title' => 'Search Fairchild Guide To Palms...',
695
    'glue' => '+',
696
    'weight' => 0,
697
    'status' => 0, //disabled since Fairchild Guide To Palms seems to be down
698
    'category' => 'Specimens/Occurrences',
699
  );
700
  $ext_links_default["ggbn"] = array(
701
    'id' => "ggbn",
702
    'link' => 'http://www.ggbn.org/ggbn_portal/search/result?fullScientificName=',
703
    'title' => 'Search GGBN...',
704
    'glue' => '+',
705
    'weight' => 0,
706
    'status' => 1,
707
    'category' => 'Molecular Resources',
708
  );
709
  return $ext_links_default;
710
}
(7-7/7)