Subversion Repositories wpShopGermany4

Rev

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