Browse Source

Merge branch '7.x-2.x' of git.drupal.org:sandbox/spficklin/1337878 into 7.x-2.x

Stephen Ficklin 11 years ago
parent
commit
8335722371

+ 5 - 5
tripal_contact/tripal_contact.module

@@ -191,16 +191,16 @@ function tripal_contact_theme() {
 function tripal_contact_block_info() {
 
   $blocks['contbase']['info'] = t('Tripal Contact Details');
-  $blocks['contbase']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contbase']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['contprops']['info'] = t('Tripal Contact Properties');
-  $blocks['contprops']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contprops']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['contrels']['info'] = t('Tripal Contact Relationships');
-  $blocks['contrels']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contrels']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['contpubs']['info'] = t('Tripal Cotact Publications');
-  $blocks['contpubs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['contpubs']['cache'] = 'BLOCK_NO_CACHE';
 
   return $blocks;
 }
@@ -687,7 +687,7 @@ function tripal_contact_preprocess_tripal_contact_relationships(&$variables) {
 
 /**
  * Implementation of hook_form_alter()
- * 
+ *
  * @param $form
  * @param $form_state
  * @param $form_id

+ 8 - 0
tripal_core/tripal_core.views.inc

@@ -373,6 +373,14 @@ function tripal_core_views_data_mviews($data) {
     'weight' => 10,
   );
 
+    // Implicit Join to Tripal Views
+  $data['tripal_mviews']['table']['join'] = array(
+    'tripal_views' => array(
+      'left_field' => 'mview_id',
+      'field' => 'mview_id',
+    ),
+  );
+
   // Mview ID
   $data['tripal_mviews']['mview_id'] = array(
     'title' => t('Materialized View ID'),

+ 36 - 2
tripal_featuremap/includes/tripal_featuremap.admin.inc

@@ -1,4 +1,38 @@
 <?php
+
+/**
+ * Admin launchpad
+ */
+function tripal_featuremap_admin_featuremaps_listing() {
+  $output = '';
+
+  // set the breadcrumb
+  $breadcrumb = array();
+  $breadcrumb[] = l('Home', '<front>');
+  $breadcrumb[] = l('Administration', 'admin');
+  $breadcrumb[] = l('Tripal', 'admin/tripal');
+  $breadcrumb[] = l('Chado', 'admin/tripal/chado');
+  $breadcrumb[] = l('Maps', 'admin/tripal/chado/tripal_featuremap');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_featuremap_admin_featuremaps','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Tripal Feature Map Module uses primarily views to provide an '
+      . 'administrative interface. Currently one or more views needed for this '
+      . 'administrative interface are disabled. <strong>Click each of the following links to '
+      . 'enable the pertinent views</strong>:</p>';
+    $output .= '<ul>';
+      $output .= '<li>'.l('Feature Map Admin', 'admin/tripal/chado/tripal_featuremap/views/featuremaps/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
+}
+
 /**
  * Administrative settings form
  *
@@ -19,7 +53,7 @@ function tripal_featuremap_admin() {
   if (!$active_jobs) {
     get_tripal_featuremap_admin_form_sync_set($form);
     get_tripal_featuremap_admin_form_cleanup_set($form);
-// TODO: complete coding of indexing and taxonomy assignment to features.    
+// TODO: complete coding of indexing and taxonomy assignment to features.
 //    get_tripal_featuremap_admin_form_reindex_set($form);
 //    get_tripal_featuremap_admin_form_taxonomy_set($form);
   }
@@ -368,7 +402,7 @@ function tripal_featuremap_sync_featuremaps($featuremap_id = NULL, $job_id = NUL
 function tripal_featuremap_cleanup($dummy = NULL, $job_id = NULL) {
 
   return tripal_core_clean_orphaned_nodes('featuremap', $job_id);
-  
+
 }
 /**
  * Add the map as a taxonomy term for associating with map_features

+ 0 - 0
tripal_featuremap/theme/tripal_featuremap_admin.tpl.php → tripal_featuremap/theme/tripal_featuremap_help.tpl.php


+ 61 - 43
tripal_featuremap/tripal_featuremap.module

@@ -134,22 +134,32 @@ function tripal_featuremap_menu() {
   $items = array();
 
   // The administative settings menu
-  $items['admin/tripal/tripal_featuremap'] = array(
+  $items['admin/tripal/chado/tripal_featuremap'] = array(
     'title' => 'Maps',
+    'description' => 'Genetic Maps of Features',
+    'page callback' => 'tripal_featuremap_admin_featuremaps_listing',
+    'access arguments' => array('administer tripal featuremap'),
+    'type' => MENU_NORMAL_ITEM,
+  );
+
+  $items['admin/tripal/chado/tripal_featuremap/help'] = array(
+    'title' => 'Help',
     'description' => 'Basic Description of Tripal Map Module Functionality',
     'page callback' => 'theme',
-    'page arguments' => array('tripal_featuremap_admin'),
+    'page arguments' => array('tripal_featuremap_help'),
     'access arguments' => array('administer tripal featuremap'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 10
   );
 
-  $items['admin/tripal/tripal_featuremap/configuration'] = array(
-    'title' => 'Configuration',
+  $items['admin/tripal/chado/tripal_featuremap/configuration'] = array(
+    'title' => 'Settings',
     'description' => 'Manage integration of Chado maps including associated features.',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_featuremap_admin'),
     'access arguments' => array('administer tripal featuremap'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 2
   );
 
   // Synchronizing maps from Chado to Drupal
@@ -159,7 +169,7 @@ function tripal_featuremap_menu() {
     'access arguments' => array('administer tripal featuremap'),
     'type' => MENU_CALLBACK
   );
-  
+
   // AJAX calls for adding/removing properties to a featuremap
   $items['tripal_featuremap/properties/add'] = array(
     'page callback' => 'tripal_featuremap_property_add',
@@ -178,6 +188,14 @@ function tripal_featuremap_menu() {
     'type ' => MENU_CALLBACK,
   );
 
+  $items['admin/tripal/chado/tripal_featuremap/views/featuremaps/enable'] = array(
+    'title' => 'Enable featuremap Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_featuremap_admin_featuremaps', 'admin/tripal/chado/tripal_featuremap'),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+
   return $items;
 }
 
@@ -230,16 +248,16 @@ function tripal_featuremap_theme() {
       'arguments' => array('node' => NULL),
       'template' => 'tripal_featuremap_references',
     ),
-    'tripal_featuremap_admin' => array(
-      'template' => 'tripal_featuremap_admin',
+    'tripal_featuremap_help' => array(
+      'template' => 'tripal_featuremap_help',
       'arguments' =>  array(NULL),
       'path' => drupal_get_path('module', 'tripal_featuremap') . '/theme'
     ),
-    
+
     // Themed Forms
     'chado_featuremap_node_form' => array(
      'arguments' => array('form'),
-    ),      
+    ),
   );
 }
 
@@ -249,20 +267,20 @@ function tripal_featuremap_theme() {
 function tripal_featuremap_block_info() {
 
   $blocks['mapbase']['info'] = t('Tripal Map Details');
-  $blocks['mapbase']['cache'] = BLOCK_NO_CACHE;
+  $blocks['mapbase']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['mapprops']['info'] = t('Tripal Map Properties');
-  $blocks['mapprops']['cache'] = BLOCK_NO_CACHE;
-  
+  $blocks['mapprops']['cache'] = 'BLOCK_NO_CACHE';
+
   $blocks['mappos']['info'] = t('Tripal Map Features');
-  $blocks['mappos']['cache'] = BLOCK_NO_CACHE;
-  
+  $blocks['mappos']['cache'] = 'BLOCK_NO_CACHE';
+
   $blocks['mappubs']['info'] = t('Tripal Map Publications');
-  $blocks['mappubs']['cache'] = BLOCK_NO_CACHE;
+  $blocks['mappubs']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['maprefs']['info'] = t('Tripal Map References');
-  $blocks['maprefs']['cache'] = BLOCK_NO_CACHE;
-    
+  $blocks['maprefs']['cache'] = 'BLOCK_NO_CACHE';
+
   return $blocks;
 }
 /**
@@ -336,7 +354,7 @@ function tripal_featuremap_cron() {
  *  @return
  *  If the permission for the specified operation is not set then return FALSE. If the
  *  permission is set then return NULL as this allows other modules to disable
- *  access.  The only exception is when the $op == 'create'.  We will always 
+ *  access.  The only exception is when the $op == 'create'.  We will always
  *  return TRUE if the permission is set.
  *
  * @ingroup tripal_featuremap
@@ -384,7 +402,7 @@ function chado_featuremap_node_access($node, $op, $account) {
  */
 function chado_featuremap_insert($node) {
 
-  // if the featuremap_id already exists then we got to the insert via 
+  // if the featuremap_id already exists then we got to the insert via
   // a syncing operation.  We do not need to add the feature map
   if ($node->featuremap_id) {
     $featuremap['featuremap_id'] = $node->featuremap_id;
@@ -400,29 +418,29 @@ function chado_featuremap_insert($node) {
       drupal_set_message(t('Unable to add featuremap.', 'warning'));
       watchdog('tripal_featuremap', 'Unable to create feature map where values: %values',
         array('%values' => print_r($values, TRUE)), WATCHDOG_WARNING);
-      return;  
+      return;
     }
-    
+
     // now add the properties
     $properties = array(); // stores all of the properties we need to add
     $cross_refs = array(); // stores any cross references for this featuremap
-  
+
     // get the list of properties for easy lookup (without doing lots of database queries
     $properties_list = array();
     $sql = "
       SELECT DISTINCT CVT.cvterm_id, CVT.name, CVT.definition
       FROM  {cvterm} CVT
         INNER JOIN {cv} ON CVT.cv_id = CV.cv_id
-      WHERE 
-        CV.name = 'featuremap_property' AND 
+      WHERE
+        CV.name = 'featuremap_property' AND
         NOT CVT.is_obsolete = 1
-      ORDER BY CVT.name ASC 
+      ORDER BY CVT.name ASC
     ";
     $prop_types = chado_query($sql);
     while ($prop = $prop_types->fetchObject()) {
       $properties_list[$prop->cvterm_id] = $prop->name;
-    }   
-  
+    }
+
     // get the properties that should be added. Properties are in one of two forms:
     //  1) prop_value-[type id]-[index]
     //  2) new_value-[type id]-[index]
@@ -441,8 +459,8 @@ function chado_featuremap_insert($node) {
       $name = $properties_list[$type_id];
       $properties[$name][$index] = trim($node->new_value);
     }
-    
-    // iterate through all of the properties to see if the Map dbxref is set, 
+
+    // iterate through all of the properties to see if the Map dbxref is set,
     // if so, add it to the $cross_refs array
     foreach ($properties as $name => $element) {
       foreach ($element as $index => $value) {
@@ -453,11 +471,11 @@ function chado_featuremap_insert($node) {
         }
       }
     }
-    
+
     // now add in the properties
     foreach ($properties as $property => $elements) {
       foreach ($elements as $rank => $value) {
-         
+
         $status = tripal_featuremap_insert_property($featuremap['featuremap_id'], $property, $value, FALSE);
         if (!$status) {
           drupal_set_message("Error cannot add property: $property", "error");
@@ -466,7 +484,7 @@ function chado_featuremap_insert($node) {
         }
       }
     }
-  
+
     // add in any database cross-references
     foreach ($cross_refs as $index => $ref) {
       $featuremap_dbxref = tripal_featuremap_add_featuremap_dbxref($featuremap['featuremap_id'], trim($ref));
@@ -486,7 +504,7 @@ function chado_featuremap_insert($node) {
     if (!$featuremap_id) {
        // next add the item to the drupal table
       $sql = "
-        INSERT INTO {chado_featuremap} (nid, vid, featuremap_id) 
+        INSERT INTO {chado_featuremap} (nid, vid, featuremap_id)
         VALUES (:nid, :vid, :featuremap_id)
       ";
       db_query($sql, array(':nid' => $node->nid, ':vid' => $node->vid, ':featuremap_id' => $featuremap['featuremap_id']));
@@ -524,23 +542,23 @@ function chado_featuremap_update($node) {
   // now update the properties
   $properties = array(); // stores all of the properties we need to add
   $cross_refs = array(); // stores any cross references for this map
-   
+
   // get the list of properties for easy lookup (without doing lots of database queries
   $properties_list = array();
   $sql = "
     SELECT DISTINCT CVT.cvterm_id, CVT.name, CVT.definition
     FROM  {cvterm} CVT
       INNER JOIN {cv} ON CVT.cv_id = CV.cv_id
-    WHERE 
-      CV.name = 'featuremap_property' AND 
+    WHERE
+      CV.name = 'featuremap_property' AND
       NOT CVT.is_obsolete = 1
-    ORDER BY CVT.name ASC 
+    ORDER BY CVT.name ASC
   ";
   $prop_types = chado_query($sql);
   while ($prop = $prop_types->fetchObject()) {
     $properties_list[$prop->cvterm_id] = $prop->name;
   }
-  
+
   // get the properties that should be added. Properties are in one of three forms:
   //  1) prop_value-[type id]-[index]
   //  2) new_value-[type id]-[index]
@@ -566,8 +584,8 @@ function chado_featuremap_update($node) {
     $index = count($properties[$name]);
     $properties[$name][$index] = trim($node->new_value);
   }
-  
-  // iterate through all of the properties to see if the Map dbxref is set, 
+
+  // iterate through all of the properties to see if the Map dbxref is set,
   // if so, add it to the $cross_refs array
   foreach ($properties as $name => $element) {
     foreach ($element as $index => $value) {
@@ -616,7 +634,7 @@ function chado_featuremap_load($node) {
 
   $values = array('featuremap_id' => $featuremap_id);
   $featuremap = tripal_core_generate_chado_var('featuremap', $values);
-  
+
   // expand the description field as it is needed by the form
   $featuremap = tripal_core_expand_chado_vars($featuremap, 'field', 'featuremap.description');
 

+ 173 - 355
tripal_featuremap/tripal_featuremap.views_default.inc

@@ -8,365 +8,183 @@
 function tripal_featuremap_views_default_views() {
   $views = array();
 
-  if (!module_exists('tripal_views')) {
-    return $views;
-  }
+  $view = tripal_featuremap_defaultview_admin_featuremaps();
+  $views[$view->name] = $view;
+
+  return $views;
+}
+
+function tripal_featuremap_defaultview_admin_featuremaps() {
 
-  // Main default view
-  $view = new view;
-  $view->name = 'featuremap_listing';
-  $view->description = 'A listing of all chado feature maps';
-  $view->tag = 'chado default';
+  $view = new view();
+  $view->name = 'tripal_featuremap_admin_featuremaps';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
   $view->base_table = 'featuremap';
+  $view->human_name = 'Feature Map Admin';
   $view->core = 6;
-  $view->api_version = '2';
+  $view->api_version = '3.0';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
-    'name' => array(
-      'label' => 'Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => 'node/[nid]',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'link_to_node' => 1,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'featuremap',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-    'description' => array(
-      'label' => 'Description',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'link_to_node' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'description',
-      'table' => 'featuremap',
-      'field' => 'description',
-      'relationship' => 'none',
-    ),
-    'name_1' => array(
-      'label' => 'Map Units',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'link_to_node' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name_1',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('sorts', array(
-    'name' => array(
-      'order' => 'ASC',
-      'id' => 'name',
-      'table' => 'featuremap',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'unittype_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'unittype_id_op',
-        'identifier' => 'unittype_id',
-        'label' => 'Map Units',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'unittype_id',
-      'table' => 'featuremap',
-      'field' => 'unittype_id',
-      'relationship' => 'none',
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'name_1' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'name_1_op',
-        'identifier' => 'name_1',
-        'label' => 'Name',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'name_1',
-      'table' => 'featuremap',
-      'field' => 'name',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'description' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'description_op',
-        'identifier' => 'description',
-        'label' => 'Description',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'description',
-      'table' => 'featuremap',
-      'field' => 'description',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all feature maps matching the entered criteria. If you leave a any of the criteria blank then the maps will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all maps will be listed.',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access chado_featuremap content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Maps');
-  $handler->override_option('header', 'Click "Show" to see a list of all feature maps matching the entered criteria. If you leave a any of the criteria blank then the maps will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all maps will be listed.');
-  $handler->override_option('header_format', '1');
-  $handler->override_option('header_empty', 1);
-  $handler->override_option('empty', 'No feature maps match the current criteria.');
-  $handler->override_option('empty_format', '1');
-  $handler->override_option('items_per_page', 25);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'name' => 'name',
-      'description' => 'description',
-      'name_1' => 'name_1',
-      'nid' => 'nid',
-    ),
-    'info' => array(
-      'name' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'description' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'name_1' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'nid' => array(
-        'separator' => '',
-      ),
-    ),
-    'default' => '-1',
-  ));
-  $default_handler = $handler;
-  $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/featuremaps');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Maps',
-    'description' => 'A listing of chado feature maps.',
-    'weight' => '0',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
+  $handler->display->display_options['title'] = 'Maps';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['access']['perm'] = 'access chado_featuremap content';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+  'name' => 'name',
+  'description' => 'description',
+  'name_1' => 'name_1',
+  'nid' => 'nid',
+  );
+  $handler->display->display_options['style_options']['default'] = '-1';
+  $handler->display->display_options['style_options']['info'] = array(
+  'name' => array(
+    'sortable' => 1,
+    'separator' => '',
+  ),
+  'description' => array(
+    'sortable' => 1,
+    'separator' => '',
+  ),
+  'name_1' => array(
+    'sortable' => 1,
+    'separator' => '',
+  ),
+  'nid' => array(
+    'separator' => '',
+  ),
+  );
+  /* Header: Global: Action Links */
+  $handler->display->display_options['header']['action_links_area']['id'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area']['table'] = 'views';
+  $handler->display->display_options['header']['action_links_area']['field'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area']['label'] = 'Action Links';
+  $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
+  $handler->display->display_options['header']['action_links_area']['link-1'] = array(
+  'label-1' => 'Add Map',
+  'path-1' => 'node/add/tripal-featuremap',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-2'] = array(
+  'label-2' => '',
+  'path-2' => '',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-3'] = array(
+  'label-3' => '',
+  'path-3' => '',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-4'] = array(
+  'label-4' => '',
+  'path-4' => '',
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No feature maps match the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '1';
+  /* Relationship: Featuremap: Featuremap => Node */
+  $handler->display->display_options['relationships']['featuremap_id']['id'] = 'featuremap_id';
+  $handler->display->display_options['relationships']['featuremap_id']['table'] = 'chado_featuremap';
+  $handler->display->display_options['relationships']['featuremap_id']['field'] = 'featuremap_id';
+  /* Field: Content: Nid */
+  $handler->display->display_options['fields']['nid']['id'] = 'nid';
+  $handler->display->display_options['fields']['nid']['table'] = 'node';
+  $handler->display->display_options['fields']['nid']['field'] = 'nid';
+  $handler->display->display_options['fields']['nid']['relationship'] = 'featuremap_id';
+  $handler->display->display_options['fields']['nid']['exclude'] = TRUE;
+  /* Field: Chado Featuremap: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'featuremap';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  $handler->display->display_options['fields']['name']['alter']['path'] = 'node/[nid]';
+  /* Field: Chado Featuremap: Description */
+  $handler->display->display_options['fields']['description']['id'] = 'description';
+  $handler->display->display_options['fields']['description']['table'] = 'featuremap';
+  $handler->display->display_options['fields']['description']['field'] = 'description';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name_1']['id'] = 'name_1';
+  $handler->display->display_options['fields']['name_1']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name_1']['field'] = 'name';
+  $handler->display->display_options['fields']['name_1']['label'] = 'Map Units';
+  /* Field: Content: Delete link */
+  $handler->display->display_options['fields']['delete_node']['id'] = 'delete_node';
+  $handler->display->display_options['fields']['delete_node']['table'] = 'views_entity_node';
+  $handler->display->display_options['fields']['delete_node']['field'] = 'delete_node';
+  $handler->display->display_options['fields']['delete_node']['relationship'] = 'featuremap_id';
+  $handler->display->display_options['fields']['delete_node']['exclude'] = TRUE;
+  /* Field: Content: Edit link */
+  $handler->display->display_options['fields']['edit_node']['id'] = 'edit_node';
+  $handler->display->display_options['fields']['edit_node']['table'] = 'views_entity_node';
+  $handler->display->display_options['fields']['edit_node']['field'] = 'edit_node';
+  $handler->display->display_options['fields']['edit_node']['relationship'] = 'featuremap_id';
+  $handler->display->display_options['fields']['edit_node']['exclude'] = TRUE;
+  /* Field: Global: Custom text */
+  $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
+  $handler->display->display_options['fields']['nothing']['table'] = 'views';
+  $handler->display->display_options['fields']['nothing']['field'] = 'nothing';
+  $handler->display->display_options['fields']['nothing']['label'] = '';
+  $handler->display->display_options['fields']['nothing']['alter']['text'] = '[edit_node]   [delete_node]';
+  $handler->display->display_options['fields']['nothing']['element_label_colon'] = FALSE;
+  /* Sort criterion: Chado Featuremap: Name */
+  $handler->display->display_options['sorts']['name']['id'] = 'name';
+  $handler->display->display_options['sorts']['name']['table'] = 'featuremap';
+  $handler->display->display_options['sorts']['name']['field'] = 'name';
+  /* Filter criterion: Chado Featuremap: Name */
+  $handler->display->display_options['filters']['name_1']['id'] = 'name_1';
+  $handler->display->display_options['filters']['name_1']['table'] = 'featuremap';
+  $handler->display->display_options['filters']['name_1']['field'] = 'name';
+  $handler->display->display_options['filters']['name_1']['operator'] = 'contains';
+  $handler->display->display_options['filters']['name_1']['group'] = '0';
+  $handler->display->display_options['filters']['name_1']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['name_1']['expose']['operator_id'] = 'name_1_op';
+  $handler->display->display_options['filters']['name_1']['expose']['label'] = 'Name Contains';
+  $handler->display->display_options['filters']['name_1']['expose']['operator'] = 'name_1_op';
+  $handler->display->display_options['filters']['name_1']['expose']['identifier'] = 'name_1';
+  $handler->display->display_options['filters']['name_1']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Featuremap: Description */
+  $handler->display->display_options['filters']['description']['id'] = 'description';
+  $handler->display->display_options['filters']['description']['table'] = 'featuremap';
+  $handler->display->display_options['filters']['description']['field'] = 'description';
+  $handler->display->display_options['filters']['description']['operator'] = 'contains';
+  $handler->display->display_options['filters']['description']['group'] = '0';
+  $handler->display->display_options['filters']['description']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['description']['expose']['operator_id'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['label'] = 'Description Contains';
+  $handler->display->display_options['filters']['description']['expose']['operator'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['identifier'] = 'description';
+  $handler->display->display_options['filters']['description']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
 
-  // Add code specific to a local chado installation
-  // NOTE: Edit $handler above to $default_handler for the default display
-  if (tripal_core_chado_schema_exists()) {
-    // Add nid field
-    $fields = $view->get_items('field', 'default');
-    $new_fields = array(
-      'nid' => array(
-        'label' => 'Nid',
-        'alter' => array(
-          'alter_text' => 0,
-          'text' => '',
-          'make_link' => 0,
-          'path' => '',
-          'absolute' => 0,
-          'link_class' => '',
-          'alt' => '',
-          'rel' => '',
-          'prefix' => '',
-          'suffix' => '',
-          'target' => '',
-          'help' => '',
-          'trim' => 0,
-          'max_length' => '',
-          'word_boundary' => 1,
-          'ellipsis' => 1,
-          'html' => 0,
-          'strip_tags' => 0,
-        ),
-        'empty' => '',
-        'hide_empty' => 0,
-        'empty_zero' => 0,
-        'hide_alter_empty' => 1,
-        'link_to_node' => 0,
-        'exclude' => 1,
-        'id' => 'nid',
-        'table' => 'node',
-        'field' => 'nid',
-        'relationship' => 'none',
-      )
-    );
-    $fields = $new_fields + $fields;
-    // Adds feature => Node relationship
-    $default_handler->override_option('relationships', array(
-      'nid' => array(
-        'label' => 'Map to Node',
-        'required' => 0,
-        'id' => 'nid',
-        'table' => 'chado_featuremap',
-        'field' => 'nid',
-        'relationship' => 'none',
-      ),
-    ));
-    // Change analysis.name to have a link to the node
-    $fields['name']['alter']['link_to_node'] = 1;
-    $default_handler->override_option('fields', $fields);
-    // Only show records with published nodes
-    /**
-    $filters = $view->get_items('filter', 'default');
-    $filters['status'] = array(
-      'operator' => '=',
-      'value' => '1',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'status',
-      'table' => 'node',
-      'field' => 'status',
-      'relationship' => 'none',
-    );
-    $default_handler->override_option('filters', $filters);
-    */
-  }
-  $views[$view->name] = $view;
+  /* Display: Page */
+  $handler = $view->new_display('page', 'Page', 'page_1');
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_featuremap/featuremaps';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Maps';
+  $handler->display->display_options['menu']['description'] = 'A listing of chado feature maps.';
+  $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
+  $handler->display->display_options['tab_options']['weight'] = '0';
 
-  return $views;
-}
+  return $view;
+}

+ 31 - 0
tripal_genetic/includes/tripal_genetic.admin.inc

@@ -0,0 +1,31 @@
+<?php
+
+function tripal_genetic_admin_genetics_listing() {
+  $output = '';
+
+  // set the breadcrumb
+  $breadcrumb = array();
+  $breadcrumb[] = l('Home', '<front>');
+  $breadcrumb[] = l('Administration', 'admin');
+  $breadcrumb[] = l('Tripal', 'admin/tripal');
+  $breadcrumb[] = l('Chado', 'admin/tripal/chado');
+  $breadcrumb[] = l('Genetics', 'admin/tripal/chado/tripal_genetic');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_genetic_admin_genetics','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Tripal Genetic Module uses primarily views to provide an '
+      . 'administrative interface. Currently one or more views needed for this '
+      . 'administrative interface are disabled. <strong>Click each of the following links to '
+      . 'enable the pertinent views</strong>:</p>';
+    $output .= '<ul>';
+      $output .= '<li>'.l('Genetic Admin', 'admin/tripal/chado/tripal_genetic/views/genetics/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
+}

+ 0 - 0
tripal_genetic/theme/tripal_genetic_help.tpl.php


+ 46 - 2
tripal_genetic/tripal_genetic.module

@@ -14,9 +14,48 @@
 
 require('api/tripal_genetic.api.inc');
 require('includes/tripal_genetic.schema.inc');
+require('includes/tripal_genetic.admin.inc');
 
+/**
+ *  Menu items are automatically added for the new node types created
+ *  by this module to the 'Create Content' Navigation menu item.  This function
+ *  adds more menu items needed for this module.
+ *
+ * @ingroup tripal_genetic
+ */
+function tripal_genetic_menu() {
+  $items = array();
+
+    // the administative settings menu
+  $items['admin/tripal/chado/tripal_genetic'] = array(
+   'title' => 'Genetics',
+   'description' => 'Genetic data including Genotypes.',
+   'page callback' => 'tripal_genetic_admin_genetics_listing',
+   'access arguments' => array('adminster tripal genetic'),
+   'type' => MENU_NORMAL_ITEM,
+  );
+
+  $items['admin/tripal/chado/tripal_genetic/help'] = array(
+   'title' => 'Help',
+   'description' => "A description of the Tripal genetic module including a short description of it's usage.",
+   'page callback' => 'theme',
+   'page arguments' => array('tripal_genetic_help'),
+   'access arguments' => array('adminster tripal genetic'),
+   'type' => MENU_LOCAL_TASK,
+  );
 
-/*************************************************************************
+  $items['admin/tripal/chado/tripal_genetic/views/genetics/enable'] = array(
+    'title' => 'Enable genetic Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_genetic_admin_genetics', 'admin/tripal/chado/tripal_genetic'),
+    'access arguments' => array('administer tripal genetic'),
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+/**
  * Implements hook_views_api()
  * Purpose: Essentially this hook tells drupal that there is views support for
  *  for this module which then includes tripal_genetic.views.inc where all the
@@ -26,7 +65,7 @@ require('includes/tripal_genetic.schema.inc');
  */
 function tripal_genetic_views_api() {
   return array(
-      'api' => 2.0,
+      'api' => 3.0,
   );
 }
 
@@ -48,6 +87,11 @@ function tripal_genetic_theme() {
       'template' => 'tripal_stock_genotypes',
       'path' => "$theme_path/tripal_stock",
     ),
+    'tripal_genetic_help' => array(
+      'template' => 'tripal_genetic_help',
+      'variables' =>  array(NULL),
+      'path' => "$theme_path",
+    ),
   );
   return $items;
 }

+ 106 - 231
tripal_genetic/tripal_genetic.views_default.inc

@@ -8,246 +8,121 @@
 function tripal_genetic_views_default_views() {
   $views = array();
 
-  if (!module_exists('tripal_views')) {
-    return $views;
-  }
+  $view = tripal_genetic_defaultviews_admin_genotypes();
+  $views[$view->name] = $view;
+
+  return $views;
+}
+
+function tripal_genetic_defaultviews_admin_genotypes() {
 
-  // Main default view
-  $view = new view;
-  $view->name = 'genotype_listing';
-  $view->description = 'A listing of observed genotypes and the features displaying them';
-  $view->tag = 'chado default';
+  $view = new view();
+  $view->name = 'tripal_genetic_admin_genetics';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
   $view->base_table = 'genotype';
-  $view->core = 6;
-  $view->api_version = '2';
+  $view->human_name = 'Genotype Admin';
+  $view->core = 7;
+  $view->api_version = '3.0';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
+  $handler->display->display_options['title'] = 'Genotypes Observed';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'uniquename' => 'uniquename',
+    'name' => 'name',
+    'description' => 'description',
+  );
+  $handler->display->display_options['style_options']['default'] = 'uniquename';
+  $handler->display->display_options['style_options']['info'] = array(
     'uniquename' => array(
-      'label' => 'Uniquename',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'uniquename',
-      'table' => 'genotype',
-      'field' => 'uniquename',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'name' => array(
-      'label' => 'Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'genotype',
-      'field' => 'name',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'description' => array(
-      'label' => 'Description',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'description',
-      'table' => 'genotype',
-      'field' => 'description',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'uniquename' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'uniquename_op',
-        'identifier' => 'uniquename',
-        'label' => 'Unique Name Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'uniquename',
-      'table' => 'genotype',
-      'field' => 'uniquename',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
-    'description' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'description_op',
-        'identifier' => 'description',
-        'label' => 'Description Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'description',
-      'table' => 'genotype',
-      'field' => 'description',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all genotypes matching the entered criteria. If you leave a any of the criteria blank then the genotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all genotypes will be listed.',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Genotypes Observed');
-  $handler->override_option('header', 'Click "Show" to see a list of all genotypes matching the entered criteria. If you leave a any of the criteria blank then the genotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all genotypes will be listed.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No genotypes match the current criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'uniquename' => 'uniquename',
-      'name' => 'name',
-      'description' => 'description',
-    ),
-    'info' => array(
-      'uniquename' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'name' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'description' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => 'uniquename',
-  ));
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No genotypes match the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Field: Chado Genotype: Uniquename */
+  $handler->display->display_options['fields']['uniquename']['id'] = 'uniquename';
+  $handler->display->display_options['fields']['uniquename']['table'] = 'genotype';
+  $handler->display->display_options['fields']['uniquename']['field'] = 'uniquename';
+  /* Field: Chado Genotype: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'genotype';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  /* Field: Chado Genotype: Description */
+  $handler->display->display_options['fields']['description']['id'] = 'description';
+  $handler->display->display_options['fields']['description']['table'] = 'genotype';
+  $handler->display->display_options['fields']['description']['field'] = 'description';
+  /* Filter criterion: Chado Genotype: Uniquename */
+  $handler->display->display_options['filters']['uniquename']['id'] = 'uniquename';
+  $handler->display->display_options['filters']['uniquename']['table'] = 'genotype';
+  $handler->display->display_options['filters']['uniquename']['field'] = 'uniquename';
+  $handler->display->display_options['filters']['uniquename']['operator'] = 'contains';
+  $handler->display->display_options['filters']['uniquename']['group'] = '0';
+  $handler->display->display_options['filters']['uniquename']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['uniquename']['expose']['operator_id'] = 'uniquename_op';
+  $handler->display->display_options['filters']['uniquename']['expose']['label'] = 'Unique Name Contains';
+  $handler->display->display_options['filters']['uniquename']['expose']['operator'] = 'uniquename_op';
+  $handler->display->display_options['filters']['uniquename']['expose']['identifier'] = 'uniquename';
+  $handler->display->display_options['filters']['uniquename']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Genotype: Description */
+  $handler->display->display_options['filters']['description']['id'] = 'description';
+  $handler->display->display_options['filters']['description']['table'] = 'genotype';
+  $handler->display->display_options['filters']['description']['field'] = 'description';
+  $handler->display->display_options['filters']['description']['operator'] = 'contains';
+  $handler->display->display_options['filters']['description']['group'] = '0';
+  $handler->display->display_options['filters']['description']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['description']['expose']['operator_id'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['label'] = 'Description Contains';
+  $handler->display->display_options['filters']['description']['expose']['operator'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['identifier'] = 'description';
+  $handler->display->display_options['filters']['description']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/genotypes');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Genotypes',
-    'description' => 'A genotype is defined by a collection of features, mutations, balancers, deficiencies, haplotype blocks, or engineered constructs.',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_genetic/genotypes';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Genotypes';
+  $handler->display->display_options['menu']['description'] = 'A genotype is defined by a collection of features, mutations, etc.';
+  $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
+  $handler->display->display_options['tab_options']['weight'] = '0';
 
-  return $views;
-}
+  return $view;
+}

+ 0 - 3
tripal_library/tripal_library.install

@@ -59,12 +59,9 @@ function tripal_library_install() {
  */
 function tripal_library_uninstall() {
   // Drop the MView table if it exists
-  // D7 @todo Fix tripal_mviews_get_mview_id()
-  /**
   if ($mview_id = tripal_mviews_get_mview_id('library_feature_count')) {
     tripal_mviews_action("delete", $mview_id);
   }
-  */
 }
 
 /**

+ 9 - 0
tripal_library/tripal_library.module

@@ -155,6 +155,15 @@ function tripal_library_menu() {
     'access arguments' => array('administer tripal libraries'),
     'type' => MENU_CALLBACK
   );
+
+  $items['admin/tripal/chado/tripal_library/views/libraries/enable'] = array(
+    'title' => 'Enable Library Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_library_admin_libraries', 'admin/tripal/chado/tripal_library'),
+    'access arguments' => array('administer tripal libraries'),
+    'type' => MENU_CALLBACK,
+  );
+
   return $items;
 }
 

+ 5 - 1
tripal_library/tripal_library.views_default.inc

@@ -35,7 +35,11 @@ function tripal_library_admin_defaultviews_library() {
   $handler->display->display_options['cache']['type'] = 'none';
   $handler->display->display_options['query']['type'] = 'views_query';
   $handler->display->display_options['exposed_form']['type'] = 'basic';
-  $handler->display->display_options['pager']['type'] = 'none';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
   $handler->display->display_options['style_plugin'] = 'table';
   $handler->display->display_options['style_options']['grouping'] = '';
   $handler->display->display_options['style_options']['columns'] = array(

+ 34 - 0
tripal_natural_diversity/includes/tripal_natural_diversity.admin.inc

@@ -0,0 +1,34 @@
+<?php
+
+/**
+ *
+ */
+function tripal_natural_diversity_admin_natdiv_view() {
+  $output = '';
+
+  // set the breadcrumb
+  $breadcrumb = array();
+  $breadcrumb[] = l('Home', '<front>');
+  $breadcrumb[] = l('Administration', 'admin');
+  $breadcrumb[] = l('Tripal', 'admin/tripal');
+  $breadcrumb[] = l('Chado', 'admin/tripal/chado');
+  $breadcrumb[] = l('Diversity Experiments', 'admin/tripal/chado/tripal_natdiv');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_natural_diversity_admin_natdiv_exp','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Tripal Natural Diversity Module uses primarily views to provide an '
+      . 'administrative interface. Currently one or more views needed for this '
+      . 'administrative interface are disabled. <strong>Click each of the following links to '
+      . 'enable the pertinent views</strong>:</p>';
+    $output .= '<ul>';
+      $output .= '<li>'.l('Natural Diversity Experiments Admin', 'admin/tripal/chado/tripal_natdiv/views/natdiv_exp/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
+}

+ 51 - 6
tripal_natural_diversity/tripal_natural_diversity.module

@@ -2,7 +2,7 @@
 
 require_once('api/tripal_natural_diversity.api.inc');
 require_once('includes/tripal_natural_diversity.schema.inc');
-
+require_once('includes/tripal_natural_diversity.admin.inc');
 /**
  *  @file
  * This file contains the basic functions needed for this drupal module.
@@ -15,7 +15,47 @@ require_once('includes/tripal_natural_diversity.schema.inc');
  * @ingroup tripal_modules
  */
 
-/*************************************************************************
+/**
+ *  Menu items are automatically added for the new node types created
+ *  by this module to the 'Create Content' Navigation menu item.  This function
+ *  adds more menu items needed for this module.
+ *
+ * @ingroup tripal_natural_diversity
+ */
+function tripal_natural_diversity_menu() {
+  $items = array();
+
+    // the administative settings menu
+  $items['admin/tripal/chado/tripal_natdiv'] = array(
+   'title' => 'Natural Diversity Experiments',
+   'description' => 'Experiments relating to natural diversity such as genotype and phenotype experiments.',
+   'page callback' => 'tripal_natural_diversity_admin_natdiv_view',
+   'access arguments' => array('adminster tripal natural_diversity'),
+   'type' => MENU_NORMAL_ITEM,
+  );
+
+  $items['admin/tripal/chado/tripal_natdiv/help'] = array(
+   'title' => 'Help',
+   'description' => "A description of the Tripal natural_diversity module including a short description of it's usage.",
+   'page callback' => 'theme',
+   'page arguments' => array('tripal_natdiv_help'),
+   'access arguments' => array('adminster tripal natural_diversity'),
+   'type' => MENU_LOCAL_TASK,
+   'weight' => 10
+  );
+
+  $items['admin/tripal/chado/tripal_natdiv/views/natdiv_exp/enable'] = array(
+    'title' => 'Enable Natural Diversity Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_natural_diversity_admin_natdiv_exp', 'admin/tripal/chado/tripal_natdiv'),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+/**
  * Implements hook_views_api()
  * Purpose: Essentially this hook tells drupal that there is views support for
  *  for this module which then includes tripal_natural_diversity.views.inc where all the
@@ -25,7 +65,7 @@ require_once('includes/tripal_natural_diversity.schema.inc');
  */
 function tripal_natural_diversity_views_api() {
   return array(
-      'api' => 2.0,
+      'api' => 3.0,
   );
 }
 
@@ -54,6 +94,11 @@ function tripal_natural_diversity_theme() {
       'template' => 'tripal_stock_nd_phenotypes',
       'path' => "$theme_path/tripal_stock",
     ),
+    'tripal_natdiv_help' => array(
+      'template' => 'tripal_natdiv_help',
+      'variables' =>  array(NULL),
+      'path' => "$theme_path",
+    ),
   );
   return $items;
 }
@@ -64,13 +109,13 @@ function tripal_natural_diversity_theme() {
 function tripal_natural_diversity_block_info() {
 
   $blocks['ndfgenotype']['info'] = t('Tripal Natural Diversity Feature Genotypes');
-  $blocks['ndfgenotype']['cache'] = BLOCK_NO_CACHE;
+  $blocks['ndfgenotype']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['ndsgenotype']['info'] = t('Tripal Natural Diversity Library Genotypes');
-  $blocks['ndsgenotype']['cache'] = BLOCK_NO_CACHE;
+  $blocks['ndsgenotype']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['ndsphenotype']['info'] = t('Tripal Natural Diversity Stock Phenotypes');
-  $blocks['ndsphenotype']['cache'] = BLOCK_NO_CACHE;
+  $blocks['ndsphenotype']['cache'] = 'BLOCK_NO_CACHE';
 
   return $blocks;
 }

+ 446 - 897
tripal_natural_diversity/tripal_natural_diversity.views_default.inc

@@ -8,935 +8,484 @@
 function tripal_natural_diversity_views_default_views() {
   $views = array();
 
+  // Experiment Listing
+  $view = tripal_natural_diversity_defaultview_admin_natdiv_exp();
+  $views[$view->name] = $view;
+
+  // List geolocations
+  $view = tripal_natural_diversity_defaultview_admin_geolocations();
+  $views[$view->name] = $view;
 
-  if (!module_exists('tripal_views')) {
-    return $views;
-  }
+  // List protocols
+  $view = tripal_natural_diversity_defaultview_admin_protocols();
+  $views[$view->name] = $view;
 
+  // List Reagents
+  $view = tripal_natural_diversity_defaultview_admin_reagents();
+  $views[$view->name] = $view;
 
-  // Experiment Listing
-  $view = new view;
-  $view->name = 'natdiv_experiment_listing';
-  $view->description = 'A listing of all natural diversity experiments';
-  $view->tag = 'chado default';
+  return $views;
+}
+
+function tripal_natural_diversity_defaultview_admin_natdiv_exp() {
+
+  $view = new view();
+  $view->name = 'tripal_natural_diversity_admin_natdiv_exp';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
   $view->base_table = 'nd_experiment';
-  $view->core = 6;
-  $view->api_version = '2';
-  $view->disabled = FALSE;
+  $view->human_name = 'NatDiv Experiment Admin';
+  $view->core = 7;
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
+  $handler->display->display_options['title'] = 'Natural Diversity Experiments';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'name' => 'name',
+    'description' => 'description',
+  );
+  $handler->display->display_options['style_options']['default'] = '-1';
+  $handler->display->display_options['style_options']['info'] = array(
     'name' => array(
-      'label' => 'Type',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-    'description' => array(
-      'label' => 'Location Experiment Performed',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'description',
-      'table' => 'nd_geolocation',
-      'field' => 'description',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('sorts', array(
-    'name' => array(
-      'order' => 'ASC',
-      'id' => 'name',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-    'description' => array(
-      'order' => 'ASC',
-      'id' => 'description',
-      'table' => 'nd_geolocation',
-      'field' => 'description',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'type_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'type_id_op',
-        'identifier' => 'type_id',
-        'label' => 'Experiment Type',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'type_id',
-      'table' => 'nd_experiment',
-      'field' => 'type_id',
-      'relationship' => 'none',
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
     'description' => array(
-      'operator' => '=',
-      'value' => array(),
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'description_op',
-        'identifier' => 'geolocation',
-        'label' => 'Location Experiment Performed',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'description',
-      'table' => 'nd_geolocation',
-      'field' => 'description',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-    ),
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all experiments matching the entered criteria. If you leave a any of the criteria blank then the experiments will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all experiments will be listed.',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Natural Diversity Experiments');
-  $handler->override_option('header', 'Click "Show" to see a list of all experiments matching the entered criteria. If you leave a any of the criteria blank then the experiments will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all experiments will be listed.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No natural diversity experiments match the current criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'name' => 'name',
-      'description' => 'description',
-    ),
-    'info' => array(
-      'name' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'description' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
-    'default' => '-1',
-  ));
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No natural diversity experiments match the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  $handler->display->display_options['fields']['name']['label'] = 'Type';
+  /* Field: Chado Nd Geolocation: Description */
+  $handler->display->display_options['fields']['description']['id'] = 'description';
+  $handler->display->display_options['fields']['description']['table'] = 'nd_geolocation';
+  $handler->display->display_options['fields']['description']['field'] = 'description';
+  $handler->display->display_options['fields']['description']['label'] = 'Location Experiment Performed';
+  /* Sort criterion: Chado Cvterm: Name */
+  $handler->display->display_options['sorts']['name']['id'] = 'name';
+  $handler->display->display_options['sorts']['name']['table'] = 'cvterm';
+  $handler->display->display_options['sorts']['name']['field'] = 'name';
+  /* Sort criterion: Chado Nd Geolocation: Description */
+  $handler->display->display_options['sorts']['description']['id'] = 'description';
+  $handler->display->display_options['sorts']['description']['table'] = 'nd_geolocation';
+  $handler->display->display_options['sorts']['description']['field'] = 'description';
+  /* Filter criterion: Chado Nd Experiment: Type Id */
+  $handler->display->display_options['filters']['type_id']['id'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['table'] = 'nd_experiment';
+  $handler->display->display_options['filters']['type_id']['field'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['group'] = '0';
+  $handler->display->display_options['filters']['type_id']['value'] = 'All';
+  $handler->display->display_options['filters']['type_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['operator_id'] = 'type_id_op';
+  $handler->display->display_options['filters']['type_id']['expose']['label'] = 'Experiment Type';
+  $handler->display->display_options['filters']['type_id']['expose']['operator'] = 'type_id_op';
+  $handler->display->display_options['filters']['type_id']['expose']['identifier'] = 'type_id';
+  /* Filter criterion: Chado Nd Geolocation: Description */
+  $handler->display->display_options['filters']['description']['id'] = 'description';
+  $handler->display->display_options['filters']['description']['table'] = 'nd_geolocation';
+  $handler->display->display_options['filters']['description']['field'] = 'description';
+  $handler->display->display_options['filters']['description']['value'] = array();
+  $handler->display->display_options['filters']['description']['group'] = '0';
+  $handler->display->display_options['filters']['description']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['description']['expose']['operator_id'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['label'] = 'Location Experiment Performed';
+  $handler->display->display_options['filters']['description']['expose']['operator'] = 'description_op';
+  $handler->display->display_options['filters']['description']['expose']['identifier'] = 'geolocation';
+
+  /** MANUALLY ADD since filter handler no exporting correctly */
+  $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
+  $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
+  $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/natdiv_experiments');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Natural Diversity Experiments',
-    'description' => 'A single assay resulting in a single genotype or phenotype. Multiple assays resulting in an entire experiment should be grouped together as a project.',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_natdiv/experiments';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Experiments';
+  $handler->display->display_options['menu']['description'] = 'A single assay resulting in a single genotype or phenotype.';
+  $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
+  $handler->display->display_options['tab_options']['weight'] = '0';
 
-  // List geolocations
-  $view = new view;
-  $view->name = 'geolocation_listing';
-  $view->description = 'A listing of locations where natural diversity experiments took place.';
-  $view->tag = 'chado default';
+  /** MANUALLY ADD since filter handler no exporting correctly
+  $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
+  $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
+  $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
+  */
+
+  return $view;
+}
+
+function tripal_natural_diversity_defaultview_admin_geolocations() {
+
+  $view = new view();
+  $view->name = 'tripal_natural_diversity_admin_geolocs';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
   $view->base_table = 'nd_geolocation';
-  $view->core = 6;
-  $view->api_version = '2';
-  $view->disabled = FALSE;
+  $view->human_name = 'NatDiv Locations Admin';
+  $view->core = 7;
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
+  $handler->display->display_options['title'] = 'Geographical Locations';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'description' => 'description',
+    'latitude' => 'latitude',
+    'longitude' => 'longitude',
+    'altitude' => 'altitude',
+    'geodetic_datum' => 'geodetic_datum',
+  );
+  $handler->display->display_options['style_options']['default'] = 'description';
+  $handler->display->display_options['style_options']['info'] = array(
     'description' => array(
-      'label' => 'Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'description',
-      'table' => 'nd_geolocation',
-      'field' => 'description',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'latitude' => array(
-      'label' => 'Latitude',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'latitude',
-      'table' => 'nd_geolocation',
-      'field' => 'latitude',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'longitude' => array(
-      'label' => 'Longitude',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'longitude',
-      'table' => 'nd_geolocation',
-      'field' => 'longitude',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     'altitude' => array(
-      'label' => 'Altitude',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'altitude',
-      'table' => 'nd_geolocation',
-      'field' => 'altitude',
-      'relationship' => 'none',
-    ),
-    'geodetic_datum' => array(
-      'label' => 'Geodetic Datum',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'geodetic_datum',
-      'table' => 'nd_geolocation',
-      'field' => 'geodetic_datum',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
-  ));
-  $handler->override_option('filters', array(
     'geodetic_datum' => array(
-      'operator' => '=',
-      'value' => array(),
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'geodetic_datum_op',
-        'identifier' => 'geodetic_datum',
-        'label' => 'Geodetic Datum',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'geodetic_datum',
-      'table' => 'nd_geolocation',
-      'field' => 'geodetic_datum',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-    ),
-    'latitude' => array(
-      'operator' => '=',
-      'value' => array(
-        'value' => '',
-        'min' => '',
-        'max' => '',
-      ),
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 1,
-        'operator' => 'latitude_op',
-        'identifier' => 'latitude',
-        'label' => 'Latitude',
-        'optional' => 0,
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'latitude',
-      'table' => 'nd_geolocation',
-      'field' => 'latitude',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'longitude' => array(
-      'operator' => '=',
-      'value' => array(
-        'value' => '',
-        'min' => '',
-        'max' => '',
-      ),
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 1,
-        'operator' => 'longitude_op',
-        'identifier' => 'longitude',
-        'label' => 'Longitude',
-        'optional' => 0,
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'longitude',
-      'table' => 'nd_geolocation',
-      'field' => 'longitude',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
-    'altitude' => array(
-      'operator' => '=',
-      'value' => array(
-        'value' => '',
-        'min' => '',
-        'max' => '',
-      ),
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 1,
-        'operator' => 'altitude_op',
-        'identifier' => 'altitude',
-        'label' => 'Altitude',
-        'optional' => 0,
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'altitude',
-      'table' => 'nd_geolocation',
-      'field' => 'altitude',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'description' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'description_op',
-        'identifier' => 'description',
-        'label' => 'Name Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'description',
-      'table' => 'nd_geolocation',
-      'field' => 'description',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'textfield',
-      'multiple' => 0,
-      'optional' => 0,
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Geographical Locations');
-  $handler->override_option('header', 'Use the following criteria to limit the locations listed. If you leave a any of the criteria blank then the locations will be not be filtered based on that field.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No locations matched the current criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'description' => 'description',
-      'latitude' => 'latitude',
-      'longitude' => 'longitude',
-      'altitude' => 'altitude',
-      'geodetic_datum' => 'geodetic_datum',
-    ),
-    'info' => array(
-      'description' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'latitude' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'longitude' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'altitude' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'geodetic_datum' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => 'description',
-  ));
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No locations matched the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Field: Chado Nd Geolocation: Description */
+  $handler->display->display_options['fields']['description']['id'] = 'description';
+  $handler->display->display_options['fields']['description']['table'] = 'nd_geolocation';
+  $handler->display->display_options['fields']['description']['field'] = 'description';
+  $handler->display->display_options['fields']['description']['label'] = 'Name';
+  /* Field: Chado Nd Geolocation: Latitude */
+  $handler->display->display_options['fields']['latitude']['id'] = 'latitude';
+  $handler->display->display_options['fields']['latitude']['table'] = 'nd_geolocation';
+  $handler->display->display_options['fields']['latitude']['field'] = 'latitude';
+  /* Field: Chado Nd Geolocation: Longitude */
+  $handler->display->display_options['fields']['longitude']['id'] = 'longitude';
+  $handler->display->display_options['fields']['longitude']['table'] = 'nd_geolocation';
+  $handler->display->display_options['fields']['longitude']['field'] = 'longitude';
+  /* Field: Chado Nd Geolocation: Altitude */
+  $handler->display->display_options['fields']['altitude']['id'] = 'altitude';
+  $handler->display->display_options['fields']['altitude']['table'] = 'nd_geolocation';
+  $handler->display->display_options['fields']['altitude']['field'] = 'altitude';
+  /* Field: Chado Nd Geolocation: Geodetic Datum */
+  $handler->display->display_options['fields']['geodetic_datum']['id'] = 'geodetic_datum';
+  $handler->display->display_options['fields']['geodetic_datum']['table'] = 'nd_geolocation';
+  $handler->display->display_options['fields']['geodetic_datum']['field'] = 'geodetic_datum';
+  /* Filter criterion: Chado Nd Geolocation: Geodetic Datum */
+  $handler->display->display_options['filters']['geodetic_datum']['id'] = 'geodetic_datum';
+  $handler->display->display_options['filters']['geodetic_datum']['table'] = 'nd_geolocation';
+  $handler->display->display_options['filters']['geodetic_datum']['field'] = 'geodetic_datum';
+  $handler->display->display_options['filters']['geodetic_datum']['group'] = '0';
+  $handler->display->display_options['filters']['geodetic_datum']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['geodetic_datum']['expose']['label'] = 'Geodetic Datum';
+  $handler->display->display_options['filters']['geodetic_datum']['expose']['identifier'] = 'geodetic_datum';
+  $handler->display->display_options['filters']['geodetic_datum']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Nd Geolocation: Latitude */
+  $handler->display->display_options['filters']['latitude']['id'] = 'latitude';
+  $handler->display->display_options['filters']['latitude']['table'] = 'nd_geolocation';
+  $handler->display->display_options['filters']['latitude']['field'] = 'latitude';
+  $handler->display->display_options['filters']['latitude']['value'] = '';
+  $handler->display->display_options['filters']['latitude']['group'] = '0';
+  $handler->display->display_options['filters']['latitude']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['latitude']['expose']['label'] = 'Latitude';
+  $handler->display->display_options['filters']['latitude']['expose']['identifier'] = 'latitude';
+  $handler->display->display_options['filters']['latitude']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Nd Geolocation: Longitude */
+  $handler->display->display_options['filters']['longitude']['id'] = 'longitude';
+  $handler->display->display_options['filters']['longitude']['table'] = 'nd_geolocation';
+  $handler->display->display_options['filters']['longitude']['field'] = 'longitude';
+  $handler->display->display_options['filters']['longitude']['value'] = '';
+  $handler->display->display_options['filters']['longitude']['group'] = '0';
+  $handler->display->display_options['filters']['longitude']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['longitude']['expose']['label'] = 'Longitude';
+  $handler->display->display_options['filters']['longitude']['expose']['identifier'] = 'longitude';
+  $handler->display->display_options['filters']['longitude']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Nd Geolocation: Altitude */
+  $handler->display->display_options['filters']['altitude']['id'] = 'altitude';
+  $handler->display->display_options['filters']['altitude']['table'] = 'nd_geolocation';
+  $handler->display->display_options['filters']['altitude']['field'] = 'altitude';
+  $handler->display->display_options['filters']['altitude']['value'] = '';
+  $handler->display->display_options['filters']['altitude']['group'] = '0';
+  $handler->display->display_options['filters']['altitude']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['altitude']['expose']['label'] = 'Altitude';
+  $handler->display->display_options['filters']['altitude']['expose']['identifier'] = 'altitude';
+  $handler->display->display_options['filters']['altitude']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Nd Geolocation: Description */
+  $handler->display->display_options['filters']['description']['id'] = 'description';
+  $handler->display->display_options['filters']['description']['table'] = 'nd_geolocation';
+  $handler->display->display_options['filters']['description']['field'] = 'description';
+  $handler->display->display_options['filters']['description']['operator'] = 'contains';
+  $handler->display->display_options['filters']['description']['group'] = '0';
+  $handler->display->display_options['filters']['description']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['description']['expose']['label'] = 'Description Contains';
+  $handler->display->display_options['filters']['description']['expose']['identifier'] = 'description';
+  $handler->display->display_options['filters']['description']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/natdiv_geolocations');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Locations',
-    'description' => 'Geographical locations in which natural diversity experiments might be performed.',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_natdiv/locations';
+  $handler->display->display_options['menu']['type'] = 'tab';
+  $handler->display->display_options['menu']['title'] = 'Locations';
+  $handler->display->display_options['menu']['description'] = 'Geographical locations in which natural diversity experiments might be performed.';
+  $handler->display->display_options['menu']['weight'] = '-8';
+  $handler->display->display_options['menu']['name'] = 'management';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
 
-  // List protocols
-  $view = new view;
-  $view->name = 'natdiv_protocol_listing';
-  $view->description = 'A listing of protocols used for natural diversity experiments';
-  $view->tag = 'chado default';
-  $view->base_table = 'nd_protocol';
+  return $view;
+}
+
+function tripal_natural_diversity_defaultview_admin_reagents() {
+
+  $view = new view();
+  $view->name = 'tripal_natural_diversity_admin_reagents';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
+  $view->base_table = 'nd_reagent';
+  $view->human_name = 'NatDiv Reagent Admin';
   $view->core = 6;
-  $view->api_version = '2';
-  $view->disabled = FALSE;
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
-    'name' => array(
-      'label' => 'Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'nd_protocol',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'name' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'name_op',
-        'identifier' => 'name',
-        'label' => 'Name Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'name',
-      'table' => 'nd_protocol',
-      'field' => 'name',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all protocols matching the entered criteria. If you leave a any of the criteria blank then the protocols will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all protocols will be listed.',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Protocols');
-  $handler->override_option('header', 'Click "Show" to see a list of all protocols matching the entered criteria. If you leave a any of the criteria blank then the protocols will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all protocols will be listed.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No protocols match the current criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'name' => 'name',
-    ),
-    'info' => array(
-      'name' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => 'name',
-  ));
+  $handler->display->display_options['title'] = 'Reagents';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No reagents match the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Field: Chado Nd Reagent: Name */
+  $handler->display->display_options['fields']['name_1']['id'] = 'name_1';
+  $handler->display->display_options['fields']['name_1']['table'] = 'nd_reagent';
+  $handler->display->display_options['fields']['name_1']['field'] = 'name';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  $handler->display->display_options['fields']['name']['label'] = 'Type';
+  /* Filter criterion: Chado Nd Reagent: Type Id */
+  $handler->display->display_options['filters']['type_id']['id'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['table'] = 'nd_reagent';
+  $handler->display->display_options['filters']['type_id']['field'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['value'] = 'All';
+  $handler->display->display_options['filters']['type_id']['group'] = '0';
+  $handler->display->display_options['filters']['type_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['operator_id'] = 'type_id_op';
+  $handler->display->display_options['filters']['type_id']['expose']['label'] = 'Type';
+  $handler->display->display_options['filters']['type_id']['expose']['operator'] = 'type_id_op';
+  $handler->display->display_options['filters']['type_id']['expose']['identifier'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Nd Reagent: Name */
+  $handler->display->display_options['filters']['name']['id'] = 'name';
+  $handler->display->display_options['filters']['name']['table'] = 'nd_reagent';
+  $handler->display->display_options['filters']['name']['field'] = 'name';
+  $handler->display->display_options['filters']['name']['operator'] = 'contains';
+  $handler->display->display_options['filters']['name']['group'] = '0';
+  $handler->display->display_options['filters']['name']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['label'] = 'Name Contains';
+  $handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
+  $handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /** MANUALLY ADD since filter handler no exporting correctly */
+  $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
+  $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
+  $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/natdiv_protocols');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Protocols',
-    'description' => 'The protcols used for natural diversity experiments',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_natdiv/reagents';
+  $handler->display->display_options['menu']['type'] = 'tab';
+  $handler->display->display_options['menu']['title'] = 'Reagents';
+  $handler->display->display_options['menu']['description'] = 'Reagents used in natural diversity experiments';
+  $handler->display->display_options['menu']['weight'] = '0';
+  $handler->display->display_options['menu']['name'] = 'management';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
 
-  // List Reagents
-  $view = new view;
-  $view->name = 'natdiv_reagent_listing';
-  $view->description = 'A listing of reagents used in natural diversity experiments';
-  $view->tag = 'chado default';
-  $view->base_table = 'nd_reagent';
-  $view->core = 6;
-  $view->api_version = '2';
-  $view->disabled = FALSE;
+  /** MANUALLY ADD since filter handler no exporting correctly
+  $handler->display->display_options['filters']['type_id']['expose']['values_form_type'] = 'select';
+  $handler->display->display_options['filters']['type_id']['expose']['select_multiple'] = FALSE;
+  $handler->display->display_options['filters']['type_id']['expose']['select_optional'] = TRUE;
+  $handler->display->display_options['filters']['type_id']['expose']['max_length'] = 40;
+  */
+
+  return $view;
+}
+
+function tripal_natural_diversity_defaultview_admin_protocols() {
+
+  $view = new view();
+  $view->name = 'tripal_natural_diversity_admin_protocols';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
+  $view->base_table = 'nd_protocol';
+  $view->human_name = 'NatDiv Protocol Admin';
+  $view->core = 7;
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
-    'name_1' => array(
-      'label' => 'Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name_1',
-      'table' => 'nd_reagent',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-    'name' => array(
-      'label' => 'Type',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'type_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'type_id_op',
-        'identifier' => 'type_id',
-        'label' => 'Type',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'type_id',
-      'table' => 'nd_reagent',
-      'field' => 'type_id',
-      'relationship' => 'none',
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all reagents matching the entered criteria. If you leave a any of the criteria blank then the reagents will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all reagents will be listed.',
-    ),
+  $handler->display->display_options['title'] = 'Protocols';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'none';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'name' => 'name',
+  );
+  $handler->display->display_options['style_options']['default'] = 'name';
+  $handler->display->display_options['style_options']['info'] = array(
     'name' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'name_op',
-        'identifier' => 'name',
-        'label' => 'Name Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'name',
-      'table' => 'nd_reagent',
-      'field' => 'name',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Reagents');
-  $handler->override_option('header', 'Click "Show" to see a list of all reagents matching the entered criteria. If you leave a any of the criteria blank then the reagents will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all reagents will be listed.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No reagents match the current criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No protocols match the current criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Field: Chado Nd Protocol: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'nd_protocol';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  /* Filter criterion: Chado Nd Protocol: Name */
+  $handler->display->display_options['filters']['name']['id'] = 'name';
+  $handler->display->display_options['filters']['name']['table'] = 'nd_protocol';
+  $handler->display->display_options['filters']['name']['field'] = 'name';
+  $handler->display->display_options['filters']['name']['operator'] = 'contains';
+  $handler->display->display_options['filters']['name']['group'] = '0';
+  $handler->display->display_options['filters']['name']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['label'] = 'Name Contains';
+  $handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
+  $handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/natdiv_reagents');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Reagents',
-    'description' => 'Reagents used in natural diversity experiments',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_natdiv/protocols';
+  $handler->display->display_options['menu']['type'] = 'tab';
+  $handler->display->display_options['menu']['title'] = 'Protocols';
+  $handler->display->display_options['menu']['description'] = 'The protcols used for natural diversity experiments';
+  $handler->display->display_options['menu']['weight'] = '-5';
+  $handler->display->display_options['menu']['name'] = 'management';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
 
-  return $views;
+  return $view;
 }

+ 1 - 0
tripal_phenotype/theme/tripal_phenotype_help.tpl.php

@@ -0,0 +1 @@
+<h3>Tripal Phenotype Module</h3>

+ 91 - 2
tripal_phenotype/tripal_phenotype.module

@@ -12,7 +12,66 @@
  * @ingroup tripal_modules
  */
 
-/*************************************************************************
+/**
+ *  Menu items are automatically added for the new node types created
+ *  by this module to the 'Create Content' Navigation menu item.  This function
+ *  adds more menu items needed for this module.
+ *
+ * @ingroup tripal_phenotype
+ */
+function tripal_phenotype_menu() {
+  $items = array();
+
+    // the administative settings menu
+  $items['admin/tripal/chado/tripal_phenotype'] = array(
+   'title' => 'Phenotypes',
+   'description' => 'A controlled sentence describing observable effects of non-wild type function.',
+   'page callback' => 'tripal_phenotype_admin_phenotypes_listing',
+   'access arguments' => array('adminster tripal phenotype'),
+   'type' => MENU_NORMAL_ITEM,
+  );
+
+  $items['admin/tripal/chado/tripal_phenotype/help'] = array(
+   'title' => 'Help',
+   'description' => "A description of the Tripal phenotype module including a short description of it's usage.",
+   'page callback' => 'theme',
+   'page arguments' => array('tripal_phenotype_help'),
+   'access arguments' => array('adminster tripal phenotype'),
+   'type' => MENU_LOCAL_TASK,
+  );
+
+  $items['admin/tripal/chado/tripal_phenotype/views/phenotypes/enable'] = array(
+    'title' => 'Enable Phenotype Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_phenotype_admin_phenotypes', 'admin/tripal/chado/tripal_phenotype'),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
+  );
+
+  return $items;
+}
+
+/**
+ *  We need to let drupal know about our theme functions and their arguments.
+ *  We create theme functions to allow users of the module to customize the
+ *  look and feel of the output generated in this module
+ *
+ * @ingroup tripal_phenotype
+ */
+function tripal_phenotype_theme($existing, $type, $theme, $path) {
+  $core_path = drupal_get_path('module', 'tripal_core');
+
+  $items = array(
+    'tripal_phenotype_help' => array(
+      'template' => 'tripal_phenotype_help',
+      'variables' =>  array(NULL),
+      'path' => "$path/theme",
+    ),
+  );
+  return $items;
+}
+
+/**
  * Implements hook_views_api()
  * Purpose: Essentially this hook tells drupal that there is views support for
  *  for this module which then includes tripal_phenotype.views.inc where all the
@@ -22,6 +81,36 @@
  */
 function tripal_phenotype_views_api() {
   return array(
-      'api' => 2.0,
+      'api' => 3.0,
   );
 }
+
+function tripal_phenotype_admin_phenotypes_listing() {
+  $output = '';
+
+  // set the breadcrumb
+  $breadcrumb = array();
+  $breadcrumb[] = l('Home', '<front>');
+  $breadcrumb[] = l('Administration', 'admin');
+  $breadcrumb[] = l('Tripal', 'admin/tripal');
+  $breadcrumb[] = l('Chado', 'admin/tripal/chado');
+  $breadcrumb[] = l('Phenotypes', 'admin/tripal/chado/tripal_phenotype');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_phenotype_admin_phenotypes','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Tripal Phenotype Module uses primarily views to provide an '
+      . 'administrative interface. Currently one or more views needed for this '
+      . 'administrative interface are disabled. <strong>Click each of the following links to '
+      . 'enable the pertinent views</strong>:</p>';
+    $output .= '<ul>';
+      $output .= '<li>'.l('Phenotype Admin', 'admin/tripal/chado/tripal_phenotype/views/phenotypes/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
+}

+ 180 - 468
tripal_phenotype/tripal_phenotype.views_default.inc

@@ -8,481 +8,193 @@
 function tripal_phenotype_views_default_views() {
   $views = array();
 
-  if (!module_exists('tripal_views')) {
-    return $views;
-  }
+  $view = tripal_phenotype_defaultview_admin_phenotypes();
+  $views[$view->name] = $view;
+
+  return $views;
+}
+
+function tripal_phenotype_defaultview_admin_phenotypes() {
 
-  // Main default view
-  $view = new view;
-  $view->name = 'phenotype_listing';
-  $view->description = 'A listing of chado phenotypes';
-  $view->tag = 'chado default';
+  $view = new view();
+  $view->name = 'tripal_phenotype_admin_phenotypes';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
   $view->base_table = 'phenotype';
-  $view->core = 6;
-  $view->api_version = '2';
+  $view->human_name = 'Phenotype Admin';
+  $view->core = 7;
+  $view->api_version = '3.0';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('relationships', array(
-    'assay_id' => array(
-      'label' => 'assay_id to cvterm',
-      'required' => 0,
-      'id' => 'assay_id',
-      'table' => 'phenotype',
-      'field' => 'assay_id',
-      'relationship' => 'none',
-    ),
-    'attr_id' => array(
-      'label' => 'attr_id to cvterm',
-      'required' => 0,
-      'id' => 'attr_id',
-      'table' => 'phenotype',
-      'field' => 'attr_id',
-      'relationship' => 'none',
-    ),
-    'cvalue_id' => array(
-      'label' => 'cvalue_id to cvterm',
-      'required' => 0,
-      'id' => 'cvalue_id',
-      'table' => 'phenotype',
-      'field' => 'cvalue_id',
-      'relationship' => 'none',
-    ),
-    'observable_id' => array(
-      'label' => 'observable_id to cvterm',
-      'required' => 0,
-      'id' => 'observable_id',
-      'table' => 'phenotype',
-      'field' => 'observable_id',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('fields', array(
-    'uniquename' => array(
-      'label' => 'Unique Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'uniquename',
-      'table' => 'phenotype',
-      'field' => 'uniquename',
-      'relationship' => 'none',
-    ),
-    'name_1' => array(
-      'label' => 'Phenotypic Attribute',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name_1',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'attr_id',
-    ),
-    'name_3' => array(
-      'label' => 'Controlled Value',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name_3',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'cvalue_id',
-    ),
-    'value' => array(
-      'label' => 'Value',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'value',
-      'table' => 'phenotype',
-      'field' => 'value',
-      'relationship' => 'none',
-    ),
-    'name_2' => array(
-      'label' => 'Observation Type',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name_2',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'observable_id',
-    ),
-    'name' => array(
-      'label' => 'Evidence Type',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'absolute' => 0,
-        'link_class' => '',
-        'alt' => '',
-        'rel' => '',
-        'prefix' => '',
-        'suffix' => '',
-        'target' => '',
-        'help' => '',
-        'trim' => 0,
-        'max_length' => '',
-        'word_boundary' => 1,
-        'ellipsis' => 1,
-        'html' => 0,
-        'strip_tags' => 0,
-      ),
-      'empty' => '',
-      'hide_empty' => 0,
-      'empty_zero' => 0,
-      'hide_alter_empty' => 1,
-      'type' => 'separator',
-      'separator' => ', ',
-      'exclude' => 0,
-      'id' => 'name',
-      'table' => 'cvterm',
-      'field' => 'name',
-      'relationship' => 'assay_id',
-    ),
-  ));
-  $handler->override_option('filters', array(
-    'search_results' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => FALSE,
-      'expose' => array(
-        'operator' => FALSE,
-        'label' => '',
-      ),
-      'id' => 'search_results',
-      'table' => 'views',
-      'field' => 'search_results',
-      'relationship' => 'none',
-      'apply_button' => 'Show',
-      'no_results_text' => 'Click "Show" to see a list of all phenotypes matching the entered criteria. If you leave a any of the criteria blank then the phenotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all phenotypes will be listed.',
-    ),
-    'attr_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'attr_id_op',
-        'identifier' => 'attr_id',
-        'label' => 'Phenotypic Attribute',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'attr_id',
-      'table' => 'phenotype',
-      'field' => 'attr_id',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-    ),
-    'cvalue_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'cvalue_id_op',
-        'identifier' => 'cvalue_id',
-        'label' => 'Controlled Value',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'cvalue_id',
-      'table' => 'phenotype',
-      'field' => 'cvalue_id',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-    ),
-    'observable_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'observable_id_op',
-        'identifier' => 'observable_id',
-        'label' => 'Observation Type',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'observable_id',
-      'table' => 'phenotype',
-      'field' => 'observable_id',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-    ),
-    'assay_id' => array(
-      'operator' => '=',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'assay_id_op',
-        'identifier' => 'assay_id',
-        'label' => 'Evidence Type',
-        'remember' => 0,
-      ),
-      'case' => 1,
-      'id' => 'assay_id',
-      'table' => 'phenotype',
-      'field' => 'assay_id',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-      'values_form_type' => 'select',
-      'multiple' => 1,
-      'optional' => 0,
-      'show_all' => 0,
-    ),
+  $handler->display->display_options['title'] = 'Phenotypes';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['access']['perm'] = 'access administration pages';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['pager']['options']['offset'] = '0';
+  $handler->display->display_options['pager']['options']['id'] = '0';
+  $handler->display->display_options['pager']['options']['quantity'] = '9';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['grouping'] = '';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'uniquename' => 'uniquename',
+    'value' => 'value',
+  );
+  $handler->display->display_options['style_options']['default'] = 'uniquename';
+  $handler->display->display_options['style_options']['info'] = array(
     'uniquename' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'uniquename_op',
-        'identifier' => 'uniquename',
-        'label' => 'Unique Name Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'uniquename',
-      'table' => 'phenotype',
-      'field' => 'uniquename',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
+      'sortable' => 1,
+      'separator' => '',
     ),
     'value' => array(
-      'operator' => '~',
-      'value' => '',
-      'group' => '0',
-      'exposed' => TRUE,
-      'expose' => array(
-        'use_operator' => 0,
-        'operator' => 'value_op',
-        'identifier' => 'phen_value',
-        'label' => 'Value Contains',
-        'remember' => 0,
-      ),
-      'case' => 0,
-      'id' => 'value',
-      'table' => 'phenotype',
-      'field' => 'value',
-      'relationship' => 'none',
-      'agg' => array(
-        'records_with' => 1,
-        'aggregates_with' => 1,
-      ),
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Phenotypes');
-  $handler->override_option('header', 'Click "Show" to see a list of all phenotypes matching the entered criteria. If you leave a any of the criteria blank then the phenotypes will be not be filtered based on that field. Furthermore, if you leave all criteria blank then all phenotypes will be listed.');
-  $handler->override_option('header_format', '2');
-  $handler->override_option('header_empty', 0);
-  $handler->override_option('empty', 'No phenotypes match the supplied criteria.');
-  $handler->override_option('empty_format', '2');
-  $handler->override_option('items_per_page', 50);
-  $handler->override_option('use_pager', '1');
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'uniquename' => 'uniquename',
-      'value' => 'value',
-    ),
-    'info' => array(
-      'uniquename' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'value' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => 'uniquename',
-  ));
+      'sortable' => 1,
+      'separator' => '',
+    ),
+  );
+  /* No results behavior: Global: Text area */
+  $handler->display->display_options['empty']['text']['id'] = 'area';
+  $handler->display->display_options['empty']['text']['table'] = 'views';
+  $handler->display->display_options['empty']['text']['field'] = 'area';
+  $handler->display->display_options['empty']['text']['content'] = 'No phenotypes match the supplied criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '2';
+  /* Relationship: Chado Phenotype: observable_id => Cvterm */
+  $handler->display->display_options['relationships']['observable_id_to_cvterm']['id'] = 'observable_id_to_cvterm';
+  $handler->display->display_options['relationships']['observable_id_to_cvterm']['table'] = 'phenotype';
+  $handler->display->display_options['relationships']['observable_id_to_cvterm']['field'] = 'observable_id_to_cvterm';
+  $handler->display->display_options['relationships']['observable_id_to_cvterm']['label'] = 'Observable ID  => Cvterm';
+  /* Relationship: Chado Phenotype: attr_id => Cvterm */
+  $handler->display->display_options['relationships']['attr_id_to_cvterm']['id'] = 'attr_id_to_cvterm';
+  $handler->display->display_options['relationships']['attr_id_to_cvterm']['table'] = 'phenotype';
+  $handler->display->display_options['relationships']['attr_id_to_cvterm']['field'] = 'attr_id_to_cvterm';
+  $handler->display->display_options['relationships']['attr_id_to_cvterm']['label'] = 'Attribute id => Cvterm';
+  /* Relationship: Chado Phenotype: cvalue_id => Cvterm */
+  $handler->display->display_options['relationships']['cvalue_id_to_cvterm']['id'] = 'cvalue_id_to_cvterm';
+  $handler->display->display_options['relationships']['cvalue_id_to_cvterm']['table'] = 'phenotype';
+  $handler->display->display_options['relationships']['cvalue_id_to_cvterm']['field'] = 'cvalue_id_to_cvterm';
+  $handler->display->display_options['relationships']['cvalue_id_to_cvterm']['label'] = 'cvalue id => Cvterm';
+  /* Relationship: Chado Phenotype: assay_id => Cvterm */
+  $handler->display->display_options['relationships']['assay_id_to_cvterm']['id'] = 'assay_id_to_cvterm';
+  $handler->display->display_options['relationships']['assay_id_to_cvterm']['table'] = 'phenotype';
+  $handler->display->display_options['relationships']['assay_id_to_cvterm']['field'] = 'assay_id_to_cvterm';
+  $handler->display->display_options['relationships']['assay_id_to_cvterm']['label'] = 'assay id => Cvterm';
+  /* Field: Chado Phenotype: Uniquename */
+  $handler->display->display_options['fields']['uniquename']['id'] = 'uniquename';
+  $handler->display->display_options['fields']['uniquename']['table'] = 'phenotype';
+  $handler->display->display_options['fields']['uniquename']['field'] = 'uniquename';
+  $handler->display->display_options['fields']['uniquename']['label'] = 'Unique Name';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name_2']['id'] = 'name_2';
+  $handler->display->display_options['fields']['name_2']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name_2']['field'] = 'name';
+  $handler->display->display_options['fields']['name_2']['relationship'] = 'observable_id_to_cvterm';
+  $handler->display->display_options['fields']['name_2']['label'] = 'Observed Unit';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name_1']['id'] = 'name_1';
+  $handler->display->display_options['fields']['name_1']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name_1']['field'] = 'name';
+  $handler->display->display_options['fields']['name_1']['relationship'] = 'attr_id_to_cvterm';
+  $handler->display->display_options['fields']['name_1']['label'] = 'Phenotypic Attribute';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name_3']['id'] = 'name_3';
+  $handler->display->display_options['fields']['name_3']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name_3']['field'] = 'name';
+  $handler->display->display_options['fields']['name_3']['relationship'] = 'cvalue_id_to_cvterm';
+  $handler->display->display_options['fields']['name_3']['label'] = 'Controlled Value';
+  /* Field: Chado Phenotype: Value */
+  $handler->display->display_options['fields']['value']['id'] = 'value';
+  $handler->display->display_options['fields']['value']['table'] = 'phenotype';
+  $handler->display->display_options['fields']['value']['field'] = 'value';
+  /* Field: Chado Cvterm: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'cvterm';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  $handler->display->display_options['fields']['name']['relationship'] = 'assay_id_to_cvterm';
+  $handler->display->display_options['fields']['name']['label'] = 'Evidence Type';
+  /* Filter criterion: Chado Phenotype: Attr Id */
+  $handler->display->display_options['filters']['attr_id']['id'] = 'attr_id';
+  $handler->display->display_options['filters']['attr_id']['table'] = 'phenotype';
+  $handler->display->display_options['filters']['attr_id']['field'] = 'attr_id';
+  $handler->display->display_options['filters']['attr_id']['group'] = '0';
+  $handler->display->display_options['filters']['attr_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['attr_id']['expose']['operator_id'] = 'attr_id_op';
+  $handler->display->display_options['filters']['attr_id']['expose']['label'] = 'Phenotypic Attribute';
+  $handler->display->display_options['filters']['attr_id']['expose']['operator'] = 'attr_id_op';
+  $handler->display->display_options['filters']['attr_id']['expose']['identifier'] = 'attr_id';
+  /* Filter criterion: Chado Phenotype: Cvalue Id */
+  $handler->display->display_options['filters']['cvalue_id']['id'] = 'cvalue_id';
+  $handler->display->display_options['filters']['cvalue_id']['table'] = 'phenotype';
+  $handler->display->display_options['filters']['cvalue_id']['field'] = 'cvalue_id';
+  $handler->display->display_options['filters']['cvalue_id']['group'] = '0';
+  $handler->display->display_options['filters']['cvalue_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['cvalue_id']['expose']['operator_id'] = 'cvalue_id_op';
+  $handler->display->display_options['filters']['cvalue_id']['expose']['label'] = 'Controlled Value';
+  $handler->display->display_options['filters']['cvalue_id']['expose']['operator'] = 'cvalue_id_op';
+  $handler->display->display_options['filters']['cvalue_id']['expose']['identifier'] = 'cvalue_id';
+  /* Filter criterion: Chado Phenotype: Observable Id */
+  $handler->display->display_options['filters']['observable_id']['id'] = 'observable_id';
+  $handler->display->display_options['filters']['observable_id']['table'] = 'phenotype';
+  $handler->display->display_options['filters']['observable_id']['field'] = 'observable_id';
+  $handler->display->display_options['filters']['observable_id']['group'] = '0';
+  $handler->display->display_options['filters']['observable_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['observable_id']['expose']['operator_id'] = 'observable_id_op';
+  $handler->display->display_options['filters']['observable_id']['expose']['label'] = 'Observation Type';
+  $handler->display->display_options['filters']['observable_id']['expose']['operator'] = 'observable_id_op';
+  $handler->display->display_options['filters']['observable_id']['expose']['identifier'] = 'observable_id';
+  /* Filter criterion: Chado Phenotype: Assay Id */
+  $handler->display->display_options['filters']['assay_id']['id'] = 'assay_id';
+  $handler->display->display_options['filters']['assay_id']['table'] = 'phenotype';
+  $handler->display->display_options['filters']['assay_id']['field'] = 'assay_id';
+  $handler->display->display_options['filters']['assay_id']['group'] = '0';
+  $handler->display->display_options['filters']['assay_id']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['assay_id']['expose']['operator_id'] = 'assay_id_op';
+  $handler->display->display_options['filters']['assay_id']['expose']['label'] = 'Evidence Type';
+  $handler->display->display_options['filters']['assay_id']['expose']['operator'] = 'assay_id_op';
+  $handler->display->display_options['filters']['assay_id']['expose']['identifier'] = 'assay_id';
+  /* Filter criterion: Chado Phenotype: Uniquename */
+  $handler->display->display_options['filters']['uniquename']['id'] = 'uniquename';
+  $handler->display->display_options['filters']['uniquename']['table'] = 'phenotype';
+  $handler->display->display_options['filters']['uniquename']['field'] = 'uniquename';
+  $handler->display->display_options['filters']['uniquename']['operator'] = '~';
+  $handler->display->display_options['filters']['uniquename']['group'] = '0';
+  $handler->display->display_options['filters']['uniquename']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['uniquename']['expose']['operator_id'] = 'uniquename_op';
+  $handler->display->display_options['filters']['uniquename']['expose']['label'] = 'Unique Name Contains';
+  $handler->display->display_options['filters']['uniquename']['expose']['operator'] = 'uniquename_op';
+  $handler->display->display_options['filters']['uniquename']['expose']['identifier'] = 'uniquename';
+  /* Filter criterion: Chado Phenotype: Value */
+  $handler->display->display_options['filters']['value']['id'] = 'value';
+  $handler->display->display_options['filters']['value']['table'] = 'phenotype';
+  $handler->display->display_options['filters']['value']['field'] = 'value';
+  $handler->display->display_options['filters']['value']['operator'] = 'contains';
+  $handler->display->display_options['filters']['value']['group'] = '0';
+  $handler->display->display_options['filters']['value']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['value']['expose']['operator_id'] = 'value_op';
+  $handler->display->display_options['filters']['value']['expose']['label'] = 'Value Contains';
+  $handler->display->display_options['filters']['value']['expose']['operator'] = 'value_op';
+  $handler->display->display_options['filters']['value']['expose']['identifier'] = 'phen_value';
+  $handler->display->display_options['filters']['value']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/phenotypes');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Phenotypes',
-    'description' => 'A phenotypic statement, or a single atomic phenotypic observation, is a controlled sentence describing observable effects of non-wild type function.',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  $views[$view->name] = $view;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_phenotype/phenotypes';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Phenotypes';
+  $handler->display->display_options['menu']['description'] = 'A controlled sentence describing observable effects of non-wild type function';
+  $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
+  $handler->display->display_options['tab_options']['weight'] = '0';
 
-  return $views;
+  return $view;
 }

+ 10 - 10
tripal_stock/tripal_stock.module

@@ -944,34 +944,34 @@ function chado_stock_delete($node) {
  */
 function tripal_stock_block_info() {
   $blocks['base']['info'] = t('Tripal Stock Details');
-  $blocks['base']['cache'] = BLOCK_NO_CACHE;
+  $blocks['base']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['properties']['info'] = t('Tripal Stock Properties');
-  $blocks['properties']['cache'] = BLOCK_NO_CACHE;
+  $blocks['properties']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['references']['info'] = t('Tripal Stock References');
-  $blocks['references']['cache'] = BLOCK_NO_CACHE;
+  $blocks['references']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['relationships_as_object']['info'] = t('Tripal Stock Relationships');
-  $blocks['relationships_as_object']['cache'] = BLOCK_NO_CACHE;
+  $blocks['relationships_as_object']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['synonyms']['info'] = t('Tripal Stock Synonyms');
-  $blocks['synonyms']['cache'] = BLOCK_NO_CACHE;
+  $blocks['synonyms']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['collections']['info'] = t('Tripal Stock Collections');
-  $blocks['collections']['cache'] = BLOCK_NO_CACHE;
+  $blocks['collections']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['phenotypes']['info'] = t('Tripal Stock Phenotypes');
-  $blocks['phenotypes']['cache'] = BLOCK_NO_CACHE;
+  $blocks['phenotypes']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['genotypes']['info'] = t('Tripal Stock Genotypes');
-  $blocks['genotypes']['cache'] = BLOCK_NO_CACHE;
+  $blocks['genotypes']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['locations']['info'] = t('Tripal Stock Locations');
-  $blocks['locations']['cache'] = BLOCK_NO_CACHE;
+  $blocks['locations']['cache'] = 'BLOCK_NO_CACHE';
 
   $blocks['orgstocks']['info'] = t('Tripal Organism Stocks');
-  $blocks['orgstocks']['cache'] = BLOCK_NO_CACHE;
+  $blocks['orgstocks']['cache'] = 'BLOCK_NO_CACHE';
 
   return $blocks;
 }

+ 0 - 0
tripal_views/theme/tripal_views_admin.tpl.php → tripal_views/theme/tripal_views_help.tpl.php


+ 50 - 13
tripal_views/tripal_views.module

@@ -17,7 +17,6 @@ function tripal_views_menu() {
   $items['chado'] = array(
     'title' => 'Search Biological Data',
     'description' => 'Listings of the various biological data available categorized by type.',
-    'page callback' => 'tripal_views_biological_data_page',
     'access arguments' => array('access content'),
     'expanded' => TRUE,
     'type' => MENU_NORMAL_ITEM,
@@ -26,13 +25,13 @@ function tripal_views_menu() {
   $items['admin/tripal/views-integration'] = array(
     'title' => 'Views Integration',
     'description' => 'Integration of all the chado tables and fields with Drupal Views.',
-    //'page callback' => 'theme',
-    //'page arguments' => array('tripal_views_admin'),
+    'page callback' => 'tripal_views_admin_integration_view',
     'access arguments' => array('manage tripal_views_integration'),
     'type' => MENU_NORMAL_ITEM,
     'weight' => 2
   );
 
+  /**
   $items['admin/tripal/views-integration/list'] = array(
     'title' => 'List of Integrated Tables',
     'description' => 'Provide a list of all integrated tables and allows for adding new tables or editing already integrated tables.',
@@ -41,6 +40,7 @@ function tripal_views_menu() {
     'type' => MENU_NORMAL_ITEM,
     'weight' => 0,
   );
+  */
 
   $items['admin/tripal/views-integration/new'] = array(
     'title' => 'Integrate A Table',
@@ -48,7 +48,7 @@ function tripal_views_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_form'),
     'access arguments' => array('manage tripal_views_integration'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_CALLBACK,
     'weight' => 1,
   );
 
@@ -57,7 +57,7 @@ function tripal_views_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_form', 4),
     'access arguments' => array('manage tripal_views_integration'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_CALLBACK,
   );
 
   $items['admin/tripal/views-integration/delete/%'] = array(
@@ -82,7 +82,7 @@ function tripal_views_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_import_form'),
     'access arguments' => array('manage tripal_views_integration'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_CALLBACK,
     'weight' => 2,
   );
 
@@ -92,7 +92,7 @@ function tripal_views_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_views_integration_export_form', 4),
     'access arguments' => array('manage tripal_views_integration'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_CALLBACK,
     'weight' => 3,
   );
 
@@ -109,10 +109,18 @@ function tripal_views_menu() {
     'title' => 'Help',
     'description' => "A description of the Tripal Views module including a short description of it's usage.",
     'page callback' => 'theme',
-    'page arguments' => array('tripal_views_admin'),
+    'page arguments' => array('tripal_views_help'),
     'access arguments' => array('manage tripal_views_integration'),
-    'type' => MENU_NORMAL_ITEM,
-    'weight' => 4,
+    'type' => MENU_LOCAL_TASK,
+    'weight' => 10,
+  );
+
+  $items['admin/tripal/views-integrations/views/integrations/enable'] = array(
+    'title' => 'Enable Integrations Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_views_admin_integrations', 'admin/tripal/views-integrations'),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
   );
 
   return $items;
@@ -142,7 +150,7 @@ function tripal_views_init() {
  */
 function tripal_views_help ($path, $arg) {
   if ($path == 'admin/help#tripal_views') {
-    return theme('tripal_views_admin', array());
+    return theme('tripal_views_help', array());
   }
 }
 
@@ -197,8 +205,8 @@ function tripal_views_theme($existing, $type, $theme, $path) {
       'variables' => array('element' => NULL)
     ),
     // instructions page for the views module
-    'tripal_views_admin' => array(
-      'template' => 'tripal_views_admin',
+    'tripal_views_help' => array(
+      'template' => 'tripal_views_help',
       'variables' =>  array(NULL),
       'path' => drupal_get_path('module', 'tripal_views') . '/theme'
     ),
@@ -253,4 +261,33 @@ function tripal_views_form_alter($form, $form_state, $form_id) {
     }
     */
   }
+}
+
+function tripal_views_admin_integration_view() {
+  $output = '';
+
+  // set the breadcrumb
+  $breadcrumb = array();
+  $breadcrumb[] = l('Home', '<front>');
+  $breadcrumb[] = l('Administration', 'admin');
+  $breadcrumb[] = l('Tripal', 'admin/tripal');
+  $breadcrumb[] = l('Intgrations', 'admin/tripal/views-integrations');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_views_admin_integrations','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Tripal Views Module uses primarily views to provide an '
+      . 'administrative interface. Currently one or more views needed for this '
+      . 'administrative interface are disabled. <strong>Click each of the following links to '
+      . 'enable the pertinent views</strong>:</p>';
+    $output .= '<ul>';
+      $output .= '<li>'.l('Tripal Views Admin', 'admin/tripal/views-integrations/views/integrations/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
 }

+ 156 - 5
tripal_views/tripal_views.views.inc

@@ -147,6 +147,9 @@ function tripal_views_views_pre_render(&$view) {
 function tripal_views_views_data() {
   $data = array();
 
+  // Manually integrate the drupal.tripal_views* tables
+  $data = tripal_views_views_data_tripal_views_tables($data);
+
   // MAKE SURE ALL CHADO TABLES ARE INTEGRATED
   tripal_views_integrate_all_chado_tables();
 
@@ -345,14 +348,14 @@ function tripal_views_views_data() {
             WATCHDOG_NOTICE);
         }
         // add relationship entry
-        $fake_field = $base_table . '_to_' . $left_table;
+        $fake_field = $base_field . '_to_' . $left_table;
         $data[$base_table][$fake_field] = array(
-          'title' => "$base_title => $left_title",
-          'help' => "Joins $base_title to $left_title",
+          'title' => "$base_title.$base_field => $left_title",
+          'help' => "Joins $base_title.$base_field to $left_title",
           'relationship' => array(
             'handler' => $join->relationship_handler,
-            'title' => t("$base_title => $left_title"),
-            'label' => t("$base_title => $left_title"),
+            'title' => t("$base_field => $left_title"),
+            'label' => t("$base_field => $left_title"),
             'real field' => $base_field,
             'base' => $left_table,
             'base field' => $left_field
@@ -367,6 +370,154 @@ function tripal_views_views_data() {
   return $data;
 }
 
+/**
+ *
+ */
+function tripal_views_views_data_tripal_views_tables($data) {
+
+  $data['tripal_views']['table']['group'] = t('Tripal Views Integration');
+  $data['tripal_views']['table']['base'] = array(
+    'field' => 'setup_id', // This is the identifier field for the view.
+    'title' => t('Tripal Views Integration'),
+    'help' => t('Specifications on how to integrate various tables with Drupal Views'),
+    'weight' => -10,
+  );
+
+  // Implicit Join to Materialized Views
+  $data['tripal_views']['table']['join'] = array(
+    'tripal_mviews' => array(
+      'left_field' => 'mview_id',
+      'field' => 'mview_id',
+    ),
+  );
+
+  // setup_id
+  $data['tripal_views']['setup_id'] = array(
+    'title' => t('Setup ID'),
+    'help' => t('Primary key of the integration'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // mview_id
+  $data['tripal_views']['mview_id'] = array(
+    'title' => t('Materialized View ID'),
+    'help' => t('The primary key of the Mview integrated.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // base_table
+  $data['tripal_views']['base_table'] = array(
+    'title' => t('Base Table?'),
+    'help' => t('Whether the table being integrated should be considered a base table.'),
+    'field' => array(
+      'handler' => 'views_handler_field_boolean',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_boolean_operator',
+      'label' => t('Base Table?'),
+      'type' => 'yes-no',
+      'use equal' => TRUE,
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // table_name
+  $data['tripal_views']['table_name'] = array(
+    'title' => t('Chado Table Name'),
+    'help' => t('The name of the table being integrated'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // priority
+  $data['tripal_views']['priority'] = array(
+    'title' => t('Priority'),
+    'help' => t('The priority of the integration.'),
+    'field' => array(
+      'handler' => 'views_handler_field_numeric',
+      'click sortable' => TRUE,
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_numeric',
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+  );
+
+  // name
+  $data['tripal_views']['name'] = array(
+    'title' => t('Name'),
+    'help' => t('The name of the integration'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  // comment
+  $data['tripal_views']['comment'] = array(
+    'title' => t('Description'),
+    'help' => t('Short description or comment about this integration.'),
+    'field' => array(
+      'handler' => 'views_handler_field',
+      'click sortable' => TRUE, // This is use by the table display plugin.
+    ),
+    'sort' => array(
+      'handler' => 'views_handler_sort',
+    ),
+    'filter' => array(
+      'handler' => 'views_handler_filter_string',
+    ),
+    'argument' => array(
+      'handler' => 'views_handler_argument_string',
+    ),
+  );
+
+  return $data;
+}
+
 /**
  * Implements hook_views_data_alter().
  * Used to add Chado <-> Node Joins & Relationships

+ 315 - 0
tripal_views/tripal_views.views_default.inc

@@ -0,0 +1,315 @@
+<?php
+
+/**
+ *
+ *
+ * @ingroup tripal_views
+ */
+function tripal_views_views_default_views() {
+  $views = array();
+
+  $view = tripal_views_defaultview_admin_integrations();
+  $views[$view->name] = $view;
+
+  return $views;
+}
+
+function tripal_views_defaultview_admin_integrations() {
+
+  $view = new view();
+  $view->name = 'tripal_views_admin_integrations';
+  $view->description = 'DO NOT DISABLE';
+  $view->tag = 'tripal admin';
+  $view->base_table = 'tripal_views';
+  $view->human_name = 'Tripal Views Admin';
+  $view->core = 7;
+  $view->api_version = '3.0';
+  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Master */
+  $handler = $view->new_display('default', 'Master', 'default');
+  $handler->display->display_options['title'] = 'Tripal Views Integrations';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['access']['perm'] = 'manage tripal_views_integration';
+  $handler->display->display_options['cache']['type'] = 'none';
+  $handler->display->display_options['query']['type'] = 'views_query';
+  $handler->display->display_options['exposed_form']['type'] = 'basic';
+  $handler->display->display_options['exposed_form']['options']['submit_button'] = 'Filter';
+  $handler->display->display_options['pager']['type'] = 'full';
+  $handler->display->display_options['pager']['options']['items_per_page'] = '25';
+  $handler->display->display_options['style_plugin'] = 'table';
+  $handler->display->display_options['style_options']['columns'] = array(
+    'name' => 'name',
+    'table_name' => 'table_name',
+    'mv_table' => 'mv_table',
+    'comment' => 'comment',
+    'base_table' => 'base_table',
+    'priority' => 'priority',
+  );
+  $handler->display->display_options['style_options']['default'] = '-1';
+  $handler->display->display_options['style_options']['info'] = array(
+    'name' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+    'table_name' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+    'mv_table' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+    'comment' => array(
+      'sortable' => 0,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+    'base_table' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+    'priority' => array(
+      'sortable' => 1,
+      'default_sort_order' => 'asc',
+      'align' => '',
+      'separator' => '',
+      'empty_column' => 0,
+    ),
+  );
+  /* Header: Global: Text area */
+  $handler->display->display_options['header']['area']['id'] = 'area';
+  $handler->display->display_options['header']['area']['table'] = 'views';
+  $handler->display->display_options['header']['area']['field'] = 'area';
+  $handler->display->display_options['header']['area']['label'] = 'Description';
+  $handler->display->display_options['header']['area']['empty'] = TRUE;
+  $handler->display->display_options['header']['area']['content'] = '<p>The following tables are available for integration with Drupal Views. If a table is integrated more than once, then the setup with the lightest priority will be used. For example, if you have created a custom setup with a priority of -5 then that will be used instead of the default setup with priority 10. Priorities range from -10 to +10 where a setup with -10 has greater precedent than any other and +10 has the least.</p>';
+  $handler->display->display_options['header']['area']['format'] = 'filtered_html';
+  /* Header: Global: Action Links */
+  $handler->display->display_options['header']['action_links_area']['id'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area']['table'] = 'views';
+  $handler->display->display_options['header']['action_links_area']['field'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area']['label'] = 'Add Links';
+  $handler->display->display_options['header']['action_links_area']['empty'] = TRUE;
+  $handler->display->display_options['header']['action_links_area']['link-1'] = array(
+    'label-1' => 'Add New Integration',
+    'path-1' => 'admin/tripal/views-integration/new',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-2'] = array(
+    'label-2' => 'Import Integration',
+    'path-2' => 'admin/tripal/views-integration/import',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-3'] = array(
+    'label-3' => '',
+    'path-3' => '',
+  );
+  $handler->display->display_options['header']['action_links_area']['link-4'] = array(
+    'label-4' => '',
+    'path-4' => '',
+  );
+  /* Header: Global: Action Links */
+  $handler->display->display_options['header']['action_links_area_1']['id'] = 'action_links_area_1';
+  $handler->display->display_options['header']['action_links_area_1']['table'] = 'views';
+  $handler->display->display_options['header']['action_links_area_1']['field'] = 'action_links_area';
+  $handler->display->display_options['header']['action_links_area_1']['label'] = 'Delete Links';
+  $handler->display->display_options['header']['action_links_area_1']['empty'] = TRUE;
+  $handler->display->display_options['header']['action_links_area_1']['link-1'] = array(
+    'label-1' => 'Delete ALL Integrations',
+    'path-1' => 'admin/tripal/views-integration/delete-all/confirm',
+  );
+  $handler->display->display_options['header']['action_links_area_1']['link-2'] = array(
+    'label-2' => '',
+    'path-2' => '',
+  );
+  $handler->display->display_options['header']['action_links_area_1']['link-3'] = array(
+    'label-3' => '',
+    'path-3' => '',
+  );
+  $handler->display->display_options['header']['action_links_area_1']['link-4'] = array(
+    'label-4' => '',
+    'path-4' => '',
+  );
+  /* Field: Tripal Views Integration: Setup ID */
+  $handler->display->display_options['fields']['setup_id']['id'] = 'setup_id';
+  $handler->display->display_options['fields']['setup_id']['table'] = 'tripal_views';
+  $handler->display->display_options['fields']['setup_id']['field'] = 'setup_id';
+  $handler->display->display_options['fields']['setup_id']['exclude'] = TRUE;
+  $handler->display->display_options['fields']['setup_id']['separator'] = '';
+  /* Field: Tripal Views Integration: Name */
+  $handler->display->display_options['fields']['name']['id'] = 'name';
+  $handler->display->display_options['fields']['name']['table'] = 'tripal_views';
+  $handler->display->display_options['fields']['name']['field'] = 'name';
+  /* Field: Tripal Views Integration: Chado Table Name */
+  $handler->display->display_options['fields']['table_name']['id'] = 'table_name';
+  $handler->display->display_options['fields']['table_name']['table'] = 'tripal_views';
+  $handler->display->display_options['fields']['table_name']['field'] = 'table_name';
+  /* Field: Tripal Materialized Views: Table */
+  $handler->display->display_options['fields']['mv_table']['id'] = 'mv_table';
+  $handler->display->display_options['fields']['mv_table']['table'] = 'tripal_mviews';
+  $handler->display->display_options['fields']['mv_table']['field'] = 'mv_table';
+  $handler->display->display_options['fields']['mv_table']['label'] = 'Materialized View';
+  /* Field: Tripal Views Integration: Description */
+  $handler->display->display_options['fields']['comment']['id'] = 'comment';
+  $handler->display->display_options['fields']['comment']['table'] = 'tripal_views';
+  $handler->display->display_options['fields']['comment']['field'] = 'comment';
+  /* Field: Tripal Views Integration: Base Table? */
+  $handler->display->display_options['fields']['base_table']['id'] = 'base_table';
+  $handler->display->display_options['fields']['base_table']['table'] = 'tripal_views';
+  $handler->display->display_options['fields']['base_table']['field'] = 'base_table';
+  $handler->display->display_options['fields']['base_table']['not'] = 0;
+  /* Field: Tripal Views Integration: Priority */
+  $handler->display->display_options['fields']['priority']['id'] = 'priority';
+  $handler->display->display_options['fields']['priority']['table'] = 'tripal_views';
+  $handler->display->display_options['fields']['priority']['field'] = 'priority';
+  $handler->display->display_options['fields']['priority']['separator'] = '';
+  /* Field: Global: Custom text */
+  $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
+  $handler->display->display_options['fields']['nothing']['table'] = 'views';
+  $handler->display->display_options['fields']['nothing']['field'] = 'nothing';
+  $handler->display->display_options['fields']['nothing']['label'] = 'Edit Link';
+  $handler->display->display_options['fields']['nothing']['exclude'] = TRUE;
+  $handler->display->display_options['fields']['nothing']['alter']['text'] = 'edit';
+  $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
+  $handler->display->display_options['fields']['nothing']['alter']['path'] = 'admin/tripal/views-integration/edit/[setup_id]';
+  /* Field: Global: Custom text */
+  $handler->display->display_options['fields']['nothing_1']['id'] = 'nothing_1';
+  $handler->display->display_options['fields']['nothing_1']['table'] = 'views';
+  $handler->display->display_options['fields']['nothing_1']['field'] = 'nothing';
+  $handler->display->display_options['fields']['nothing_1']['label'] = 'Delete Link';
+  $handler->display->display_options['fields']['nothing_1']['exclude'] = TRUE;
+  $handler->display->display_options['fields']['nothing_1']['alter']['text'] = 'delete';
+  $handler->display->display_options['fields']['nothing_1']['alter']['make_link'] = TRUE;
+  $handler->display->display_options['fields']['nothing_1']['alter']['path'] = 'admin/tripal/views-integration/delete/[setup_id]';
+  /* Field: Global: Custom text */
+  $handler->display->display_options['fields']['nothing_2']['id'] = 'nothing_2';
+  $handler->display->display_options['fields']['nothing_2']['table'] = 'views';
+  $handler->display->display_options['fields']['nothing_2']['field'] = 'nothing';
+  $handler->display->display_options['fields']['nothing_2']['label'] = 'Export Link';
+  $handler->display->display_options['fields']['nothing_2']['exclude'] = TRUE;
+  $handler->display->display_options['fields']['nothing_2']['alter']['text'] = 'export';
+  $handler->display->display_options['fields']['nothing_2']['alter']['make_link'] = TRUE;
+  $handler->display->display_options['fields']['nothing_2']['alter']['path'] = 'admin/tripal/views-integration/export/[setup_id]';
+  /* Field: Global: Custom text */
+  $handler->display->display_options['fields']['nothing_3']['id'] = 'nothing_3';
+  $handler->display->display_options['fields']['nothing_3']['table'] = 'views';
+  $handler->display->display_options['fields']['nothing_3']['field'] = 'nothing';
+  $handler->display->display_options['fields']['nothing_3']['label'] = '';
+  $handler->display->display_options['fields']['nothing_3']['alter']['text'] = '[nothing]   [nothing_1]<br />
+  [nothing_2]';
+  $handler->display->display_options['fields']['nothing_3']['element_class'] = 'short-column';
+  $handler->display->display_options['fields']['nothing_3']['element_label_class'] = 'short-column';
+  $handler->display->display_options['fields']['nothing_3']['element_label_colon'] = FALSE;
+  /* Sort criterion: Tripal Views Integration: Chado Table Name */
+  $handler->display->display_options['sorts']['table_name']['id'] = 'table_name';
+  $handler->display->display_options['sorts']['table_name']['table'] = 'tripal_views';
+  $handler->display->display_options['sorts']['table_name']['field'] = 'table_name';
+  /* Sort criterion: Tripal Views Integration: Priority */
+  $handler->display->display_options['sorts']['priority']['id'] = 'priority';
+  $handler->display->display_options['sorts']['priority']['table'] = 'tripal_views';
+  $handler->display->display_options['sorts']['priority']['field'] = 'priority';
+  /* Filter criterion: Tripal Views Integration: Name */
+  $handler->display->display_options['filters']['name']['id'] = 'name';
+  $handler->display->display_options['filters']['name']['table'] = 'tripal_views';
+  $handler->display->display_options['filters']['name']['field'] = 'name';
+  $handler->display->display_options['filters']['name']['operator'] = 'contains';
+  $handler->display->display_options['filters']['name']['group'] = 1;
+  $handler->display->display_options['filters']['name']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['name']['expose']['operator_id'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['label'] = 'Integration Name Contains';
+  $handler->display->display_options['filters']['name']['expose']['operator'] = 'name_op';
+  $handler->display->display_options['filters']['name']['expose']['identifier'] = 'name';
+  $handler->display->display_options['filters']['name']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Tripal Views Integration: Chado Table Name */
+  $handler->display->display_options['filters']['table_name']['id'] = 'table_name';
+  $handler->display->display_options['filters']['table_name']['table'] = 'tripal_views';
+  $handler->display->display_options['filters']['table_name']['field'] = 'table_name';
+  $handler->display->display_options['filters']['table_name']['group'] = 1;
+  $handler->display->display_options['filters']['table_name']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['table_name']['expose']['operator_id'] = 'table_name_op';
+  $handler->display->display_options['filters']['table_name']['expose']['label'] = 'Chado Table Name';
+  $handler->display->display_options['filters']['table_name']['expose']['operator'] = 'table_name_op';
+  $handler->display->display_options['filters']['table_name']['expose']['identifier'] = 'table_name';
+  $handler->display->display_options['filters']['table_name']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Tripal Materialized Views: Table */
+  $handler->display->display_options['filters']['mv_table']['id'] = 'mv_table';
+  $handler->display->display_options['filters']['mv_table']['table'] = 'tripal_mviews';
+  $handler->display->display_options['filters']['mv_table']['field'] = 'mv_table';
+  $handler->display->display_options['filters']['mv_table']['group'] = 1;
+  $handler->display->display_options['filters']['mv_table']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['mv_table']['expose']['operator_id'] = 'mv_table_op';
+  $handler->display->display_options['filters']['mv_table']['expose']['label'] = 'Materialized View Table Name';
+  $handler->display->display_options['filters']['mv_table']['expose']['operator'] = 'mv_table_op';
+  $handler->display->display_options['filters']['mv_table']['expose']['identifier'] = 'mv_table';
+  $handler->display->display_options['filters']['mv_table']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Tripal Views Integration: Priority */
+  $handler->display->display_options['filters']['priority']['id'] = 'priority';
+  $handler->display->display_options['filters']['priority']['table'] = 'tripal_views';
+  $handler->display->display_options['filters']['priority']['field'] = 'priority';
+  $handler->display->display_options['filters']['priority']['group'] = 1;
+  $handler->display->display_options['filters']['priority']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['priority']['expose']['operator_id'] = 'priority_op';
+  $handler->display->display_options['filters']['priority']['expose']['label'] = 'Priority';
+  $handler->display->display_options['filters']['priority']['expose']['operator'] = 'priority_op';
+  $handler->display->display_options['filters']['priority']['expose']['identifier'] = 'priority';
+  $handler->display->display_options['filters']['priority']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Tripal Views Integration: Base Table? */
+  $handler->display->display_options['filters']['base_table']['id'] = 'base_table';
+  $handler->display->display_options['filters']['base_table']['table'] = 'tripal_views';
+  $handler->display->display_options['filters']['base_table']['field'] = 'base_table';
+  $handler->display->display_options['filters']['base_table']['value'] = 'All';
+  $handler->display->display_options['filters']['base_table']['group'] = 1;
+  $handler->display->display_options['filters']['base_table']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['base_table']['expose']['operator_id'] = '';
+  $handler->display->display_options['filters']['base_table']['expose']['label'] = 'Integrates a Base Table?';
+  $handler->display->display_options['filters']['base_table']['expose']['operator'] = 'base_table_op';
+  $handler->display->display_options['filters']['base_table']['expose']['identifier'] = 'base_table';
+  $handler->display->display_options['filters']['base_table']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /* Display: Page */
+  $handler = $view->new_display('page', 'Page', 'page');
+  $handler->display->display_options['path'] = 'admin/tripal/views-integration/integrations';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Integrations';
+  $handler->display->display_options['menu']['weight'] = '-10';
+  $handler->display->display_options['menu']['name'] = 'management';
+  $handler->display->display_options['menu']['context'] = 0;
+  $handler->display->display_options['menu']['context_only_inline'] = 0;
+  $handler->display->display_options['tab_options']['weight'] = '0';
+
+  return $view;
+}