Project

General

Profile

« Previous | Next » 

Revision 2d3d6556

Added by Andreas Kohlbecker almost 6 years ago

base rank slecction with null option

View differences:

modules/cdm_dataportal/cdm_api/cdm_api.module
1520 1520
 *    - CDM_ORDER_BY_ORDER_INDEX_DESC (can only be used with OrderedTerms!!)
1521 1521
 * @param bool $empty_option
1522 1522
 *   An additional element do be placed at the beginning og the list. This element will be the default option.
1523
 * @return array
1524
 *    the terms in an array as options for a form element that allows multiple choices.
1523 1525
 */
1524 1526
function cdm_terms_by_type_as_option($term_type, $order_by = CDM_ORDER_BY_TITLE_CACHE_ASC, $term_label_callback = NULL, $empty_option = FALSE){
1525 1527
  $terms = cdm_ws_fetch_all(
......
1532 1534
  return cdm_terms_as_options($terms, $term_label_callback, $empty_option);
1533 1535
}
1534 1536

  
1535
/**
1536
 * @todo Please document this function.
1537
 * @see http://drupal.org/node/1354
1538
 */
1539
function cdm_rankVocabulary_as_option() {
1540
  $options = cdm_vocabulary_as_option(UUID_RANK, NULL, false);
1541
  return $options;
1542
}
1543 1537

  
1544 1538
/**
1545 1539
 * @todo Please document this function.
modules/cdm_dataportal/settings.php
1246 1246
    '#title' => t('Rank of highest displayed taxon') . ':',
1247 1247
     // Before DEFAULT_TAXONTREE_RANKLIMIT_UUID.
1248 1248
    '#default_value' => variable_get(TAXONTREE_RANKLIMIT, TAXONTREE_RANKLIMIT_DEFAULT),
1249
    '#options' => cdm_rankVocabulary_as_option(),
1249
    '#options' => cdm_vocabulary_as_option(UUID_RANK, null, true),
1250 1250
    '#description' => t('This is the rank of the highest displayed taxon in the
1251 1251
      <em>taxon tree</em>. You can select here which rank should be at the top
1252 1252
      level of the tree structure.'),
......
2056 2056
    );
2057 2057
  }
2058 2058

  
2059
  $options = cdm_rankVocabulary_as_option();
2059
  $options = cdm_vocabulary_as_option(UUID_RANK, null, true);
2060 2060
  array_unshift($options, '-- DISABLED --');
2061 2061
  $form['taxon_profile']['picture']['image_hide_rank'] = array(
2062 2062
    '#type' => 'select',

Also available in: Unified diff