[{if $installMessage}][{$installMessage}][{elseif $result}][{$result}][{elseif $abodata}]
[{if $abodata.ppresponse}]
	<script type="text/javascript">
		var ppresonse = '[{$abodata.ppresponse}]';
		if (ppresonse == 'cancel') {
			alert('Der Zahlungsvorgang wurde abgebrochen.');
		}	
		else {
			window.opener.handleAboDataPaypalResponse('[{$abodata.ppresponse}]', '[{$abodata.module}]');
		}
		window.close();
	</script>
[{else}]
	<h1>[{$abodata.moduleEntryDataArray.title}] - Abo verwalten</h1>
	<div id="moduleAbo" class="[{$moduleEntry.aboState.status}]">
		<h5>Ihr aktuelles Abonnement</h5>
		<ul>
			<li id="moduleAboStatus">[{$abodata.moduleEntryDataArray.aboState.message}]</li>
		</ul>
		<div id="aboTest"[{if $abodata.moduleEntryDataArray.aboState.showButtonTest == false}] style="display: none;"[{/if}]>
			[{if $abodata.moduleEntryDataArray.price == 0}]
				<button id="moduleAboButtonTest" data-modulepath="[{$abodata.moduleEntryDataArray.path}]">Kostenlose Version jetzt beginnen</button>
			[{else}]
				<span>
					Mit der kostenlosen Testversion können Sie unverbindlich alle Modulfunktionen direkt in Ihrem Onlineshop testen.
					<br>
					Die Testversion läuft nach einem Monat automatisch aus und kann bei Bedarf auch verlängert werden.
				</span>
				<h4>
					Testen Sie jetzt das Modul [{$abodata.moduleEntryDataArray.title}] kostenlos und unverbindlich.
				</h4>
				<button id="moduleAboButtonTest" data-modulepath="[{$abodata.moduleEntryDataArray.path}]">Kostenlose Testversion jetzt beginnen</button>
			[{/if}]
		</div>
		<div id="aboCancel" data-modulepath="[{$abodata.moduleEntryDataArray.path}]"[{if $abodata.moduleEntryDataArray.aboState.showButtonCancel == false}] style="display: none;"[{/if}]>
			<button id="moduleAboButtonCancel">Abo beenden</button>
		</div>
		[{if $abodata.moduleEntryDataArray.price > 0}]
		<div id="aboStart" data-modulepath="[{$abodata.moduleEntryDataArray.path}]"[{if $abodata.moduleEntryDataArray.aboState.showButtonStart == false}] style="display: none;"[{/if}]>
			<h5>Ihre Abovorteile</h5>
			<ul>
				<li>Geringe monatliche Kosten ohne Risiko</li>
				<li>Sofort einsatzbereit</li>
				<li>Zukünftige Modulversionen inklusive</li>
				<li>Automatischer Mengenrabatt ab dem 2. Modul</li>
			</ul>
			<h4>
				Abonnieren Sie jetzt das Modul [{$abodata.moduleEntryDataArray.title}] für nur [{$abodata.moduleEntryDataArray.price|number_format:2:",":"."}] € pro Monat.
			</h4>
			[{if $abodata.errormessage != ""}]
				[{ $abodata.errormessage }]
			[{else}]
				<button id="moduleAboButtonStartPayment">Abo beginnen</button>
			[{/if}]
		</div>
		[{/if}]
	</div>
	<input type="hidden" value="[{$abodata.paypalUrl}]" id="aboWrapperPaypalUrl" name="aboWrapperPaypalUrl" />
	<input type="hidden" value="[{$abodata.paypalPreapprovalKey}]" id="aboWrapperPaypalPreapprovalKey" name="aboWrapperPaypalPreapprovalKey" />
[{/if}]
[{elseif $moduleId != ""}]

[{foreach from=$moduleDataArray item="moduleEntry"}]
<html>
<head>
<script type="text/javascript">
	var specialfunction = "";
</script>
</head>
<body>
<div class="container">
<div class="row mt10">
	<div class="one-half column">
		<img src="https://www.shopmodul24.de/out/azure/img/schwinkendorf-it-systeme-logo.png" title="Schwinkendorf Service GmbH" alt="Schwinkendorf Service GmbH" />
	</div>
	<div class="one-half column textright">
		<h2>Modulverwaltung</h2>	
	</div>
</div>
<div class="row">
<div class="u-full-width">

	<table class="u-full-width" id="modulesInstalled">
  	<thead>
    	<tr>
			<th class="one column"></th>
      		<th class="two columns">Modul</th>
      		<th class="five columns">Beschreibung</th>
      		<th class="one columns">Version</th>
      		<th class="one column">Lizenz</th>
      		<th class="one column">Status</th>
			<th class="one column"></th>
    	</tr>
  	</thead>
  	<tbody>
			[{if $moduleEntry.installed == 1}]
				<tr class="moduleListing" id="[{$moduleEntry.path}]">
					<td><img id="moduleConfigurationButton" style="max-width: 50px;" src="https://www.shopmodul24.de/out/azure/img/start-settings-bw.png" alt="[{$moduleEntry.title}] Konfigurieren" title="[{$moduleEntry.title}] Konfigurieren"/></td>
    				<td>[{$moduleEntry.title}]</td>
      				<td>[{$moduleEntry.shortdescription}]</td>
      				<td id="[{$moduleEntry.path}]_version_img" class="green" title="[{$moduleEntry.installedVersion}]" alt="[{$moduleEntry.installedVersion}]"></td>
      				<td id="[{$moduleEntry.path}]_status_img" class="[{$moduleEntry.aboState.status}]" title="[{$moduleEntry.aboState.message}]" alt="[{$moduleEntry.aboState.message}]"></td>
      				<td id="[{$moduleEntry.path}]_function_img" class="[{$moduleEntry.function.maincheck}]" title="[{$moduleEntry.function.maincheckmessage}]" alt="[{$moduleEntry.function.maincheckmessage}]"></td>
  					<td><img style="max-width: 50px;" src="https://www.shopmodul24.de/out/pictures/master/product/1/[{$moduleEntry.image}]" alt="[{$moduleEntry.title}]" title="[{$moduleEntry.title}]"/></td>
				</tr>
				<tr class="moduleConfiguration" id="[{$moduleEntry.path}]_configuration">
					<td colspan="7">
						<div id="sitConfigTabsMain">	

							[{foreach from=$moduleEntry.config key="tabTitle" item="configFile" name="config"}]
								<div class="sitConfigTabMain" id="moduleConfig[{$smarty.foreach.config.iteration}]" data-file="[{$configFile}]">[{$tabTitle}]</div>
							[{/foreach}]

							<div class="sitConfigTabMain" id="moduleStatus">Modulstatus</div>

							<div class="sitConfigTabContentMain" id="moduleStatusContent">

								<div id="sitConfigTabContentMainData">

    									<div id="sitConfigEntry" class="sitConfigEntry">

											<div id="moduleFunction" class="[{$moduleEntry.function.maincheck}]">
												<h5>Funktionalität</h5>
												<ul>
													[{foreach from=$moduleEntry.function.checkArray item="checkEntry"}]
														<li class="[{$checkEntry.check}]">
															[{$checkEntry.checktitle}]: [{$checkEntry.checkmessage}]
														</li>
													[{/foreach}]
												</ul>
											</div>

											<div id="moduleVersion" [{if $moduleEntry.version > $moduleEntry.installedVersion}]class="update"[{/if}]>
												<h5>Version</h5>
												<ul>
												<li>Installierte Version: [{$moduleEntry.installedVersion}]</li>
												[{if $moduleEntry.version > $moduleEntry.installedVersion}]
													<li>Es ist eine aktuellere Modulversion verfügbar ([{$moduleEntry.version}])</li>
												[{else}]
													<li>Ihre Modulversion ist auf dem aktuellen Stand</li>
												[{/if}]
												</ul>
											</div>

											<div id="moduleAbo" class="[{$moduleEntry.aboState.status}]">
												<h5>Abonnement</h5>
												<ul>
													<li id="moduleAboStatus">[{$moduleEntry.aboState.message}]</li>
												</ul>

												<button id="moduleAboButtonManage" data-modulepath="[{$moduleEntry.path}]" data-shopid="[{$oShop->oxshops__oxid->value}]">Abo verwalten</button>
											</div>

        								</div>
    							</div>

								<div id="sitConfigTabContentTabData">
									<div id="sitConfigListMain"></div>
									<div id="sitConfigListNavigation"></div>
									<div id="sitMessageMain">
										<div id="sitMessage"></div>
									</div>
									<div id="sitConfigEntryData"></div>
								</div>

							</div>

						</div>
					</td>
				</tr>
    		[{/if}]
		[{/foreach}]
  	</tbody>
	</table>
</div>
</div>
</div>
[{$sit_module_framework}]
<div id="aboWrapperClose">×</div>
<div id="aboWrapper">	
	<div id="aboData">
		
	</div>
</div>
</body>
</html>
[{else}]
<html>
<head>
<script type="text/javascript">
	var specialfunction = "";
	var specialfunctionTab = "";
</script>
</head>
<body>
<div class="container">
	<div class="row mt10">
		<div class="one-half column">
			<img src="https://www.shopmodul24.de/out/azure/img/schwinkendorf-it-systeme-logo.png" title="Schwinkendorf Service GmbH" alt="Schwinkendorf Service GmbH" />
		</div>
		<div class="one-half column textright">
			<h2>Modulverwaltung</h2>	
		</div>
	</div>
	<div class="row">
		<div class="u-full-width">

			<h3>Installiert</h3>
			<table class="u-full-width" id="modulesInstalled">
			<thead>
				<tr>
					<th class="one column"></th>
					<th class="two columns">Modul</th>
					<th class="five columns">Beschreibung</th>
					<th class="one columns">Version</th>
					<th class="one column">Lizenz</th>
					<th class="one column">Status</th>
					<th class="one column"></th>
				</tr>
			</thead>
			<tbody>
				[{foreach from=$moduleDataArray item="moduleEntry"}]
					[{if $moduleEntry.installed == 1}]
						<tr class="moduleListing" id="[{$moduleEntry.path}]">
							<td><img id="moduleConfigurationButton" style="max-width: 50px;" src="https://www.shopmodul24.de/out/azure/img/start-settings-bw.png" alt="[{$moduleEntry.title}] Konfigurieren" title="[{$moduleEntry.title}] Konfigurieren"/></td>
							<td>[{$moduleEntry.title}]</td>
							<td>[{$moduleEntry.shortdescription}]</td>
							<td id="[{$moduleEntry.path}]_version_img" class="green" title="[{$moduleEntry.installedVersion}]" alt="[{$moduleEntry.installedVersion}]"></td>
							<td id="[{$moduleEntry.path}]_status_img" class="[{$moduleEntry.aboState.status}]" title="[{$moduleEntry.aboState.message}]" alt="[{$moduleEntry.aboState.message}]"></td>
							<td id="[{$moduleEntry.path}]_function_img" class="[{$moduleEntry.function.maincheck}]" title="[{$moduleEntry.function.maincheckmessage}]" alt="[{$moduleEntry.function.maincheckmessage}]"></td>
							<td><img style="max-width: 50px;" src="https://www.shopmodul24.de/out/pictures/master/product/1/[{$moduleEntry.image}]" alt="[{$moduleEntry.title}]" title="[{$moduleEntry.title}]"/></td>
						</tr>
						<tr class="moduleConfiguration" id="[{$moduleEntry.path}]_configuration">
							<td colspan="7">
								<div id="sitConfigTabsMain">	

									[{foreach from=$moduleEntry.config key="tabTitle" item="configFile" name="config"}]
										<div class="sitConfigTabMain" id="moduleConfig[{$smarty.foreach.config.iteration}]" data-file="[{$configFile}]">[{$tabTitle}]</div>
									[{/foreach}]

									<div class="sitConfigTabMain" id="moduleStatus">Modulstatus</div>

									<div class="sitConfigTabContentMain" id="moduleStatusContent">

										<div id="sitConfigTabContentMainData">

												<div id="sitConfigEntry" class="sitConfigEntry">

													<div id="moduleFunction" class="[{$moduleEntry.function.maincheck}]">
														<h5>Funktionalität</h5>
														<ul>
															[{foreach from=$moduleEntry.function.checkArray item="checkEntry"}]
																<li class="[{$checkEntry.check}]">
																	[{$checkEntry.checktitle}]: [{$checkEntry.checkmessage}]
																</li>
															[{/foreach}]
														</ul>
													</div>

													<div id="moduleVersion" [{if $moduleEntry.version > $moduleEntry.installedVersion}]class="update"[{/if}]>
														<h5>Version</h5>
														<ul>
														<li>Installierte Version: [{$moduleEntry.installedVersion}]</li>
														[{if $moduleEntry.version > $moduleEntry.installedVersion}]
															<li>Es ist eine aktuellere Modulversion verfügbar ([{$moduleEntry.version}])</li>
														[{else}]
															<li>Ihre Modulversion ist auf dem aktuellen Stand</li>
														[{/if}]
														</ul>
													</div>

													<div id="moduleAbo" class="[{$moduleEntry.aboState.status}]">
														<h5>Abonnement</h5>
														<ul>
															<li id="moduleAboStatus">[{$moduleEntry.aboState.message}]</li>
														</ul>
														[{if $moduleEntry.price > 0}]
															<button id="moduleAboButtonManage" data-modulepath="[{$moduleEntry.path}]" data-shopid="[{$oShop->oxshops__oxid->value}]">Abo verwalten</button>
														[{/if}]
													</div>

												</div>
										</div>

										<div id="sitConfigTabContentTabData">
											<div id="sitConfigListMain"></div>
											<div id="sitConfigListNavigation"></div>
											<div id="sitMessageMain">
												<div id="sitMessage"></div>
											</div>
											<div id="sitConfigEntryData"></div>
										</div>

									</div>

								</div>
							</td>
						</tr>
					[{/if}]
				[{/foreach}]
			</tbody>
			</table>
			
			[{assign var="availableModules" value=false}]
			[{foreach from=$moduleDataArray item="moduleEntry"}]
				[{if $moduleEntry.installed == 0}]
					[{assign var="availableModules" value=true}]
				[{/if}]
			[{/foreach}]
			[{if $availableModules}]
			<h3>Verfügbar</h3>
			<table class="u-full-width" id="modulesAvailable">
				<thead>
					<tr>
						<th class="one column"></th>
						<th class="three columns">Modul</th>
						<th class="five columns">Beschreibung</th>
						<th class="two columns">Version</th>
						<th class="one column"></th>
					</tr>
				</thead>
				<tbody>
					[{foreach from=$moduleDataArray item="moduleEntry"}]
						[{if $moduleEntry.installed == 0}]
							<tr class="moduleListing" id="[{$moduleEntry.path}]">
								<td><a href="https://www.shopmodul24.de/out/media/[{$moduleEntry.filename}]" target="_blank"><img id="moduleInstallationButton_" style="max-width: 50px;" src="https://www.shopmodul24.de/out/azure/img/start-install-bw.png" alt="[{$moduleEntry.title}] Installieren" title="[{$moduleEntry.title}] Installieren"/></a></td>
					
								<td>[{$moduleEntry.title}]</td>
								<td>[{$moduleEntry.shortdescription}]</td>
								<td>[{$moduleEntry.version}]</td>
								<td><img style="max-width: 50px;" src="https://www.shopmodul24.de/out/pictures/master/product/1/[{$moduleEntry.image}]" alt="[{$moduleEntry.title}]" title="[{$moduleEntry.title}]"/></td>
							</tr>

							<tr class="moduleInstallation" id="[{$moduleEntry.path}]_installation">
								<td colspan="7"></td>
							</tr>
						[{/if}]
					[{/foreach}]
				</tbody>
			</table>
			[{/if}]
		</div>
	</div>
</div>
[{$sit_module_framework}]
<div id="aboWrapperClose">×</div>
<div id="aboWrapper">	
	<div id="aboData">
		
	</div>
</div>
</body>
</html>
[{/if}]