Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
1067 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die E-Mail Konfiguration
5
	 */
6
 
7
?>
8
<div class="wpsg_admin_submenu">
9
 
5455 thomas 10
	<div class="list-group">
7094 florian 11
		<span class="list-group-head list-group-item"><?php echo __('Konfiguration'); ?></span>
12
		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>
13
			<a class="list-group-item <?php echo (($k == $this->view['subAction'])?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a>
1067 daniel 14
		<?php } ?>
7094 florian 15
	</div>
16
 
1067 daniel 17
</div>
18
 
7156 daniel 19
<script>
20
 
21
    var uploadData = {};
22
 
23
</script>
24
 
5532 daniel 25
<div class="wpsg_admin_content form-horizontal">
5562 daniel 26
	<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo wpsg_hspc(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf&noheader=1'); ?>">
7094 florian 27
 
5532 daniel 28
		<?php echo wpsg_drawForm_AdminboxStart('Allgemeine Einstellungen', 'wpsg'); ?>
7147 daniel 29
		<?php $logoPath = wpsg_getUploadDir('wpsg_mailconf').'wpsg_email_logo.jpg'; ?>
7094 florian 30
 
31
		<?php echo wpsg_drawForm_Checkbox(
32
			'wpsg_htmlmail',
33
			__('HTML Mails versenden', 'wpsg'),
34
			$this->get_option('wpsg_htmlmail')
35
		); ?>
36
 
37
 
38
		<div class="col-emaillogo">
39
 
40
			<?php if(file_exists($logoPath)) { ?>
7147 daniel 41
 
7094 florian 42
				<?php echo wpsg_drawForm_Checkbox(
43
					'wpsg_email_logo_activated',
44
					__("E-Maillogo anzeigen"),
45
					$this->get_option('wpsg_email_logo_activated')
46
				); ?>
47
 
48
				<?php echo wpsg_drawForm_Checkbox(
49
					'wpsg_email_logo_watermark',
50
					__("E-Maillogo als Wasserzeichen anzeigen"),
51
					$this->get_option('wpsg_email_logo_watermark')
52
				); ?>
7147 daniel 53
 
7094 florian 54
			<?php } ?>
55
 
7103 thomas 56
			<br />
57
 
7094 florian 58
			<div class="form-group">
59
				<div class="col-sm-6 control-label control-label-email-conf">
60
					<label><?php echo __("E-Maillogo (JPG)"); ?></label>
61
				</div>
62
				<div class="col-sm-6">
63
					<?php if(file_exists($logoPath)) { ?>
7147 daniel 64
						<a href="<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=emailconf&getEmailLogo=1&noheader=1'; ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a><br>
7094 florian 65
					<?php } ?>
66
					<input type="file" name="wpsg_email_logo">
67
				</div>
68
 
69
				<?php if(file_exists($logoPath)) { ?>
70
					<?php echo wpsg_drawForm_Checkbox(
71
						'wpsg_email_logo_del',
72
						__("Logo Löschen"),
73
 
74
					); ?>
75
				<?php } ?>
76
 
77
			</div> <!-- .form-group -->
7103 thomas 78
 
79
			<br />
80
 
7094 florian 81
			<?php if(file_exists($logoPath)) { ?>
82
 
83
				<div class="form-group col-logo-alignment">
84
					<div class="col-sm-6 control-label control-label-email-conf">
85
						<label><?php echo __("Ausrichtung des Maillogos"); ?></label>
86
					</div>
87
					<div class="col-sm-6 email-logo-alignment">
88
						<?php $logoAlignment = $this->get_option('wpsg_email_logo_alignment'); ?>
89
						<?php $standardAlignment = false; ?>
90
						<?php if(!wpsg_isSizedString($logoAlignment)) $standardAlignment = true; ?>
91
						<input type="radio" name="wpsg_email_logo_alignment" value="left" <?php if($logoAlignment === "left"):?>checked<?php endif;?>> <span>&#xf036 <?php echo __("Linksbündig"); ?></span> <br>
92
						<input type="radio" name="wpsg_email_logo_alignment" value="center" <?php if($logoAlignment === "center"):?>checked<?php endif;?>> <span>&#xf037 <?php echo __("Zentriert"); ?></span> <br>
93
						<input type="radio" name="wpsg_email_logo_alignment" value="right" <?php if($logoAlignment === "right" || $standardAlignment):?>checked<?php endif;?>> <span>&#xf038 <?php echo __("Rechtsbündig"); ?></span>
94
					</div>
95
				</div>
7103 thomas 96
 
97
				<br />
98
 
7094 florian 99
				<?php $logoTransparency = $this->get_option('wpsg_email_logo_transparency'); ?>
100
				<?php if(!wpsg_isSized($logoTransparency)) $logoTransparency = "100%"; ?>
101
				<?php echo wpsg_drawForm_Input(
102
					'wpsg_email_logo_transparency',
103
					__("Deckkraft des Logos"),
104
					strpos($logoTransparency, "%") !== false ? $logoTransparency : $logoTransparency."%"
105
				); ?>
106
 
107
			<?php } ?>
108
 
109
		</div>
5532 daniel 110
		<?php echo wpsg_drawForm_AdminboxEnd(); ?>
7094 florian 111
 
5532 daniel 112
		<?php echo wpsg_drawEMailConfig(
7094 florian 113
			'global',
114
			__('Globale Vorgaben', 'wpsg'),
5532 daniel 115
			__('Werden keine Angaben für die folgenden E-Mails gemacht, so gelten die globalen Angaben.', 'wpsg')); ?>
7094 florian 116
 
5532 daniel 117
		<?php echo wpsg_drawEMailConfig(
7094 florian 118
			'adminmail',
119
			__('Bestellbestätigung (Admin)', 'wpsg'),
120
			__('Diese Mail bekommt der Admin beim Eingang einer neuen Bestellung.', 'wpsg'),
5532 daniel 121
			true); ?>
7094 florian 122
 
5532 daniel 123
		<?php echo wpsg_drawEMailConfig(
7094 florian 124
			'kundenmail',
125
			__('Bestellbestätigung (Kunde)', 'wpsg'),
5532 daniel 126
			__('Diese Mail bekommt der Kunde nach Durchführung der Bestellung.', 'wpsg'),
127
			false,
128
			true); ?>
7094 florian 129
 
5532 daniel 130
		<?php echo wpsg_drawEMailConfig(
7094 florian 131
			'status',
132
			__('Statusänderung (Kunde)', 'wpsg'),
5532 daniel 133
			__('Diese Mail bekommt der Kunde bei der Änderung des Bestellstatus.', 'wpsg')); ?>
7094 florian 134
 
5532 daniel 135
		<?php $this->callMods('admin_emailconf'); ?>
136
 
3433 daniel 137
		<div class="wpsg_hinweis"><?php echo __('Klicken Sie auf die jeweilige Mail um die Einstellungen angezeigt zu bekommen bzw. zu ändern.', 'wpsg'); ?></div>
7094 florian 138
 
5532 daniel 139
		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" /></p>
7094 florian 140
 
5532 daniel 141
	</form>
1414 daniel 142
</div>
143
 
144
<script type="text/javascript">/* <![CDATA[ */
145
 
146
	/**
147
	 * Speichert die Informationen ob die Mailboxen auf oder zugeklappt sind in dem Cookie
148
	 */
149
	function wpsg_mail_save_cookie()
150
	{
151
 
152
		var wpsg_mail_open = Array();
7094 florian 153
 
5532 daniel 154
		jQuery('.wpsg_email_box .panel-body:visible').each(function() {
1414 daniel 155
 
156
			wpsg_mail_open.push(jQuery(this).prev().attr("id"));
7094 florian 157
 
1414 daniel 158
		} );
159
 
160
		jQuery.cookie('wpsg_mail', wpsg_mail_open.join(','));
7094 florian 161
 
1414 daniel 162
	} // function wpsg_mail_save_cookie()
7156 daniel 163
 
164
    function wpsg_removeAttachemnt(a) {
165
 
166
	    var id = parseInt(a.getAttribute('data-id'));
167
	    var key = a.getAttribute('data-key');
168
 
169
        uploadData[key].forEach(function(item, index, object) {
1414 daniel 170
 
7156 daniel 171
            if (parseInt(item.id) === id) {
172
 
173
                object.splice(index, 1);
174
 
175
            }
176
 
177
        } );
178
 
179
        return false;
180
 
181
    }
182
 
183
    var wpframe;
184
 
1414 daniel 185
	jQuery(document).ready(function() {
7156 daniel 186
 
187
        jQuery(".btnAddAttachment").click(function(event) {
1414 daniel 188
 
7156 daniel 189
            var source = event.target || event.srcElement;
190
            var key = jQuery(source).attr("data-key");
191
 
192
            event.preventDefault();
193
 
194
            if (wpframe) { wpframe.open(); return; }
195
 
196
            wpframe = wp.media.frames.file_frame = wp.media({
197
                title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>",
198
                button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" },
199
                multiple: true
200
            });
201
 
202
            wpframe.on('select', function() {
203
 
204
                var attachments = wpframe.state().get('selection').map( function(attachment) {
205
 
206
                    attachment.toJSON();
207
 
208
                    var bDrin = false;
209
 
210
                    for (var i in uploadData[key]) {
211
 
212
                        if (uploadData[key][i].id === attachment.id) {
213
 
214
                            bDrin = true;
215
 
216
                            break;
217
 
218
                        }
219
 
220
                    }
221
 
222
                    if (!bDrin) {
223
 
224
                        uploadData[key].push( {
225
                            id: attachment.id,
226
                            filename: attachment.attributes.filename,
227
                            url: attachment.attributes.url
228
                        } );
229
 
230
                    }
231
 
232
                    return attachment;
233
 
234
                } );
235
 
236
            } );
237
 
238
            wpframe.open();
239
 
240
        } );
241
 
5532 daniel 242
		jQuery('.wpsg_email_box .panel-heading').bind('click', function() {
7094 florian 243
 
244
			jQuery(this).next().toggle();
245
 
1414 daniel 246
			wpsg_mail_save_cookie();
7094 florian 247
 
5562 daniel 248
		} ).css( { 'cursor': 'pointer' } ).disableSelection().next().hide();
1414 daniel 249
 
250
		if (jQuery.cookie('wpsg_mail') != null)
251
		{
252
 
253
			var arOpen = jQuery.cookie('wpsg_mail').split(',');
254
 
255
			for (var i = 0; i < arOpen.length; i ++)
256
			{
7094 florian 257
 
1414 daniel 258
				jQuery('#' + arOpen[i]).next().show();
7094 florian 259
				jQuery('#' + arOpen[i]).css('border-bottom', '0px');
260
 
1414 daniel 261
			}
7094 florian 262
 
263
		}
264
 
265
		jQuery("#wpsg_htmlmail").click(function() {
266
 
267
			if(jQuery("#wpsg_htmlmail")[0].checked == false) jQuery(".col-emaillogo").css("display", "none");
268
			else $(".col-emaillogo").css("display", "block");
269
 
270
		});
271
		if(jQuery("#wpsg_htmlmail")[0].checked == false) jQuery(".col-emaillogo").css("display", "none");
272
 
273
		jQuery("#wpsg_email_logo_watermark").click(function() {
274
 
275
			if(jQuery("#wpsg_email_logo_watermark")[0].checked == true) jQuery(".col-logo-alignment").hide();
276
			else jQuery(".col-logo-alignment").show()
277
 
278
		});
7133 daniel 279
 
280
		if(jQuery("#wpsg_email_logo_watermark").first().checked == true) jQuery(".col-logo-alignment").hide();
7094 florian 281
 
1414 daniel 282
	} );
283
 
7094 florian 284
	/* ]]> */</script>