Browse Source

Added a new Data Search menu/block for all default content type search pages to be found. Previously there were put by default on the Navigation menu which made them a pain to move

Stephen Ficklin 7 years ago
parent
commit
a10f618375
2 changed files with 24 additions and 0 deletions
  1. 21 0
      tripal/tripal.install
  2. 3 0
      tripal/tripal.views_default.inc

+ 21 - 0
tripal/tripal.install

@@ -19,6 +19,13 @@ function tripal_install() {
       'not null' => FALSE,
     ));
   }
+
+  $menu = array(
+    'menu_name' => 'data_search',
+    'title' => t('Data Search'),
+    'description' => 'The Data Search menu contains links to search tools for finding biological data.',
+  );
+  menu_save($menu);
 }
 
 /**
@@ -1011,4 +1018,18 @@ function tripal_update_7306() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Could not add the tripal_collection table:' . $error);
   }
+}
+/**
+ * Adds a new Data search menu for the Tripal created search tools.  If you
+ * have customized any of the Tripal content search forms then those forms will
+ * remain unchanged. All other default search pages will be moved to the
+ * new Data Search menu item available at Admin > Stucture > Menu > Data Search.
+ */
+function tripal_update_7307() {
+  $menu = array(
+    'menu_name' => 'data_search',
+    'title' => t('Data Search'),
+    'description' => 'The Data Search menu contains links to search tools for finding biological data.',
+  );
+  menu_save($menu);
 }

+ 3 - 0
tripal/tripal.views_default.inc

@@ -228,6 +228,9 @@ function tripal_bundle_default_views(&$views) {
     $handler->display->display_options['menu']['title'] = $bundle->label . ' Search';
     $handler->display->display_options['menu']['description'] = 'A search form for finding ' . $bundle->label . ' records';
     $handler->display->display_options['menu']['weight'] = '-10';
+    $handler->display->display_options['menu']['name'] = 'data_search';
+    $handler->display->display_options['menu']['context'] = 0;
+    $handler->display->display_options['menu']['context_only_inline'] = 0;
 
     $views[$view_name] = $view;
   }