1 file.api.php hook_file_formatter_FORMATTER_settings($form, &$form_state, $settings)

Define formatter settings.

Note: This is not really a hook. The function name is manually specified via 'settings callback' in hook_file_formatter_info(), with this recommended callback name pattern.

Parameters

$form: An array represeting the settings form.

$form_state: An array representing the current state of the settings form.

$settings: An array containing default settings for the form elements.

File

core/modules/file/file.api.php, line 156
Hooks for file module.

Code

function hook_file_formatter_FORMATTER_settings($form, &$form_state, $settings) {
  $element['image_style'] = array(
    '#title' => t('Image style'),
    '#type' => 'select',
    '#options' => image_style_options(FALSE),
    '#default_value' => $settings['image_style'],
    '#empty_option' => t('None (original image)'),
  );
  return $element;
}