Project

General

Profile

« Previous | Next » 

Revision 38dd933d

Added by Andreas Kohlbecker almost 7 years ago

#5737 admins settings for hierarchical distribution styles

View differences:

modules/cdm_dataportal/includes/descriptions.inc
1614 1614
    if (isset($descriptionElement->status)) {
1615 1615
      $status_label = $descriptionElement->status->representation_L10n;
1616 1616
      $status_markup = '<span class="distributionStatus distributionStatus-' . $descriptionElement->status->idInVocabulary . '"> '
1617
        . $status_label . ' </span>';
1617
        . $status_label . '</span>';
1618 1618

  
1619 1619
    };
1620 1620
    return array($status_label, $status_markup);
......
1707 1707
  function compose_distribution_hierarchy($distribution_tree, $feature_block_settings){
1708 1708

  
1709 1709
    static $hierarchy_style;
1710
    // TODO expose $hierarchy_style to administration of provide a hook
1710
    // TODO expose $hierarchy_style to administration or provide a hook
1711 1711
    if( !isset($hierarchy_style)){
1712
      $hierarchy_style = array(
1713
        // level 2
1714
        array(
1715
          'label_suffix' => '',
1716
          'element_glue' => ', ',
1717
          'element_set_pre' => '(',
1718
          'element_set_post' => ')'
1719
        ),
1720
        // level 1
1721
        array(
1722
          'label_suffix' => '',
1723
          'element_glue' => '; ',
1724
          'element_set_pre' => '',
1725
          'element_set_post' => ''
1726
        ),
1727
        // level 0
1728
        array(
1729
          'label_suffix' => ':',
1730
          'element_glue' => ' ',
1731
          'element_set_pre' => '',
1732
          'element_set_post' => ''
1733
        ),
1734
      );
1712
      $hierarchy_style = get_array_variable_merged(DISTRIBUTION_HIERARCHY_STYLE, DISTRIBUTION_HIERARCHY_STYLE_DEFAULT);
1735 1713
    }
1736 1714

  
1737 1715
    $render_array = array();
......
1779 1757
    $level_index++;
1780 1758
    static $enclosingTag = "span";
1781 1759

  
1782
    $level_style = array_pop($hierarchy_style);
1760
    $level_style = array_shift($hierarchy_style);
1783 1761
    if(count($hierarchy_style) == 0){
1784 1762
      // lowest defined level style will be reused for all following levels
1785 1763
      $hierarchy_style[] = $level_style;
......
1842 1820
        . ' level_index_' . $level_index
1843 1821
        . ' " title="' . $status_label . '">'
1844 1822
        . '<span class="area_label">' . $label
1845
        . $level_style['label_suffix'] . ' </span>'
1823
        . $level_style['label_suffix'] . '</span>'
1846 1824
        .  $status_markup
1847 1825
      ;
1848 1826

  
......
1867 1845

  
1868 1846
      $per_node_markup[$node_index] .= '</' . $enclosingTag . '>';
1869 1847
    }
1870
    $markup .= $level_style['element_set_pre']  . join( $level_style['element_glue'], $per_node_markup) . $level_style['element_set_post'];
1848
    $markup .= $level_style['item_group_prefix']  . join( $level_style['item_glue'], $per_node_markup) . $level_style['item_group_postfix'];
1871 1849
  }
1872 1850

  
1873 1851

  

Also available in: Unified diff