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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
|
<?php
/**
* Template für die Lizenzverwaltung
*/
$wpsg_update_data = wpsg_get_update_data();
if (!is_array($wpsg_update_data) || !current_user_can('wpsg_lizence') || !wpsg_isSizedInt($wpsg_update_data['returnCode'])) die();
?>
<div class="wpsg_admin" id="wpsg-bs">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><?php echo __('wpShopGermany', 'wpsg'); ?></a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li role="presentation" class="<?php echo (($this->view['actionName'] == "index")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin"><?php echo __("Einstellungen", "wpsg"); ?></a></li>
<li role="presentation" class="<?php echo (($this->view['actionName'] == "module")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module"><?php echo __("Module", "wpsg"); ?></a></li>
<?php if (current_user_can('wpsg_lizence') && is_array($wpsg_update_data)) { ?>
<li role="presentation" class="<?php echo (($this->view['actionName'] == "licence")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung"><?php echo __("Lizenzverwaltung", "wpsg"); ?></a></li>
<?php } ?>
<li role="presentation" class="<?php echo (($this->view['actionName'] == 'news')?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=news">
<?php echo __('Aktuelles', 'wpsg'); ?>
<?php $wpsg_news_unread = wpsg_news::countUnreadNews(); if (wpsg_isSizedInt($wpsg_news_unread)) { ?>
<span class="badge" style="background-color:#D9534F;"><?php echo $wpsg_news_unread; ?></span>
<?php } ?>
</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li role="presentation" class="<?php echo (($this->view['actionName'] == "hilfe")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=hilfe"><?php echo __("Hilfe", "wpsg"); ?></a></li>
<li role="presentation" class="<?php echo (($this->view['actionName'] == "ueber")?'active':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=ueber"><?php echo __("Über", "wpsg"); ?></a></li>
</ul>
</div>
</div>
</nav>
<div class="wpsg_admin_wrap">
<div class="wpsg_msg_wrap"><hr class="wp-header-end wpsg-wp-header-end"/></div>
<div class="wpsg_admin_submenu">
<div class="list-group">
<span class="list-group-head list-group-item"><?php echo __('Lizenzverwaltung'); ?></span>
<a class="list-group-item <?php echo (($this->view['subaction'] == 'registerdata')?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=registerdata"><?php echo __('Registrierungsdaten', 'wpsg'); ?></a>
<a class="list-group-item <?php echo (($this->view['subaction'] == 'domaindata')?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=domaindata"><?php echo __('Domainverwaltung', 'wpsg'); ?></a>
<a class="list-group-item <?php echo (($this->view['subaction'] == 'modulactivation')?'active':''); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&subaction=modulactivation"><?php echo __('Modulaktivierung', 'wpsg'); ?></a>
</div>
</div>
<div class="wpsg_admin_content form-horizontal">
<div class="panel panel-default">
<div class="panel-heading clearfix">
<h3 class="panel-title">
<?php if ($this->view['subaction'] === 'registerdata') { ?><?php echo __('Registrierungsdaten', 'wpsg'); ?>
<?php } else if ($this->view['subaction'] === 'domaindata') { ?><?php echo __('Domainverwaltung', 'wpsg'); ?>
<?php } else if ($this->view['subaction'] === 'modulactivation') { ?><?php echo __('Modulaktivierung', 'wpsg'); ?><?php } ?>
</h3>
</div>
<div class="panel-body">
<?php if ($this->view['subaction'] === 'registerdata') { ?>
<form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=saveRegister">
<?php wp_nonce_field('wpsg-admin-licence-register'); ?>
<?php $strLicenceLabel = ''; ?>
<?php if ($wpsg_update_data['licence_model'] === 'enterprise') { $strLicenceLabel = __('Enterprise', 'wpsg'); ?>
<?php } else if ($wpsg_update_data['licence_model'] === 'pro') { $strLicenceLabel = __('Pro', 'wpsg'); } ?>
<?php echo wpsg_drawForm_Text(_('Lizenzmodel'), $strLicenceLabel); ?>
<br />
<?php echo wpsg_drawForm_Input('register[company]', __('Firma', 'wpsg'), $wpsg_update_data['registerData']['company']); ?>
<?php echo wpsg_drawForm_Input('register[firstname]', __('Vorname', 'wpsg'), $wpsg_update_data['registerData']['firstname']); ?>
<?php echo wpsg_drawForm_Input('register[lastname]', __('Name', 'wpsg'), $wpsg_update_data['registerData']['lastname']); ?>
<?php echo wpsg_drawForm_Input('register[zip]', __('PLZ', 'wpsg'), $wpsg_update_data['registerData']['zip']); ?>
<?php echo wpsg_drawForm_Input('register[city]', __('Ort', 'wpsg'), $wpsg_update_data['registerData']['city']); ?>
<?php echo wpsg_drawForm_Input('register[street]', __('Straße', 'wpsg'), $wpsg_update_data['registerData']['street']); ?>
<?php echo wpsg_drawForm_Select('register[country]', __('Land', 'wpsg'), array(
'1' => __('Deutschland', 'wpsg'),
'2' => __('Österreich', 'wpsg'),
'3' => __('Schweiz', 'wpsg'),
'4' => __('Niederlande', 'wpsg'),
'5' => __('Belgien', 'wpsg')
), $wpsg_update_data['registerData']['country']); ?>
<?php echo wpsg_drawForm_Input('register[email]', __('E-Mail', 'wpsg'), $wpsg_update_data['registerData']['email']); ?>
<br />
<?php echo wpsg_drawForm_SubmitButton(__('Speichern', 'wpsg')); ?>
</form>
<?php } else if ($this->view['subaction'] === 'domaindata') { ?>
<?php if (wpsg_isSizedArray($wpsg_update_data['domainData'])) { ?>
<table class="table domaintable">
<thead>
<tr>
<th class="col_domain"><?php echo __('Domain', 'wpsg'); ?></th>
<th class="col_action"></th>
</tr>
</thead>
<tbody>
<?php foreach ($wpsg_update_data['domainData'] as $domain) { ?>
<tr class="success">
<td class="col_domain"><?php echo $domain; ?></td>
<td class="col_action">
<a href="<?php
echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=domainDeRegister', 'wpsg-admin-licence-domainDeRegister');
?>" class="btn btn-warning btn-sm"><?php echo __('Registrierung aufheben'); ?></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } else { ?>
<p><?php echo __('Es sind noch keine Domains für diese Lizenz registriert.', 'wpsg'); ?></p>
<?php } ?>
<hr />
<?php if (($wpsg_update_data['licence_model'] === 'enterprise' || sizeof($wpsg_update_data['domainData']) < 1) && !in_array($_SERVER['HTTP_HOST'], $wpsg_update_data['domainData'])) { ?>
<p class="wpsg_message_ok"><?php echo __('Diese Domain kann noch auf Ihre Lizenz aktiviert werden.', 'wpsg'); ?></p>
<br />
<a href="<?php
echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=domainRegister', 'wpsg-admin-licence-domainRegister');
?>" class="btn btn-primary"><?php echo __('Diese Domain registrieren', 'wpsg'); ?></a>
<?php } else if (in_array($_SERVER['HTTP_HOST'], $wpsg_update_data['domainData'])) { ?>
<p class="wpsg_message_ok"><?php echo __('Diese Domain ist bereits auf diesen Schlüssel registriert.', 'wpsg'); ?></p>
<?php } else { ?>
<p class="error"><?php echo __('Diese Domain kann nicht mehr registriert werden.', 'wpsg'); ?></p>
<?php } ?>
<?php } else if ($this->view['subaction'] === 'modulactivation') { ?>
<?php $this->shop->loadModule(true); ?>
<?php $wpsg_update_data = wpsg_get_update_data(); ?>
<form method="POST" action="<?php echo WPSG_URL_WP ?>wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=activatemodul&source=licence">
<?php echo wp_nonce_field('wpsg-admin-licence-activatemodul'); ?>
<fieldset>
<legend style="padding-top:0px;"><?php echo __('Modulcode aktivieren', 'wpsg'); ?></legend>
<div class="row">
<div class="col-xs-10">
<input required="required" type="text" class="form-control" name="modulcode" id="modulcode" />
</div>
<div class="col-xs-2">
<input class="btn btn-primary btn-block" type="submit" class="form-control" value="<?php echo __('Prüfen', 'wpsg'); ?>" />
</div>
</div>
</fieldset>
</form>
<br />
<?php if (wpsg_isSizedArray($wpsg_update_data)) { ?>
<?php // Ich zeige hier nur die Aktiven Module an ?>
<?php foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info) { if ($modul_info['active'] !== true) unset($wpsg_update_data['modulinfo'][$modul_key]); } ?>
<table class="table modultable">
<thead>
<tr>
<th><?php echo __('Modulname', 'wpsg'); ?></th>
<th><?php echo __('Version', 'wpsg'); ?></th>
<th><?php echo __('Lizenz', 'wpsg'); ?></th>
<th><?php echo __('verfügbare Version', 'wpsg'); ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($wpsg_update_data['modulinfo'] as $modul_key => $modul_info) { ?>
<tr style="font-style:normal;" class="success">
<td><?php echo $modul_info['label']; ?></td>
<td>
<?php if ($this->shop->hasModInstalled($modul_key)) { ?>
<?php echo $this->shop->arAllModule[$modul_key]->version; ?>
<?php } ?>
</td>
<td>
<?php if ($modul_info['free'] === true) { ?>
<?php echo __('kostenlos', 'wpsg'); ?>
<?php } else if ($modul_info['active'] === true) { ?>
<?php echo __('enthalten', 'wpsg'); ?>
<?php } else { ?>
<?php if (wpsg_isSizedString($modul_info['shop_url'])) { ?>
<a href="<?php echo $modul_info['shop_url']; ?>" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
<?php } else { ?>
<a href="https://shop.maennchen1.de" target="_blank"><?php echo __('Modulcode erwerben', 'wpsg'); ?></a>
<?php } ?>
<?php } ?>
</td>
<td><?php
echo $modul_info['version'];
if ($this->shop->hasModInstalled($modul_key) && $modul_info['version'] === $this->shop->arAllModule[$modul_key]->version)
{
echo ' - <strong class="wpsg_message_ok">'.__('aktuell', 'wpsg').'</strong>';
}
else if (version_compare($modul_info['version'], WPSG_VERSION) > 0)
{
echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong><br />'.wpsg_translate(__('<a href="#1#">wpShopGermany Update</a> notwendig', 'wpsg'), WPSG_URL_WP.'wp-admin/plugins.php');
}
else if (version_compare($modul_info['version'], $this->shop->arAllModule[$modul_key]->version) > 0)
{
echo ' - <strong class="wpsg_error">'.__('neue Version verfügbar', 'wpsg').'</strong>';
if ($modul_info['active'] === true)
{
echo '<br />';
echo wpsg_translate(__('<a href="#1#">Version installieren</a>.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=registrierung&noheader=1&do=installModul&modul='.$modul_key.'&source=licence');
}
}
?></td>
</tr>
<?php } ?>
</tbody>
</table>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
|