You are here

function blockreference_list_values in Block reference 7

Build the select options for a blockreference_select_sort element.

1 call to blockreference_list_values()
blockreference_select_sort_process in ./blockreference.module
Process callback for a blockreference_select_sort element.

File

./blockreference.module, line 921
Defines a field type for referencing a block from a node.

Code

function blockreference_list_values($field, $language, $current_bid) {
  $instance = $field[$language]['instance'];
  $options = _blockreference_potential_references($field[$language]['field'], array(
    $current_bid,
  ), TRUE);
  foreach ($options as $key => $value) {
    $options[$key] = _blockreference_item($field, $value);
  }
  natcasesort($options);
  if (!$instance['required']) {
    $options = array(
      0 => ' - ' . t('none') . ' - ',
    ) + $options;
  }
  return $options;
}