You are here

function blockreference_field_widget_settings_form in Block reference 7

Same name and namespace in other branches
  1. 7.2 blockreference.field.inc \blockreference_field_widget_settings_form()

Implements hook_field_widget_settings_form().

File

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

Code

function blockreference_field_widget_settings_form($field, $instance) {
  $widget = $instance['widget'];
  $defaults = field_info_widget_settings($widget['type']);
  $settings = array_merge($defaults, $widget['settings']);
  $form = array();
  if ($widget['type'] == 'blockreference_autocomplete') {
    $form['size'] = array(
      '#type' => 'textfield',
      '#title' => t('Size of textfield'),
      '#default_value' => $settings['size'],
      '#element_validate' => array(
        '_element_validate_integer_positive',
      ),
      '#required' => TRUE,
    );
  }
  return $form;
}