<?php
if(isset($tpl['gallery_arr']))
{
	if(!empty($tpl['gallery_arr']))
	{
		$gallery_ids = explode(",", $_GET['gallery_ids']);
		foreach($tpl['gallery_arr'] as $items)
		{
			foreach($items as $pic)
			{
				if (!empty($pic['small_path']) && is_file(PJ_INSTALL_PATH . $pic['small_path']))
				{
					?>
					<div class="image<?php echo in_array($pic['id'], $gallery_ids) ? " active" : NULL; ?>">
						<a href="#" class="pjErSetPhoto" data-id="<?php echo $pic['id'];?>"><img src="<?php echo PJ_INSTALL_URL . $pic['small_path']; ?>"/></a>
						<span></span>
					</div>
					<?php
				}
			}
		}
	}else{
		?><span class="block t5"><?php __('lblItemsNoPhotos');?></span><?php
	}
}else{
	?><span class="block t5"><?php __('lblSelectItems');?></span><?php 
}
?>