1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
|
<?php
/**
* Template für die Einstellungen des "Anschreiben" Moduls
* @version 4.6.1
*/
if (!defined('ABSPATH')) exit;
$arTexts = $this->view['wpsg_mod_coverletter']['arTexts'];
$logo_pos = $this->get_option('wpsg_mod_coverletter_logo_position');
$defaultAlign = ((!isset($logo_pos) || empty($logo_pos))?'align-buttons-active':'');
$alignLeft = (($logo_pos === 'left')?'align-buttons-active':'');
$alignCenter = (($logo_pos === 'center')?'align-buttons-active':'');
$alignRight = (($logo_pos === 'right')?'align-buttons-active':'');
$logo_transparency = (($this->get_option('wpsg_mod_coverletter_logo_transparency'))?$this->get_option('wpsg_mod_coverletter_logo_transparency'):'100%');
?>
<div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo esc_html__('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
</ul>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="tab1">
<?php echo wpsg_drawForm_TextStart(); ?>
<div style="position:relative;">
<?php if ($this->view['wpsg_mod_coverletter']['bp'] === false) { ?>
<p><?php echo esc_html__('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
<?php } else { ?>
<a target="_blank" href="<?php echo esc_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=getBp&noheader=1'); ?>"><?php echo esc_html__('Derzeitiges Briefpapier', 'wpsg'); ?></a>
<?php } ?>
<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>
<input type="file" name="wpsg_mod_coverletter_bp">
<?php if ($this->view['wpsg_mod_coverletter']['bp'] !== false) { ?>
<label>
<input type="checkbox" name="wpsg_mod_coverletter_bp_del" value="1" /> <?php echo esc_html__('Löschen', 'wpsg'); ?>
</label>
<?php } ?>
</div>
<?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), ['noP' => true, 'helps' => 'wpsg_mod_coverletter_bp']); ?>
<hr />
<?php echo wpsg_drawForm_Input('wpsg_mod_coverletter_subject', __('Betreff', 'wpsg'), $this->get_option('wpsg_mod_coverletter_subject'), ['help' => 'wpsg_mod_coverletter_subject']); ?>
<?php echo wpsg_drawForm_Textarea('wpsg_mod_coverletter_text', __('Textvorgabe', 'wpsg'), $this->get_option('wpsg_mod_coverletter_text'), ['help' => 'wpsg_mod_coverletter_text']); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
<div style="position:relative;">
<?php if ($this->view['wpsg_mod_coverletter']['logo'] === false) { ?>
<p><?php echo esc_html__('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
<?php } else { ?>
<a target="_blank" href="<?php echo esc_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=getLogo&noheader=1'); ?>"><?php echo esc_html__('Derzeitiges Logo', 'wpsg'); ?></a>
<?php } ?>
<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>
<input type="file" name="wpsg_mod_coverletter_logo">
<?php if ($this->view['wpsg_mod_coverletter']['logo'] !== false) { ?>
<div class="row"><br />
<div class="col-md-12">
<div class="position">
<input type="text" style="width:45%; float:left; margin-right:10px;" data-toggle="tooltip" class="wpsg_mod_coverletter_logo_x" name="wpsg_mod_coverletter_logo_x" placeholder="<?php echo esc_attr__('X-Position', 'wpsg'); ?>" value="<?php echo esc_attr($this->get_option('wpsg_mod_coverletter_logo_x')); ?>" />
<input type="text" style="width:45%;" data-toggle="tooltip" class="wpsg_mod_coverletter_logo_y" name="wpsg_mod_coverletter_logo_y" placeholder="<?php echo esc_attr__('Y-Position', 'wpsg'); ?>" value="<?php echo esc_attr($this->get_option('wpsg_mod_coverletter_logo_y')); ?>" />
</div>
</div>
<div class="col-md-8 logo-transparency">
<label>
<input type="text" name="wpsg_mod_coverletter_logo_transparency" value="<?php echo esc_attr($logo_transparency); ?>" /> <?php echo esc_html__('Logodeckkraft', 'wpsg'); ?>
</label>
</div>
<div class="col-md-12">
<label style="margin-top:20px; ">
<input type="checkbox" name="wpsg_mod_coverletter_logo_del" value="1" /> <?php echo esc_html__('Löschen', 'wpsg'); ?>
</label>
</div>
</div>
<?php } ?>
<button class="button wpsg_coverletter_preview" style="float:right; margin-right:10px;" name="wpsg_coverletter_preview" type="button">
<?php echo esc_html__('Vorschau', 'wpsg'); ?>
</button>
</div>
<?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), ['noP' => true, 'helps' => 'wpsg_mod_coverletter_logo']); ?>
<hr /><br />
<style>
.wpsg_mod_coverletter_fieldtable { table-layout:fixed; width:100%; }
.wpsg_mod_coverletter_fieldtable > thead > tr > th,
.wpsg_mod_coverletter_fieldtable > tbody > tr > td { vertical-align:middle; padding:6px 5px; }
.wpsg_mod_coverletter_fieldtable .col_bezeichnung { width:110px; }
.wpsg_mod_coverletter_fieldtable .col_x,
.wpsg_mod_coverletter_fieldtable .col_y { width:70px; }
.wpsg_mod_coverletter_fieldtable .col_color { width:56px; }
.wpsg_mod_coverletter_fieldtable .col_groesse { width:72px; }
.wpsg_mod_coverletter_fieldtable .col_action { width:50px; text-align:center; }
.wpsg_mod_coverletter_fieldtable input[type="text"],
.wpsg_mod_coverletter_fieldtable select { width:100%; max-width:none; min-width:0; margin:0; }
.wpsg_mod_coverletter_fieldtable input.wpsg_mod_coverletter_number { text-align:right; }
.wpsg_mod_coverletter_fieldtable input[type="color"] { display:block; width:100%; height:30px; padding:2px; border:1px solid #8c8f94; border-radius:4px; background:#fff; cursor:pointer; }
.wpsg_mod_coverletter_fieldtable input[type="checkbox"] { margin:0; }
</style>
<table class="table table-body-striped wpsg_mod_coverletter_fieldtable">
<thead>
<tr>
<th class="col_bezeichnung"><?php echo esc_html__('Bezeichnung', 'wpsg'); ?></th>
<th class="col_freitext"><?php echo esc_html__('Freitext', 'wpsg'); ?></th>
<th class="col_x"><?php echo esc_html__('X', 'wpsg'); ?></th>
<th class="col_y"><?php echo esc_html__('Y', 'wpsg'); ?></th>
<th class="col_color"><?php echo esc_html__('Farbe', 'wpsg'); ?></th>
<th class="col_groesse"><?php echo esc_html__('Größe', 'wpsg'); ?></th>
<th class="col_action"><?php echo esc_html__('Aktiv', 'wpsg'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->view['wpsg_mod_coverletter']['fields'] as $f => $field_name) { ?>
<?php $arText = ((is_array($arTexts[$f]??null))?$arTexts[$f]:[]); ?>
<tr>
<td><?php echo wpsg_hspc($field_name); ?></td>
<td>
<input type="text" name="text[<?php echo esc_attr($f); ?>][text]" value="<?php echo esc_attr($arText['text']??''); ?>" />
</td>
<td>
<input type="text" class="wpsg_mod_coverletter_number" inputmode="decimal" name="text[<?php echo esc_attr($f); ?>][x]" value="<?php echo esc_attr($arText['x']??''); ?>" />
</td>
<td>
<input type="text" class="wpsg_mod_coverletter_number" inputmode="decimal" name="text[<?php echo esc_attr($f); ?>][y]" value="<?php echo esc_attr($arText['y']??''); ?>" />
</td>
<td>
<input type="color" name="text[<?php echo esc_attr($f); ?>][color]" value="<?php echo esc_attr($arText['color']??'#000000'); ?>" />
</td>
<td>
<select name="text[<?php echo esc_attr($f); ?>][fontsize]">
<?php for ($size = 8; $size <= 14; $size++) { ?>
<option <?php echo (((string)($arText['fontsize']??'') === (string)$size)?'selected="selected"':''); ?> value="<?php echo esc_attr($size); ?>"><?php echo esc_html($size); ?></option>
<?php } ?>
</select>
</td>
<td class="col_action">
<input type="checkbox" title="<?php echo esc_attr__('Diese Checkbox aktivieren, damit die Textzeile verwendet wird.', 'wpsg'); ?>" value="1" name="text[<?php echo esc_attr($f); ?>][aktiv]" <?php echo ((is_numeric($arText['aktiv']??null) && $arText['aktiv'] > 0)?'checked="checked"':''); ?> />
</td>
</tr>
<?php } ?>
</tbody>
</table>
<input class="button" onclick="if (!confirm('<?php echo esc_js(__('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg')); ?>')) return false; else location.href = '<?php echo esc_js(wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_coverletter&do=reset&noheader=1', 'wpsg-coverletter-reset')); ?>';" type="button" value="<?php echo esc_attr__('Standardeinstellungen laden', 'wpsg'); ?>" />
<br /><br />
<div class="info">
<p>
<?php echo esc_html__('Die Angaben für X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?>
</p>
</div>
<br />
</div>
</div>
</div>
<script type="text/javascript">/* <![CDATA[ */
/**
* Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
*/
function handleLogoAlignClick(pressedEl) {
if (pressedEl.hasClass('align-buttons-active')) {
return;
} else {
pressedEl.addClass('align-buttons-active');
pressedEl[0].value = pressedEl[0].value + ' selected';
jQuery.each(jQuery('.logo-align-button'), function(index, element) {
if (element.classList.contains('align-buttons-active') && element !== pressedEl[0]) {
var values = element.value.split(' ');
element.value = values[0];
element.classList.remove('align-buttons-active');
return false;
}
});
}
} // function handleLogoAlignClick(pressedEl)
/**
* Wird beim Klicken auf den Vorschau Button ausgelöst
*/
function wpsg_coverletter_preview() {
var url = <?php echo wp_json_encode(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'); ?>;
window.open(url, '_blank');
return false;
} // function wpsg_coverletter_preview()
jQuery(document).ready(function() {
jQuery('#wpsg_tab').wpsg_tab({
'cookiename': 'wpsg_mod_coverletter_tab',
'tab2': function() {
jQuery('.tablink').show();
}
});
jQuery('.wpsg_coverletter_preview').click(function() {
wpsg_coverletter_preview();
});
});
/* ]]> */</script>
|