X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Ffield_instance_settings_form.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd7%2Fhook%2Ffield_instance_settings_form.twig;h=6a432010600acee89cf59a53c7b62eb3e2439ac4;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_instance_settings_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_instance_settings_form.twig new file mode 100644 index 000000000..6a4320106 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_instance_settings_form.twig @@ -0,0 +1,30 @@ +/** + * Implements hook_field_instance_settings_form(). + */ +function {{ machine_name }}_field_instance_settings_form($field, $instance) { + $settings = $instance['settings']; + + $form['text_processing'] = array( + '#type' => 'radios', + '#title' => t('Text processing'), + '#default_value' => $settings['text_processing'], + '#options' => array( + t('Plain text'), + t('Filtered text (user selects text format)'), + ), + ); + if ($field['type'] == 'text_with_summary') { + $form['display_summary'] = array( + '#type' => 'select', + '#title' => t('Display summary'), + '#options' => array( + t('No'), + t('Yes'), + ), + '#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.'), + '#default_value' => !empty($settings['display_summary']) ? $settings['display_summary'] : 0, + ); + } + + return $form; +}