customer_galleriescategory.phtml 3.09 KB
<!--/** 
	 * wird geladen wenn der eingabetyp @see @anc_text_eingabetyp genutzt wird
	 * @package	anc_text 
	 * @since	20140425
	 * @author	netz.coop eG* 
	 */ 
-->
<?php
	$SelectedCategoryNcAlbumModel = Mage::helper('anc_album/nccategory')->getSelectedCategoryNcAlbumModel();
//	$SelectedCategoryNcAlbumModel = Mage::helper('anc_album/ncmodel')->getAllCategoryNcAlbums();; 
	if(is_object($SelectedCategoryNcAlbumModel) && $SelectedCategoryNcAlbumModel->getId()) {
		$SelectedCategoryNcAlbumModel_id = $SelectedCategoryNcAlbumModel->getId();
	} else {
		$SelectedCategoryNcAlbumModel_id = false;
	}
?> 
<div class="anctext-customer_galleriescategory">
	<div class="anctext-gallerie-subheader">
		
		<?php if($this->getSelectorIdDropzone()): ?>
			<div id="<?php echo $this->getSelectorIdDropzone(); ?>"  class="dropzone anctext-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 // $categories_ncalbums = Mage::getModel('anc_album/ncmodel')->getAllCategoryNcAlbums(); ?>
		<?php // 	D::s($categories_ncalbums,'$categories_ncalbum',5,1,1);?>
		<?php if(is_array($categories_ncalbums) && !empty($categories_ncalbums)): ?>
			<div id="anctext-gallerie-subheader-category">
				<ul id="menu">
					<li>Rubrik <img  src="/skin/frontend/base/default/texts/anc/text/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('anctext/customer/gallerysimple', array()) ?>ncalbum_id/"+ui.selected.dataset['ncalbum_id']+"/  ul.gallery";
							var gallerie_csspath = '.anctext-customer_galleriescategory > .anctext-gallerie-content > .anctext-gallerie-content-view';
							jQuery(gallerie_csspath).load(url, function() { 
								Anc_Text_Type.customerGallerysimplePrettyPhoto(); 
								loadNcTextIntoProductGalleryThumbnailButton();
							});
							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="anctext-gallerie-content">
		<div class="anctext-gallerie-content-view">
			<?php echo $this->setTemplate('anc/text/customer_gallerysimple.phtml')->setNcalbumId($SelectedCategoryNcAlbumModel_id)->toHtml(); ?>
		</div> 
	</div>
</div>