Переглянути джерело

final touches with updates to change name of sequences

Shawna Spoor 8 роки тому
батько
коміт
a8b258f309

+ 21 - 6
tripal_ds/includes/tripal_ds.ds.inc

@@ -84,8 +84,8 @@ function _ds_layout_settings_info($bundle_name, $instances) {
         // type so we want to make sure that image goes in the summary.
         // It is not a TripalField so it won't have a chado table.
         if ($instance_name == 'data__image' and $term->name == 'organism') {
-        array_push($summary_fields, $instance_name);
-        $fields_with_regions[$instance_name] = 'right';
+          array_push($summary_fields, $instance_name);
+          $fields_with_regions[$instance_name] = 'right';
         }
       }
     }
@@ -145,10 +145,10 @@ function _ds_layout_settings_info($bundle_name, $instances) {
     }
   }
 
-  // Add blocks to $region_left.
-  $position = count($region_right);
-  $region_left[$position] = 'toc';
-  $fields_with_regions += [ 'toc' => 'left'];
+  // Add blocks to $region_left and build the toc field that is placed within.
+  _ds_fields_info_write($bundle_name);
+  $region_left += [ 'toc' ];
+  $fields_with_regions += [ 'toc' => 'left' ];
   // Build the ds layout.
   $record = new stdClass;
   $record->id ='TripalEntity|' . $bundle_name . '|default';
@@ -207,3 +207,18 @@ function tripal_ds_toc_block($entity_type) {
   return $toc;
 }
 
+function _ds_fields_info_write($bundle_name) {
+  $fields = new stdClass;
+  $fields->id ='TripalEntity|' . $bundle_name . '|default';
+  $fields->entity_type = 'TripalEntity';
+  $fields->bundle = $bundle_name;
+  $fields->view_mode = 'default';
+  $fields->settings = array(
+    'toc' => array(
+      'weight' => 0,
+      'label' => 'hidden',
+      'format' => 'default',
+    ),
+  );
+  drupal_write_record('ds_field_settings', $fields);
+}

+ 2 - 2
tripal_ds/includes/tripal_ds.field_group.inc

@@ -247,7 +247,7 @@ function _data_sequence_field_group_info($bundle_name, $fields){
   //Write to the tripal_ds table to record the new tripal pane.
   $field_for_table = new stdClass();
   $field_for_table->tripal_ds_field_name = 'group_sequence_tripalpane';
-  $field_for_table->tripal_ds_field_label = 'Data Sequences';
+  $field_for_table->tripal_ds_field_label = 'Sequence';
   $field_for_table->entity_type = 'TripalEntity';
   $field_for_table->bundle = $bundle_name;
 
@@ -264,7 +264,7 @@ function _data_sequence_field_group_info($bundle_name, $fields){
   $field_group_fieldset->mode = 'default';
   $field_group_fieldset->parent_name = 'group_sequence_tripalpane';
   $field_group_fieldset->data = array(
-    'label' => 'Data Sequences',
+    'label' => 'Sequence',
     'weight' => '3',
     'children' => array(
       0 => 'group_sequence_table',