Browse Source

Now chado tables are integrated on install of tripal_views and don't need the user to go to the views UI

Lacey Sanderson 12 years ago
parent
commit
f061e39d9e
1 changed files with 15 additions and 0 deletions
  1. 15 0
      tripal_views/tripal_views.module

+ 15 - 0
tripal_views/tripal_views.module

@@ -85,6 +85,21 @@ function tripal_views_menu() {
   return $items;
 }
 
+/**
+ * Implements hook_init().
+ */
+function tripal_views_init() {
+
+  // Need to ensure that all chado tables are integrated w/out making
+  // the user go to views UI. It would be ideal to do this in a hook called only once
+  // directly after install/enabling of the module but such a hook doesn't
+  // exist in Drupal 6
+  $tripal_views = db_fetch_object(db_query("SELECT true as has_rows FROM {tripal_views}"));
+  if (!$tripal_views->has_rows) {
+    tripal_views_integrate_all_chado_tables();
+  }
+}
+
 /**
  * Implements hook_views_api()
  *