Project

General

Profile

« Previous | Next » 

Revision 3eccfdb9

Added by Andreas Kohlbecker about 8 years ago

#5677 sort order for distributions configurable in portal

View differences:

modules/cdm_dataportal/includes/descriptions.inc
73 73
  $cdm_distribution_filter = get_array_variable_merged(CDM_DISTRIBUTION_FILTER, CDM_DISTRIBUTION_FILTER_DEFAULT);
74 74
  $query = array();
75 75

  
76
  // new default, TODO put into settings #5677
77
  $query['distributionOrder'] = 'AREA_ORDER';
76
  $feature_block_settings = get_feature_block_settings(UUID_DISTRIBUTION);
77
  if($feature_block_settings['sort_elements'] == SORT_HIERARCHICAL){
78
    $query['distributionOrder'] = 'AREA_ORDER';
79
  }
78 80

  
79 81
  $query['recipe'] = variable_get(DISTRIBUTION_CONDENSED_RECIPE, DISTRIBUTION_CONDENSED_RECIPE_DEFAULT);
80 82

  
83

  
84

  
81 85
  if ($cdm_distribution_filter['filter_rules']['statusOrderPreference']) {
82 86
    $query['statusOrderPreference'] = 1;
83 87
  }
modules/cdm_dataportal/settings.php
1997 1997
            NO_SORT => 'No sorting',
1998 1998
            SORT_ASC => 'Ascending',
1999 1999
            SORT_DESC => 'Descending',
2000
            SORT_HIERARCHICAL => 'Hierachical'
2000
            SORT_HIERARCHICAL => 'Hierarchical'
2001 2001
          ),
2002
          '#description' => 'NOT YET USED! only in preparation',
2002
          '#description' => 'NOT YET FULLY USED! only in preparation (works partially for distributions)
2003
          <dl>
2004
          <dr><dt>No sorting</dt><dd>Sorting undefined</dd></dr>
2005
          <dr><dt>Ascending</dt><dd>Alphabetically in ascending order</dd></dr>
2006
          <dr><dt>Descending</dt><dd>Alphabetically in descending order</dd></dr>
2007
          <dr><dt>Hierarchical</dt><dd>Use the order of items and their hierarchy. This is not possible for all feature and item types.</dd></dr>
2008
          </dl>',
2003 2009
        );
2004 2010

  
2005 2011
        $form_feature_block_layout[$subform_id]['element_tag'] = array(
......
2090 2096

  
2091 2097
  $form['taxon_profile']['distribution_layout'][DISTRIBUTION_ORDER_MODE] = array(
2092 2098
    '#type' => 'radios',
2093
    '#title' => t('Order mode') . ':',
2099
    '#title' => t('Textal distribution mode') . ':',
2094 2100
    '#default_value' => variable_get(DISTRIBUTION_ORDER_MODE, DISTRIBUTION_ORDER_MODE_DEFAULT),
2095 2101
    '#options' => array(
2096 2102
      'FLAT_ALPHA' => t('Flat list'),

Also available in: Unified diff