anctext_1.phtml
5.42 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
<?php
/**
*
* @var $this anc_text/catalog_product_view_options_type_anctext
*
* @package anc_text
* @anc_text_eingabetyp -- Formular bzw ansicht im Frontend im Warenkorb beim Produkt konfigurieren
* @copy Grundlage: Magento18/app/design/frontend/base/default/template/catalog/product/view/options/type/text.phtml
* @since 20140416
* @author netz.coop eG*
*/
?>
<?php $DropzoneIndex = Mage::helper('anc_lib/data')->getElementIndexForId(); ?>
<?php $dropzone_id = 'anctext-dropzone-id'.$DropzoneIndex; ?>
<?php $ancnote_id = 'ancnote-id'; ?>
<?php $_option = $this->getOption(); ?>
<?php $input_id = 'options_'.$_option->getId().'_text'; ?>
<div class="anctext-anctext anc-productview">
<script type="text/javascript">
function loadNcTextIntoProductGalleryThumbnailButton() {
jQuery('.anc_text_choose').unbind("click").click(function(e){
e.preventDefault();
Anc_Text_Type.loadTextInto(
jQuery(this).data('anc_text_id'),
jQuery('#<?php echo $input_id; ?>'),
jQuery(this).data('anc_text_url'),
jQuery('#<?php echo $dropzone_id; ?>')
);
});
}
</script>
<div class="anctext_type anc-productview-type" id="<?php echo $_option->getSku(); ?>">
<div class="anctext_type-fakewrapper anc-productview-type-fakewrapper">
<div id="<?php echo $ancnote_id; ?>"></div>
<input type="text" onchange="opConfig.reloadPrice()" id="<?php echo $input_id ?>" class="input-text<?php echo $_option->getIsRequire() ? ' required-entry' : '' ?> <?php echo $_option->getMaxCharacters() ? ' validate-length maximum-length-'.$_option->getMaxCharacters() : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" value="<?php echo $this->escapeHtml($this->getDefaultValue()) ?>" />
<div class="anctext-info">
<div class="editor"></div>
<div class="text"></div>
</div>
<div class="<?php echo $_option->getSku(); ?>" id="anctext-texteditorarea-id">
<div id="<?php echo $dropzone_id; ?>"
class="dropzone anctext-dropzone"
title=""
data-pxwidth="<?php echo $_option->getTextSizeX() ?>"
data-pxheight="<?php echo $_option->getTextSizeY() ?>"
data-maxfilesizemb="<?php echo $_option->getMaxCharacters() ?>"
>
<?php // $path = Mage::helper('anc_text/nctext')->getNcTextPath($this->getDefaultValue(), 'relative', 'original'); ?>
<?php // $Currentpageinfos = Mage::helper('anc_lib/data')->getCurrentcheckoutcartinfos(); ?>
<?php $ItemInfos= Mage::helper('anc_lib/data')->getCheckoutCartItemInfos(); ?>
<?php // $Cropdata = Mage::helper('anc_text/nctext')->getCropdata($ItemInfos['item_id']); ?>
<div class="preview-database-text"
data-textsrc="<?php echo DS.$path; ?>"
<?php if(is_array($Cropdata)): ?>
data-cropH="<?php echo $Cropdata['cropH']; ?>"
data-cropW="<?php echo $Cropdata['cropW']; ?>"
data-imgH="<?php echo $Cropdata['imgH']; ?>"
data-imgW="<?php echo $Cropdata['imgW']; ?>"
data-imgInitH="<?php echo $Cropdata['imgInitH']; ?>"
data-imgInitW="<?php echo $Cropdata['imgInitW']; ?>"
data-imgX1="<?php echo $Cropdata['imgX1']; ?>"
data-imgY1="<?php echo $Cropdata['imgY1']; ?>"
<?php endif; ?>
>
<?php // if($path):?>
<!--<img src="<?php // echo $path; ?>" />-->
<?php // endif; ?>
</div>
</div>
</div>
</div>
</div>
<!-- Gallerien zum auswählen -->
<?php $gallerie_dropzone_id = 'anctext-dropzone-id'.Mage::helper('anc_lib/data')->getElementIndexForId(); ?>
<div class="anctext_type-possibility anc-productview-possibility">
<?php echo $this->getLayout()
->getBlockSingleton('anc_text/galleriesmanager')
->setTemplate('anc/text/customer_galleries.phtml')
->setIfGalleryCategory(true)
->setSelectorIdDropzoneOwn($gallerie_dropzone_id)
->toHtml(); ?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// damit initialen laden der Gallerie auch die Thumbnail-Bilder-Button funktionieren
loadNcTextIntoProductGalleryThumbnailButton();
});
</script>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
var dropzone_params = {
url: "<?php echo $this->getUrl('anctext/customer/uploadText', array()) ?>",
dictDefaultMessage: 'Bild 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 das hochgeladene Bild auch in der dropbopx angezeigt wird
Anc_Text_Type.loadTextInto(
reponse.id,
// jQuery('#<?php // echo $_option->getSku(); ?> > dd > .input-box > input'),
jQuery('#<?php echo $input_id; ?>'),
'<?php echo DS; ?>'+reponse.path,
jQuery('#<?php echo $dropzone_id; ?>')
);
// damit nach hochladen eines bildes und darauf folgende reloaden der gallerie,
// die (anderen) galleriebilder wieder in die dropbox geladen werden können
loadNcTextIntoProductGalleryThumbnailButton();
},
};
Anc_Text_Type.droppableFile(
jQuery(" #<?php echo $gallerie_dropzone_id; ?>"),
dropzone_params,
jQuery(" #<?php echo $input_id; ?>"),
jQuery(" #<?php echo $ancnote_id; ?>"),
gallery_ajaxData,
false
);
});
</script>
</div>