summaryrefslogtreecommitdiff
path: root/views/mods/mod_productindex/page_metabox.phtml
blob: a8685e3e958543bd7d6df82a06040ec621d8a513 (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
<?php

	/**
	 * Template für die Einstellungen innerhalb des Posts
	 * @version 4.6.1
	 */

?>

<style>

    #wpsg_mod_productindex_layer { height:20rem; }
    #wpsg_mod_productindex_layer select,
    #wpsg_mod_productindex_layer input { width:25rem; }
    #wpsg_mod_productindex_layer #wpsg_mod_productindex_hideOrder,
    #wpsg_mod_productindex_layer #wpsg_mod_productindex_hideViewSelect { width:15px; height:15px; }

</style>

<br /> 

<?php echo wpsg_drawForm_Checkbox('wpsg_mod_productindex_active', __('Seite als Produktseite verwenden', 'wpsg'), get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_active', true)); ?>

<br />

<div id="wpsg_mod_productindex_layer" style="display:none; height:20rem;">
	
	<div style="width:50%; float:left;">
		
		<?php /* alle Produkte */ ?>
		<?php echo wpsg_drawForm_Select('wpsg_mod_productindex_show', __('Produkte', 'wpsg'), $this->view['wpsg_mod_productindex']['arShow'], get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_show', true)); ?>		
		<br />
		
		<?php /* Produktanzahl */ ?>
		<?php echo wpsg_drawForm_Input('wpsg_mod_productindex_perPage', __('Pro Seite', 'wpsg'), get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_perPage', true)); ?>
		<br /> 
		
		<?php /* kommagetrennte Produktauswahl */ ?>
		<div class="wpsg_mod_productindex_layershow wpsg_mod_productindex_layer_1" style="display:none;">
			<?php echo wpsg_drawForm_Input('wpsg_mod_productindex_productids', __('Produktauswahl (Kommagetrennte IDs)', 'wpsg'), get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_productids', true)); ?>	
			<br />
		</div>	
		
		<?php /* Produktgruppenauswahl*/ ?> 
		<?php if ($this->hasMod('wpsg_mod_productgroups')) { ?>
		<div class="wpsg_mod_productindex_layershow wpsg_mod_productindex_layer_2" style="display:none;">
			<?php if (sizeof($this->view['wpsg_mod_productindex']['arProductGroups']) <= 0) { ?>
				<?php echo wpsg_drawForm_Input('', __('Produktgruppen', 'wpsg'), __('Keine Produktgruppen angelegt.', 'wpsg'), array('text' => true)); ?>
			<?php } else { ?>
				<?php echo wpsg_drawForm_Select('wpsg_mod_productindex_groups', __('Produktgruppen', 'wpsg'), $this->view['wpsg_mod_productindex']['arProductGroups'], get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_groups', true), array('multiple' => ((sizeof($this->view['wpsg_mod_productindex']['arProductGroups']) < 5)?sizeof($this->view['wpsg_mod_productindex']['arProductGroups']):5))); ?>
			<?php } ?>		
			<br />		
		</div>	
		<?php } ?>
		
		<?php /* Produktkategorieauswahl */ ?> 
		<?php if ($this->hasMod('wpsg_mod_produktartikel')) { ?>
		<div class="wpsg_mod_productindex_layershow wpsg_mod_productindex_layer_3" style="display:none;">
			<?php if (sizeof($this->view['wpsg_mod_productindex']['arCategories']) <= 0) { ?>
				<?php echo wpsg_drawForm_Input('', __('Kategorien', 'wpsg'), __('Keine Kategorien angelegt.', 'wpsg'), array('text' => true)); ?>
			<?php } else { ?>
				<?php echo wpsg_drawForm_Select('wpsg_mod_productindex_categories', __('Kategorien', 'wpsg'), $this->view['wpsg_mod_productindex']['arCategories'], get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_categories', true), array('multiple' => ((sizeof($this->view['wpsg_mod_productindex']['arCategories']) < 5)?sizeof($this->view['wpsg_mod_productindex']['arCategories']):5))); ?>
			<?php } ?>			
			<br />			
		</div>
		<?php } ?>
		
	</div>
	
	<div style="width:50%; float:right;">
	
		<?php /* Produkttemplateauswahl list/grid */ ?>
		<?php echo wpsg_drawForm_Select('wpsg_mod_productindex_template', __('Template', 'wpsg'), $this->view['wpsg_mod_productindex']['arTemplates'], get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_template', true), array('noIndex' => true)); ?>
		
		<br /> 
		
		<?php /* Standardsortierauswahl */ ?>
		<?php echo wpsg_drawForm_Select('wpsg_mod_productindex_order', __('Standardsortierung', 'wpsg'), $this->view['wpsg_mod_productindex']['arOrder'], get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_order', true)); ?>
	
		<br />
		
		<?php /* Sortierauswahl ausblenden */ ?>
		<?php echo wpsg_drawForm_Checkbox('wpsg_mod_productindex_hideOrder', __('Sortierungsauswahl ausblenden', 'wpsg'), get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_hideOrder', true)); ?>
		
		<br /> 
		
		<?php /* Ansichtswechsel ausblenden */ ?>
		<?php echo wpsg_drawForm_Checkbox('wpsg_mod_productindex_hideViewSelect', __('Ansichtenwechsel ausblenden', 'wpsg'), get_post_meta($this->view['wpsg_mod_productindex']['post_id'], 'wpsg_mod_productindex_hideViewSelect', true)); ?>
	 	 	
	</div>
		
</div> 

<script>

	/**
	 * Zeigt / Versteckt die Optionen für die Produktübersichtsseite
	 */
	function wpsg_mod_productindex_activate() {

		if (jQuery('#wpsg_mod_productindex_active').prop('checked')) {

			jQuery('#wpsg_mod_productindex_layer').show();

		} else {

			jQuery('#wpsg_mod_productindex_layer').hide();

		}
		
	}
	
	function wpsg_mod_productindex_switchShow() {

		var show = jQuery('#wpsg_mod_productindex_show').val();
 
		jQuery('.wpsg_mod_productindex_layershow').hide();
		jQuery('.wpsg_mod_productindex_layer_' + show).show();
		
	}
	
	jQuery(document).ready(function() {

		jQuery('#wpsg_mod_productindex_active').bind('change', function() { wpsg_mod_productindex_activate(); } );
		jQuery('#wpsg_mod_productindex_show').bind('change', function() { wpsg_mod_productindex_switchShow(); } );
		
		wpsg_mod_productindex_activate();		
		wpsg_mod_productindex_switchShow();

	} );
	
</script>