commit 522a5b8c5352339b2c9acf22392f6cb48773228d
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Tue Jun 5 17:54:21 2018 +0200

    fix #7451 fixing outdated search URIs, hiding fairchild, adding ggbn

diff --git a/modules/cdm_dataportal/ext_links/ext_links.module b/modules/cdm_dataportal/ext_links/ext_links.module
index c72b4dc3..89a19f25 100644
--- a/modules/cdm_dataportal/ext_links/ext_links.module
+++ b/modules/cdm_dataportal/ext_links/ext_links.module
@@ -244,6 +244,7 @@ function ext_links_admin($form, &$form_state) {
     'text_description' => 'The text of the link that is displayed..',
     'category' => 'Category',
   );
+  /*
   $ext_links[18] = array(
     'form' => 'fairchild',
     'form_title' => 'Fairchild Guide To Palms',
@@ -255,6 +256,18 @@ function ext_links_admin($form, &$form_state) {
     'text_description' => 'The text of the link that is displayed..',
     'category' => 'Category',
   );
+  */
+  $ext_links[19] = array(
+    'form' => 'ggbm',
+    'form_title' => 'Global Genome Biodiversity Network',
+    'check_title' => 'Display Global Genome Biodiversity Network Link?',
+    'link_title' => 'Global Genome Biodiversity Network link',
+    'link_description' => 'The link to GGBN search without the taxon name.',
+    'concat_default_value' => '+',
+    'text_title' => 'Global Genome Biodiversity Network text',
+    'text_description' => 'The text of the link that is displayed..',
+    'category' => 'Category',
+  );
 
 
   for ($i = 0; $i < sizeof($ext_links); $i++) {
@@ -597,11 +610,15 @@ function theme_ext_links_list_grouped($variables) {
     $categories['epic']['title'] = variable_get('ext_links_epic_category', $ext_links_default['epic']['category_default_value']);
     $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 />';
   }
-  if (variable_get('ext_links_fairchild_check', 1)) {
-    $categoryTitles[] = variable_get('ext_links_fairchild_category', $ext_links_default['fairchild']['category_default_value']);
-    $categories['fairchild']['title'] = variable_get('ext_links_fairchild_category', $ext_links_default['fairchild']['category_default_value']);
-    $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 />';
-
+//  if (variable_get('ext_links_fairchild_check', 1)) {
+//    $categoryTitles[] = variable_get('ext_links_fairchild_category', $ext_links_default['fairchild']['category_default_value']);
+//    $categories['fairchild']['title'] = variable_get('ext_links_fairchild_category', $ext_links_default['fairchild']['category_default_value']);
+//    $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 />';
+//  }
+  if (variable_get('ext_links_ggbn_check', 1)) {
+    $categoryTitles[] = variable_get('ext_links_ggbn_category', $ext_links_default['ggbn']['category_default_value']);
+    $categories['ggbn']['title'] = variable_get('ext_links_ggnb_category', $ext_links_default['ggbn']['category_default_value']);
+    $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 />';
   }
 
   $categoryTitles = array_unique($categoryTitles);
@@ -682,8 +699,11 @@ function theme_ext_links_list_plain($variables) {
   if (variable_get('ext_links_bhl_check', 1)) {
     $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 />';
   }
-  if (variable_get('ext_links_fairchild_check', 1)) {
-    $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 />';
+//  if (variable_get('ext_links_fairchild_check', 1)) {
+//    $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 />';
+//  }
+  if (variable_get('ext_links_ggbn_check', 1)) {
+    $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 />';
   }
   if (variable_get('ext_links_arkive_check', 1)) {
     $postURL = '&output=xml_no_dtd&client=arkive-images&site=arkive-images&ie=utf8&oe=utf8&num=20&proxystylesheet=tng-search&filter=0&getfields=*';
@@ -767,7 +787,7 @@ function ext_links_get_default() {
     'category_default_value' => 'Specimens/Occurrences',
   );
   $ext_links_default["nybg"] = array(
-    'link_default_value' => 'http://sweetgum.nybg.org/vh/specimen_list.php?Where=',
+    'link_default_value' => 'http://sweetgum.nybg.org/science/vh/specimen_list.php?SummaryData=',
     'text_default_value' => 'Search NYBG...',
     'category_default_value' => 'Specimens/Occurrences',
   );
@@ -822,7 +842,7 @@ function ext_links_get_default() {
     'category_default_value' => 'Classification',
   );
   $ext_links_default["wcsp"] = array(
-    'link_default_value' => 'http://apps.kew.org/wcsp/prepareChecklist.do?checklist=monocots%40%40150290520121019541',
+    'link_default_value' => 'http://wcsp.science.kew.org/qsearch.do?plantName=',
     'text_default_value' => 'Search World Checklist Monocots...',
     'category_default_value' => 'Classification',
   );
@@ -837,7 +857,7 @@ function ext_links_get_default() {
     'category_default_value' => 'General',
   );
   $ext_links_default["jstor"] = array(
-    'link_default_value' => 'http://plants.jstor.org/search?searchText=',
+    'link_default_value' => 'https://plants.jstor.org/search?filter=name&so=ps_group_by_genus_species+asc&Query=',
     'text_default_value' => 'Search JSTOR Plant Science...',
     'category_default_value' => 'General',
   );
@@ -846,10 +866,19 @@ function ext_links_get_default() {
     'text_default_value' => 'Search ePIC...',
     'category_default_value' => 'General',
   );
+  /*
+   * hidden since Fairchild Guide To Palms seems to be down
   $ext_links_default["fairchild"] = array(
     'link_default_value' => 'http://palmguide.org/palmsearch.php?query=',
     'text_default_value' => 'Search Fairchild Guide To Palms...',
     'category_default_value' => 'Specimens/Occurrences',
   );
+  */
+  $ext_links_default["ggbn"] = array(
+    'link_default_value' => 'http://www.ggbn.org/ggbn_portal/search/result?fullScientificName=',
+    'text_default_value' => 'Search GGBN...',
+    'category_default_value' => 'Molecular Resources',
+  );
+  //
   return $ext_links_default;
 }
