<?php

//print_R('<pre>');			
//print_R($aArticleImages);			
//print_R('</pre>');

$sPhotos = '<section class="add-edit-group photos" data-groupname="photos">';

	$sPhotos .='<div class="spacer'.(!empty($oMijnOVIS->parsedDetails->photolabel) ? '' : ' not-loaded-yet').'"></div>';
	
	$sPhotos .='<div class="images" id="images">';
		
		$iCountImages = 0;
			
		if(!empty($oMijnOVIS->parsedDetails->images) && is_array($oMijnOVIS->parsedDetails->images)){
			foreach($oMijnOVIS->parsedDetails->images as $oArticleImage){
				
				$sURLPath = array_values(array_filter(explode('/',$oArticleImage->traditional->default->clean->url)));
				$sURLPathKey = str_ireplace('.jpg','',$sURLPath[2]);
				
				if(!empty($oArticleImage->traditional->default->clean->url)){				
					
					$iCountImages++;
					
					$sPhotos .='<div class="image-container" id="'.$sURLPathKey.'" data-imgurl="'.$oArticleImage->traditional->default->clean->url.'" data-phototype="'.(!empty($oArticleImage->general) ? 'generalimage' : 'productimage').'">
						<div class="image-content" style="background-image:url('.$oArticleImage->traditional->default->clean->url.');" onclick="jQuery.editImage(\''.$sURLPathKey.'\',\''.(!empty($oArticleImage->general) ? 'generalimage' : 'productimage').'\');"></div><span class="sort-image"></span>
					</div>';
				}
			}
		}
		
		if($iCountImages < 24){		
			$sPhotos .='<div class="image-container no-sorting" id="add-new">
				<div class="image-content add-picture add-new-image"></div>
			</div>';
		}

	$sPhotos .='</div>';
	
	$sPhotos .='<div id="drag-drop-area" class="drag-drop-area"></div>';

$sPhotos .= '</section>';

return $sPhotos;