customer_gallerysimple.phtml 4.18 KB
<?php // $NcTexts = Mage::helper('anc_text/ncmodel')->getNcTextsForCustomer();  ?>
<?php 
	
	$params=Mage::app()->getRequest()->getParams();
//	D::s($params,'Mage::app()->getRequest()->getParam',5,1,1);

	if(!$ncalbum_id = $this->getNcalbumId()) {
//		D::ulli('1',1,1);
		$ncalbum_id = Mage::app()->getRequest()->getParam('ncalbum_id');
	}
	if(!$ncalbum_id) {
//		D::ulli('2',1,1);
		$customer = Mage::getSingleton('customer/session')->getCustomer();
		$ncalbum_id = Mage::getModel('anc_album/ncalbum')->load($customer->getId(), 'customer_id')->getId();
	}
	if($ncalbum_id) {
		if($params['ncobject_album_id'] && $params['ncobjectsingle']){
			D::ulli('1',1,1);
			$NcTexts = Mage::helper('anc_text/ncmodel')->getNcTextsForAlbum($params['ncobject_album_id']);	
		}else{
			if($params['ncpersonalisiert']===1){
//				D::ulli('2',1,1);
				$param_arrayFields = array(
					'ncalbum_id',
//					'ispersonalized',
					'ordered'
				);
				$param_arrayContent = array(
					array('eq' => $ncalbum_id,'eq' => '0'),
//					array('eq' => '1'),
					array('null' => true),
				);
				$NcTexts = Mage::helper('anc_text/ncmodel')->getNcTextsForAlbum($ncalbum_id,$param_arrayFields,$param_arrayContent);
			}else{
//				D::ulli('3',1,1);
				$param_arrayFields = array(
					'ncalbum_id',
					'ispersonalized',
					'ordered'
				);
				$param_arrayContent = array(
//					array('eq' => $ncalbum_id,'neq' => '1','eq'=>null),
//					array('eq' => '0'),
//					array('eq' => '5')
					array('eq' => $ncalbum_id),
					array('null' => true),
					array('null' => true),
//					array('eq' => '0'),
//					array('eq'=> 'Du nicht'),
				);
				$NcTexts = Mage::helper('anc_text/ncmodel')->getNcTextsForAlbum($ncalbum_id,$param_arrayFields,$param_arrayContent);
				
			}
				
		}
			//ncobjectsingle
		
	} else {
//		D::ulli('4',1,1);
//		if(Mage::app()->getRequest()->getParam('ncobject_album_id')){
//			$NcTexts = Mage::helper('anc_text/ncmodel')->getNcTextsForAlbum($ncalbum_id);	
//		}else{
			$NcTexts = Mage::helper('anc_text/ncmodel')->getNcTextsForCustomer();
//		}
//		D::li('getNcTextsForCustomer() - nix mit album aber anscheinend wohl trotzdem keine texte in der gallerie');
		
	}
?>
<ul class="gallery AncGalleryTexts">
	<?php $var_count=0?>
	<?php foreach($NcTexts as $nctext ): ?>
	<?php if($var_count%2 ==0){
			$var_cssanctextwrapper='anc_text_wrapper_bg_white';
		}else{
			$var_cssanctextwrapper='anc_text_wrapper';
		}
//		D::s($nctext,'$nctext',5,1,1)
	?>
		<?php $NcTextPath = Mage::helper('anc_text/nctext')->getNcTextPath($nctext['entity_id'], 'relative', 'thumbnail'); ?>
		<?php $NcTextPath_original = Mage::helper('anc_text/nctext')->getNcTextPath($nctext['entity_id'], 'relative', 'original'); ?>
		<?php $nctext_title = Mage::helper('anc_text/nctext')->getNcTextMetaDataAsHtml($nctext['entity_id']); ?>
		<a data-site="<?php echo $this->getUrl('anctext/customer/showNcTextForm', array('id'=>$nctext['entity_id'])) ?>" 
		   class="anctext-showNcTextForm" 
		   rel="prettyPhoto[pp_gal2]" 
		   href="<?php echo DS.$NcTextPath_original ?>" 
		   >
			<!--<div class="anc_text_wrapper">-->
			<div class="<?php echo $var_cssanctextwrapper?>">
				<a class="anc_text_choose" 
					href="#" 
					data-anc_text_id="<?php echo $nctext['entity_id'] ?>" 
					data-anc_admin_id="<?php echo $nctext['admin_user_id'];?>"

					data-anc_text_url="<?php echo DS.$NcTextPath_original ?>"
					data-site="<?php echo $this->getUrl('anctext/customer/showNcTextForm', array('id'=>$nctext['entity_id'])) ?>" 
					title='<?php if($nctext['name']):?><span class="header"><?php echo $nctext['name']; ?></span><?php endif; ?><span class="content"><?php if($nctext['comment']): echo $nctext['comment'].'<br/><br/>'; endif; ?><?php echo $nctext_title; ?></span>'
				>
					
					<div class='anctext-gallerie-subheader anctexthead' title="<?php  echo $nctext_title;?>"  id="<?php echo $nctext['entity_id']?>"><?php echo $nctext['name'].' '; ?>  </div><br>
					<div class='anctextcontentpreview' title="<?php  echo $nctext_title;?>"  id="<?php echo $nctext['entity_id']?>"><?php echo Mage::helper('anc_printconfigproduct/placeholder')->replaceStringWithArrayValues($nctext['content']).' '; ?> ?>  </div><br>
				</a>
			</div>
		</a>	
	<?php $var_count++; ?>
	<?php endforeach; ?>
</ul>