Project

General

Profile

Revision 75c1da8e

ID75c1da8e469941fe51f36e5a664835035f5be3f9
Parent 7e219fcc
Child db9c6559

Added by Andreas Kohlbecker over 1 year ago

ref #7770, ref #9034 settings to choose visible extension types

View differences:

modules/cdm_dataportal/settings.php
63 63
    $annotationTypeKeys[] = 'NULL_VALUE';
64 64
  }
65 65

  
66
  define('ANNOTATION_TYPES_VISIBLE', 'annotations_types_as_footnotes');
67
  define('ANNOTATIONS_TYPES_AS_FOOTNOTES_DEFAULT', serialize($annotationTypeKeys));
66
  const ANNOTATION_TYPES_VISIBLE = 'annotations_types_as_footnotes';
67
  define('ANNOTATION_TYPES_VISIBLE_DEFAULT', serialize($annotationTypeKeys));
68

  
69
/* extensionTypeKeys */
70
$extensionTypeKeys = array_keys(cdm_vocabulary_as_option(UUID_EXTENSION_TYPE));
71
if (in_array(UUID_ANNOTATION_TYPE_TECHNICAL, $extensionTypeKeys)) {
72
  // Additional value for the NULL case.
73
  $extensionTypeKeys[] = 'NULL_VALUE';
74
}
75
const EXTENSION_TYPES_VISIBLE = 'annotations_types_as_footnotes';
76
define('EXTENSION_TYPES_VISIBLE_DEFAULT', serialize($annotationTypeKeys));
68 77

  
69 78
  define('BIBLIOGRAPHY_FOR_ORIGINAL_SOURCE', 'bibliography_for_original_source');
70 79
  define('BIBLIOGRAPHY_FOR_ORIGINAL_SOURCE_DEFAULT', serialize(array(
......
1571 1580
  $annotationTypeOptions = cdm_terms_by_type_as_option('AnnotationType');
1572 1581
  // Additional option for the NULL case.
1573 1582
  $annotationTypeOptions['NULL_VALUE'] = t('untyped');
1574
  $annotationsTypesAsFootnotes = variable_get(ANNOTATION_TYPES_VISIBLE, unserialize(ANNOTATIONS_TYPES_AS_FOOTNOTES_DEFAULT));
1583
  $annotationsTypesVisible = variable_get(ANNOTATION_TYPES_VISIBLE, unserialize(EXTENSION_TYPES_VISIBLE_DEFAULT));
1575 1584
  $form['annotations'][ANNOTATION_TYPES_VISIBLE] = array(
1576 1585
    '#type' => 'checkboxes',
1577 1586
    '#title' => t('Visbility of annotation types'),
1578 1587
    '#description' => t("Only annotations of the selected type will be displayed. You may want to turn 'technical annotations' off."),
1579 1588
    '#options' => $annotationTypeOptions,
1580
    '#default_value' => $annotationsTypesAsFootnotes
1589
    '#default_value' => $annotationsTypesVisible
1590
  );
1591

  
1592
  $form['extensions'] = array(
1593
    '#type' => 'fieldset',
1594
    '#title' => t('Extensions'),
1595
    '#collapsible' => FALSE,
1596
    '#collapsed' => FALSE,
1597
    '#description' => t('This sections allows configuring global settings regarding the data type extensions.'),
1598
  );
1599

  
1600
  $extensionTypeOptions = cdm_terms_by_type_as_option('ExtensionType');
1601
  $extensionTypesVisible = variable_get(EXTENSION_TYPES_VISIBLE, unserialize(EXTENSION_TYPES_VISIBLE_DEFAULT));
1602
  $form['extensions'][EXTENSION_TYPES_VISIBLE] = array(
1603
    '#type' => 'checkboxes',
1604
    '#title' => t('Visbility of extension types'),
1605
    '#description' => t("Only extensions of the selected type will be displayed."),
1606
    '#options' => $extensionTypeOptions,
1607
    '#default_value' => $extensionTypesVisible
1581 1608
  );
1582 1609

  
1583 1610

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)