Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 5485)
+++ /mods/wpsg_mod_basic.class.php	(revision 5488)
@@ -38,4 +38,5 @@
 			97	 	=> 'wpsg_mod_scaleprice', // Vor Varianten
 			98 		=> 'wpsg_mod_varianten', // Vor Rabatt (100 nicht vergeben = Core)
+			99 		=> 'wpsg_mod_productvariants', 
 			101     => 'wpsg_mod_downloadplus',	// 100 = Core reserviert	
 			105 	=> 'wpsg_mod_basketteaser',
@@ -355,4 +356,7 @@
 		public function settings_edit() { }
 		
+		/** Wird vom Backend aufgerufen wenn die Einstellungen bearbeitet werden (Nach dem Formular) */
+		public function settings_edit_afterform() { }
+		
 		/** Wird vom Backend aufgerufen wenn die Einstellungen gespeichert werden sollen */
 		public function settings_save() { }
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 5488)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 5488)
@@ -0,0 +1,512 @@
+<?php
+
+	/**
+	 * Modulklasse "Produktvarianten"
+	 * @author Daschmi (27.04.2016)
+	 */
+	class wpsg_mod_productvariants extends wpsg_mod_basic
+	{
+		
+		var $lizenz = 1;
+		var $id = 99;
+		
+		const TYPE_SELECT = 0;
+		const TYPE_RADIO = 1;
+		const TYPE_IMAGE = 2;
+		
+		/**
+		 * Costructor
+		 */
+		public function __construct()
+		{
+				
+			parent::__construct();
+				
+			$this->name = __('Produktvarianten', 'wpsg');
+			$this->group = __('Produkte', 'wpsg');
+			$this->desc = __('ErmÃ¶glicht es zentral Varianten anzulegen und diese im Produkt zu aktivieren.', 'wpsg');
+			
+			define('WPSG_TBL_VARIANTS', $this->shop->prefix.'wpsg_variants');
+			define('WPSG_TBL_VARIANTS_VARI', $this->shop->prefix.'wpsg_variants_vari');
+			define('WPSG_TBL_PRODUCTS_VARIANT', $this->shop->prefix.'wpsg_products_variant');
+			define('WPSG_TBL_PRODUCTS_VARIATION', $this->shop->prefix.'wpsg_products_variation');
+						
+		} // public function __construct()
+		 
+		public function install()
+		{
+				
+			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
+		 
+			$sql = "CREATE TABLE ".WPSG_TBL_VARIANTS." (
+				id int(11) NOT NULL AUTO_INCREMENT,
+				name varchar(255) NOT NULL,					
+				product_id int(11) NOT NULL,
+				deleted int(1) NOT NULL,
+				pos int(11) NOT NULL,
+				type int(11) NOT NULL,
+				PRIMARY KEY  (id),
+				KEY product_id (product_id)
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+				
+			dbDelta($sql);
+			
+			$sql = "CREATE TABLE ".WPSG_TBL_VARIANTS_VARI." (
+				id int(11) NOT NULL AUTO_INCREMENT,
+				variant_id int(11) NOT NULL,
+				name varchar(255) NOT NULL,
+				
+				anr varchar(255) NOT NULL,
+				price double(10,2) NOT NULL,
+				stock int(11) NOT NULL,
+				images text NOT NULL,
+				
+				deleted int(1) NOT NULL,
+				pos int(11) NOT NULL,
+				PRIMARY KEY  (id)
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+			
+			dbDelta($sql);
+			
+			$sql = "CREATE TABLE ".WPSG_TBL_PRODUCTS_VARIANT." (
+				id int(11) NOT NULL AUTO_INCREMENT,
+				variant_id int(11) NOT NULL,
+				product_id int(11) NOT NULL,
+			
+				pos int(11) NOT NULL,
+			
+				PRIMARY KEY  (id),
+				KEY product_id (product_id),
+				KEY variant_id (variant_id)
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+				
+			dbDelta($sql);
+							
+			$sql = "CREATE TABLE ".WPSG_TBL_PRODUCTS_VARIATION." (
+				id int(11) NOT NULL AUTO_INCREMENT,
+				variation_id int(11) NOT NULL,
+				product_id int(11) NOT NULL,
+				
+				active int(1) NOT NULL,
+				anr varchar(255) NOT NULL,
+				price double(10,2) NOT NULL,
+				stock int(11) NOT NULL,
+				images text NOT NULL, 
+									
+				PRIMARY KEY  (id),
+				KEY product_id (product_id),
+				KEY variation_id (variation_id)
+			) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;";
+			
+			dbDelta($sql);
+			
+		} // public function install()
+		
+		public function settings_edit_afterform()
+		{
+			
+			$this->shop->view['wpsg_mod_productvariants']['html'] = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productvariants/admin_html.phtml', false);
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productvariants/settings_edit.phtml');
+			
+		} // public function settings_edit_afterform()
+		 
+		public function be_ajax() 
+		{ 
+			
+			$action = $_REQUEST['subaction'].'Action';
+			
+			$this->$action();
+			
+		} // public function be_ajax()
+		
+		public function product_addedit_content(&$product_content, &$product_data)
+		{
+				
+			// Wenn eine Ãbersetzung bearbeitet wird, dann nichts machen
+			if (isset($_REQUEST['wpsg_lang'])) return;
+		
+			if (wpsg_isSizedInt($product_data['id']))
+			{
+					
+				$this->shop->view['wpsg_mod_productvariants']['html'] = $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productvariants/admin_html.phtml', false);
+					
+			}
+				
+			$product_content['wpsg_mod_productvariants'] = array(
+				'title' => __('Produktvarianten', 'wpsg'),
+				'content' => $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productvariants/produkt_addedit_content.phtml', false)
+			);
+				
+		} // public function product_addedit_content(&$product_content, &$produkt_data)
+		
+		/* Modulfunktionen */ 
+		
+		private function admin_showAction()
+		{
+			 
+			$this->shop->view['product_id'] = $_REQUEST['product_id'];
+			$this->shop->view['arVariants'] = $this->getVariants($_REQUEST['product_id'], true);
+			
+			die($this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productvariants/admin_show.phtml'));
+			
+		} // private function showAction()
+		
+		private function admin_addAction()
+		{
+									
+			$this->db->ImportQuery(WPSG_TBL_VARIANTS, array(
+				'name' => wpsg_q(__('Unbenannt', 'wpsg')),
+				'product_id' => wpsg_q($_REQUEST['product_id']),
+				'deleted' => '0',
+				'pos' => '5000'
+			));
+			
+			$this->admin_showAction();
+			
+		} // private function admin_addAction()
+		
+		private function admin_editAction()
+		{
+			
+			$this->shop->view['product_id'] = wpsg_getStr($_REQUEST['product_id'], '0');
+			$this->shop->view['variant'] = $this->getVariant($_REQUEST['variant_id']);
+			$this->shop->view['arVariation'] = $this->getVariationOfVariant($_REQUEST['variant_id'], $_REQUEST['product_id']);
+			
+			die($this->shop->render(WPSG_PATH_VIEW.'/mods/mod_productvariants/admin_edit.phtml'));
+			
+		} // private function admin_editAction()
+		
+		private function admin_variation_addAction()
+		{
+			
+			$variation_id = $this->db->ImportQuery(WPSG_TBL_VARIANTS_VARI, array(
+				'variant_id' => wpsg_q($_REQUEST['variant_id']),
+				'name' => __('Unbenannt', 'wpsg'),
+				'deleted' => '0'
+			));
+			
+			if (wpsg_isSizedInt($_REQUEST['product_id']))
+			{
+				
+				$this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIATION, array(
+					'variation_id' => wpsg_q($variation_id),
+					'product_id' => wpsg_q($_REQUEST['product_id'])
+				));
+				
+			}
+			
+			$this->admin_editAction();
+			
+		} // private function admin_variation_addAction()
+		
+		private function admin_delAction()
+		{
+			
+			$this->db->UpdateQuery(WPSG_TBL_VARIANTS, array(
+				'deleted' => '1'
+			), " `id` = '".wpsg_q($_REQUEST['variant_id'])."' ");
+			
+			$this->admin_showAction();
+			
+		} // private function admin_delAction()
+		
+		private function admin_variation_delAction()
+		{
+			
+			$this->db->UpdateQuery(WPSG_TBL_VARIANTS_VARI, array(
+				'deleted' => '1'
+			), " `id` = '".wpsg_q($_REQUEST['variation_id'])."' ");
+				
+			$this->admin_editAction();
+			
+		} // private function admin_variation_delAction()
+		
+		private function setProductVariant($product_id, $variant_id, $field, $value)
+		{
+			
+			if (!wpsg_isSizedInt($product_id) || !wpsg_isSizedInt($variant_id)) die("Systemfehler");
+				
+			$id_exist = $this->db->fetchOne("
+				SELECT
+					`id`
+				FROM
+					`".WPSG_TBL_PRODUCTS_VARIANT."`
+				WHERE
+					`variant_id` = '".wpsg_q($variant_id)."' AND
+					`product_id` = '".wpsg_q($product_id)."'
+			");
+				
+			$data = array(
+				$field => wpsg_q($value),
+				'product_id' => wpsg_q($product_id),
+				'variant_id' => wpsg_q($variant_id)
+			);
+				
+			if (wpsg_isSizedInt($id_exist)) $this->db->UpdateQuery(WPSG_TBL_PRODUCTS_VARIANT, $data, " `id` = '".wpsg_q($id_exist)."' ");
+			else $this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIANT, $data);
+			
+		} // private function setProductVariant($product_id, $variant_id, $field, $value)
+		
+		private function setProductVariation($product_id, $variation_id, $field, $value)
+		{
+			
+			if (!wpsg_isSizedInt($product_id) || !wpsg_isSizedInt($variation_id)) die("Systemfehler");
+			
+			$id_exist = $this->db->fetchOne("
+				SELECT 
+					`id` 
+				FROM 
+					`".WPSG_TBL_PRODUCTS_VARIATION."` 
+				WHERE 
+					`variation_id` = '".wpsg_q($variation_id)."' AND
+					`product_id` = '".wpsg_q($product_id)."' 
+			");
+			
+			$data = array(
+				$field => wpsg_q($value),
+				'product_id' => wpsg_q($product_id),
+				'variation_id' => wpsg_q($variation_id)
+			);
+			
+			if (wpsg_isSizedInt($id_exist)) $this->db->UpdateQuery(WPSG_TBL_PRODUCTS_VARIATION, $data, " `id` = '".wpsg_q($id_exist)."' ");
+			else $this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIATION, $data);
+			
+		} // private function setProductVariation($product_id, $field, $value)
+		
+		private function admin_inlineEditAction()
+		{
+			
+			if (wpsg_isSizedString($_REQUEST['field'], 'name'))
+			{
+				
+				$this->db->UpdateQuery(WPSG_TBL_VARIANTS, array('name' => wpsg_q($_REQUEST['value'])), " `id` = '".wpsg_q($_REQUEST['field_id'])."' ");
+				
+			}
+			else if (wpsg_isSizedString($_REQUEST['field'], 'pos'))
+			{
+							
+				$i = 0; foreach ($_REQUEST['value'] as $var)
+				{
+						
+					$var_id = substr($var, 4);
+						
+					if (wpsg_isSizedInt($_REQUEST['product_id'])) $this->setProductVariant($_REQUEST['product_id'], $var_id, 'pos', $i);
+					else $this->db->UpdateQuery(WPSG_TBL_VARIANTS, array('pos' => wpsg_q($i)), " `id` = '".wpsg_q($var_id)."' ");
+						
+					$i ++;
+					
+				}
+			 
+				die('1');
+				
+			}			
+			else if (wpsg_isSizedString($_REQUEST['field'], 'vari_name'))
+			{
+				
+				$this->db->UpdateQuery(WPSG_TBL_VARIANTS_VARI, array('name' => wpsg_q($_REQUEST['value'])), " `id` = '".wpsg_q($_REQUEST['field_id'])."' ");
+				
+			}			
+			else if (wpsg_isSizedString($_REQUEST['field'], 'vari_pos'))
+			{
+					
+				$i = 0; foreach ($_REQUEST['value'] as $vari)
+				{
+			
+					$vari_id = substr($vari, 5);
+			
+					$this->db->UpdateQuery(WPSG_TBL_VARIANTS_VARI, array('pos' => wpsg_q($i)), " `id` = '".wpsg_q($vari_id)."' ");
+			
+					$i ++;
+						
+				}
+			
+				die('1');
+			
+			}
+			else if (preg_match('/vari_(.*)/', $_REQUEST['field']))
+			{
+			
+				$this->setProductVariation($_REQUEST['product_id'], $_REQUEST['field_id'], substr($_REQUEST['field'], 5), $_REQUEST['value']);
+			
+			}
+						
+			// TODO: Ãbersetzung	
+			
+			die($_REQUEST['value']);
+			
+		} // private function admin_inlineEditAction()
+		   
+		/**
+		 * Gibt die Variationen einer Variante zurÃŒck
+		 * @param Integer $variant_id ID der Variante
+		 */
+		public function getVariationOfVariant($variant_id, $product_id = false)
+		{
+		
+			$strQuerySELECT = "";
+			$strQueryJOIN = "";
+						
+			if (wpsg_isSizedInt($product_id))
+			{
+				
+				$strQueryJOIN .= " LEFT JOIN `".WPSG_TBL_PRODUCTS_VARIATION."` AS PV ON (PV.`variation_id` = VI.`id` AND PV.`product_id` = '".wpsg_q($product_id)."') ";
+				$strQuerySELECT .= " , PV.`active`, PV.`anr`, PV.`price`, PV.`stock`, PV.`images` ";
+								
+			}
+			
+			$arVari = $this->db->fetchAssoc("
+				SELECT
+					VI.`id`, VI.`name`, VI.`deleted`, VI.`pos`
+					".$strQuerySELECT."
+				FROM
+					`".WPSG_TBL_VARIANTS_VARI."` AS VI
+						".$strQueryJOIN."
+				WHERE
+					VI.`variant_id` = '".wpsg_q($variant_id)."' AND
+					VI.`deleted` != '1'
+				ORDER BY
+					VI.`pos`
+			");
+			
+			// TODO: Ãbersetzung
+			
+			return $arVari;
+			
+		} // public function getVariationOfVariant($variant_id)
+						
+		/**
+		 * Gibt eine einzelne Variante zurÃŒck
+		 * @param unknown $variant_id
+		 */
+		public function getVariant($variant_id)
+		{
+			
+			$arVariant = $this->db->fetchRow("
+				SELECT
+					V.*
+				FROM
+					`".WPSG_TBL_VARIANTS."` AS V
+				WHERE
+					V.`id` = '".wpsg_q($variant_id)."' 
+			");
+			
+			// TODO: Ãbersetzung
+			
+			return $arVariant;
+			
+		} // public function getVariant($variant_id)
+		
+		public function getVariation($variation_id)
+		{
+			
+			$arVariation = $this->db->fetchRow("
+				SELECT
+					VI.*
+				FROM
+					`".WPSG_TBL_VARIANTS_VARI."` AS VI
+				WHERE
+					VI.`id` = '".wpsg_q($variant_id)."'					
+			");
+			
+			$arVariation['images'] = wpsg_trim(explode(',', $arVariation['images']));
+			
+			// TODO: Ãbersetzung
+			
+			return $arVariation;
+			
+		} // public function getVariation($variation_id)
+		
+		/**
+		 * Gibt einen Array der Produktvarianten zurÃŒck
+		 * @param Integer|Boolean $product_id Produkt ID
+		 * @param Boolean $global Globale Varianten? 
+		 */
+		public function getVariants($product_id = false, $global = true)
+		{
+			
+			$strQuerySELECT = "";
+			$strQueryORDER = "";
+			$strQueryJOIN = "";
+			$strProductQuery = " AND ( 0 ";
+			
+			if (wpsg_isSizedInt($product_id)) 
+			{
+				
+				$strProductQuery .= " OR V.`product_id` = '".wpsg_q($product_id)."' ";
+				
+				$strQuerySELECT .= ", (
+					SELECT 
+						COUNT(*) 
+					FROM 
+						`".WPSG_TBL_VARIANTS_VARI."` AS VI 
+							LEFT JOIN `".WPSG_TBL_PRODUCTS_VARIATION."` AS PVI ON (PVI.`variation_id` = VI.`id`)
+					WHERE 
+						PVI.`product_id` = '".wpsg_q($product_id)."' AND
+						PVI.`active` = '1' AND
+						VI.`variant_id` = V.`id` AND 
+						VI.`deleted` != '1'
+				) AS `count_active` ";
+				
+				$strQueryJOIN = " LEFT JOIN `".WPSG_TBL_PRODUCTS_VARIANT."` AS PV ON (PV.`variant_id` = V.`id` AND PV.`product_id` = '".wpsg_q($product_id)."') ";
+				
+				$strQueryORDER .= " PV.`pos` ASC, ";
+				
+			}
+			else
+			{
+				
+				$strQuerySELECT .= ", '0' AS `count_active` ";
+				
+			}
+			
+			if ($global === true) 
+			{
+				
+				$strProductQuery .= " OR V.`product_id` = '0' ";
+				
+			}
+			
+			$strProductQuery .= " ) ";			
+					
+			$arData = $this->db->fetchAssoc("
+				SELECT 
+					V.*,
+					(SELECT COUNT(*) FROM `".WPSG_TBL_VARIANTS_VARI."` AS VI WHERE VI.`variant_id` = V.`id` AND VI.`deleted` != '1') AS `count_variation`,
+					(
+						SELECT 
+							COUNT(DISTINCT `product_id`)
+						FROM						 
+							`".WPSG_TBL_VARIANTS_VARI."` AS VI
+								LEFT JOIN `".WPSG_TBL_PRODUCTS_VARIATION."` AS PVI ON (PVI.`variation_id` = VI.`id`)		
+								LEFT JOIN `".WPSG_TBL_PRODUCTS."` AS P ON (PVI.`product_id` = P.`id`)
+						WHERE
+							VI.`variant_id` = V.`id` AND							
+							PVI.`active` = '1' AND
+							P.`id` > 0 AND
+							P.`deleted` != '1'
+					) AS `count_produkte`
+					".$strQuerySELECT."
+				FROM
+					`".WPSG_TBL_VARIANTS."` AS V
+						".$strQueryJOIN."
+				WHERE
+					V.`deleted` != '1' 
+					".$strProductQuery."
+				GROUP BY
+					V.`id`
+				ORDER BY
+					".$strQueryORDER."
+					V.`product_id` ASC, V.`pos`
+			");
+			
+			// TODO: Ãbersetzung
+			// TODO: Sortierung aus Produkt
+			
+			return $arData;
+			
+		} // public function getVariants()
+		 
+	} // class wpsg_mod_productvariants extends wpsg_mod_basic
+
+?>
Index: /views/admin/kundendaten_tab2.phtml
===================================================================
--- /views/admin/kundendaten_tab2.phtml	(revision 5485)
+++ /views/admin/kundendaten_tab2.phtml	(revision 5488)
@@ -46,5 +46,5 @@
 				<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Kundenvariable lÃ¶schen', 'wpsg'); ?>" onclick="return wpsg_removeCustomField(<?php echo $c_id; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
 				
-				<script type="text/javascript">
+				<script type="text/javascript">/* <![CDATA[ */
 
 					jQuery('#kundenvariable_name_<?php echo $c_id; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten&do=inlinedit&noheader=1', {
@@ -60,5 +60,5 @@
 	
 	
-				</script>
+					/* ]]> */</script>
 					
 			</td>
Index: /views/admin/module.phtml
===================================================================
--- /views/admin/module.phtml	(revision 5485)
+++ /views/admin/module.phtml	(revision 5488)
@@ -38,12 +38,12 @@
 	<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>
+		<!-- <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>
+		</h3> -->
 		
-		<p><?php echo $this->arAllModule[$_REQUEST['modul']]->desc; ?></p>
+		<p><?php echo $this->arAllModule[$_REQUEST['modul']]->desc; ?></p><br />
 		
 		<?php $modul_install = $this->get_option($_REQUEST['modul'], $this->view['global']); ?>
@@ -95,4 +95,9 @@
 	</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>
Index: /views/css/admin.css
===================================================================
--- /views/css/admin.css	(revision 5485)
+++ /views/css/admin.css	(revision 5488)
@@ -31,4 +31,5 @@
 #wpsg-bs .wpsg_admin_submenu .list-group-item.active { color:#FFFFFF; }
 #wpsg-bs .list-group-head a { color:#FFFFFF; }
+#wpsg-bs .modal-dialog { width:70%; }
 
 /* Inline Edit */
@@ -84,5 +85,5 @@
 .wpsg_admin_content { padding-left:20px; width:800px; float:left; }
 .wpsg_admin_content h3 { margin:20px; }
-.wpsg_admin_content h3.panel-title { margin-bottom:0px; }
+.wpsg_admin_content h3.panel-title { margin:0px; }
 .wpsg_admin_submenu .list-group-item { padding:5px 10px; }
 .list-group { margin-bottom:15px !important; }
@@ -128,3 +129,17 @@
 #wpsg_produktattribute .wpsg_form_field { padding:10px 0; }
 
+/* Modul Produktvarianten */
+.wpsg_mod_productvariants_table_variants .col_action { text-align:right; width:60px; }
+.wpsg_mod_productvariants_table_variants .col_products { text-align:center; width:75px; }
+.wpsg_mod_productvariants_table_variants .col_vari { width:75px; text-align:center; }
+.wpsg_mod_productvariants_table_variants .col_id { width:50px; }
+.wpsg_mod_productvariants_table_variation .col_action { text-align:right; width:75px; }
+.wpsg_mod_productvariants_table_variation tbody:nth-child(even) td { background-color:#F9F9F9; }
+.wpsg_mod_productvariants_table_variation .col_id { width:50px; }
+.wpsg_mod_productvariants_table_variation .col_active { width:25px; }
+.wpsg_mod_productvariants_info { font-style:italic; font-size:0.9em; }
+.wpsg_mod_productvariants_dialog_noDialog { border:1px solid #DDDDDD; padding:5px; margin:-5px; margin-top:15px; margin-bottom:15px; }
+.wpsg_mod_productvariants_dialog_noDialog .modal-body { padding:1rem 0px; }
+.wpsg_mod_productvariants_dialog_noDialog .modal-footer { padding:1rem 0px; }
+
 #beschreibung_ifr { height:500px; }
Index: /views/js/admin.js
===================================================================
--- /views/js/admin.js	(revision 5485)
+++ /views/js/admin.js	(revision 5488)
@@ -19,4 +19,10 @@
 		
 		ui.children().each(function() {
+			
+			jQuery(this).find('td').each(function() {
+				
+				jQuery(this).width(jQuery(this).width());
+				
+			} );
 			
 			jQuery(this).width(jQuery(this).width());
Index: /views/js/editable.js
===================================================================
--- /views/js/editable.js	(revision 5485)
+++ /views/js/editable.js	(revision 5488)
@@ -21,5 +21,10 @@
 				    if(jQuery.trim(value) == '') { return wpsg_ajax.ie_validate_empty; }
 				    
-				}
+				},
+				'display': function(value, sourceData) {
+			        
+					jQuery(this).html(sourceData);
+					
+			    }
 			} );
 			
Index: /views/mods/mod_productgroups/produkt_addedit_sidebar.phtml
===================================================================
--- /views/mods/mod_productgroups/produkt_addedit_sidebar.phtml	(revision 5485)
+++ /views/mods/mod_productgroups/produkt_addedit_sidebar.phtml	(revision 5488)
@@ -23,7 +23,8 @@
 		
 		<br /><br />
-		<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;page=wpsg-Productgroups"><?php echo __('Produktgruppenverwaltung', 'wpsg'); ?></a>
-		<br /><br />	
+		
+		<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;page=wpsg-Productgroups"><span class="wpsg-glyphicon glyphicon glyphicon-book"></span><?php echo __('Produktgruppenverwaltung', 'wpsg'); ?></a><br />
 		<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productgroups"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktgruppe', 'wpsg'); ?></a>
+		
 	</div>
 </div>
Index: /views/mods/mod_productvariants/admin_edit.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_edit.phtml	(revision 5488)
+++ /views/mods/mod_productvariants/admin_edit.phtml	(revision 5488)
@@ -0,0 +1,172 @@
+<?php
+
+	/**
+	 * Template um eine Variante zu bearbeiten
+	 */
+
+?>
+
+<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
+<input type="hidden" id="wpsg_mod_productvariants_var_id" value="<?php echo $this->view['variant']['id']; ?>" />
+
+<?php if (wpsg_isSizedArray($this->view['arVariation'])) { ?>
+
+	<table class="table wpsg_mod_productvariants_table_variation">
+    	<thead>
+      		<tr>
+      		
+      			<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+      			<th class="col_active"></th>
+      			<?php } ?>
+      		
+      			<th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
+        		<th class="col1"><?php echo __('Name', 'wpsg'); ?></th> 
+        		
+        		<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+        		<th class="col_artnr"><?php echo __('Artikelnummer', 'wpsg'); ?></th>
+        		<th class="col_price"><?php echo __('Preis', 'wpsg'); ?></th>
+        		<th class="col_stock"><?php echo __('Lagerbestand', 'wpsg'); ?></th>
+        		<?php } else { ?>
+        		<th class="col_action"></th>
+        		<?php } ?>
+        		
+      		</tr>
+    	</thead>    	
+    	<?php $i = 0; foreach ($this->view['arVariation'] as $vari) { $i ++; ?>
+    	<tbody id="vari_<?php echo $vari['id']; ?>">
+    		<tr>    		
+    		
+    			<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+    			<td class="col_active">
+    				<input type="checkbox" id="productvariation_active_<?php echo $vari['id']; ?>" name="active" value="1" <?php echo ((wpsg_isSizedString($vari['active'], '1'))?'checked="checked"':''); ?> />
+    			</td>
+    			<?php } ?>
+    		
+    			<td class="col_id">
+    				<?php echo $vari['id']; ?>
+    				<script type="text/javascript">/* <![CDATA[ */
+
+    					<?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+						jQuery('#productvariation_name_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+							submitdata: { 
+					    		field: 'vari_name',
+					    		field_id: '<?php echo $vari['id']; ?>'
+							}
+						});		
+						<?php } else { ?>
+
+						jQuery('#productvariation_active_<?php echo $vari['id']; ?>').bind('change', function() {
+
+							var value = '0';
+							if (jQuery(this).prop('checked') === true) value = '1';
+							
+							jQuery.ajax( {
+								url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+								data: {
+									field: 'vari_active',
+									field_id: '<?php echo $vari['id']; ?>',
+									product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+									value: value
+								}
+							} );
+							
+						} );
+						
+						jQuery('#productvariation_anr_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+							submitdata: { 
+					    		field: 'vari_anr',
+					    		product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+					    		field_id: '<?php echo $vari['id']; ?>'
+							}
+						});		
+
+						jQuery('#productvariation_price_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+							submitdata: { 
+					    		field: 'vari_price',
+					    		product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+					    		field_id: '<?php echo $vari['id']; ?>'
+							}
+						});		
+
+						jQuery('#productvariation_stock_<?php echo $vari['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+							submitdata: { 
+					    		field: 'vari_stock',
+					    		product_id: jQuery('#wpsg_mod_productvariants_product_id').val(),
+					    		field_id: '<?php echo $vari['id']; ?>'
+							}
+						});
+						<?php } ?>		
+		
+					/* ]]> */</script>	
+    			</td>
+    			<td class="col1"><span class="wpsg_editable" id="productvariation_name_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['name']); ?></span></td>
+    			
+    			<?php if (wpsg_isSizedInt($this->view['product_id'])) { ?>
+    			<td class="col_artnr"><span class="wpsg_editable" id="productvariation_anr_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['anr']); ?></span></td>    			
+    			<td class="col_price"><span class="wpsg_editable" id="productvariation_price_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc(wpsg_ff($vari['price'], $this->get_option('wpsg_currency'))); ?></span></td>
+    			<td class="col_stock"><span class="wpsg_editable" id="productvariation_stock_<?php echo $vari['id']; ?>"><?php echo wpsg_hspc($vari['stock']); ?></span></td>
+    			<?php } else { ?>    			 
+    			<td class="col_action">
+    			    			
+    				<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variation lÃ¶schen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariation_del(<?php echo $vari['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+    				
+    			</td>    
+    			<?php } ?>			
+    			
+    		</tr>
+    		
+    		<?php /* ?>
+    		<tr>
+    			<td class="col_id">&nbsp;</td>
+    			<td class="col_image" colspan="5">
+    				TODO: Bilder
+    			</td>
+    		</tr>
+    		*/ ?>
+    	</tbody>
+    	<?php } ?>    	
+    	    	
+    </table>
+
+	<script type="text/javascript">/* <![CDATA[ */
+
+		<?php if (!wpsg_isSizedInt($this->view['product_id']) || wpsg_isSizedInt($this->view['variant']['product_id'])) { ?>
+
+		jQuery('.wpsg_mod_productvariants_table_variation').sortable( {
+			items: 'tbody',
+			helper: wpsg_Tablefix,  
+			update: function(event, ui) {
+ 
+				var wpsg_reorder = jQuery(this).sortable('toArray');
+				var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+	
+				jQuery.ajax( {
+					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+					data: {
+						'field': 'vari_pos',
+						'value': jQuery(this).sortable('toArray'),
+						'product_id': product_id
+					},
+					success: function(data) { }
+				} ); 
+																			 
+			}			
+		} ).disableSelection();
+		
+		<?php } ?>
+
+		<?php if (wpsg_isSizedInt($this->view['variant']['product_id']) || !wpsg_isSizedInt($this->view['product_id'])) { ?>
+		jQuery('#wpsg_mod_productvariants_variation_add_button').show();
+		<?php } else { ?>
+		jQuery('#wpsg_mod_productvariants_variation_add_button').hide();
+		<?php } ?>	
+			
+	/* ]]> */</script> 
+    
+    <?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+    <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verÃ€ndert werden.', 'wpsg'); ?></p>
+    <?php } ?>
+
+<?php } else { ?>
+<?php echo __('Bisher keine Variationen der Variante angelegt.', 'wpsg'); ?>
+<?php } ?>
Index: /views/mods/mod_productvariants/admin_html.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_html.phtml	(revision 5488)
+++ /views/mods/mod_productvariants/admin_html.phtml	(revision 5488)
@@ -0,0 +1,226 @@
+<?php
+
+	/**
+	 * HTML Teil fÃŒr die Produktvariablenverwaltung
+	 * (GLOBAL und Produktbezogen)
+	 */
+
+?>
+
+<div id="wpsg_mod_productvariants_dialog" class="wpsg_mod_productvariants_dialog_noDialog">
+            
+      <div class="modal-body">
+        
+      </div>
+      <div class="modal-footer">
+      
+      	<button type="button" class="btn-sm wpsg_mod_productvariants_variants btn btn-default" onclick="return wpsg_mod_productvariants_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Produktvariante', 'wpsg'); ?></button> 
+                 
+        <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" id="wpsg_mod_productvariants_variation_add_button" style="display:none;" onclick="return wpsg_mod_productvariants_variation_add();"><span class="glyphicon glyphicon-plus"></span>&nbsp;<?php echo __('Neue Variation', 'wpsg'); ?></button>
+        <button type="button" class="btn-sm wpsg_mod_productvariants_variants_vari btn btn-default" style="display:none;" onclick="return wpsg_mod_productvariants_back();"><span class="glyphicon glyphicon-chevron-left"></span>&nbsp;<?php echo __('ZurÃŒck', 'wpsg'); ?></button>
+      </div>
+      
+</div>
+ 
+<script type="text/javascript">/* <![CDATA[ */
+
+	function wpsg_mod_productvariants_del(variant_id)
+	{
+
+		if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie die Variante lÃ¶schen mÃ¶chten?', 'wpsg'); ?>')) return false;
+
+		var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+		
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_del',
+				'variant_id': variant_id,
+				'product_id': product_id
+			},
+			success: function(data) { 
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+
+			}
+    	} ); 
+		   
+        return false;
+		
+	} // function wpsg_mod_productvariants_del(variant_id)
+
+	function wpsg_mod_productvariation_del(variation_id)
+	{
+
+		if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie die Variation lÃ¶schen mÃ¶chten?', 'wpsg'); ?>')) return false;
+
+		var vari_id = jQuery('#wpsg_mod_productvariants_var_id').val();
+		
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_variation_del',
+				'variation_id': variation_id,
+				'variant_id': vari_id
+			},
+			success: function(data) { 
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+
+			}
+    	} ); 
+		   
+        return false;
+		
+	} // function wpsg_mod_productvariation_del(variation_id)
+	
+	function wpsg_mod_productvariants_edit(variant_id)
+	{
+
+		var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+		 
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_edit',
+				'variant_id': variant_id,
+				'product_id': product_id
+			},
+			success: function(data) { 
+
+				jQuery('.wpsg_mod_productvariants_variants').hide();
+				jQuery('.wpsg_mod_productvariants_variants_vari').show();
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+
+			}
+    	} ); 
+		   
+        return false;
+		
+	} // function wpsg_mod_productvariants_edit(variant_id)
+
+	function wpsg_mod_productvariants_variation_add()
+	{
+
+		var variant_id = jQuery('#wpsg_mod_productvariants_var_id').val();
+		var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+		
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_variation_add',
+				'variant_id': variant_id,
+				'product_id': product_id
+			},
+			success: function(data) { 
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+
+			}
+    	} ); 
+		   
+        return false;
+		
+	} // function wpsg_mod_productvariants_variation_add()
+	
+	function wpsg_mod_productvariants_add()
+	{
+
+		var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+		
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_add',
+				'product_id': product_id
+			},
+			success: function(data) { 
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);				
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+
+			}
+    	} ); 
+		   
+        return false;
+		
+	} // function wpsg_mod_productvariants_add()
+	
+	function wpsg_mod_productvariants_back()
+	{
+
+		var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+		
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);		
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_show',
+				'product_id': product_id
+			},
+			success: function(data) { 
+
+				jQuery('.wpsg_mod_productvariants_variants').show();
+				jQuery('.wpsg_mod_productvariants_variants_vari').hide();
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false);
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data); 
+
+			}
+    	} ); 
+		
+		return false;
+		
+	} // function wpsg_mod_productvariants_back()
+	
+	function wpsg_mod_productvariants_show(product_id)
+	{
+
+		jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', true);
+		jQuery('#wpsg_mod_productvariants_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+		 
+		jQuery.ajax( {
+			url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&noheader=1',
+			data: {  
+				'subaction': 'admin_show',
+				'product_id': product_id
+			},
+			success: function(data) { 
+
+				jQuery('.wpsg_mod_productvariants_variants').show();
+				jQuery('.wpsg_mod_productvariants_variants_vari').hide();
+				
+				jQuery('#wpsg_mod_productvariants_dialog .modal-body').html(data);
+				jQuery('#wpsg_mod_productvariants_dialog button').prop('disabled', false); 
+
+			}
+    	} ); 
+		 
+		return false;
+		
+	} // function wpsg_mod_productvariants_show()
+
+/* ]]> */</script>
Index: /views/mods/mod_productvariants/admin_show.phtml
===================================================================
--- /views/mods/mod_productvariants/admin_show.phtml	(revision 5488)
+++ /views/mods/mod_productvariants/admin_show.phtml	(revision 5488)
@@ -0,0 +1,102 @@
+<?php
+
+	/**
+	 * Verwaltung der Produktvarianten im Backend
+	 */
+
+?>
+
+<input type="hidden" id="wpsg_mod_productvariants_product_id" value="<?php echo $this->view['product_id']; ?>" />
+
+<?php if (wpsg_isSizedArray($this->view['arVariants'])) { ?>
+
+	<table class="table table-striped wpsg_mod_productvariants_table_variants">
+    	<thead>
+      		<tr>
+      			<th class="col_id"><?php echo __('Id', 'wpsg'); ?></th>
+        		<th class="col1"><?php echo __('Name', 'wpsg'); ?></th>
+        		<th class="col_vari"><?php echo __('Variationen', 'wpsg'); ?></th>
+        		
+        		<?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+        		<th class="col_products"><?php echo __('Produkte', 'wpsg'); ?></th>
+        		<?php } ?>
+        		
+        		<th class="col_action"></th>
+      		</tr>
+    	</thead>
+    	<tbody>
+    		<?php foreach ($this->view['arVariants'] as $var) { ?>
+    		<tr id="var_<?php echo $var['id']; ?>">
+    			<td class="col_id"><?php echo $var['id']; ?></td>
+    			<td class="col1">
+    				<span class="wpsg_editable" id="productvariants_name_<?php echo $var['id']; ?>"><?php echo wpsg_hspc($var['name']); ?></span>
+    				<?php if (wpsg_isSizedInt($var['product_id'])) { ?>
+    				&nbsp;<span class="wpsg_mod_productvariants_info"><?php echo __('(Produktbezogen)', 'wpsg'); ?></span>
+    				<?php } ?>
+    			</td>
+    			<td class="col_vari"><?php 
+    			
+    				if (wpsg_isSizedInt($this->view['product_id'])) echo $var['count_active'].'/'.$var['count_variation'];
+    				else echo $var['count_variation']; 
+    			
+    			?></td>
+    			<?php if (!wpsg_isSizedInt($this->view['product_id'])) { ?>
+    			<td class="col_products"><?php echo wpsg_hspc($var['count_produkte']); ?></td>
+    			<?php } ?>
+    			<td class="col_action">
+    			
+    				<script type="text/javascript">/* <![CDATA[ */
+
+    					<?php if ((wpsg_isSizedInt($this->view['product_id']) && $this->view['product_id'] == $var['product_id']) || (!wpsg_isSizedInt($var['product_id']) && !wpsg_isSizedInt($this->view['product_id']))) { ?>
+						jQuery('#productvariants_name_<?php echo $var['id']; ?>').wspg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1', {
+							submitdata: { 
+					    		field: 'name',
+					    		field_id: '<?php echo $var['id']; ?>'
+							}
+						});
+						<?php } ?>		
+		
+					/* ]]> */</script>
+    			
+    				<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variante bearbeiten', 'wpsg'); ?>" onclick="return wpsg_mod_productvariants_edit(<?php echo $var['id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
+    				
+    				<?php if ((wpsg_isSizedInt($this->view['product_id']) && $this->view['product_id'] == $var['product_id']) || (!wpsg_isSizedInt($var['product_id']) && !wpsg_isSizedInt($this->view['product_id']))) { ?>    				
+    				<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Variante lÃ¶schen', 'wpsg'); ?>" onclick="return wpsg_mod_productvariants_del(<?php echo $var['id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
+					<?php } ?>
+			
+    			</td>
+    		</tr>
+    		<?php } ?>
+    	</tbody>
+    </table>
+    
+    <p class="wpsg_hinweis"><?php echo __('Reihenfolge kann mittels Drag&Drop verÃ€ndert werden.', 'wpsg'); ?></p>
+    
+    <script>/* <![CDATA[ */
+
+	    jQuery('.wpsg_mod_productvariants_table_variants tbody').sortable( {
+			items: 'tr',
+			helper: wpsg_Tablefix,  
+			update: function(event, ui) {
+
+				var wpsg_reorder = jQuery(this).sortable('toArray');
+				var product_id = jQuery('#wpsg_mod_productvariants_product_id').val();
+
+				jQuery.ajax( {
+					url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants&subaction=admin_inlineEdit&noheader=1',
+					data: {
+						'field': 'pos',
+						'product_id': product_id,
+						'value': jQuery(this).sortable('toArray')
+					},
+					success: function(data) { }
+				} );
+																			 
+			}			
+		} ).disableSelection();
+
+    /* ]]> */</script>
+
+<?php } else { ?>
+<?php echo __('Bisher keine Produktvarianten angelegt.', 'wpsg'); ?>
+<?php } ?>
Index: /views/mods/mod_productvariants/produkt_addedit_content.phtml
===================================================================
--- /views/mods/mod_productvariants/produkt_addedit_content.phtml	(revision 5488)
+++ /views/mods/mod_productvariants/produkt_addedit_content.phtml	(revision 5488)
@@ -0,0 +1,33 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Verwaltung der Produktvarianten innerhalb des Produktes
+	 */
+
+?>
+
+<?php echo wpsg_drawForm_AdminboxStart(__('Produktvarianten', 'wpsg')); ?>
+
+<?php if (wpsg_isSizedInt($this->view['data']['id'])) { ?>
+
+	<?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+
+	<script type="text/javascript">/* <![CDATA[ */
+
+		jQuery(document).ready(function() {
+
+			wpsg_mod_productvariants_show(<?php echo $this->view['data']['id']; ?>);
+			
+		} );
+
+	/* ]]> */</script>
+
+<?php } else { ?>
+
+	<?php echo __('Bitte speichern Sie das Produkt zuerst.', 'wpsg'); ?>
+			
+<?php } ?>
+
+<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_productvariants"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Produktvarianten', 'wpsg'); ?></a>
+
+<?php echo wpsg_drawForm_AdminboxEnd(); ?>
Index: /views/mods/mod_productvariants/settings_edit.phtml
===================================================================
--- /views/mods/mod_productvariants/settings_edit.phtml	(revision 5488)
+++ /views/mods/mod_productvariants/settings_edit.phtml	(revision 5488)
@@ -0,0 +1,22 @@
+<?php
+
+	/*
+	 * Template fÃŒr die Einstellungen des Moduls 
+	 */
+
+?>
+
+<h4><?php echo __('Verwaltung der globalen Produktvarianten', 'wpsg'); ?></h4>
+
+<?php echo $this->view['wpsg_mod_productvariants']['html']; ?>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+	jQuery(document).ready(function() {
+
+		wpsg_mod_productvariants_show(0);
+		
+	} );
+
+/* ]]> */</script>
+ 
