You are here

function _textimage_image_style_form_form_alter in Textimage 7.3

Make alterations to the core 'image_style_form' form.

A fieldset is added if the image style is Textimage relevant.

1 call to _textimage_image_style_form_form_alter()
textimage_form_image_style_form_alter in ./textimage.module
Implements hook_form_FORM_ID_alter().

File

./textimage.admin.inc, line 12
Textimage - Admin page callbacks.

Code

function _textimage_image_style_form_form_alter(&$form, &$form_state, $form_id) {
  if (TextimageStyles::isTextimage($form_state['image_style'])) {
    $form['textimage_options'] = array(
      '#type' => 'fieldset',
      '#tree' => TRUE,
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#title' => t('Textimage options'),
      '#description' => t('Define Textimage options specific for this image style.'),
    );

    // Define file storage wrapper used for the style images.
    $scheme_options = array();
    foreach (file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE) as $scheme => $stream_wrapper) {
      $scheme_options[$scheme] = $stream_wrapper['name'];
    }
    $form['textimage_options']['uri_scheme'] = array(
      '#type' => 'radios',
      '#options' => $scheme_options,
      '#title' => t('Image destination'),
      '#description' => t('Select where Textimage image files should be stored. Private file storage has significantly more overhead than public files, but allows access restriction.'),
      '#default_value' => $form_state['image_style']['textimage']['uri_scheme'],
    );

    // Adds a submit handler to deal with textimage options.
    $form['#submit'][] = '_textimage_image_style_form_textimage_submit';
  }
}