Project

General

Profile

Revision 977bba78

ID977bba78560ff1387b601420f9c55409ac19fd92
Parent bf31af5f
Child d0e8e73c

Added by Andreas Kohlbecker almost 2 years ago

fix #8093 registration identifier links configurable

View differences:

modules/cdm_dataportal/cdm_dataportal.module
2128 2128
 */
2129 2129
function path_to_registration($identifier) {
2130 2130

  
2131
  return 'cdm_dataportal/registration/' . urlencode($identifier);
2131
  if(variable_get(CDM_REGISTRATION_PRESISTENT_IDENTIFIER_AS_LINK)){
2132
    return $identifier;
2133
  } else {
2134
    return 'cdm_dataportal/registration/' . urlencode($identifier);
2135
  }
2132 2136
}
2133 2137

  
2134 2138
/**
modules/cdm_dataportal/includes/name.inc
676 676
  }
677 677

  
678 678
  $registration_date_insitute_markup = render_registration_date_and_institute($registration_dto, 'span');
679
  $itentifier_markup = l($registration_dto->identifier, $registration_dto->identifier, array('attributes' => array('class' => array('identifier'))));
679
  $itentifier_markup = l($registration_dto->identifier, path_to_registration($registration_dto->identifier), array('attributes' => array('class' => array('identifier'))));
680 680

  
681 681
  $tagged_text_options = array();
682 682
  if(isset($registration_dto->nameRef)){
......
781 781
    if(isset($registration->institution->titleCache)){
782 782
      $office_class_attribute = registration_intitute_class_attribute($registration);
783 783
    }
784
    $markup = "<span class=\"registration $office_class_attribute\">" . l($registration->identifier, $registration->identifier) . ', '
784
    $markup = "<span class=\"registration $office_class_attribute\">" . l($registration->identifier, path_to_registration($registration->identifier)) . ', '
785 785
      .  preg_replace('/^([^T]*)(.*)$/', '${1}', $registration->registrationDate)
786 786
      . '</span>';
787 787
  }
modules/cdm_dataportal/settings.php
35 35
  define('CDM_DATAPORTAL_LAST_VISITED_TAB_ARRAY_INDEX', 999);
36 36
  define('CDM_DATAPORTAL_SPECIMEN_DERIVATE_TREE', 0);
37 37

  
38
  define('CDM_REGISTRATION_PRESISTENT_IDENTIFIER_AS_LINK', 'cdm_registration_presistent_identifier_as_link');
39

  
38 40
  /* annotationTypeKeys */
39 41
  $annotationTypeKeys = array_keys(cdm_vocabulary_as_option(UUID_ANNOTATION_TYPE));
40 42
  if (in_array(UUID_ANNOTATION_TYPE_TECHNICAL, $annotationTypeKeys)) {
......
1613 1615
      '#description' => t('Check this box if the link to advanced search should be show below the search box.'),
1614 1616
  );
1615 1617

  
1618
  // --- Registrations --- //
1619
  $form['registrations'] = array(
1620
    '#type' => 'fieldset',
1621
    '#title' => t('Registrations'),
1622
    '#collapsible' => FALSE,
1623
    '#collapsed' => FALSE,
1624
  );
1625
  $form['registrations']['cdm_registration_presistent_identifier_as_link'] = array(
1626
    '#type' => 'checkbox',
1627
    '#title' => t('Use the persistent http identifier as link'),
1628
    '#default_value' => variable_get('cdm_registration_presistent_identifier_as_link', 0),
1629
    '#description' => t('Switch the portal from using the drupal path <code>registration/{url encoded persistent http identifier}</code> to using the persistent http identifier directly as link.'),
1630
  );
1631

  
1616 1632
  // ---- Taxon Name Rendering --- //
1617 1633
  $form['taxon_name'] = array(
1618 1634
      '#type' => 'fieldset',

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)