1.20.x image.admin.inc image_style_delete_form($form, &$form_state, $style)

Form builder; Form for deleting an image style.

Parameters

$style: An image style array.

See also

image_style_delete_form_submit()

Related topics

File

modules/image/image.admin.inc, line 274
Admin page callbacks for the Image module.

Code

function image_style_delete_form($form, &$form_state, $style) {
  $form_state['image_style'] = $style;

  $replacement_styles = array_diff_key(image_style_options(TRUE, PASS_THROUGH), array($style['name'] => ''));
  $form['replacement'] = array(
    '#title' => t('Replacement style'),
    '#type' => 'select',
    '#options' => $replacement_styles,
    '#empty_option' => t('No replacement, just delete'),
  );

  return confirm_form(
  $form, 
  t('Optionally select a style before deleting %style', array('%style' => $style['label'])), 
  'admin/config/media/image-styles', 
  t('If this style is in use on the site, you may select another style to replace it. All images that have been generated for this style will be permanently deleted.'), 
  t('Delete'), t('Cancel')
  );
}