Subversion Repositories wpShopGermany4

Rev

Rev 7287 | Rev 7304 | 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>
7303 thomas 71
                        <div class="col-md-12">
72
        				    <div class="position">
73
                            	<input type="text" style="width:45%; float:left; margin-right:10px;" data-toggle="tooltip" class="wpsg_mod_coverletter_logo_x" name="text[<?php echo $f; ?>][x]" placeholder="X-Position" value="" />
74
                                <input type="text" style="width:45%;" data-toggle="tooltip" class="wpsg_mod_coverletter_logo_y" name="text[<?php echo $f; ?>][x]" placeholder="Y-Position" value="" />
75
                            </div>
76
                        </div>
7256 thomas 77
						<div class="col-md-12">
7303 thomas 78
							<label style="margin-top:20px; ">
7258 daniel 79
								<input type="checkbox" name="wpsg_mod_coverletter_logo_del" value="1" />&nbsp;'.__('Löschen', 'wpsg').'
7256 thomas 80
							</label>
81
						</div>
82
					</div>';
83
					echo __($strSuffix);
84
				} ?>
7303 thomas 85
 
7256 thomas 86
 
87
 
7258 daniel 88
				<button class="button wpsg_coverletter_preview" style="float:right; margin-right:10px;" name="wpsg_coverletter_preview" type="button">
7256 thomas 89
					<?php echo __("Vorschau", "wpsg"); ?>
90
				</button>
91
 
92
			</div>
7258 daniel 93
 
94
			<?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_mod_coverletter_logo')); ?>
7256 thomas 95
 
7258 daniel 96
			<hr /><br />
7256 thomas 97
 
7258 daniel 98
			<table class="table table-body-striped wpsg_mod_coverletter_fieldtable">
7256 thomas 99
				<thead>
100
				<tr>
101
					<th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
102
					<th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
103
					<th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
104
					<th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
105
					<th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
106
					<th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
107
					<th class="col_action"></th>
108
				</tr>
109
				</thead>
110
				<tbody>
7258 daniel 111
				<?php foreach ($this->view['wpsg_mod_coverletter']['fields'] as $f => $field_name) { ?>
7256 thomas 112
					<tr>
113
						<td><?php echo wpsg_hspc($field_name); ?></td>
114
						<td>
7258 daniel 115
							<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 116
						</td>
117
						<td>
7258 daniel 118
							<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 119
						</td>
120
						<td>
7258 daniel 121
							<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 122
						</td>
123
						<td>
7258 daniel 124
							<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 125
						</td>
126
						<td>
127
							<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
7258 daniel 128
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
129
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
130
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
131
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
132
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
133
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
134
								<option <?php echo ((wpsg_getStr($this->view['wpsg_mod_coverletter']['arTexts'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
7256 thomas 135
							</select>
136
						</td>
137
						<td>
7258 daniel 138
							<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 139
						</td>
140
					</tr>
141
				<?php } ?>
142
				</tbody>
143
			</table>
144
 
145
			<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'); ?>" />
146
 
147
			<br /><br />
148
 
149
			<div class="info">
150
				<p>
151
					<?php echo __('Die Angaben für X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?><br />
152
					<?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFFF für weiß, #000000 für schwarz).', 'wpsg'); ?>
153
				</p>
154
			</div>
155
 
156
			<br />
157
 
158
		</div>
159
	</div>
160
</div>
161
 
162
<script type="text/javascript">/* <![CDATA[ */
163
 
164
	/**
165
	 * Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
166
	 */
167
	function handleLogoAlignClick(pressedEl)
168
	{
169
 
170
		if(pressedEl.hasClass("align-buttons-active")) return;
171
		else
172
		{
173
 
174
			pressedEl.addClass("align-buttons-active");
175
			pressedEl[0].value = pressedEl[0].value + " selected";
176
 
177
			jQuery.each($(".logo-align-button"), function(index, element) {
178
				if(element.classList.contains("align-buttons-active") && element !== pressedEl[0]){
179
 
180
					var values = element.value.split(" ");
181
					element.value = values[0];
182
 
183
					element.classList.remove("align-buttons-active");
184
 
185
					return false;
186
 
187
				}
188
			});
189
 
190
		}
191
 
192
	} // function handleLogoAlignClick()
193
 
194
	/**
195
	 * Wird beim Klicken auf den Vorschau Button ausgelöst
196
	 */
7258 daniel 197
	function wpsg_coverletter_preview()
7256 thomas 198
	{
199
 
7267 daniel 200
		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 201
 
202
		window.open(url, '_blank');
203
 
204
		return false;
205
 
7258 daniel 206
	} // function wpsg_coverletter_preview()
7256 thomas 207
 
208
 
209
 
210
	jQuery(document).ready(function() {
211
 
212
		jQuery('#wpsg_tab').wpsg_tab( {
7258 daniel 213
			'cookiename': 'wpsg_mod_coverletter_tab',
7256 thomas 214
			'tab2': function() {
215
				jQuery('.tablink').show();
216
			}
217
		} );
218
 
7258 daniel 219
		jQuery(".wpsg_coverletter_preview").click(function(){ wpsg_coverletter_preview(); });
7256 thomas 220
 
221
	} );
222
 
223
	/* ]]> */</script>