diff --git a/modules/image/image.admin.inc b/modules/image/image.admin.inc index 19e8351..255be0f 100644 --- a/modules/image/image.admin.inc +++ b/modules/image/image.admin.inc @@ -56,23 +56,23 @@ function image_style_form($form, &$form_state, $style) { '#markup' => theme('image_style_preview', array('style' => $style)), ); + // Show the Image Style label. + $form['label'] = array( + '#type' => 'textfield', + '#title' => t('Image style name'), + '#default_value' => $style['label'], + '#required' => TRUE, + ); + // Allow the name of the style to be changed, unless this style is // provided by a module's hook_default_image_styles(). if ($style['storage'] & IMAGE_STORAGE_MODULE) { $form['name'] = array( - '#type' => 'item', - '#title' => t('Image style name'), - '#markup' => $style['label'], - '#description' => t('This image style is being provided by %module module and may not be renamed.', array('%module' => $style['module'])), + '#type' => 'value', + '#value' => $style['name'], ); } else { - $form['label'] = array( - '#type' => 'textfield', - '#title' => t('Image style name'), - '#default_value' => $style['label'], - '#required' => TRUE, - ); $form['name'] = array( '#type' => 'machine_name', '#size' => '64', @@ -214,15 +214,10 @@ function image_style_form_override_submit($form, &$form_state) { * Submit handler for saving an image style. */ function image_style_form_submit($form, &$form_state) { - $style = $form_state['image_style']; - // Update the image style name if it has changed. - if (isset($form_state['values']['name']) && $style['name'] != $form_state['values']['name']) { + $style = $form_state['image_style']; + if (isset($form_state['values']['name']) && isset($form_state['values']['label'])) { $style['name'] = $form_state['values']['name']; - } - - // Update the image style label if it has changed. - if (isset($form_state['values']['label']) && $style['label'] != $form_state['values']['label']) { $style['label'] = $form_state['values']['label']; }