Subversion Repositories wpShopGermany4

Rev

Rev 7156 | 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
 
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
 
5532 daniel 137
		<?php $this->callMods('admin_emailconf'); ?>
138
 
3433 daniel 139
		<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 140
 
5532 daniel 141
		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit" /></p>
7094 florian 142
 
5532 daniel 143
	</form>
1414 daniel 144
</div>
145
 
146
<script type="text/javascript">/* <![CDATA[ */
147
 
148
	/**
149
	 * Speichert die Informationen ob die Mailboxen auf oder zugeklappt sind in dem Cookie
150
	 */
151
	function wpsg_mail_save_cookie()
152
	{
153
 
154
		var wpsg_mail_open = Array();
7094 florian 155
 
5532 daniel 156
		jQuery('.wpsg_email_box .panel-body:visible').each(function() {
1414 daniel 157
 
158
			wpsg_mail_open.push(jQuery(this).prev().attr("id"));
7094 florian 159
 
1414 daniel 160
		} );
161
 
162
		jQuery.cookie('wpsg_mail', wpsg_mail_open.join(','));
7094 florian 163
 
1414 daniel 164
	} // function wpsg_mail_save_cookie()
7156 daniel 165
 
166
    function wpsg_removeAttachemnt(a) {
167
 
168
	    var id = parseInt(a.getAttribute('data-id'));
169
	    var key = a.getAttribute('data-key');
170
 
171
        uploadData[key].forEach(function(item, index, object) {
1414 daniel 172
 
7156 daniel 173
            if (parseInt(item.id) === id) {
174
 
175
                object.splice(index, 1);
176
 
177
            }
178
 
179
        } );
180
 
181
        return false;
182
 
183
    }
184
 
185
    var wpframe;
186
 
1414 daniel 187
	jQuery(document).ready(function() {
7156 daniel 188
 
189
        jQuery(".btnAddAttachment").click(function(event) {
1414 daniel 190
 
7156 daniel 191
            var source = event.target || event.srcElement;
192
            var key = jQuery(source).attr("data-key");
193
 
194
            event.preventDefault();
195
 
196
            if (wpframe) { wpframe.open(); return; }
197
 
198
            wpframe = wp.media.frames.file_frame = wp.media({
199
                title: "<?php echo __('Auswählen oder Hochladen von Medien', 'wpsg'); ?>",
200
                button: { text: "<?php echo __('Medien benutzen', 'wpsg'); ?>" },
201
                multiple: true
202
            });
203
 
204
            wpframe.on('select', function() {
205
 
206
                var attachments = wpframe.state().get('selection').map( function(attachment) {
207
 
208
                    attachment.toJSON();
209
 
210
                    var bDrin = false;
211
 
212
                    for (var i in uploadData[key]) {
213
 
214
                        if (uploadData[key][i].id === attachment.id) {
215
 
216
                            bDrin = true;
217
 
218
                            break;
219
 
220
                        }
221
 
222
                    }
223
 
224
                    if (!bDrin) {
225
 
226
                        uploadData[key].push( {
227
                            id: attachment.id,
228
                            filename: attachment.attributes.filename,
229
                            url: attachment.attributes.url
230
                        } );
231
 
232
                    }
233
 
234
                    return attachment;
235
 
236
                } );
237
 
238
            } );
239
 
240
            wpframe.open();
241
 
242
        } );
243
 
5532 daniel 244
		jQuery('.wpsg_email_box .panel-heading').bind('click', function() {
7094 florian 245
 
246
			jQuery(this).next().toggle();
247
 
1414 daniel 248
			wpsg_mail_save_cookie();
7094 florian 249
 
5562 daniel 250
		} ).css( { 'cursor': 'pointer' } ).disableSelection().next().hide();
1414 daniel 251
 
252
		if (jQuery.cookie('wpsg_mail') != null)
253
		{
254
 
255
			var arOpen = jQuery.cookie('wpsg_mail').split(',');
256
 
257
			for (var i = 0; i < arOpen.length; i ++)
258
			{
7094 florian 259
 
1414 daniel 260
				jQuery('#' + arOpen[i]).next().show();
7094 florian 261
				jQuery('#' + arOpen[i]).css('border-bottom', '0px');
262
 
1414 daniel 263
			}
7094 florian 264
 
265
		}
266
 
267
		jQuery("#wpsg_htmlmail").click(function() {
268
 
269
			if(jQuery("#wpsg_htmlmail")[0].checked == false) jQuery(".col-emaillogo").css("display", "none");
270
			else $(".col-emaillogo").css("display", "block");
271
 
272
		});
273
		if(jQuery("#wpsg_htmlmail")[0].checked == false) jQuery(".col-emaillogo").css("display", "none");
274
 
275
		jQuery("#wpsg_email_logo_watermark").click(function() {
276
 
277
			if(jQuery("#wpsg_email_logo_watermark")[0].checked == true) jQuery(".col-logo-alignment").hide();
278
			else jQuery(".col-logo-alignment").show()
279
 
280
		});
7133 daniel 281
 
282
		if(jQuery("#wpsg_email_logo_watermark").first().checked == true) jQuery(".col-logo-alignment").hide();
7094 florian 283
 
1414 daniel 284
	} );
285
 
7094 florian 286
	/* ]]> */</script>