Subversion Repositories wpShopGermany4

Rev

Rev 7133 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5532 daniel 1
 
2
<?php echo wpsg_drawForm_AdminboxStart($this->view['field_title'], 'wpsg_email_box'); ?>
3
 
4
	<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_betreff', __('Betreff', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_betreff')); ?>
5
	<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_absender', __('Absender', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_absender')); ?>
6
 
7
	<?php if ($this->view['field_to'] === true) { ?>
5562 daniel 8
	<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_empfaenger', __('Empfänger', 'wpsg'), $GLOBALS['wpsg_sc']->get_option('wpsg_'.$this->view['field_key'].'_empfaenger')); ?>
5532 daniel 9
	<?php } ?>
10
 
11
	<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_cc', __('CC', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_cc')); ?>
12
	<?php echo wpsg_drawForm_Input('wpsg_'.$this->view['field_key'].'_bcc', __('BCC', 'wpsg'), $this->get_option('wpsg_'.$this->view['field_key'].'_bcc')); ?>
13
 
7156 daniel 14
    <div class="form-group form-group-sm">
15
 
16
        <label class="col-sm-6 control-label">
5532 daniel 17
 
7156 daniel 18
            <input value="<?php echo __('Neuer Anhang', 'wpsg'); ?>" data-key="<?php echo $this->view['field_key']; ?>" class="btnAddAttachment button" type="text" style="text-align:center;" size="10" id="media_<?php echo $this->view['field_key']; ?>" />
19
 
20
        </label>
21
 
22
        <div class="col-sm-6">
23
 
24
            <div class="wpsg_mailattachment" id="wpsg_mailattachment_<?php echo $this->view['field_key']; ?>">
25
                <div v-for="a in arAttachment">
26
 
27
                    <div class="wpsg_flex wpsg_flex_justify_content_space_between wpsg_flex_align_items_center">
28
                        <a target="_blank" v-bind:href="a.url">{{a.filename}}</a>
29
                        <a href="" v-bind:data-id="a.id" data-key="<?php echo $this->view['field_key']; ?>" onclick="return wpsg_removeAttachemnt(this);">
30
                            <span class="fa fa-trash"></span>
31
                        </a>
32
                    </div>
33
 
34
                </div>
35
                <input type="hidden" v-bind:value="getIds" name="wpsg_<?php echo $this->view['field_key']; ?>_mediaattachment" />
36
            </div>
37
 
38
        </div>
39
 
40
        <div class="clearfix wpsg_clear"></div>
41
 
42
    </div>
5532 daniel 43
 
7156 daniel 44
    <hr />
45
 
46
    <p style="font-weight:700;"><?php echo (__('Text unter der E-Mail', 'wpsg')); ?></p>
47
 
7133 daniel 48
    <?php
49
 
50
    // RTE
51
    ob_start();
52
    wp_editor($this->get_option('wpsg_'.$this->view['field_key'].'_text'), 'wpsg_'.$this->view['field_key'].'_text');
53
    $rte_content = ob_get_contents();
54
    ob_end_clean();
55
 
56
    echo $rte_content;
57
 
58
    ?>
5532 daniel 59
 
6567 thomas 60
	<br />
61
	<?php echo __('* Der restliche E-Mailtext kann nur im Mailtemplate verändert werden', 'wpsg'); ?>
5532 daniel 62
	<?php if (wpsg_isSizedString($notice)) { ?>
63
 
64
	<br />
65
	<div class="wpsg_hinweis"><?php echo $notice; ?></div>
66
 
67
	<?php } ?>
68
 
69
	<br />
7156 daniel 70
 
71
    <script>
72
 
73
        uploadData['<?php echo $this->view['field_key']; ?>'] = <?php
74
 
75
            $arAttachment = [];
76
            $arAttachmentSet = $this->get_option('wpsg_'.$this->view['field_key'].'_mediaattachment');
77
 
78
            if (wpsg_isSizedString($arAttachmentSet)) {
79
 
80
                $arAttachmentSet = explode(',', $arAttachmentSet);
81
 
82
                foreach ($arAttachmentSet as $a_id) {
83
 
84
                    $a_file = get_attached_file($a_id);
85
                    $a_url = wp_get_attachment_url($a_id);
86
 
87
                    $arAttachment[] = [
88
                        'id' => $a_id,
89
                        'filename' => basename($a_file),
90
                        'url' => $a_url
91
                    ];
92
 
93
                }
94
 
95
            }
96
 
97
            echo json_encode($arAttachment);
98
 
99
        ?>;
100
 
101
        var wpsg_mailattachment_<?php echo $this->view['field_key']; ?> = new Vue( {
102
            el: '#wpsg_mailattachment_<?php echo $this->view['field_key']; ?>',
103
            data: {
104
                arAttachment: uploadData.<?php echo $this->view['field_key']; ?>
105
            },
106
            computed: {
107
                getIds: function() {
108
 
109
                    var arReturn = [];
110
 
111
                    for (var i in this.arAttachment) {
112
 
113
                        arReturn.push(this.arAttachment[i].id);
114
 
115
                    }
116
 
117
                    return arReturn;
118
 
119
                }
120
            }
121
        } );
122
 
123
    </script>
5532 daniel 124
 
125
<?php echo wpsg_drawForm_AdminboxEnd(); ?>