<?php

extract( shortcode_atts( array( 
	'image_url'    => '',
	'image_width'  => '120',
	'image_height' => '120',
	'quote'        => '',
	'name'         => '',
 ), $atts ) );
 
ob_start(); global $gp; ?>

	<li class="testimonial-slide">
	
		<?php if ( $image_url ) { ?>
		
			<?php $image = aq_resize( wp_get_attachment_url( $image_url ), $image_width, $image_height, true, false, true ); ?>
			<?php if ( $gp['retina'] == 'enabled' ) {
				$retina = aq_resize( wp_get_attachment_url( $image_url ), $image_width * 2, $image_height * 2, true, true, true );
			} else {
				$retina = '';
			} ?>
			
			<img src="<?php echo esc_url( $image[0] ); ?>" data-rel="<?php echo esc_url( $retina ); ?>" width="<?php echo absint( $image[1] ); ?>" height="<?php echo absint( $image[2] ); ?>" alt="<?php if ( get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ) ) { echo get_post_meta( get_post_thumbnail_id(), '_wp_attachment_image_alt', true ); } else { the_title_attribute(); } ?>" class="wp-post-image testimonial-image avatar" />
											
		<?php } ?>
							
		<div class="testimonial-quote"<?php if ( $image_url ) { ?> style="margin-left: <?php echo absint( $image[1] ) + 38; ?>px;"<?php } ?>>
			<?php if ( $quote ) { ?><h5><?php echo esc_attr( $quote ); ?></h5><?php } ?>
			<?php if ( $name ) { ?><span class="testimonial-name"><?php echo esc_attr( $name ); ?></span><?php } ?>
		</div>

	</li>

<?php

$output_string = ob_get_contents();
ob_end_clean(); 	
echo wp_kses_post( $output_string );

?>