summaryrefslogtreecommitdiff
path: root/views/admin/module.phtml
blob: b4a5e4c16fcd11a54d0bac35272d1a921ef263e2 (plain)
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
<?php
	
	/**
	 * Templatedatei für die Modulseite des Backend
	 * Sollte nicht angepasst werden
	 */

?>
<div class="wpsg_admin_submenu">
	
	<div class="wpsg_modul_search_wrap">
		<input id="wpsg_modul_search" type="text" class="wpsg_modul_search" value="<?php echo wpsg_getStr($_COOKIE['wpsg-modulfilter-search']); ?>" />	
		<label title="<?php echo __('Wenn aktiviert, werden nur aktive Module angezeigt'); ?>">
			<input type="checkbox" <?php echo ((wpsg_isSizedString($_COOKIE['wpsg-modulfilter-check'], 'true'))?'checked="checked"':''); ?> id="wpsg_modul_onlyactive" class="wpsg_modul_onlyactive" />
			<span class="glyphicon glyphicon-ok wpsg_modul_onlyactive_glyphicon" aria-hidden="true"></span>
		</label>
	</div>
	
	<?php foreach ($this->view['groups'] as $group_name => $g) { ?>
	<div class="list-group list-modul-group" style="display:none;" >
		<span class="list-group-item list-group-head"><?php echo $group_name; ?></span>		
		<?php foreach ($g as $mod_key => $m) { ?>
		<a class="<?php echo (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':''); ?> list-group-modul list-group-item <?php echo (($mod_key == wpsg_getStr($_REQUEST['modul'])?'active':'')); ?>" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $mod_key; ?>">
			<span class="wpsg_modul_name"><?php echo $m->name; ?></span>
			<?php if (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':'') { ?>
			<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
			<?php } ?>
		</a>
		<?php } ?>
	</div>
	<?php } ?>
	 
</div>

<?php if (isset($_REQUEST['modul'])) { ?>
<div class="wpsg_admin_content form-horizontal">
	<?php echo wpsg_drawForm_AdminboxStart($this->arAllModule[$_REQUEST['modul']]->name); ?>		
	<form name="form1" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $_REQUEST['modul']; ?>&amp;noheader=1" method="post" enctype="multipart/form-data">
		
		<!-- <h3>
			<?php echo $this->arAllModule[$_REQUEST['modul']]->name; ?>
			<?php if (isset($this->arAllModule[$_REQUEST['modul']]->hilfeURL) && $this->arAllModule[$_REQUEST['modul']]->hilfeURL != '') { ?>
			<a target="_blank" href="<?php echo $this->arAllModule[$_REQUEST['modul']]->hilfeURL; ?>" class="wpsg_form_help_notip"></a>	
			<?php } ?>
		</h3> -->
		
		<p><?php echo $this->arAllModule[$_REQUEST['modul']]->desc; ?></p><br />
		
		<?php $modul_install = $this->get_option($_REQUEST['modul'], $this->view['global']); ?>
		<?php echo wpsg_drawForm_Select('aktiv', __('Modul aktiviert', 'wpsg'), array('0' => __('Nein', 'wpsg'), '1' => __('Ja', 'wpsg')), ((wpsg_isSizedInt($modul_install))?'1':'0')); ?>
		 		 
		<?php if (isset($this->arAllModule[$_REQUEST['modul']]->version)) { ?>
		<?php echo wpsg_drawForm_Input('', __('Version', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->version, array('text' => true)); ?>		
		
		<?php if (isset($this->arAllModule[$_REQUEST['modul']]->free) && $this->arAllModule[$_REQUEST['modul']]->free === true) { ?>
		<?php $strLizenz = __('Kostenfrei', 'wpsg'); ?>
		<?php } else { ?>
		<?php if (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) { ?>
		<?php $strLizenz = __('Aktiviert', 'wpsg'); ?>
		<?php } else { ?>
		<?php if ($this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0) { ?>
		<?php $strLizenz = wpsg_translate(__('Demo Modus noch #1# Tage verbleibend.', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->getDemoDays()); ?>
		<?php } else { ?>
		<?php $strLizenz = __('Demo Modus abgelaufen.', 'wpsg'); ?>
		<?php } ?>
		<?php } ?>
		<?php } ?>
		<?php echo wpsg_drawForm_Text(__('Lizenz'), $strLizenz); ?>
		 	
		<?php } ?>
		
		<?php if (!isset($this->arAllModule[$_REQUEST['modul']]->version) || ((wpsg_isTrue($this->arAllModule[$_REQUEST['modul']]->free) || (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) || $this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0))) { ?>
			<?php if ($this->arAllModule[$_REQUEST['modul']]->inline === true) { ?>
			<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>
			<?php } ?> 
			
			<input type="hidden" name="subaction" value="module" />
					
			<?php if ($this->arAllModule[$_REQUEST['modul']]->inline == true) { ?>
			</form>
			<?php } ?>
					
			<?php if ($this->get_option($_REQUEST['modul'], $this->view['global']) > 0) { ?>
			<?php echo $this->arModule[$_REQUEST['modul']]->settings_edit(); ?>
			<?php } ?>
			
			<?php if ($this->arAllModule[$_REQUEST['modul']]->inline !== true) { ?>
			<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>			
			<?php } ?>
		<?php } else { ?>
		<p class="submit"><input type="submit" value="<?php echo __('Einstellungen speichern', 'wpsg'); ?>" class="button-primary" id="submit" name="submit"></p>
		<?php } ?>
						
	<?php if ($this->arAllModule[$_REQUEST['modul']]->inline !== true) { ?>
	</form>
	<?php } ?>
	
	<?php if (array_key_exists($_REQUEST['modul'], $this->arModule) && (!isset($this->arAllModule[$_REQUEST['modul']]->version) || (($this->arAllModule[$_REQUEST['modul']]->free === true || (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) || $this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0)))) { ?>
	<?php echo $this->arModule[$_REQUEST['modul']]->settings_edit_afterform(); ?>
	<?php } ?>	
	
	<?php echo wpsg_drawForm_AdminboxEnd(); ?>
</div>
<?php } else { ?>

	<?php if ($this->hasMod('wpsg_mod_core')) { ?>
	<?php echo $this->callMod('wpsg_mod_core', 'module_index'); ?>
	<?php } else { ?>
	
		<div class="wpsg_admin_content">
	
			<h3><?php echo __('Modulverwaltung', 'wpsg'); ?></h3>
			<p><?php echo __('wpShopGermany ist Modular aufgebaut, wählen Sie links das Modul aus, welches Sie konfigurieren möchten. ', 'wpsg'); ?></p>
			
			<p><?php echo wpsg_translate(
				__('<span style="color:red; font-weight:bold;">wpShopGermany Vollversion erwerben und weitere Funktionen freischalten.</span> [ <a target="_blank" href="#1#">Vollversion kaufen</a> ] [ <a target="_blank" href="#2#">Weitere Infos</a> ]', 'wpsg'),
				'http://shop.maennchen1.de/produkte/wpshopgermany-lizenzkey/',
				'http://wpshopgermany.de/'
			); ?></p>
	
		</div>
	
	<?php } ?>	
	
<?php } ?>

<script type="text/javascript">/* <![CDATA[ */

	function wpsg_ssh_module()
	{

		jQuery('.list-modul-group').show();
		jQuery('.wpsg_admin_submenu .list-group-item').show();

		var check = jQuery('#wpsg_modul_onlyactive').prop('checked');
		var search = jQuery('#wpsg_modul_search').val();

		jQuery.cookie('wpsg-modulfilter-check', check);
		jQuery.cookie('wpsg-modulfilter-search', search);
		
		jQuery('.wpsg_modul_name').each(function() {

			if (!jQuery(this).parent().hasClass('active'))
			{
			
				if (check && !jQuery(this).parent().hasClass('modul_akt')) jQuery(this).parent().hide();
				else if (jQuery.trim(search) != '')
				{
	
					var re = new RegExp(search, 'i');

					if (!jQuery(this).html().match(re)) jQuery(this).parent().hide();
					else jQuery(this).parent().show();
						
				}

			}
				
		} ); 

		jQuery('.list-modul-group').each(function() {

			if (jQuery(this).find('.list-group-modul:visible').length <= 0) jQuery(this).hide();
			else jQuery(this).show();				
			
		} );
		
	}

	jQuery(document).ready(function() {

		jQuery('#wpsg_modul_onlyactive').bind('change', function(event) {

			wpsg_ssh_module();			
			jQuery(this).blur();
			
		} );

		jQuery('#wpsg_modul_search').focus().bind('blur', wpsg_ssh_module);
		jQuery('#wpsg_modul_search').focus().bind('keyup', wpsg_ssh_module);
		
		wpsg_ssh_module();
		
	} );

/* ]]> */</script>