You are here

function image_style_add_form_submit in Drupal 7

Submit handler for adding a new image style.

File

modules/image/image.admin.inc, line 273
Administration pages for image settings.

Code

function image_style_add_form_submit($form, &$form_state) {
  $style = array(
    'name' => $form_state['values']['name'],
    'label' => $form_state['values']['label'],
  );
  $style = image_style_save($style);
  drupal_set_message(t('Style %name was created.', array(
    '%name' => $style['label'],
  )));
  $form_state['redirect'] = 'admin/config/media/image-styles/edit/' . $style['name'];
}