You are here

function rolereference_field_settings_form in Role Reference 7

Implements hook_field_settings_form().

File

./rolereference.module, line 45

Code

function rolereference_field_settings_form($field, $instance, $has_data) {
  $settings = $field['settings'];
  $form = array();
  $role_options = array_map('check_plain', user_roles());
  $form['referenceable_roles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Roles that can be referenced'),
    '#description' => t('Select roles that may be referenced by this field. All roles will be available if none are checked.'),
    '#multiple' => TRUE,
    '#default_value' => is_array($settings['referenceable_roles']) ? $settings['referenceable_roles'] : array(),
    '#options' => $role_options,
  );
  return $form;
}