customer_galleriescategory.phtml 2.85 KB
<!--/** 
	 * wird geladen wenn der eingabetyp @see @anc_image_eingabetyp genutzt wird
	 * @package	anc_image 
	 * @since	20140425
	 * @author	netz.coop eG* 
	 */ 
-->
<?php 
	$SelectedCategoryNcAlbumModel = Mage::helper('anc_album/nccategory')->getSelectedCategoryNcAlbumModel(); 
	if(is_object($SelectedCategoryNcAlbumModel) && $SelectedCategoryNcAlbumModel->getId()) {
		$SelectedCategoryNcAlbumModel_id = $SelectedCategoryNcAlbumModel->getId();
	} else {
		$SelectedCategoryNcAlbumModel_id = false;
	}
?> 
<div class="ancimage-customer_galleriescategory">
	<div class="ancimage-gallerie-subheader">
		<?php if($this->getSelectorIdDropzone()): ?>
			<div id="<?php echo $this->getSelectorIdDropzone(); ?>"  class="dropzone ancimage-dropzone" title="Bitte ziehen Sie aus Ihrem Dateiexplorer einfach ein Bild in diesen Bereich!"></div>
		<?php else: ?> 
			<div>&nbsp;</div>
		<?php endif; ?>		
		
		<?php $categories_ncalbums = Mage::helper('anc_album/ncmodel')->getAllCategoryNcAlbums(); ?>
			
		<?php if(is_array($categories_ncalbums) && !empty($categories_ncalbums)): ?>
			<div id="ancimage-gallerie-subheader-category">
				<ul id="menu">
					<li>Rubrik <img  src="/skin/frontend/base/default/images/anc/image/unten_25x50.png" />
						<ul id="categories_ncalbums">
							<?php foreach ($categories_ncalbums as $ncalbum): ?>
								<?php $ncalbum_id = $ncalbum['entity_id']; ?>
								<li data-ncalbum_id="<?php echo $ncalbum['entity_id'] ?>"
									class="<?php if($ncalbum_id===$SelectedCategoryNcAlbumModel_id) { echo 'ui-selected'; } ?>"
								>
									<?php echo $ncalbum['name'] ?>
								</li>
							<?php endforeach; ?>						
						</ul>
					</li>
				</ul>
			</div>
			<script type="text/javascript">
					var selectOpt = {
						selected: function(typ, ui) {
							var url = "<?php echo $this->getUrl('ancimage/customer/gallerysimple', array()) ?>ncalbum_id/"+ui.selected.dataset['ncalbum_id']+"/  ul.gallery";
							var gallerie_csspath = '.ancimage-customer_galleriescategory > .ancimage-gallerie-content > .ancimage-gallerie-content-view';
							jQuery(gallerie_csspath).load(url, function() { 
								Anc_Image_Type.customerGallerysimplePrettyPhoto(); 
								loadNcImageIntoProductGalleryThumbnailButton();
							});
							jQuery('#menu > li > ul').css('display','none');
						}
					}				
					jQuery('#categories_ncalbums').selectable(selectOpt);
					jQuery("#menu").menu({
						position: {
							my:'left top',
							at:'left bottom'
						}
					});					
			</script>				
				
				
		<?php endif; ?>		
	</div>
	<?php if($SelectedCategoryNcAlbumModel_id === false) { $SelectedCategoryNcAlbumModel_id =  $ncalbum_id; } ?>
	<div class="ancimage-gallerie-content">
		<div class="ancimage-gallerie-content-view">
			<?php echo $this->setTemplate('anc/image/customer_gallerysimple.phtml')->setNcalbumId($SelectedCategoryNcAlbumModel_id)->toHtml(); ?>
		</div> 
	</div>
</div>