You are here

function atom_reference_field_instance_settings_form in Scald: Media Management made easy 7

Implements hook_field_instance_settings_form().

File

modules/fields/atom_reference/atom_reference.module, line 52
Defines a new field type, allowing to directly reference Scald Atoms from a node.

Code

function atom_reference_field_instance_settings_form($field, $instance) {
  $options = array();
  foreach (scald_types() as $name => $type) {
    $options[$name] = $type->title;
  }
  $form = array();
  $form['referencable_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Atom types that can be referenced'),
    '#multiple' => TRUE,
    '#options' => $options,
    '#default_value' => $instance['settings']['referencable_types'],
  );
  $allow_override = isset($instance['settings']['allow_override']) ? $instance['settings']['allow_override'] : FALSE;
  $form['allow_override'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow context override'),
    '#default_value' => $allow_override,
  );
  return $form;
}