Project

General

Profile

« Previous | Next » 

Revision 85669a85

Added by Andreas Kohlbecker almost 5 years ago

ref #7975 implementing settings for name relationship lists - all name rels enabled by default

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
1411 1411
  return $options;
1412 1412
}
1413 1413

  
1414
/**
1415
 * Creates and array of defaults for drupal select form elements.
1416
 *
1417
 * @param $vocabulary_uuid
1418
 *   The UUID of the CDM Term Vocabulary
1419
 * @param $term_label_callback
1420
 *   An optional call back function which can be used to modify the term label
1421
 * @param bool $empty_option
1422
 *   An additional element do be placed at the beginning og the list. This element will be the default option.
1423
 * @param array $include_filter
1424
 *   An associative array consisting of a field name an regular expression. All term matching
1425
 *   these filter are included. The value of the field is converted to a String by var_export()
1426
 *   so a boolean 'true' can be matched by '/true/'
1427
 * @param string $order_by
1428
 *   One of the order by constants defined in this file
1429
 * @return array
1430
 *   the terms in an array (key: uuid => value: uuid) as defaults for a form element that allows multiple choices.
1431
 */
1432
function cdm_vocabulary_as_defaults($vocabulary_uuid, array $include_filter = null) {
1433

  
1434
  $options = cdm_vocabulary_as_option($vocabulary_uuid, null, null, $include_filter);
1435
  $defaults = array();
1436
  foreach ($options as $uuid => $value){
1437
    $defaults[$uuid] = $uuid;
1438
  }
1439

  
1440
  return $defaults;
1441
}
1442

  
1414 1443
/**
1415 1444
 * @param $term_type string one of
1416 1445
 *  - Unknown

Also available in: Unified diff