Browse Source

Added new tripal_fields_layout module. This will allow users to turn off our layout if they don't like it and use their own

Stephen Ficklin 9 years ago
parent
commit
fa54323234

+ 0 - 1
tripal_entities/includes/fields/tripal_entities_primary_dbxref.php

@@ -1 +0,0 @@
-<?php

+ 3 - 0
tripal_entities/includes/tripal_entities.chado_entity.inc

@@ -119,6 +119,9 @@ function tripal_entities_chado_field_alter(&$field) {
   else if ($field['chado_table'] == 'feature' and $field['chado_column'] == 'seqlen') {
     $field['field_type'] = 'seqlen';
     $field['widget_type'] = 'tripal_fields_seqlen_hidden_widget';
+    $field['label'] = 'Seqlen';
+    $field['description'] = 'The length of the residues.';
+
   }
   else if ($field['chado_table'] == 'feature' and $field['chado_column'] == 'residues') {
     $field['field_type'] = 'residues';

+ 2 - 10
tripal_entities/tripal_entities.install

@@ -6,15 +6,6 @@
 
 function tripal_entities_install() {
 
-  // add any external databases used by the file module.
-  //  tripal_entities_add_dbs();
-
-  // add any controlled vocabularies used by the file module.
-  //  tripal_entities_add_cvs();
-
-  // add any controlled vocabulary terms
-  //  tripal_entities_add_cvterms();
-
   // add any custom tables. For this case we will add an 'file' table to the
   // chado schema
   tripal_entities_add_custom_tables();
@@ -499,4 +490,5 @@ function tripal_entities_uninstall() {
     print "$entity_type : $bundle_id\n";
     field_attach_delete_bundle($entity_type, $bundle_id);
   }
-}
+}
+

+ 2 - 1
tripal_entities/tripal_entities.module

@@ -388,4 +388,5 @@ function tripal_entities_form_alter(&$form, &$form_state, $form_id) {
       }
       break;
   }
-}
+}
+

+ 3 - 1
tripal_fields/tripal_fields.module

@@ -13,4 +13,6 @@ function tripal_fields_theme($existing, $type, $theme, $path) {
       'render element' => 'element',
     ),
   );
-}
+}
+
+

+ 10 - 0
tripal_fields_layout/tripal_fields_layout.info

@@ -0,0 +1,10 @@
+name = Tripal Fields Layout
+description = Provides a layout for Tripal Entity fields.
+core = 7.x
+project = tripal
+package = Tripal
+version = 7.x-2.0
+
+dependencies[] = tripal_core
+dependencies[] = tripal_fields
+dependencies[] = tripal_entities

+ 50 - 0
tripal_fields_layout/tripal_fields_layout.install

@@ -0,0 +1,50 @@
+<?php
+
+/**
+ *
+ */
+function tripal_entities_add_tripal_bundle_panes_table(){
+  $schema = array (
+    'table' => 'tripal_bundle_panes',
+    'fields' => array (
+      'pane_id' => array (
+        'type' => 'serial',
+        'not null' => TRUE
+      ),
+      'bundle_id' => array(
+        'type' => 'int',
+        'not null' => TRUE
+      ),
+      'name' => array (
+        'type' => 'varchar',
+        'length' => 128,
+        'not null' => TRUE
+      ),
+      'weight' => array (
+        'type' => 'int',
+        'not null' => TRUE
+      ),
+      'settings' => array(
+        'type' => 'text'
+      ),
+    ),
+    'primary key' => array (
+      0 => 'pane_id'
+    ),
+    'foreign keys' => array (
+      'tripal_bundle' => array (
+        'table' => 'tripal_bundle',
+        'columns' => array (
+          'bundle_id' => 'bundle_id'
+        ),
+      ),
+    ),
+    'unique keys' => array (
+      'tripal_bundle_panes_name' => array ('name'),
+    ),
+    'indexes' => array(
+      'tripal_bundle_panes_bundle_id' => array('bundle_id'),
+    ),
+  );
+  chado_create_custom_table('tripal_bundle_panes', $schema, TRUE);
+}

+ 25 - 0
tripal_fields_layout/tripal_fields_layout.module

@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * Implements hook_form_FORM_ID_alter().
+ */
+function tripal_fields_layout_form_field_ui_display_overview_form_alter(&$form, &$form_state) {
+  $form['tripal_fields'] = array(
+    '#type' => 'fieldset',
+    '#title' => 'Biological Data Layout',
+    '#collapsible' => TRUE,
+    '#collapsed' => TRUE,
+  );
+  $form['tripal_fields']['new_pane'] = array(
+    '#type' => 'textfield',
+    '#title' => 'Add a new pane',
+    '#description' => 'Panes can be used to organize related fields. You may
+      create as many panes as desired. Once a pane is created you can use
+      the interface above to move fields into an appropriate pane. '
+  );
+  $form['tripal_fields']['new_pane_button'] = array(
+    '#type' => 'button',
+    '#name' => 'new_pane_button',
+    '#value' => 'Add',
+  );
+}