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/settings.php
410 410
     )
411 411
));
412 412

  
413
define('DISTRIBUTION_HIERARCHY_STYLE', 'distribution_hierarchy_style');
414
define('DISTRIBUTION_HIERARCHY_STYLE_DEFAULT', serialize(array(
415
  "level_0" => array(
416
    'label_suffix' => ':',
417
    'item_glue' => ' ',
418
    'item_group_prefix' => '',
419
    'item_group_postfix' => ''
420
  ),
421
  "level_1" => array(
422
    'label_suffix' => '',
423
    'item_glue' => '; ',
424
    'item_group_prefix' => ', ',
425
    'item_group_postfix' => ''
426
  ),
427
  "level_2" => array(
428
    'label_suffix' => '',
429
    'item_glue' => ', ',
430
    'item_group_prefix' => ' (',
431
    'item_group_postfix' => ')'
432
  )
433
)));
413 434

  
414 435
define('CDM_TAXON_MEDIA_FILTER', 'cdm_taxon_media_filter');
415 436
define('CDM_TAXON_MEDIA_FILTER_DEFAULT', serialize(
......
1231 1252

  
1232 1253
  $form['aggregation']['aggregate_by_taxon_relationships'][CDM_AGGREGATE_BY_TAXON_RELATIONSHIPS] = array(
1233 1254
      '#type' => 'fieldset',
1234
      '#attributes' => array('class'=>array('clearfix')),
1255
      '#attributes' => array('class' => array('clearfix')),
1235 1256
      '#title' => t('Aggregation via taxon relationsships'),
1236 1257
      '#collapsible' => TRUE,
1237 1258
      '#collapsed' => TRUE,
......
1261 1282

  
1262 1283
  $form['drupal_integration'] = array(
1263 1284
    '#type' => 'fieldset',
1264
    '#attributes' => array('class'=>array('clearfix')),
1285
    '#attributes' => array('class'=> array('clearfix')),
1265 1286
    '#title' => t('Drupal integration'),
1266 1287
    '#collapsible' => FALSE,
1267 1288
    '#collapsed' => FALSE,
......
2186 2207
    ' for details on the <em>Marked area filter</em>.',
2187 2208
  );
2188 2209

  
2210
  $form['taxon_profile']['distribution_layout'][DISTRIBUTION_HIERARCHY_STYLE] = array(
2211
    '#type' => 'fieldset',
2212
    '#tree' => true,
2213
    '#title' => t('Distribution hierarchy style')
2214
  );
2215

  
2216
  $hierarchy_styles = get_array_variable_merged(DISTRIBUTION_HIERARCHY_STYLE, DISTRIBUTION_HIERARCHY_STYLE_DEFAULT);
2217
  foreach(array_keys($hierarchy_styles) as $level) {
2218
    $form['taxon_profile']['distribution_layout'][DISTRIBUTION_HIERARCHY_STYLE][$level] = array(
2219
      '#type' => 'fieldset',
2220
      '#tree' => true,
2221
      '#title' => t(drupal_ucfirst((str_replace('_', ' ', $level)))),
2222
      '#attributes' => array('class' => array('fieldset-float'))
2223
    );
2224
    foreach ($hierarchy_styles[$level] as $key => $value) {
2225
      $form['taxon_profile']['distribution_layout'][DISTRIBUTION_HIERARCHY_STYLE][$level][$key] = array(
2226
        '#type' => 'textfield',
2227
        '#title' => t(drupal_ucfirst((str_replace('_', ' ', $key)))),
2228
        '#default_value' => $hierarchy_styles[$level][$key],
2229
        '#maxlength' => 4,
2230
        '#size' => 4
2231
      );
2232
    }
2233
  }
2234

  
2189 2235
  $level_options = cdm_vocabulary_as_option(UUID_NAMED_AREA_LEVEL, NULL, FALSE, SORT_ASC);
2190 2236
  $form['taxon_profile']['distribution_layout'][DISTRIBUTION_TREE_OMIT_LEVELS] = array(
2191 2237
    '#type' => 'checkboxes',

Also available in: Unified diff