<?php
	$list = '';

	$new_window = '';
	if( !empty($instance['new_window']) ) {
		$new_window = 'true';
	}

	foreach($instance['item'] as $item) {
		$image = $item['image_fallback'];

		if( $item['image'] ) {
			$image = wp_get_attachment_image_src($item['image'], 'full');
			$image = $image[0];
		}
		
		$list .= '[portfolio_featured_item text_left="' . $item['text_left'] . '" text_right="' . $item['text_right'] . '" title="' . do_shortcode($item['title']) . '" url="' . $item['url'] . '" image="' . $image . '"]';
	}
	
	echo do_shortcode('[portfolio_featured]' . $list . '[/portfolio_featured]');
?>