Pārlūkot izejas kodu

Organism: Added default admin view and switched to new UI

Lacey Sanderson 11 gadi atpakaļ
vecāks
revīzija
c87ef4d910

+ 41 - 8
tripal_organism/includes/tripal_organism.admin.inc

@@ -1,5 +1,38 @@
 <?php
 <?php
 
 
+/**
+ *
+ */
+function tripal_organism_admin_organism_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('Organisms', 'admin/tripal/chado/tripal_organism');
+  drupal_set_breadcrumb($breadcrumb);
+
+  // Add the view
+  $view = views_embed_view('tripal_organism_admin_organisms','default');
+  if (isset($view)) {
+    $output .= $view;
+  }
+  else {
+    $output .= '<p>The Organism 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('Organisms View', 'admin/tripal/chado/tripal_organism/views/organisms/enable').'</li>';
+    $output .= '</ul>';
+  }
+
+  return $output;
+}
+
 /**
 /**
  * Administrative settings for chado_orgnism
  * Administrative settings for chado_orgnism
  *
  *
@@ -10,7 +43,7 @@ function tripal_organism_admin() {
   $form = array();
   $form = array();
 
 
   get_tripal_organism_admin_form_reindex_set($form);
   get_tripal_organism_admin_form_reindex_set($form);
-  get_tripal_organism_admin_form_taxonomy_set($form);  
+  get_tripal_organism_admin_form_taxonomy_set($form);
 
 
   return system_settings_form($form);
   return system_settings_form($form);
 }
 }
@@ -41,7 +74,7 @@ function get_tripal_organism_admin_form_taxonomy_set(&$form) {
     '#value' => t(
     '#value' => t(
       "Drupal allows for assignment of \"taxonomy\" or catagorical terms to " .
       "Drupal allows for assignment of \"taxonomy\" or catagorical terms to " .
       "nodes. These terms allow for advanced filtering during searching. This option allows " .
       "nodes. These terms allow for advanced filtering during searching. This option allows " .
-      "for setting taxonomy only for features that belong to the selected organisms below.  All " . 
+      "for setting taxonomy only for features that belong to the selected organisms below.  All " .
       "other features will be unaffected.  To set taxonomy for all features in the site see the Feature Administration page."),
       "other features will be unaffected.  To set taxonomy for all features in the site see the Feature Administration page."),
     '#weight' => 1,
     '#weight' => 1,
   );
   );
@@ -161,9 +194,9 @@ function tripal_organism_reindex_features($organism_id = NULL, $job_id = NULL) {
   }
   }
 
 
   $sql = "
   $sql = "
-    SELECT * 
-    FROM {feature} 
-    WHERE organism_id = :organism_id 
+    SELECT *
+    FROM {feature}
+    WHERE organism_id = :organism_id
     ORDER BY feature_id";
     ORDER BY feature_id";
   $results = chado_query($sql, array(':organism_id' => $organism_id));
   $results = chado_query($sql, array(':organism_id' => $organism_id));
 
 
@@ -196,9 +229,9 @@ function tripal_organism_taxonify_features($organism_id = NULL, $job_id = NULL)
   }
   }
 
 
   $sql = "
   $sql = "
-    SELECT * 
-    FROM {feature} 
-    WHERE organism_id = :organism_id 
+    SELECT *
+    FROM {feature}
+    WHERE organism_id = :organism_id
     ORDER BY feature_id
     ORDER BY feature_id
   ";
   ";
   $results = chado_query($sql, array(':organism_id' => $organism_id));
   $results = chado_query($sql, array(':organism_id' => $organism_id));

+ 24 - 15
tripal_organism/tripal_organism.module

@@ -101,6 +101,7 @@ function tripal_organism_menu() {
   $items['admin/tripal/chado/tripal_organism'] = array(
   $items['admin/tripal/chado/tripal_organism'] = array(
    'title' => 'Organisms',
    'title' => 'Organisms',
    'description' => 'Basic Description of Tripal Organism Module Functionality',
    'description' => 'Basic Description of Tripal Organism Module Functionality',
+   'page callback' => 'tripal_organism_admin_organism_view',
    'access arguments' => array('adminster tripal organism'),
    'access arguments' => array('adminster tripal organism'),
    'type' => MENU_NORMAL_ITEM,
    'type' => MENU_NORMAL_ITEM,
   );
   );
@@ -111,25 +112,33 @@ function tripal_organism_menu() {
    'page callback' => 'theme',
    'page callback' => 'theme',
    'page arguments' => array('tripal_organism_help'),
    'page arguments' => array('tripal_organism_help'),
    'access arguments' => array('adminster tripal organism'),
    'access arguments' => array('adminster tripal organism'),
-   'type' => MENU_NORMAL_ITEM,
+   'type' => MENU_LOCAL_TASK,
   );
   );
 
 
   $items['admin/tripal/chado/tripal_organism/configuration'] = array(
   $items['admin/tripal/chado/tripal_organism/configuration'] = array(
-   'title' => 'Configuration',
+   'title' => 'Settings',
    'description' => 'Manage integration of Chado organisms including associated features',
    'description' => 'Manage integration of Chado organisms including associated features',
    'page callback' => 'drupal_get_form',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('tripal_organism_admin'),
    'page arguments' => array('tripal_organism_admin'),
    'access arguments' => array('adminster tripal organism'),
    'access arguments' => array('adminster tripal organism'),
-   'type' => MENU_NORMAL_ITEM,
+   'type' => MENU_LOCAL_TASK,
   );
   );
 
 
   $items['admin/tripal/chado/tripal_organism/sync'] = array(
   $items['admin/tripal/chado/tripal_organism/sync'] = array(
-    'title' => 'Sync Organisms',
+    'title' => 'Sync',
     'description' => 'Sync Chado organisms with Drupal',
     'description' => 'Sync Chado organisms with Drupal',
     'page callback' => 'drupal_get_form',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('tripal_organism_sync'),
     'page arguments' => array('tripal_organism_sync'),
     'access arguments' => array('adminster tripal organism'),
     'access arguments' => array('adminster tripal organism'),
-    'type' => MENU_NORMAL_ITEM,
+    'type' => MENU_LOCAL_TASK,
+  );
+
+  $items['admin/tripal/chado/tripal_organism/views/organisms/enable'] = array(
+    'title' => 'Enable Organism Administrative View',
+    'page callback' => 'tripal_views_admin_enable_view',
+    'page arguments' => array('tripal_organism_admin_organisms', 'admin/tripal/chado/tripal_organism'),
+    'access arguments' => array('administer tripal_bulk_loader'),
+    'type' => MENU_CALLBACK,
   );
   );
 
 
   return $items;
   return $items;
@@ -154,7 +163,7 @@ function tripal_organism_help ($path, $arg) {
  */
  */
 function tripal_organism_theme($existing, $type, $theme, $path) {
 function tripal_organism_theme($existing, $type, $theme, $path) {
   $core_path = drupal_get_path('module', 'tripal_core');
   $core_path = drupal_get_path('module', 'tripal_core');
-  
+
   $items = array(
   $items = array(
     'node__chado_organism' => array(
     'node__chado_organism' => array(
       'template' => 'node--chado-generic',
       'template' => 'node--chado-generic',
@@ -329,7 +338,7 @@ function chado_organism_validate($node, $form, &$form_state) {
   $node->abbreviation = trim($node->abbreviation);
   $node->abbreviation = trim($node->abbreviation);
   $node->common_name  = trim($node->common_name);
   $node->common_name  = trim($node->common_name);
   $node->description  = trim($node->description);
   $node->description  = trim($node->description);
-  
+
   // if this is an update, we want to make sure that a different organism doesn't
   // if this is an update, we want to make sure that a different organism doesn't
   // already have this genus and speces
   // already have this genus and speces
   if (property_exists($node, 'organism_id')) {
   if (property_exists($node, 'organism_id')) {
@@ -383,7 +392,7 @@ function chado_organism_insert($node) {
   $node->abbreviation = trim($node->abbreviation);
   $node->abbreviation = trim($node->abbreviation);
   $node->common_name  = trim($node->common_name);
   $node->common_name  = trim($node->common_name);
   $node->description  = trim($node->description);
   $node->description  = trim($node->description);
-  
+
   // if there is an organism_id in the $node object then this must be a sync so
   // if there is an organism_id in the $node object then this must be a sync so
   // we can skip adding the organism as it is already there, although
   // we can skip adding the organism as it is already there, although
   // we do need to proceed with the rest of the insert
   // we do need to proceed with the rest of the insert
@@ -410,7 +419,7 @@ function chado_organism_insert($node) {
 
 
   // Make sure the entry for this organism doesn't already exist in the
   // Make sure the entry for this organism doesn't already exist in the
   // chado_organism table if it doesn't exist then we want to add it.
   // chado_organism table if it doesn't exist then we want to add it.
-  $check_org_id = chado_get_id_for_node('organism', $node->nid);  
+  $check_org_id = chado_get_id_for_node('organism', $node->nid);
   if (!$check_org_id) {
   if (!$check_org_id) {
     $record = new stdClass();
     $record = new stdClass();
     $record->nid = $node->nid;
     $record->nid = $node->nid;
@@ -441,7 +450,7 @@ function chado_organism_update($node) {
   $node->abbreviation = trim($node->abbreviation);
   $node->abbreviation = trim($node->abbreviation);
   $node->common_name  = trim($node->common_name);
   $node->common_name  = trim($node->common_name);
   $node->description  = trim($node->description);
   $node->description  = trim($node->description);
-  
+
   if ($node->revision) {
   if ($node->revision) {
     // there is no way to handle revisions in Chado but leave
     // there is no way to handle revisions in Chado but leave
     // this here just to make not we've addressed it.
     // this here just to make not we've addressed it.
@@ -546,17 +555,17 @@ function chado_organism_add_image($node) {
  */
  */
 function chado_organism_form($node, $form_state) {
 function chado_organism_form($node, $form_state) {
   $form = array();
   $form = array();
-  
+
   // we have a file upload element on the form soe we need the multipart encoding type
   // we have a file upload element on the form soe we need the multipart encoding type
   $form['#attributes']['enctype'] = 'multipart/form-data';
   $form['#attributes']['enctype'] = 'multipart/form-data';
-  
+
   // if the organism is part of the node object then we are editing. If not we are inserting
   // if the organism is part of the node object then we are editing. If not we are inserting
   if (property_exists($node, 'organism')) {
   if (property_exists($node, 'organism')) {
     $organism = $node->organism;
     $organism = $node->organism;
 
 
     // add in the comment since it is a text field and may not be included if too big
     // add in the comment since it is a text field and may not be included if too big
     $organism = tripal_core_expand_chado_vars($organism, 'field', 'organism.comment');
     $organism = tripal_core_expand_chado_vars($organism, 'field', 'organism.comment');
-    
+
     // get form defaults
     // get form defaults
     $abbreviation   = property_exists($node, 'abbreviation')   ? property_exists($node, 'abbreviation')   : $organism->abbreviation;
     $abbreviation   = property_exists($node, 'abbreviation')   ? property_exists($node, 'abbreviation')   : $organism->abbreviation;
     $genus          = property_exists($node, 'genus')          ? property_exists($node, 'genus')          : $organism->genus;
     $genus          = property_exists($node, 'genus')          ? property_exists($node, 'genus')          : $organism->genus;
@@ -564,7 +573,7 @@ function chado_organism_form($node, $form_state) {
     $common_name    = property_exists($node, 'common_name')    ? property_exists($node, 'common_name')    : $organism->common_name;
     $common_name    = property_exists($node, 'common_name')    ? property_exists($node, 'common_name')    : $organism->common_name;
     $description    = property_exists($node, 'description')    ? property_exists($node, 'description')    : $organism->comment;
     $description    = property_exists($node, 'description')    ? property_exists($node, 'description')    : $organism->comment;
     $organism_image = property_exists($node, 'organism_image') ? property_exists($node, 'organism_image') : '';
     $organism_image = property_exists($node, 'organism_image') ? property_exists($node, 'organism_image') : '';
-    
+
     // set the organism_id in the form
     // set the organism_id in the form
     $form['organism_id'] = array(
     $form['organism_id'] = array(
       '#type' => 'value',
       '#type' => 'value',
@@ -635,7 +644,7 @@ function chado_organism_load($nodes) {
     // build the organism variable
     // build the organism variable
     $values = array('organism_id' => $organism_id);
     $values = array('organism_id' => $organism_id);
     $organism = tripal_core_generate_chado_var('organism', $values);
     $organism = tripal_core_generate_chado_var('organism', $values);
-    
+
 
 
     // add in the description field
     // add in the description field
     $organism = tripal_core_expand_chado_vars($organism, 'field', 'organism.comment');
     $organism = tripal_core_expand_chado_vars($organism, 'field', 'organism.comment');

+ 170 - 273
tripal_organism/tripal_organism.views_default.inc

@@ -7,293 +7,190 @@
 function tripal_organism_views_default_views() {
 function tripal_organism_views_default_views() {
   $views = array();
   $views = array();
 
 
-  if (!module_exists('tripal_views')) {
-    return $views;
-  }
+  $view = tripal_organism_admin_defaultview_organisms();
+  $views[$view->name] = $view;
+
+  return $views;
+}
+
+function tripal_organism_admin_defaultview_organisms() {
 
 
-  // Main default view
-  $view = new view;
-  $view->name = 'organism_listing';
+  $view = new view();
+  $view->name = 'tripal_organism_admin_organisms';
   $view->description = 'A listing of all organism in chado';
   $view->description = 'A listing of all organism in chado';
-  $view->tag = 'chado default';
+  $view->tag = 'tripal admin';
   $view->base_table = 'organism';
   $view->base_table = 'organism';
+  $view->human_name = 'Organism Admin';
   $view->core = 0;
   $view->core = 0;
-  $view->api_version = '2';
+  $view->api_version = '3.0';
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
   $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
+
+  /* Display: Defaults */
   $handler = $view->new_display('default', 'Defaults', 'default');
   $handler = $view->new_display('default', 'Defaults', 'default');
-  $handler->override_option('fields', array(
+  $handler->display->display_options['title'] = 'Organisms';
+  $handler->display->display_options['use_more_always'] = FALSE;
+  $handler->display->display_options['access']['type'] = 'perm';
+  $handler->display->display_options['access']['perm'] = 'adminster tripal organism';
+  $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(
+    'common_name' => 'common_name',
+    'genus' => 'genus',
+    'species' => 'species',
+    'abbreviation' => 'abbreviation',
+  );
+  $handler->display->display_options['style_options']['default'] = '-1';
+  $handler->display->display_options['style_options']['info'] = array(
     'common_name' => array(
     'common_name' => array(
-      'label' => 'Common Name',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        '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,
-      'exclude' => 0,
-      'id' => 'common_name',
-      'table' => 'organism',
-      'field' => 'common_name',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     ),
     'genus' => array(
     'genus' => array(
-      'label' => 'Genus',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        '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,
-      'exclude' => 0,
-      'id' => 'genus',
-      'table' => 'organism',
-      'field' => 'genus',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     ),
     'species' => array(
     'species' => array(
-      'label' => 'Species',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        '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,
-      'exclude' => 0,
-      'id' => 'species',
-      'table' => 'organism',
-      'field' => 'species',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     ),
     'abbreviation' => array(
     'abbreviation' => array(
-      'label' => 'Abbreviation',
-      'alter' => array(
-        'alter_text' => 0,
-        'text' => '',
-        'make_link' => 0,
-        'path' => '',
-        'link_class' => '',
-        'alt' => '',
-        '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' => 0,
-      'exclude' => 0,
-      'id' => 'abbreviation',
-      'table' => 'organism',
-      'field' => 'abbreviation',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('sorts', array(
-    'genus' => array(
-      'order' => 'ASC',
-      'id' => 'genus',
-      'table' => 'organism',
-      'field' => 'genus',
-      'relationship' => 'none',
+      'sortable' => 1,
+      'separator' => '',
     ),
     ),
-    'species' => array(
-      'order' => 'ASC',
-      'id' => 'species',
-      'table' => 'organism',
-      'field' => 'species',
-      'relationship' => 'none',
-    ),
-  ));
-  $handler->override_option('access', array(
-    'type' => 'perm',
-    'perm' => 'access chado_organism content',
-  ));
-  $handler->override_option('cache', array(
-    'type' => 'none',
-  ));
-  $handler->override_option('title', 'Organisms');
-  $handler->override_option('empty', 'No organisms matched the supplied criteria.');
-  $handler->override_option('empty_format', '1');
-  $handler->override_option('items_per_page', 0);
-  $handler->override_option('style_plugin', 'table');
-  $handler->override_option('style_options', array(
-    'grouping' => '',
-    'override' => 1,
-    'sticky' => 0,
-    'order' => 'asc',
-    'summary' => '',
-    'columns' => array(
-      'common_name' => 'common_name',
-      'genus' => 'genus',
-      'species' => 'species',
-      'abbreviation' => 'abbreviation',
-    ),
-    'info' => array(
-      'common_name' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'genus' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'species' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-      'abbreviation' => array(
-        'sortable' => 1,
-        'separator' => '',
-      ),
-    ),
-    'default' => '-1',
-  ));
-  $default_handler = $handler;
+  );
+  /* 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'] = 'Add Organism';
+  $handler->display->display_options['header']['area']['empty'] = TRUE;
+  $handler->display->display_options['header']['area']['content'] = '<ul class="action-links">
+          <li><a href="node/add/tripal_cv">Add Organism</a></li>
+     </ul>';
+  $handler->display->display_options['header']['area']['format'] = 'full_html';
+  /* 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 organisms matched the supplied criteria.';
+  $handler->display->display_options['empty']['text']['format'] = '1';
+  /* Relationship: Organism: Organism => Node */
+  $handler->display->display_options['relationships']['organism_id']['id'] = 'organism_id';
+  $handler->display->display_options['relationships']['organism_id']['table'] = 'chado_organism';
+  $handler->display->display_options['relationships']['organism_id']['field'] = 'organism_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']['exclude'] = TRUE;
+  /* Field: Chado Organism: Common Name */
+  $handler->display->display_options['fields']['common_name']['id'] = 'common_name';
+  $handler->display->display_options['fields']['common_name']['table'] = 'organism';
+  $handler->display->display_options['fields']['common_name']['field'] = 'common_name';
+  $handler->display->display_options['fields']['common_name']['alter']['make_link'] = TRUE;
+  $handler->display->display_options['fields']['common_name']['alter']['path'] = 'node/[nid]';
+  /* Field: Chado Organism: Genus */
+  $handler->display->display_options['fields']['genus']['id'] = 'genus';
+  $handler->display->display_options['fields']['genus']['table'] = 'organism';
+  $handler->display->display_options['fields']['genus']['field'] = 'genus';
+  /* Field: Chado Organism: Species */
+  $handler->display->display_options['fields']['species']['id'] = 'species';
+  $handler->display->display_options['fields']['species']['table'] = 'organism';
+  $handler->display->display_options['fields']['species']['field'] = 'species';
+  /* Field: Chado Organism: Abbreviation */
+  $handler->display->display_options['fields']['abbreviation']['id'] = 'abbreviation';
+  $handler->display->display_options['fields']['abbreviation']['table'] = 'organism';
+  $handler->display->display_options['fields']['abbreviation']['field'] = 'abbreviation';
+  /* 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'] = 'organism_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'] = 'organism_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 Organism: Genus */
+  $handler->display->display_options['sorts']['genus']['id'] = 'genus';
+  $handler->display->display_options['sorts']['genus']['table'] = 'organism';
+  $handler->display->display_options['sorts']['genus']['field'] = 'genus';
+  /* Sort criterion: Chado Organism: Species */
+  $handler->display->display_options['sorts']['species']['id'] = 'species';
+  $handler->display->display_options['sorts']['species']['table'] = 'organism';
+  $handler->display->display_options['sorts']['species']['field'] = 'species';
+  /* Filter criterion: Chado Organism: Common Name */
+  $handler->display->display_options['filters']['common_name']['id'] = 'common_name';
+  $handler->display->display_options['filters']['common_name']['table'] = 'organism';
+  $handler->display->display_options['filters']['common_name']['field'] = 'common_name';
+  $handler->display->display_options['filters']['common_name']['operator'] = 'contains';
+  $handler->display->display_options['filters']['common_name']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['common_name']['expose']['operator_id'] = '';
+  $handler->display->display_options['filters']['common_name']['expose']['label'] = 'Common Name Contains';
+  $handler->display->display_options['filters']['common_name']['expose']['identifier'] = 'common_name';
+  $handler->display->display_options['filters']['common_name']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Organism: Genus */
+  $handler->display->display_options['filters']['genus']['id'] = 'genus';
+  $handler->display->display_options['filters']['genus']['table'] = 'organism';
+  $handler->display->display_options['filters']['genus']['field'] = 'genus';
+  $handler->display->display_options['filters']['genus']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['genus']['expose']['operator_id'] = 'genus_op';
+  $handler->display->display_options['filters']['genus']['expose']['label'] = 'Genus';
+  $handler->display->display_options['filters']['genus']['expose']['operator'] = 'genus_op';
+  $handler->display->display_options['filters']['genus']['expose']['identifier'] = 'genus';
+  $handler->display->display_options['filters']['genus']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+  /* Filter criterion: Chado Organism: Species */
+  $handler->display->display_options['filters']['species']['id'] = 'species';
+  $handler->display->display_options['filters']['species']['table'] = 'organism';
+  $handler->display->display_options['filters']['species']['field'] = 'species';
+  $handler->display->display_options['filters']['species']['exposed'] = TRUE;
+  $handler->display->display_options['filters']['species']['expose']['operator_id'] = 'species_op';
+  $handler->display->display_options['filters']['species']['expose']['label'] = 'Species';
+  $handler->display->display_options['filters']['species']['expose']['operator'] = 'species_op';
+  $handler->display->display_options['filters']['species']['expose']['identifier'] = 'species';
+  $handler->display->display_options['filters']['species']['expose']['remember_roles'] = array(
+    2 => '2',
+    1 => 0,
+    3 => 0,
+  );
+
+  /* Display: Page */
   $handler = $view->new_display('page', 'Page', 'page_1');
   $handler = $view->new_display('page', 'Page', 'page_1');
-  $handler->override_option('path', 'chado/organisms');
-  $handler->override_option('menu', array(
-    'type' => 'normal',
-    'title' => 'Organisms',
-    'description' => 'A biological organism.',
-    'weight' => '10',
-    'name' => 'navigation',
-  ));
-  $handler->override_option('tab_options', array(
-    'type' => 'none',
-    'title' => '',
-    'description' => '',
-    'weight' => 0,
-    'name' => 'navigation',
-  ));
-  // 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 organism => Node relationship
-    $default_handler->override_option('relationships', array(
-      'nid' => array(
-        'label' => 'Organism to Node',
-        'required' => 0,
-        'id' => 'nid',
-        'table' => 'chado_organism',
-        'field' => 'nid',
-        'relationship' => 'none',
-      ),
-    ));
-    // Change analysis.name to have a link to the node
-    $fields['common_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;
+  $handler->display->display_options['path'] = 'admin/tripal/chado/tripal_organism/organisms';
+  $handler->display->display_options['menu']['type'] = 'default tab';
+  $handler->display->display_options['menu']['title'] = 'Organisms';
+  $handler->display->display_options['menu']['description'] = 'A biological organism.';
+  $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 $views;
+  return $view;
 }
 }