function image_style_add_form
image_style_add_form($form, &$form_state)
Form builder; Form for adding a new image style.
See also
Related topics
File
- modules/image/image.admin.inc, line 242
- Administration pages for image settings.
Code
function image_style_add_form($form, &$form_state) { $form['label'] = array( '#type' => 'textfield', '#title' => t('Style name'), '#default_value' => '', '#required' => TRUE, ); $form['name'] = array( '#type' => 'machine_name', '#description' => t('The name is used in URLs for generated images. Use only lowercase alphanumeric characters, underscores (_), and hyphens (-).'), '#size' => '64', '#required' => TRUE, '#machine_name' => array( 'exists' => 'image_style_load', 'source' => array('label'), 'replace_pattern' => '[^0-9a-z_\-]', 'error' => t('Please only use lowercase alphanumeric characters, underscores (_), and hyphens (-) for style names.'), ), ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Create new style'), ); return $form; }
© 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_add_form/7.x