<?php
	
	/**
	 * Templatedatei für die Modulseite des Backend
	 * Sollte nicht angepasst werden
	 */

?>
<div class="wpsg_admin_submenu">
	
	<?php foreach ($this->view['groups'] as $group_name => $g) { ?>
	<div class="head">
		<div class="title"><?php echo $group_name; ?></div>			
		<div style="clear:both;"></div>
	</div>

	<ul>		
		<?php foreach ($g as $mod_key => $m) { ?>
		<li class="<?php echo (($this->get_option($mod_key, $this->view['global']) > 0)?'modul_akt':''); ?> <?php echo (($mod_key == $_REQUEST['modul'])?'current':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;action=module&amp;modul=<?php echo $mod_key; ?>"><?php echo $m->name; ?></a></li>
		<?php } ?>
	</ul>
	<div style="clear:both; height:10px; margin-left:0px; margin-right:8px;"></div>
	<?php } ?>
			
</div>

<?php if (isset($_REQUEST['modul'])) { ?>
<div class="wpsg_admin_content">		
	<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>
		
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">
				<?php echo __("Modul aktiviert", "wpsg"); ?>:
			</div>
			<div class="wpsg_form_right">
				<select name="aktiv">
					<option value="0"><?php echo __('Nein', 'wpsg'); ?></option>
					<option value="1" <?php echo (($this->get_option($_REQUEST['modul'], $this->view['global']) > 0)?'selected="selected"':''); ?>><?php echo __('Ja', 'wpsg'); ?></option>					
				</select>
			</div>
			<div class="wpsg_clear"></div>
		</div>
		 
		<?php if (isset($this->arAllModule[$_REQUEST['modul']]->version)) { ?>
		<?php echo wpsg_drawForm_Input('', __('Version', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->version, array('text' => true)); ?>		
		<div class="wpsg_form_field">
			<div class="wpsg_form_left">
				<?php echo __("Lizenz", "wpsg"); ?>:
			</div>
			<div class="wpsg_form_right">
				<p>
					<?php if (isset($this->arAllModule[$_REQUEST['modul']]->free) && $this->arAllModule[$_REQUEST['modul']]->free === true) { ?>
					<?php echo __('Kostenfrei', 'wpsg'); ?>
					<?php } else { ?>
					<?php if (is_array($this->arLizenz) && in_array($_REQUEST['modul'], (array)$this->arLizenz['mods'])) { ?>
					<?php echo __('Aktiviert', 'wpsg'); ?>
					<?php } else { ?>
					<?php if ($this->arAllModule[$_REQUEST['modul']]->getDemoDays() > 0) { ?>
					<?php echo wpsg_translate(__('Demo Modus noch #1# Tage verbleibend.', 'wpsg'), $this->arAllModule[$_REQUEST['modul']]->getDemoDays()); ?>
					<?php } else { ?>
					<?php echo __('Demo Modus abgelaufen.', 'wpsg'); ?>
					<?php } ?>
					<?php } ?>
					<?php } ?>
				</p>
			</div>
			<div class="wpsg_clear"></div>
		</div>		
		<?php } ?>
		
		<?php if (!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 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 } ?>
</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[ */

	jQuery(document).ready(function() {

		jQuery('.wpsg_form_help').tipTip();

	} );

/* ]]> */</script>