customer_gallerysimple.phtml
4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?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>