Эх сурвалжийг харах

Added label to confirm apply layout

Stephen Ficklin 8 жил өмнө
parent
commit
770235f83e

+ 0 - 64
tripal_ds/publication.ds.inc

@@ -1,64 +0,0 @@
-<?php
-/**
- * @file
- * publication.ds.inc
- */
-
-/**
- * Implements hook_ds_layout_settings_info().
- */
-function publication_ds_layout_settings_info() {
-  $export = array();
-
-  $ds_layout = new stdClass();
-  $ds_layout->api_version = 1;
-  $ds_layout->id = 'TripalEntity|bio_data_45|default';
-  $ds_layout->entity_type = 'TripalEntity';
-  $ds_layout->bundle = 'bio_data_45';
-  $ds_layout->view_mode = 'default';
-  $ds_layout->layout = 'ds_2col';
-  $ds_layout->settings = array(
-    'regions' => array(
-      'left' => array(
-        0 => 'tpub__abstract',
-      ),
-      'right' => array(
-        1 => 'group_citation',
-        2 => 'tpub__citation',
-        3 => 'group_properties',
-        4 => 'group_references',
-        5 => 'sio__references',
-        6 => 'group_property_table',
-        7 => 'tpub__publication_type',
-        8 => 'tpub__doi',
-        9 => 'sbo__database_cross_reference',
-      ),
-    ),
-    'fields' => array(
-      'tpub__abstract' => 'left',
-      'group_citation' => 'right',
-      'tpub__citation' => 'right',
-      'group_properties' => 'right',
-      'group_references' => 'right',
-      'sio__references' => 'right',
-      'group_property_table' => 'right',
-      'tpub__publication_type' => 'right',
-      'tpub__doi' => 'right',
-      'sbo__database_cross_reference' => 'right',
-    ),
-    'classes' => array(),
-    'wrappers' => array(
-      'left' => 'div',
-      'right' => 'div',
-    ),
-    'layout_wrapper' => 'div',
-    'layout_attributes' => '',
-    'layout_attributes_merge' => 1,
-    'layout_link_attribute' => '',
-    'layout_link_custom' => '',
-    'layout_disable_css' => 0,
-  );
-  $export['TripalEntity|bio_data_45|default'] = $ds_layout;
-
-  return $export;
-}

+ 0 - 17
tripal_ds/publication.features.inc

@@ -1,17 +0,0 @@
-<?php
-/**
- * @file
- * publication.features.inc
- */
-
-/**
- * Implements hook_ctools_plugin_api().
- */
-function publication_ctools_plugin_api($module = NULL, $api = NULL) {
-  if ($module == "ds" && $api == "ds") {
-    return array("version" => "1");
-  }
-  if ($module == "field_group" && $api == "field_group") {
-    return array("version" => "1");
-  }
-}

+ 0 - 138
tripal_ds/publication.field_group.inc

@@ -1,138 +0,0 @@
-<?php
-/**
- * @file
- * publication.field_group.inc
- */
-
-/**
- * Implements hook_field_group_info().
- */
-function publication_field_group_info() {
-  $field_groups = array();
-
-  $field_group = new stdClass();
-  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
-  $field_group->api_version = 1;
-  $field_group->identifier = 'group_citation|TripalEntity|bio_data_45|default';
-  $field_group->group_name = 'group_citation';
-  $field_group->entity_type = 'TripalEntity';
-  $field_group->bundle = 'bio_data_45';
-  $field_group->mode = 'default';
-  $field_group->parent_name = '';
-  $field_group->data = array(
-    'label' => 'Citation',
-    'weight' => '1',
-    'children' => array(
-      0 => 'tpub__citation',
-    ),
-    'format_type' => 'fieldset',
-    'format_settings' => array(
-      'label' => 'Citation',
-      'instance_settings' => array(
-        'id' => '',
-        'classes' => 'group-citation field-group-fieldset',
-        'description' => '',
-      ),
-      'formatter' => 'open',
-    ),
-  );
-  $field_groups[''] = $field_group;
-
-  $field_group = new stdClass();
-  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
-  $field_group->api_version = 1;
-  $field_group->identifier = 'group_properties|TripalEntity|bio_data_45|default';
-  $field_group->group_name = 'group_properties';
-  $field_group->entity_type = 'TripalEntity';
-  $field_group->bundle = 'bio_data_45';
-  $field_group->mode = 'default';
-  $field_group->parent_name = '';
-  $field_group->data = array(
-    'label' => 'Properties',
-    'weight' => '2',
-    'children' => array(
-      0 => 'group_property_table',
-    ),
-    'format_type' => 'fieldset',
-    'format_settings' => array(
-      'label' => 'Properties',
-      'instance_settings' => array(
-        'id' => '',
-        'classes' => 'group-properties field-group-fieldset',
-        'description' => '',
-      ),
-      'formatter' => 'open',
-    ),
-  );
-  $field_groups[''] = $field_group;
-
-  $field_group = new stdClass();
-  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
-  $field_group->api_version = 1;
-  $field_group->identifier = 'group_property_table|TripalEntity|bio_data_45|default';
-  $field_group->group_name = 'group_property_table';
-  $field_group->entity_type = 'TripalEntity';
-  $field_group->bundle = 'bio_data_45';
-  $field_group->mode = 'default';
-  $field_group->parent_name = 'group_properties';
-  $field_group->data = array(
-    'label' => '',
-    'weight' => '30',
-    'children' => array(
-      0 => 'sbo__database_cross_reference',
-      1 => 'tpub__doi',
-      2 => 'tpub__publication_type',
-    ),
-    'format_type' => 'table',
-    'format_settings' => array(
-      'label' => '',
-      'instance_settings' => array(
-        'label_visibility' => '3',
-        'desc' => '',
-        'first_column' => '',
-        'second_column' => '',
-        'empty_label_behavior' => '1',
-        'table_row_striping' => 0,
-        'always_show_field_label' => 0,
-        'classes' => 'group-property-table field-group-table',
-      ),
-    ),
-  );
-  $field_groups[''] = $field_group;
-
-  $field_group = new stdClass();
-  $field_group->disabled = FALSE; /* Edit this to true to make a default field_group disabled initially */
-  $field_group->api_version = 1;
-  $field_group->identifier = 'group_references|TripalEntity|bio_data_45|default';
-  $field_group->group_name = 'group_references';
-  $field_group->entity_type = 'TripalEntity';
-  $field_group->bundle = 'bio_data_45';
-  $field_group->mode = 'default';
-  $field_group->parent_name = '';
-  $field_group->data = array(
-    'label' => 'References',
-    'weight' => '3',
-    'children' => array(
-      0 => 'sio__references',
-    ),
-    'format_type' => 'fieldset',
-    'format_settings' => array(
-      'label' => 'References',
-      'instance_settings' => array(
-        'id' => '',
-        'classes' => 'group-references field-group-fieldset',
-        'description' => 'The following data housed by this site is referred  to by this publication.',
-      ),
-      'formatter' => 'open',
-    ),
-  );
-  $field_groups[''] = $field_group;
-
-  // Translatables
-  // Included for use with string extractors like potx.
-  t('Citation');
-  t('Properties');
-  t('References');
-
-  return $field_groups;
-}

+ 0 - 14
tripal_ds/publication.info

@@ -1,14 +0,0 @@
-name = Publication
-core = 7.x
-package = Features
-dependencies[] = ctools
-dependencies[] = ds
-dependencies[] = field_group
-features[ctools][] = ds:ds:1
-features[ctools][] = field_group:field_group:1
-features[ds_layout_settings][] = TripalEntity|bio_data_45|default
-features[features_api][] = api:2
-features[field_group][] = group_citation|TripalEntity|bio_data_45|default
-features[field_group][] = group_properties|TripalEntity|bio_data_45|default
-features[field_group][] = group_property_table|TripalEntity|bio_data_45|default
-features[field_group][] = group_references|TripalEntity|bio_data_45|default

+ 0 - 7
tripal_ds/publication.module

@@ -1,7 +0,0 @@
-<?php
-/**
- * @file
- * Code for the Publication feature.
- */
-
-include_once 'publication.features.inc';

+ 7 - 4
tripal_ds/tripal_ds.module

@@ -93,16 +93,19 @@ function tripal_ds_ds_layout_info() {
   return $layouts;
 }
 
-function tripal_ds_update_layout_form($form, &$form_state, $bundle) {
+function tripal_ds_update_layout_form($form, &$form_state, $bundle_name) {
   $form = array();
   $form['bundle_name'] = array(
     '#type' => 'value',
-    '#value' => $bundle,
+    '#value' => $bundle_name,
   );
 
+  $bundle = tripal_load_bundle_entity(array('name' => $bundle_name));
+  $bundle_lable = $bundle->label;
+
   return confirm_form($form,
-    t('Please confirm you would like to update this layout: '.$bundle),
-    'admin/structure/bio_data/manage/'.$bundle.'/display',
+    t('Please confirm you would like to apply this layout: ' . $bundle_lable),
+    'admin/structure/bio_data/manage/' . $bundle_lable . '/display',
     t('This action cannot be undone.'),
     t('Yes, apply layout'),
     t('No, cancel')