Project

General

Profile

« Previous | Next » 

Revision c797d7db

Added by Andreas Kohlbecker almost 4 years ago

claning up distribution_status_label_and_markup()

View differences:

modules/cdm_dataportal/includes/descriptions.inc
596 596
        }
597 597
      } // END of loop over sources
598 598

  
599
    // annotations footnotes separate.
600
    $annotations_and_sources['foot_note_keys'] = theme('cdm_entities_annotations_as_footnotekeys',
601
      array(
602
        'cdmBase_list' => $entity,
603
        'footnote_list_key' => $footnote_list_key_suggestion,
604
      )
605
    );
599
      // annotations footnotes separate.
600
      $annotations_and_sources['foot_note_keys'] = theme('cdm_entities_annotations_as_footnotekeys',
601
        array(
602
          'cdmBase_list' => $entity,
603
          'footnote_list_key' => $footnote_list_key_suggestion,
604
        )
605
      );
606 606

  
607 607
    } // END of references inline
608 608

  
......
1801 1801
    );
1802 1802

  
1803 1803

  
1804
    [$status_label, $status_markup] = distribution_status_label_and_markup($description_element);
1804
    $status = distribution_status_label_and_markup($description_element);
1805 1805

  
1806 1806
    $out = '';
1807 1807
    $out .= '<' . $enclosingTag . ' class="descriptionElement descriptionElement-' . $description_element->uuid
1808
      . ' " title="' . $status_label. '">'
1808
      . ' " title="' . $status['label']. '">'
1809 1809
      . $description_element->area->representation_L10n
1810
      . $status_markup;
1810
      . $status['markup'];
1811 1811
    if(!empty($annotations_and_sources['source_references'])){
1812 1812
      $out .= ' ' . join(' ', $annotations_and_sources['source_references'] );
1813 1813
    }
......
1820 1820
}
1821 1821

  
1822 1822
  /**
1823
   * @param $descriptionElement
1824
   * @return array
1823
   * @param $description_element
1824
   * @return array an array with following keys
1825
   *   - 'label': the plain text status label
1826
   *   - 'markup': markup for the status
1825 1827
   */
1826
  function distribution_status_label_and_markup($descriptionElement, $status_glue = '&#8210; ') {
1828
  function distribution_status_label_and_markup($description_element, $status_glue = '&#8210; ') {
1827 1829
    $status_markup = '';
1828 1830
    $status_label = '';
1829 1831

  
1830
    if (isset($descriptionElement->status)) {
1831
      $status_label = $descriptionElement->status->representation_L10n;
1832
    if (isset($description_element->status)) {
1833
      $status_label = $description_element->status->representation_L10n;
1832 1834
      $status_markup =  '<span class="distributionStatus"> '
1833 1835
        . $status_glue
1834
        . '<span class="distributionStatus-' . $descriptionElement->status->idInVocabulary . '">'
1836
        . '<span class="distributionStatus-' . $description_element->status->idInVocabulary . '">'
1835 1837
        . $status_label
1836 1838
        . '</span></span>';
1837 1839

  
1838 1840
    };
1839
    return array($status_label, $status_markup);
1841
    return ['label' => $status_label, 'markup' => $status_markup];
1840 1842
  }
1841 1843

  
1842 1844

  
......
2031 2033
          UUID_DISTRIBUTION
2032 2034
        );
2033 2035

  
2034
        [$status_label, $status_markup] = distribution_status_label_and_markup($distribution, $level_style['status_glue']);
2036
        $status = distribution_status_label_and_markup($distribution, $level_style['status_glue']);
2035 2037
      }
2036 2038

  
2037 2039
      $per_node_markup[$node_index] .= '<' . $enclosingTag . ' class="descriptionElement'
2038 2040
        . join(' descriptionElement-', $distribution_uuids)
2039 2041
        . ' level_index_' . $level_index
2040
        . ' " title="' . $status_label . '">'
2042
        . ' " title="' . $status['label'] . '">'
2041 2043
        . '<span class="area_label">' . $label
2042 2044
        . $level_style['label_suffix'] . '</span>'
2043
        . $status_markup
2045
        . $status['markup']
2044 2046
      ;
2045 2047

  
2046 2048
      if(isset($annotations_and_sources)){

Also available in: Unified diff