Subversion Repositories wpShopGermany4

Rev

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

Rev Author Line No. Line
7256 thomas 1
<?php
2
 
7258 daniel 3
	/**
7256 thomas 4
 * Template für die Einstellungen des "Anschreiben" Moduls
5
 */
6
 
7
?>
8
 
9
<div>
10
	<ul class="nav nav-tabs" role="tablist">
11
		<li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
12
	</ul>
13
	<div class="tab-content">
14
		<div role="tabpanel" class="tab-pane active" id="tab1">
15
 
16
			<?php echo wpsg_drawForm_TextStart(); ?>
17
			<div style="position:relative;">
7258 daniel 18
				<?php if ($this->view['wpsg_mod_coverletter']['bp'] === false) { ?>
7256 thomas 19
					<p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
20
				<?php } else { ?>
7258 daniel 21
					<a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=getBp&noheader=1" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
7256 thomas 22
				<?php } ?>
7258 daniel 23
				<a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_bp" data-wpsg-tip="mod_coverletter_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_bp"></a>
24
				<input type="file" name="wpsg_mod_coverletter_bp">
25
				<?php $strSuffix = ''; if ($this->view['wpsg_mod_coverletter']['bp'] !== false) { $strSuffix = '
7256 thomas 26
                    <label>
7258 daniel 27
						<input type="checkbox" name="wpsg_mod_coverletter_bp_del" value="1" />&nbsp;'.__('Löschen', 'wpsg').'
7256 thomas 28
					</label>';
29
					echo __($strSuffix);
30
				} ?>
31
			</div>
7258 daniel 32
			<?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_coverletter_bp')); ?>
7256 thomas 33
 
7267 daniel 34
			<hr />
35
 
7271 thomas 36
			<?php echo wpsg_drawForm_Input('wpsg_mod_coverletter_subject', __('Betreff', 'wpsg'),$this->get_option('wpsg_mod_coverletter_subject'), ['help' => 'wpsg_mod_coverletter_subject']); ?>
7267 daniel 37
			<?php echo wpsg_drawForm_Textarea('wpsg_mod_coverletter_text', __('Textvorgabe', 'wpsg'), $this->get_option('wpsg_mod_coverletter_text'), ['help' => 'wpsg_mod_coverletter_text']); ?>
38
 
7256 thomas 39
			<?php echo wpsg_drawForm_TextStart(); ?>
40
			<div style="position:relative;">
7258 daniel 41
				<?php if ($this->view['wpsg_mod_coverletter']['logo'] === false) { ?>
7256 thomas 42
					<p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
43
				<?php } else { ?>
7258 daniel 44
					<a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=getLogo&noheader=1" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
7256 thomas 45
				<?php } ?>
7258 daniel 46
				<a class="wpsg_glyphicon_right glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_logo" data-wpsg-tip="mod_coverletter_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_coverletter_logo"></a>
47
				<input type="file" name="wpsg_mod_coverletter_logo">
48
				<?php $logo_pos = $this->get_option("wpsg_mod_coverletter_logo_position"); ?>
7256 thomas 49
				<?php $defaultAlign = !isset($logo_pos) || empty($logo_pos) ? "align-buttons-active" : ""; ?>
50
 
51
				<?php $alignLeft = $logo_pos === 'left' ? "align-buttons-active" : ""; ?>
52
				<?php $alignCenter = $logo_pos === 'center' ? "align-buttons-active" : ""; ?>
53
				<?php $alignRight = $logo_pos === 'right' ? "align-buttons-active" : ""; ?>
54
 
7258 daniel 55
				<?php $logo_transparency = $this->get_option("wpsg_mod_coverletter_logo_transparency") ?: "0%"; ?>
7256 thomas 56
 
7287 daniel 57
				<?php $strSuffix = ''; if ($this->view['wpsg_mod_coverletter']['logo'] !== false) { $strSuffix = '
7256 thomas 58
					<div class="row">
59
						<div class="col-md-4">
60
							<div class="align-buttons">
7258 daniel 61
								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-left '.$alignLeft.'" name="wpsg_mod_coverletter_logo_position_left" value="&#xf036" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo linksbündig ausrichten").'">
62
								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-center '.$alignCenter.'" name="wpsg_mod_coverletter_logo_position_center" value="&#xf037" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo zentrieren").'">
63
								<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-right '.$alignRight.' '.$defaultAlign.'" name="wpsg_mod_coverletter_logo_position_right" value="&#xf038" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo rechtsbündig ausrichten").'">
7256 thomas 64
							</div>
65
						</div>
66
						<div class="col-md-8 logo-transparency">
67
							<label>
7258 daniel 68
								<input type="text" name="wpsg_mod_coverletter_logo_transparency" value="'.$logo_transparency.'" />&nbsp;'.__('Logodeckkraft', 'wpsg').'
7256 thomas 69
							</label>
70
						</div>
71
						<div class="col-md-12">
72
							<label>
7258 daniel 73
								<input type="checkbox" name="wpsg_mod_coverletter_logo_del" value="1" />&nbsp;'.__('Löschen', 'wpsg').'
7256 thomas 74
							</label>
75
						</div>
76
					</div>';
77
					echo __($strSuffix);
78
				} ?>
79
 
80
 
7258 daniel 81
				<button class="button wpsg_coverletter_preview" style="float:right; margin-right:10px;" name="wpsg_coverletter_preview" type="button">
7256 thomas 82
					<?php echo __("Vorschau", "wpsg"); ?>
83
				</button>
84
 
85
			</div>
7258 daniel 86
 
87
			<?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_coverletter_logo')); ?>
7256 thomas 88
 
7258 daniel 89
			<hr /><br />
7256 thomas 90
 
7258 daniel 91
			<table class="table table-body-striped wpsg_mod_coverletter_fieldtable">
7256 thomas 92
				<thead>
93
				<tr>
94
					<th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
95
					<th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
96
					<th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
97
					<th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
98
					<th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
99
					<th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
100
					<th class="col_action"></th>
101
				</tr>
102
				</thead>
103
				<tbody>
7258 daniel 104
				<?php foreach ($this->view['wpsg_mod_coverletter']['fields'] as $f => $field_name) { ?>
7256 thomas 105
					<tr>
106
						<td><?php echo wpsg_hspc($field_name); ?></td>
107
						<td>
7258 daniel 108
							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['text']); ?>" />
7256 thomas 109
						</td>
110
						<td>
7258 daniel 111
							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['x']); ?>" />
7256 thomas 112
						</td>
113
						<td>
7258 daniel 114
							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['y']); ?>" />
7256 thomas 115
						</td>
116
						<td>
7258 daniel 117
							<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['color']); ?>" />
7256 thomas 118
						</td>
119
						<td>
120
							<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
7258 daniel 121
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
122
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
123
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
124
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
125
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
126
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
127
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
7256 thomas 128
							</select>
129
						</td>
130
						<td>
7258 daniel 131
							<input type="checkbox" title="<?php echo __('Diese Checkbox aktivieren, damit die Textzeile verwendet wird.', 'wpsg'); ?>" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['wpsg_mod_coverletter']['arTexts'][$f]['aktiv']))?'checked="checked"':''); ?> />
7256 thomas 132
						</td>
133
					</tr>
134
				<?php } ?>
135
				</tbody>
136
			</table>
137
 
138
			<input class="button" onclick="if (!confirm('<?php echo __('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg'); ?>')) return false; else location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;do=reset&amp;noheader=1';" type="button" value="<?php echo __('Standardeinstellungen laden', 'wpsg'); ?>" />
139
 
140
			<br /><br />
141
 
142
			<div class="info">
143
				<p>
144
					<?php echo __('Die Angaben für X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?><br />
145
					<?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFFF für weiß, #000000 für schwarz).', 'wpsg'); ?>
146
				</p>
147
			</div>
148
 
149
			<br />
150
 
151
		</div>
152
	</div>
153
</div>
154
 
155
<script type="text/javascript">/* <![CDATA[ */
156
 
157
	/**
158
	 * Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
159
	 */
160
	function handleLogoAlignClick(pressedEl)
161
	{
162
 
163
		if(pressedEl.hasClass("align-buttons-active")) return;
164
		else
165
		{
166
 
167
			pressedEl.addClass("align-buttons-active");
168
			pressedEl[0].value = pressedEl[0].value + " selected";
169
 
170
			jQuery.each($(".logo-align-button"), function(index, element) {
171
				if(element.classList.contains("align-buttons-active") && element !== pressedEl[0]){
172
 
173
					var values = element.value.split(" ");
174
					element.value = values[0];
175
 
176
					element.classList.remove("align-buttons-active");
177
 
178
					return false;
179
 
180
				}
181
			});
182
 
183
		}
184
 
185
	} // function handleLogoAlignClick()
186
 
187
	/**
188
	 * Wird beim Klicken auf den Vorschau Button ausgelöst
189
	 */
7258 daniel 190
	function wpsg_coverletter_preview()
7256 thomas 191
	{
192
 
7267 daniel 193
		var url = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=orderAjax&noheader=1&wpsg_mod_coverletter_preview=1";
7256 thomas 194
 
195
		window.open(url, '_blank');
196
 
197
		return false;
198
 
7258 daniel 199
	} // function wpsg_coverletter_preview()
7256 thomas 200
 
201
 
202
 
203
	jQuery(document).ready(function() {
204
 
205
		jQuery('#wpsg_tab').wpsg_tab( {
7258 daniel 206
			'cookiename': 'wpsg_mod_coverletter_tab',
7256 thomas 207
			'tab2': function() {
208
				jQuery('.tablink').show();
209
			}
210
		} );
211
 
7258 daniel 212
		jQuery(".wpsg_coverletter_preview").click(function(){ wpsg_coverletter_preview(); });
7256 thomas 213
 
214
	} );
215
 
216
	/* ]]> */</script>