Project

General

Profile

« Previous | Next » 

Revision 08a339ec

Added by Andreas Kohlbecker over 9 years ago

fixing #1803 (PALMS. Common names entered with Editor not displaying well in the portal), the CommonName elements respect the feature block settings so that source references as content are shown in the portal

View differences:

7.x/modules/cdm_dataportal/cdm_dataportal.css
187 187
.homotypicSynonymyGroup li.footnotes,
188 188
.homotypicSynonyms li.footnotes,
189 189
.misapplied li.footnotes,
190
.content li.descriptionText, /* TODO this line has only left for debuggin: remove it */
191
.block-cdm-dataportal-feature .content li.cdm\:TextData {
190
.content li.descriptionText, /* TODO this line has only left for debugging: remove it */
191
.block-cdm-dataportal-feature .content li.cdm\:TextData,
192
.block-cdm-dataportal-feature .content li.cdm\:CommonTaxonName{
192 193
  margin-top: 10px;
193 194
  margin-left: 6px;
194 195
  padding-left: 6px;
7.x/modules/cdm_dataportal/includes/descriptions.inc
284 284
    return $footnote_list_key;
285 285
  }
286 286

  
287
  /**
288
   * Provides the according tag name for the description element markup which fits the  $feature_block_settings['as_list'] value
289
   *
290
   * @param $feature_block_settings
291
   *   A feature_block_settings array, for details, please see get_feature_block_settings($feature_uuid = 'DEFAULT')
292
   */
293
  function cdm_feature_block_element_tag_name($feature_block_settings){
294
    switch ($feature_block_settings['as_list']){
295
      case 'ul':
296
      case 'ol':
297
        return 'li';
298
      case 'div':
299
        return 'span';
300
      case 'dl':
301
        return 'dd';
302
      default:
303
        return 'div'; // should never happen, throw error instead?
304
    }
305
  }
7.x/modules/cdm_dataportal/settings.php
419 419
   *          ul: as bullet list,
420 420
   *          ol: as numbered list,
421 421
   *          dl: as definition list
422
   *        The tag used for the inner element, thus depends on the value of this field. The
423
   *        inner tag name can be retrieved by the function cdm_feature_block_element_tag_name()
422 424
   *    - link_to_reference: boolean,
423 425
   *        render the reference as link, ignored if the element is NOT a DescriptionElementSource
424 426
   *    - link_to_name_used_in_source": boolean
7.x/modules/cdm_dataportal/theme/cdm_dataportal.descriptions.theme
805 805

  
806 806
  $footnote_key_suggestion = 'common-names-feature-block';
807 807

  
808
  $feature_block_settings = get_feature_block_settings(UUID_COMMON_NAME);
809

  
810
  $element_tag_name = cdm_feature_block_element_tag_name($feature_block_settings);
811

  
808 812
  if (is_array($elements)) {
809 813
    foreach ($elements as $element) {
810 814

  
......
847 851
      // loop over set of individual elements
848 852
      foreach ($elements as $element) {
849 853
        if ($element->name) {
850
          $per_language_area_out[] = '<span class="' . html_class_attribute_ref($element) . '">'
851
          . $element->name . cdm_create_description_element_footnotes($element, ',', $footnote_key_suggestion) . '</span>';
854
          $annotations_and_sources = handle_annotations_and_sources($element, $feature_block_settings, $element->name, $footnote_key_suggestion);
855
          $source_references_markup = '';
856
          if(!empty($annotations_and_sources['source_references'])){
857
            $source_references_markup = ' ' . join(', ', $annotations_and_sources['source_references']);
858
          }
859
          $per_language_area_out[] = '<' . $element_tag_name. ' class="' . html_class_attribute_ref($element) . '">'
860
          . $element->name . $source_references_markup . $annotations_and_sources['foot_note_keys'] . '</' . $element_tag_name. '>';
852 861
        }
853 862
      } // End of loop over set of individual elements
854 863
      $common_name_feature_elements[] = ($language_area_key ? $language_area_key . ': ' : '' ) . join(', ', $per_language_area_out);
......
860 869
      $feature,
861 870
      '; ',
862 871
      FALSE,
863
      'div'
872
      $feature_block_settings['as_list']
864 873
      );
865 874
    $common_name_out .= $common_name_feature_elements_render_array['#markup'];
866 875

  

Also available in: Unified diff