site_showplaylist.phtml
4.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?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;
var viewbox_width;
if(jQuery('#ncplaylist_preview').length) {
viewbox_height = jQuery('#ncplaylist_preview').height();
viewbox_width = jQuery('#ncplaylist_preview').width();
} else {
viewbox_height = jQuery(window).height() ;
viewbox_width = jQuery(window).width();
}
jQuery('.ancplaylist-site_showplaylist').css({
'height': viewbox_height+'px',
'width' : viewbox_width+'px'
});
if(jQuery('.nccontent > .ncimage > img ').width() > jQuery('.nccontent > .ncimage > img ').height()) {
var img_css = {
'width': viewbox_width+'px'
}
} else {
var height = viewbox_height -jQuery('.ncheader').outerHeight() - jQuery('.ncmenu').outerHeight();
var height_klein = height - 30;
var img_css = {
'height': height_klein+'px'
}
}
console.log(img_css);
jQuery('.nccontent > .ncimage > img ').css(img_css);
console.log(jQuery('.nccontent > .ncimage > img '));
//
// 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>