site_showplaylist_1.phtml
3.67 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
107
108
<?php
/**
* @input Mage::app()->getRequest()->getParam('ncalbum_id') direkt dann muss eingeloggt
* oder
* @input Mage::app()->getRequest()->getParam('urlauth') dann holt er sich ncalbum_id über tabelle
*/
if($urlauth = Mage::app()->getRequest()->getParam('urlauth')) {
$ncplaylist_ncalbum = Mage::helper('anc_playlist/ncmodel')->getNcAlbumByUrlauth($urlauth);
$ncalbum_id = $ncplaylist_ncalbum->getId();
} else if($ncalbum_id = Mage::app()->getRequest()->getParam('ncalbum_id')) {
// $ncplaylist_ncalbum = Mage::getModel('anc_album/ncalbum')->load($ncalbum_id);
// $ncplaylist_ncalbum = Mage::helper('anc_lib/ncrights')->loadNcModel('anc_album/ncalbum', $ncalbum_id);
$ncplaylist_ncalbum = Mage::helper('anc_playlist/ncmodel')->getNcAlbumByAlbumId($ncalbum_id);
// D::show($ncimage, '$NcImageId: '.$NcImageId,1,1);
// D::compareFe($ncplaylist_ncalbum, $ncimage, '$ncplaylist_ncalbum, $ncimage',1,1);
} else {
exit;
}
//if(is_object($ncplaylist_ncalbum)) {
$NcImageId = Mage::getSingleton('checkout/session')->getNcImageId();
if($NcImageId >= 0) {
if(Mage::app()->getRequest()->getParam('show')=== 'next') {
$NcImageId++;
} else if(Mage::app()->getRequest()->getParam('show')=== 'back') {
$NcImageId--;
}
Mage::getSingleton('checkout/session')->setNcImageId($NcImageId);
$ncimage = Mage::helper('anc_playlist/ncmodel')->getOneNcImageFromNcAlbum($ncalbum_id, $NcImageId);
} else {
// $ncimage = Mage::helper('anc_playlist/ncmodel')->getOneNcImageFromNcAlbum($ncalbum_id);
$ncimage = Mage::helper('anc_playlist/ncmodel')->getOneNcImageFromNcAlbum($ncalbum_id, 0);
Mage::getSingleton('checkout/session')->setNcImageId(0);
}
//}
?>
<div class="ancplaylist-site_showplaylist">
<div class="ncheader">
<a href="<?php echo Mage::getUrl('',array()); ?>">
<img src="/skin/frontend/ancprintconfigproduct/default/images/logo.gif" />
</a>
</div>
<div class="nccontent">
<div class="ncimage">
<img src="<?php echo DS.Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage['entity_id'], 'relative', 'original') ?>" />
</div>
</div>
<div class="ncmenu">
<a href="?show=back" id="ancplaylist_back">
<div class="ncleft">
<img src="/skin/frontend/ancprintconfigproduct/default/images/links_weiss_25x50.png" alt="weiter" />
</div>
</a>
<a href="?show=next">
<div class="ncright" id="ancplaylist_next">
<img src="/skin/frontend/ancprintconfigproduct/default/images/rechts_weiss_25x50.png" alt="zurück" />
</div>
</a>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
var viewbox_height;
if(jQuery('#ncplaylist_preview').length) {
viewbox_height = jQuery('#ncplaylist_preview').height();
} else {
viewbox_height = jQuery(window).innerHeight() ;
}
// console.log('viewbox_height: '+viewbox_height);
// var realarea = jQuery(window).innerHeight()
var realarea = viewbox_height
- jQuery('.ncheader').outerHeight()
- jQuery('.ncmenu').outerHeight() ;
// console.log(realarea+' <= '+jQuery('.nccontent ').outerHeight());
if(realarea <= jQuery('.nccontent ').outerHeight()) {
var factor = (realarea-12) / jQuery('.nccontent ').outerHeight();
var new_width = Math.round(jQuery('.nccontent ').outerWidth() * factor);
var img_css = {
'height': realarea+'px',
'width' : new_width+'px'
}
// console.log(img_css);
jQuery('.nccontent > .ncimage > img ').css(img_css);
}
var area = realarea
- jQuery('.nccontent ').outerHeight();
var padding = Math.round(area/2)+'px';
// console.log(area+' :: '+jQuery('.nccontent ').outerHeight());
var css = {
'margin-top': padding,
}
// console.log(css);
jQuery('.nccontent').css(css);
});
</script>