1 image_example.module image_example_colorize_form($data)

Form Builder; Configuration settings for colorize effect.

Create a $form array with the fields necessary for configuring the image_example_colorize effect.

Note that this is not a complete form, it only contains the portion of the form for configuring the colorize options. Therefore it does not not need to include metadata about the effect, nor a submit button.

Parameters

array $data: The current configuration for this colorize effect.

Related topics

File

modules/examples/image_example/image_example.module, line 276
Module file for image_example

Code

function image_example_colorize_form($data) {
  $form = array();
  // You do not need to worry about handling saving/updating/deleting of the
  // data collected. The image module will automatically serialize and store
  // all data associated with an effect.
  $form['color'] = array(
    '#type' => 'textfield',
    '#title' => t('Color'),
    '#description' => t('The color to use when colorizing the image. Use web-style hex colors. e.g.) #FF6633.'),
    '#default_value' => isset($data['color']) ? $data['color'] : '',
    '#size' => 7,
    '#max_length' => 7,
    '#required' => TRUE,
  );
  return $form;
}