customer_galleriesmanager_1.phtml
3.86 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
<script type="text/javascript">
function loadNcTextIntoFormThumbnailButton() {
jQuery('.anc_text_choose').unbind("click").click(function(e){
e.preventDefault();
loadNcTextIntoForm(jQuery(this).data('site'));
});
}
function loadNcTextIntoForm(param_url) {
jQuery(".anctext-customer_galleriesmanager * #anctext-customer_galleriesmanager-form-content").load(param_url, function() {
jQuery('#anctext-customer_showNcTextFormDelete').submit(function() { // catch the form's submit event
jQuery.ajax({ // create an AJAX call...
data: jQuery(this).serialize(), // get the form data
type: jQuery(this).attr('method'), // GET or POST
url: jQuery(this).attr('action'), // the file to call
success: function(response) { // on success..
jQuery('.anctext-customer_galleriesmanager * #anctext-customer_galleriesmanager-form-content').html(response); // update the DIV
}
});
return false; // cancel original event to prevent form submitting
});
jQuery('#anctext-customer_showNcTextForm').submit(function() { // catch the form's submit event
jQuery.ajax({ // create an AJAX call...
data: jQuery(this).serialize(), // get the form data
type: jQuery(this).attr('method'), // GET or POST
url: jQuery(this).attr('action'), // the file to call
success: function(response) { // on success..
jQuery('.anctext-customer_galleriesmanager * #anctext-customer_galleriesmanager-form-content').html(response); // update the DIV
}
});
return false; // cancel original event to prevent form submitting
});
});
}
</script>
<div class="anctext-customer_galleriesmanager">
<?php if(Mage::getSingleton('customer/session')->isLoggedIn()): ?>
<div class="col2-set">
<div class="col-1">
<div class="anctext-customer_galleriesmanager-form">
<div class="anctext-customer_galleriesmanager-main"><h1>Ihre Motive</h1></div>
<div class="anctext-customer_galleriesmanager-content" id="anctext-customer_galleriesmanager-form-content"></div>
</div>
</div>
<div class="col-2">
<?php $dropzone_id = 'anctext-dropzone-id'.Mage::helper('anc_lib/data')->getElementIndexForId(); ?>
<?php $ancnote_id = 'ancnote-id'; ?>
<?php echo $this->getLayout()
->getBlockSingleton('anc_text/galleriesmanager')
->setTemplate('anc/text/customer_galleries.phtml')
->setSelectorIdDropzoneOwn($dropzone_id)
->toHtml(); ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
var dropzone_params = {
url: "<?php echo $this->getUrl('anctext/customer/uploadText', array()) ?>",
dictDefaultMessage: 'Text hochladen',
success: function() { this.removeAllFiles(); }
}
var gallery_ajaxData = {
url: "<?php echo $this->getUrl('anctext/customer/gallerysimple', array()) ?> ul.gallery",
context: jQuery(".anctext-customer_galleriesown > .anctext-gallerie-content > .anctext-gallerie-content-view"),
success: function(reponse) {
// damit die gallerie auch klickbar ist
loadNcTextIntoFormThumbnailButton();
// damit hochgeladenes Bild auch im Formular gleich angezeigt wird
loadNcTextIntoForm('<?php echo $this->getUrl('anctext/customer/showNcTextForm', array())?>id/'+reponse.id+'/');
},
};
Anc_Text_Type.droppableFile(
jQuery(" #<?php echo $dropzone_id; ?>"),
dropzone_params,
null,
jQuery(" #<?php echo $ancnote_id; ?>"),
gallery_ajaxData,
false
);
});
</script>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
loadNcTextIntoFormThumbnailButton();
});
</script>
<?php else: ?>
<h1>Bitte loggen Sie sich ein!</h1>
<?php endif; ?>
</div>