You are here

function machine_name_field_widget_settings_form in Machine name 7

Implements hook_field_widget_settings_form().

File

./machine_name.module, line 50
Defines a machine name field type, relying on Form API's #type 'machine_name'.

Code

function machine_name_field_widget_settings_form($field, $instance) {
  $settings = $instance['widget']['settings'];
  $form['editable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Editable'),
    '#description' => t('Allows to edit field in saved entity.'),
    '#default_value' => !empty($settings['editable']) ? $settings['editable'] : FALSE,
  );
  return $form;
}