You are here

function blockreference_allowed_values in Block reference 6

Implementation of hook_allowed_values().

1 call to blockreference_allowed_values()
blockreference_select_sort_process in ./blockreference.module
Process an individual element.

File

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

Code

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