You are here

function textimage_text_effect_form_validate in Textimage 7.3

Settings for 'textimage_text' image effect - form validation.

1 string reference to 'textimage_text_effect_form_validate'
textimage_text_effect_form in effects/textimage_text.inc
Settings for 'textimage_text' image effect.

File

effects/textimage_text.inc, line 507
Implementation of the 'textimage_text' image effect.

Code

function textimage_text_effect_form_validate($form, &$form_state) {
  $form_values = $form_state['values']['data']['settings'];

  // Get x-y position from the anchor element.
  list($form_values['layout']['position']['x_pos'], $form_values['layout']['position']['y_pos']) = explode('-', $form_values['layout']['position']['placement']);
  unset($form_values['layout']['position']['placement']);

  // Get the font URI.
  $font_uri = TextimageFonts::getUri($form_values['font']['name']);
  $form_state['values']['data'] = array(
    'font' => array(
      'name' => $form_values['font']['name'],
      'uri' => $font_uri,
      'size' => $form_values['font']['size'],
      'angle' => $form_values['font']['angle'],
      'color' => $form_values['font']['color'],
      'stroke_mode' => $form_values['font']['stroke']['mode'],
      'stroke_color' => $form_values['font']['stroke']['color'],
      'outline_top' => $form_values['font']['stroke']['top'],
      'outline_right' => $form_values['font']['stroke']['right'],
      'outline_bottom' => $form_values['font']['stroke']['bottom'],
      'outline_left' => $form_values['font']['stroke']['left'],
      'shadow_x_offset' => $form_values['font']['stroke']['x_offset'],
      'shadow_y_offset' => $form_values['font']['stroke']['y_offset'],
      'shadow_width' => $form_values['font']['stroke']['width'],
      'shadow_height' => $form_values['font']['stroke']['height'],
    ),
    'layout' => array(
      'padding_top' => $form_values['layout']['padding']['top'],
      'padding_right' => $form_values['layout']['padding']['right'],
      'padding_bottom' => $form_values['layout']['padding']['bottom'],
      'padding_left' => $form_values['layout']['padding']['left'],
      'x_pos' => $form_values['layout']['position']['x_pos'],
      'y_pos' => $form_values['layout']['position']['y_pos'],
      'x_offset' => $form_values['layout']['position']['x_offset'],
      'y_offset' => $form_values['layout']['position']['y_offset'],
      'overflow_action' => $form_values['layout']['position']['overflow_action'],
      'background_color' => $form_values['layout']['background_color'],
    ),
    'text' => array(
      'maximum_width' => $form_values['text']['maximum_width'],
      'fixed_width' => $form_values['text']['fixed_width'],
      'align' => $form_values['text']['align'],
      'case_format' => $form_values['text']['case_format'],
      'line_spacing' => $form_values['text']['line_spacing'],
    ),
    'text_string' => $form_values['text_default']['text_string'],
  );
}