Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_instance_settings_form.twig
1 /**
2  * Implements hook_field_instance_settings_form().
3  */
4 function {{ machine_name }}_field_instance_settings_form($field, $instance) {
5   $settings = $instance['settings'];
6
7   $form['text_processing'] = array(
8     '#type' => 'radios',
9     '#title' => t('Text processing'),
10     '#default_value' => $settings['text_processing'],
11     '#options' => array(
12       t('Plain text'),
13       t('Filtered text (user selects text format)'),
14     ),
15   );
16   if ($field['type'] == 'text_with_summary') {
17     $form['display_summary'] = array(
18       '#type' => 'select',
19       '#title' => t('Display summary'),
20       '#options' => array(
21         t('No'),
22         t('Yes'),
23       ),
24       '#description' => t('Display the summary to allow the user to input a summary value. Hide the summary to automatically fill it with a trimmed portion from the main post.'),
25       '#default_value' => !empty($settings['display_summary']) ? $settings['display_summary'] :  0,
26     );
27   }
28
29   return $form;
30 }