<?php
/**
 *
 *
 * @var int    $form_id         Which form we are dealing with.
 * @var int    $field_id        Which field ID we are dealing with.
 * @var string $html_id         Which field html this field has.
 * @var array  $field           Which field object we are dealing with.
 * @var array  $entries         Which entries we are modifying.
 * @var array  $selected_fields Which fields were selected.
 * @var string $view            Which view are in.
 * @var string $placeholder     Placeholder for this field.
 * @var mixed  $form            Form settings.
 */

$id = isset( $input['id'] ) ? $input['id'] : $field->id;

$size = isset( $field->size ) ? $field->size : 'medium';

switch ( $size ) {
	case 'small':
		$rows = 6;
		break;
	default:
	case 'medium':
		$rows = 12;
		break;
	case 'large':
		$rows = 18;
		break;
}
?>
<textarea
	id="<?php echo esc_attr( $html_id ); ?>"
	class="gk-gravityactions-edit-field gk-gravityactions-edit-field-size-<?php echo esc_attr( $size ); ?>"
	name="field_values[<?php echo esc_attr( $id ); ?>]"
	rows="<?php echo esc_attr( $rows ); ?>"
	<?php if ( ! empty( $placeholder ) ) : ?>
		placeholder="<?php echo esc_attr( $placeholder ); ?>"
	<?php endif; ?>
><?php

	$value = isset( $field_values[ $id ] ) ? $field_values[ $id ] : '';

	echo esc_textarea( stripslashes_deep( $value ) );
?></textarea>
