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 echo wpsg_drawForm_AdminboxStart($this->view['field_title'], 'wpsg_email_box'); ?>
<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_betreff', __('Betreff', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_betreff')); ?>
<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_absender', __('Absender', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_absender')); ?>
<?php if ($this->view['field_to'] === true) { ?>
<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_empfaenger', __('Empfänger', 'wpsg'), wpsg_ShopController::getShop()->get_option('wpsg_'.$this->view['field_key'].'_empfaenger')); ?>
<?php } ?>
<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_cc', __('CC', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_cc')); ?>
<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_bcc', __('BCC', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_bcc')); ?>
<?php if ($this->view['field_key'] === 'reminder') { ?>
<?php echo wpsg_drawForm_Input('wpsg_reminder_hours', __('Automatischer Versand nach Bestellerstellung in Stunden', 'wpsg'), $this->get_option('wpsg_reminder_hours')); ?>
<?php echo wpsg_drawForm_Input(false, __('CRON URL', 'wpsg'), site_url().'/?wpsg_cron=1', ['readonly' => true]); ?>
<?php } ?>
<div class="form-group form-group-sm">
<label class="col-sm-6 control-label">
<input value="<?php echo __('Neuer Anhang', 'wpsg'); ?>" data-key="<?php echo $this->view['field_key']; ?>" class="btnAddAttachment button" type="button" id="media_<?php echo $this->view['field_key']; ?>" />
</label>
<div class="col-sm-6">
<div class="wpsg_mailattachment" id="wpsg_mailattachment_<?php echo $this->view['field_key']; ?>">
<div v-for="a in arAttachment">
<div class="wpsg_flex wpsg_flex_justify_content_space_between wpsg_flex_align_items_center">
<a target="_blank" v-bind:href="a.url">{{a.filename}}</a>
<a href="" v-bind:data-id="a.id" data-key="<?php echo $this->view['field_key']; ?>" onclick="return wpsg_removeAttachemnt(this);">
<span class="fa fa-trash"></span>
</a>
</div>
</div>
<input type="hidden" v-bind:value="getIds" name="wpsg_<?php echo $this->view['field_key']; ?>_mediaattachment" />
</div>
</div>
<div class="clearfix wpsg_clear"></div>
</div>
<hr />
<p style="font-weight:700;"><?php echo (__('Text unter der E-Mail', 'wpsg')); ?></p>
<?php
// RTE
ob_start();
wp_editor($this->get_option('wpsg_'.$this->view['field_key'].'_text'), 'wpsg_'.$this->view['field_key'].'_text');
$rte_content = ob_get_contents();
ob_end_clean();
echo $rte_content;
?>
<br />
<?php echo __('* Der restliche E-Mailtext kann nur im Mailtemplate verändert werden', 'wpsg'); ?>
<br />
<?php if (wpsg_isSizedString($this->view['strTemplate'])) { ?>
<br />
<strong><?php echo __('Template', 'wpsg'); ?>: </strong><?php echo $this->view['strTemplate']; ?>
<?php } ?>
<?php if (wpsg_isSizedString($notice)) { ?>
<br />
<div class="wpsg_hinweis"><?php echo $notice; ?></div>
<?php } ?>
<br />
<script>
uploadData['<?php echo $this->view['field_key']; ?>'] = <?php
$arAttachment = [];
$arAttachmentSet = $this->get_option('wpsg_'.$this->view['field_key'].'_mediaattachment');
if (wpsg_isSizedString($arAttachmentSet)) {
$arAttachmentSet = explode(',', $arAttachmentSet);
foreach ($arAttachmentSet as $a_id) {
$a_file = get_attached_file($a_id);
$a_url = wp_get_attachment_url($a_id);
$arAttachment[] = [
'id' => $a_id,
'filename' => basename($a_file),
'url' => $a_url
];
}
}
echo json_encode($arAttachment);
?>;
var wpsg_mailattachment_<?php echo $this->view['field_key']; ?> = new Vue( {
el: '#wpsg_mailattachment_<?php echo $this->view['field_key']; ?>',
data: {
arAttachment: uploadData.<?php echo $this->view['field_key']; ?>
},
computed: {
getIds: function() {
var arReturn = [];
for (var i in this.arAttachment) {
arReturn.push(this.arAttachment[i].id);
}
return arReturn;
}
}
} );
</script>
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|