On this page
function image_style_form_add_submit
image_style_form_add_submit($form, &$form_state)
Submit handler for adding a new image effect to an image style.
File
- modules/image/image.admin.inc, line 182
- Administration pages for image settings.
Code
function image_style_form_add_submit($form, &$form_state) {
$style = $form_state['image_style'];
// Check if this field has any configuration options.
$effect = image_effect_definition_load($form_state['values']['new']);
// Load the configuration form for this option.
if (isset($effect['form callback'])) {
$path = 'admin/config/media/image-styles/edit/' . $form_state['image_style']['name'] . '/add/' . $form_state['values']['new'];
$form_state['redirect'] = array($path, array('query' => array('weight' => $form_state['values']['weight'])));
}
// If there's no form, immediately add the image effect.
else {
$effect['isid'] = $style['isid'];
$effect['weight'] = $form_state['values']['weight'];
image_effect_save($effect);
drupal_set_message(t('The image effect was successfully applied.'));
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!image!image.admin.inc/function/image_style_form_add_submit/7.x