summaryrefslogtreecommitdiff
path: root/views/admin/form/emailconf.phtml
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2018-09-19 05:52:43 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2018-09-19 05:52:43 +0000
commitffe2c578ed26485e4869762e88c97e90b181bab3 (patch)
treeec3851761cea04578400de82272a35648a2e5c11 /views/admin/form/emailconf.phtml
parentb1cd3f800d12677ffe4b73ab893d02aad20506b0 (diff)
- Email Anhang universell in E-Mail Konfiguration
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7156 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/admin/form/emailconf.phtml')
-rw-r--r--views/admin/form/emailconf.phtml98
1 files changed, 86 insertions, 12 deletions
diff --git a/views/admin/form/emailconf.phtml b/views/admin/form/emailconf.phtml
index e89055d..98fd45c 100644
--- a/views/admin/form/emailconf.phtml
+++ b/views/admin/form/emailconf.phtml
@@ -11,19 +11,39 @@
<?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_attachment'] === true) { ?>
-
- <?php echo wpsg_drawForm_Upload('wpsg_'.$this->view['field_key'].'_attachfile', __('Mailanhang', 'wpsg'), '', '43', '100000'); ?>
- <br />
- <div class="wpsg_hinweis">
- <strong><?php echo __('Aktueller Anhang', 'wpsg') ?>: </strong><?php echo ((wpsg_isSizedString($this->get_option('wpsg_'.$this->view['field_key'].'_attachfile')))?$this->get_option('wpsg_'.$this->view['field_key'].'_attachfile'):__('keiner', 'wpsg')); ?>
- <?php echo ((wpsg_isSizedString($this->get_option('wpsg_kundenmail_attachfile')))?'<a class="wpsg_glyphicon_right glyphicon glyphicon-minus-sign" titel="'.__('Datei entfernen', 'wpsg').'" href="'.WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&amp;subaction='.$_REQUEST['subaction'].'&amp;cmd=del_attach_file"></a>':''); ?>
- </div>
- <br />
-
- <?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="text" style="text-align:center;" size="10" 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 />
- <br /><p style="font-weight:700;"><?php echo (__('Text unter der E-Mail', 'wpsg')); ?></p>
+ <p style="font-weight:700;"><?php echo (__('Text unter der E-Mail', 'wpsg')); ?></p>
<?php
@@ -47,5 +67,59 @@
<?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(); ?> \ No newline at end of file