You are here

function filefield_source_reference_settings in FileField Sources 6

Same name and namespace in other branches
  1. 7 sources/reference.inc \filefield_source_reference_settings()

Implements hook_filefield_source_settings().

File

sources/reference.inc, line 66
A FileField extension to allow referencing of existing files.

Code

function filefield_source_reference_settings($op, $field) {
  $return = array();
  if ($op == 'form') {
    $return['sources_reference'] = array(
      '#title' => t('Autocomplete reference options'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $return['sources_reference']['filefield_source_autocomplete'] = array(
      '#title' => t('Match file name'),
      '#options' => array(
        '0' => t('Starts with string'),
        '1' => t('Contains string'),
      ),
      '#type' => 'radios',
      '#default_value' => empty($field['filefield_source_autocomplete']) ? '0' : '1',
    );
  }
  elseif ($op == 'save') {
    $return[] = 'filefield_source_autocomplete';
  }
  return $return;
}