|
@@ -219,19 +219,27 @@ function tripal_tripal_bundle_form($form, &$form_state, $entityDataType) {
|
|
|
else {
|
|
|
$form['description']['#default_value'] = tripal_get_bundle_variable('description', $bundle->id, '');
|
|
|
}
|
|
|
-
|
|
|
- $empty_fields = tripal_get_bundle_variable('hide_empty_field', $bundle->id, '');
|
|
|
+ $hide_empty_field_var = tripal_get_bundle_variable('hide_empty_field', $bundle->id);
|
|
|
+ if ($hide_empty_field_var != 0) {
|
|
|
+ $hide_empty_field_var = TRUE;
|
|
|
+ }
|
|
|
+ $ajax_field_var = tripal_get_bundle_variable('ajax_field', $bundle->id);
|
|
|
+ if ($ajax_field_var != 0) {
|
|
|
+ $ajax_field_var = TRUE;
|
|
|
+ }
|
|
|
$form['hide_empty_field'] = array(
|
|
|
- '#type' => 'select',
|
|
|
- '#title' => t('Field Display'),
|
|
|
- '#options' => array(
|
|
|
- 'hide' => t('Hide empty fields'),
|
|
|
- 'show' => t('Show empty fields'),
|
|
|
- ),
|
|
|
- '#description' => t('Choose either to show or hide all empty fields. If "Show empty fields" is selected then fields will be loaded via AJAX to help speed page loads.'),
|
|
|
- '#default_value' => !empty($empty_fields) ? array($empty_fields,) : array('hide',),
|
|
|
+ '#type' => 'checkbox',
|
|
|
+ '#title' => t('Hide empty fields'),
|
|
|
+ '#description' => t('Uncheck this box if you would like to show all empty fields.'),
|
|
|
+ '#default_value' => $hide_empty_field_var,
|
|
|
);
|
|
|
|
|
|
+ $form['ajax_field'] = array(
|
|
|
+ '#type' => 'checkbox',
|
|
|
+ '#title' => t('Load field using AJAX'),
|
|
|
+ '#description' => t('Uncheck this box if you do not want field data to load by ajax, this may signifiantly increase page load times.'),
|
|
|
+ '#default_value' => $ajax_field_var,
|
|
|
+ );
|
|
|
$form['additional_settings'] = array(
|
|
|
'#type' => 'vertical_tabs',
|
|
|
'#weight' => 99,
|
|
@@ -393,7 +401,10 @@ function tripal_tripal_bundle_form_validate($form, $form_state) {
|
|
|
// VALIDATE: That there is a value passed for the hide_empty_field option. If
|
|
|
// no value passed default to hide field.
|
|
|
if(empty($form_state['values']['hide_empty_field'])){
|
|
|
- $form_state['values']['hide_empty_field'] = 'hide';
|
|
|
+ $form_state['values']['hide_empty_field'] = TRUE;
|
|
|
+ }
|
|
|
+ if (empty($form_state['values']['ajax_field'])) {
|
|
|
+ $form_state['values']['ajax_field'] = TRUE;
|
|
|
}
|
|
|
// VALIDATE: The only tokens used should be those we mentioned under "Available Tokens".
|
|
|
// PART 1: Set Titles.
|
|
@@ -464,6 +475,7 @@ function tripal_tripal_bundle_form_submit($form, &$form_state) {
|
|
|
|
|
|
// Save the hide_empty_field setting.
|
|
|
tripal_set_bundle_variable('hide_empty_field', $bundle->id, $form_state['values']['hide_empty_field']);
|
|
|
+ tripal_set_bundle_variable('ajax_field', $bundle->id, $form_state['values']['ajax_field']);
|
|
|
|
|
|
// Save the page title format.
|
|
|
tripal_save_title_format(
|