Index: /extensions/MyPiwiShop/admin.php
===================================================================
--- /extensions/MyPiwiShop/admin.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin.php	(revision 27568)
@@ -0,0 +1,41 @@
+<?php
+
+defined('MPS_PATH') or die('Hacking attempt!');
+ 
+global $template, $page, $conf;
+
+$page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'home';
+
+if ($page['tab'] != 'photo')
+{
+  // tabsheet
+  include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+  $tabsheet = new tabsheet();
+  $tabsheet->set_id('mps');
+  
+  $tabsheet->add('home', l10n('Welcome'), MPS_ADMIN . '-home');
+  $tabsheet->add('config', l10n('Configuration'), MPS_ADMIN . '-config');
+  $tabsheet->add('product', l10n('Products'), MPS_ADMIN . '-product');
+  $tabsheet->add('options', l10n('Options'), MPS_ADMIN . '-options');
+  $tabsheet->select($page['tab']);
+  $tabsheet->assign();
+}
+  $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+  $result 	= pwg_query($query);
+  while($row = pwg_db_fetch_assoc($result)){
+   $config = $row ;
+  }
+
+// include page
+include(MPS_PATH . 'admin/' . $page['tab'] . '.php');
+
+// template vars
+$template->assign(array(
+  'MPS_PATH'		=> MPS_PATH,
+  'MPS_ABS_PATH'	=> realpath(MPS_PATH),
+  'MPS_ADMIN'		=> MPS_ADMIN,
+  'mps_conf'		=> $config
+
+  ));  
+
+  $template->assign_var_from_handle('ADMIN_CONTENT', 'mps_content');
Index: /extensions/MyPiwiShop/admin/MyPiwiShopBatch.php
===================================================================
--- /extensions/MyPiwiShop/admin/MyPiwiShopBatch.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/MyPiwiShopBatch.php	(revision 27568)
@@ -0,0 +1,25 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+global $template, $conf;
+
+  $query='SELECT * FROM '.MPS_PRODUCT_TABLE.';';
+  $result = pwg_query($query);
+  $product = array();
+  
+  while($row = pwg_db_fetch_assoc($result)){
+  $product[]= $row;
+  }
+  
+  $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+  $result 	= pwg_query($query);
+  while($row = pwg_db_fetch_assoc($result)){
+   $config = $row ;
+  }
+
+ $template->assign(array(
+  'mps_product'	=> $product,
+  'mps_conf'	=> $config
+  ));  
+
+
Index: /extensions/MyPiwiShop/admin/MyPiwiShopBatchUnit.php
===================================================================
--- /extensions/MyPiwiShop/admin/MyPiwiShopBatchUnit.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/MyPiwiShopBatchUnit.php	(revision 27568)
@@ -0,0 +1,93 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+/*	*
+*** submit change
+**/	
+	
+if(isset($_POST['imgid']))
+	{
+	$imgid = $_POST['imgid'];
+	$imgen = array($imgid);
+	if (!isset($_POST['productcheck'])) {
+		deletThis_image_Allproduct($imgid);
+	}
+	else{	
+
+	$product_id = $_POST['productcheck'];
+	add_product_Thisimage($product_id, $imgen);
+  }
+}	
+	
+
+global $template, $conf, $page, $element_ids;
+ 
+
+ $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+  $result 	= pwg_query($query);
+  while($row = pwg_db_fetch_assoc($result)){
+   $config = $row ;
+  }
+
+  $query='
+  SELECT id
+  FROM '.IMAGES_TABLE.' 
+  WHERE id IN ('.implode(',', $element_ids).')
+  
+;';
+  $productImg = array();
+  $result = pwg_query($query);
+  while($row1 = pwg_db_fetch_assoc($result)){
+
+	$query='
+	SELECT *
+	FROM '.MPS_PROD_IMG_TABLE.' AS pit
+    JOIN '.MPS_PRODUCT_TABLE.' AS t ON t.id = pit.product_id
+	WHERE image_id = '.$row1['id'].'
+	;';
+	$re = pwg_query($query);
+	$prod = array();
+	$prodid = array();
+	$productCheck = array();
+    while($row = pwg_db_fetch_assoc($re)){
+	   $prod = array("id"			=>$row['id'],
+					 "product"		=>$row['product'],
+				     "noteAdmin"	=>$row['noteAdmin'],
+				     "price"		=>$row['price'],
+					);
+	   $productCheck[]=$prod;
+	   
+       $prodid[] = $row['id'];
+	for($i=0;$i<count($productCheck);$i++){
+	$productCheck[$i]['check'] = 'true';	
+	}
+	}
+
+	   $query = '
+	SELECT *
+	FROM '.MPS_PRODUCT_TABLE.'
+	;';
+	
+	$resu = pwg_query($query);
+	$product = array();
+	while($row2 = pwg_db_fetch_assoc($resu)){
+
+	if (!in_array($row2['id'], $prodid)) {
+	$product[]= $row2;
+	}
+	}
+	for($i=0;$i<count($product);$i++){
+	$product[$i]['check'] = 'false';	
+	}
+
+	$productimg = array_merge($productCheck, $product);
+
+	$productImg[$row1['id']] = $productimg;
+  }
+	$template->assign(array(
+	'mps_conf'		  => $config,
+	'mps_productcheck' => $productImg,
+	));
+
+
+	
+	
Index: /extensions/MyPiwiShop/admin/config.php
===================================================================
--- /extensions/MyPiwiShop/admin/config.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/config.php	(revision 27568)
@@ -0,0 +1,69 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+
+  $select_options_currency=array(
+  'AUD'=>'Australian Dollar(AUD)',
+  'BRL'=>'Brazilian Real(BRL)',
+  'CAD'=>'Canadian Dollar(CAD)',
+  'CZK'=>'Czech Koruna(CZK)',
+  'DKK'=>'Danish Krone(DKK)',
+  'EUR'=>'Euro(EUR)',
+  'HKD'=>'Hong Kong Dollar(HKD)',
+  'HUF'=>'Hungarian Forint(HUF)',
+  'ILS'=>'Israeli New Sheqel(ILS)',
+  'JPY'=>'Japanese Yen(JPY)',
+  'MYR'=>'Malaysian Ringgit(MYR)',
+  'MXN'=>'Mexican Peso(MXN)',
+  'NOK'=>'Norwegian Krone(NOK)',
+  'NZD'=>'New Zealand Dollar(NZD)',
+  'PHP'=>'Philippine Peso(PHP)',
+  'PLN'=>'Polish Zloty(PLN)',
+  'GBP'=>'Pound Sterling(GBP)',
+  'SGD'=>'Singapore Dollar(SGD)',
+  'SEK'=>'Swedish Krona(SEK)',
+  'CHF'=>'Swiss Franc(CHF)',
+  'TWD'=>'Taiwan New Dollar(TWD)',
+  'THB'=>'Thai Baht(THB)',
+  'USD'=>'U.S. Dollar(USD)'
+  );
+ 
+if (isset($_POST['save_config']))
+{
+	$PPid		= $_POST['PPid'];
+    $currency	= $_POST['currency'];
+    $ship		= $_POST['ship'];
+	$comm		= $_POST['comm'];
+	$tprmulti 	= $_POST['tprmulti'];
+	$tpruniq 	= $_POST['tpruniq'];
+	
+	
+	
+
+	$query='UPDATE '.MPS_CONF_TABLE.' 
+	SET PPid = \''.$PPid.'\',currency = \''.$currency.'\',ship = \''.$ship.'\',comm = \''.$comm.'\' ,tprmulti = \''.$tprmulti.'\',tpruniq = \''.$tpruniq.'\'
+	WHERE id=1;';
+	@$res=pwg_query($query);
+   if($res==1)
+    $page['infos']=l10n('Your configuration settings are saved');
+   else
+    $page['errors']=l10n('Error');
+
+ $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+    $result 	= pwg_query($query);
+     while($row = pwg_db_fetch_assoc($result)){
+    $config = $row ;
+   }
+
+	$template->assign(array(
+    'mps_conf'		=> $config
+    ));  
+}
+
+
+
+$template->assign(array(
+  'mps_currency' 	=> $select_options_currency,
+  ));
+
+$template->set_filename('mps_content', realpath(MPS_PATH . 'admin/template/config.tpl'));
Index: /extensions/MyPiwiShop/admin/home.php
===================================================================
--- /extensions/MyPiwiShop/admin/home.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/home.php	(revision 27568)
@@ -0,0 +1,18 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+
+
+ $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+    $result 	= pwg_query($query);
+     while($row = pwg_db_fetch_assoc($result)){
+    $config = $row ;
+   }
+
+
+$template->assign(array(
+  'mps_conf' 		=> $config,
+  'INTRO_CONTENT' 	=> load_language('intro.html', MPS_PATH, array('return'=>true)),
+  ));
+
+$template->set_filename('mps_content', realpath(MPS_PATH . 'admin/template/home.tpl'));
Index: /extensions/MyPiwiShop/admin/index.php
===================================================================
--- /extensions/MyPiwiShop/admin/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/index.php	(revision 27568)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based photo gallery                                    |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2012 Piwigo Team                  http://piwigo.org |
+// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
+// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/admin/options.php
===================================================================
--- /extensions/MyPiwiShop/admin/options.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/options.php	(revision 27568)
@@ -0,0 +1,174 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+  $select_type_opt=array(
+  'select'   =>'select',
+  'radio'    =>'radio',
+  'text'     =>'text',
+  'textarea' =>'textarea',
+  'checkbox' =>'checkbox',
+  );
+  
+  if(isset($_POST['check'])){
+   foreach($_POST['check'] AS $delete_id){
+   
+   $query='DELETE FROM '.MPS_OPTION_TABLE.' 
+   WHERE id = '.$delete_id.';';
+   pwg_query($query);
+   
+    $query='DELETE FROM '.MPS_PROD_OPT_TABLE.' 
+   WHERE opt_id = '.$delete_id.';';
+   pwg_query($query);
+  
+   $query='DELETE FROM '.MPS_OPT_VAL_TABLE.' 
+   WHERE select_id = '.$delete_id.';';
+   pwg_query($query);
+   $page['infos']=l10n('deleted');
+   }
+   }   
+
+if (isset($_POST['option_add']))
+{
+if(empty($_POST['id']))
+	{
+	
+	$order = array();
+	$query ='SELECT * FROM '.MPS_PRODUCT_TABLE.';';
+	$result = pwg_query($query);
+	while($row = pwg_db_fetch_assoc($result)){
+    	$order[] = $row['order'];
+	}
+	if (count($order) == 0) {
+	$order = 1;
+	}else{
+	$order = max($order)+1;
+	}
+	
+	$name		= $_POST['name'];
+    $type		= $_POST['type'];
+    $title		= $_POST['title'];
+	
+	if(isset($_POST['requi'])){
+	 $requi = $_POST['requi'];
+	 }else{
+	 $requi = 0;
+	 }
+	
+	
+	$query='INSERT into '.MPS_OPTION_TABLE.' (`name`,`type`,`titre`,`requi`,`order`) 
+			values (\''.$name.'\',\''.$type.'\',\''.$title.'\',\''.$requi.'\',\''.$order.'\');';
+   
+	pwg_query($query);		
+	$select_id = pwg_db_insert_id();			
+			
+	if(isset($_POST['val'])){
+	$val		= $_POST['val'];
+
+
+    foreach($val as $val_ele)
+    {
+	 $query='INSERT into '.MPS_OPT_VAL_TABLE.' (val,select_id) 
+			values (\''.$val_ele.'\',\''.$select_id.'\');';
+	 $result = pwg_query($query);
+    }
+	if($result==1)
+	$page['infos']=l10n('Option registered');
+	else
+	$page['errors']=l10n('Error');
+	}
+	}
+
+if(!empty($_POST['id']))
+	{
+
+	$name		= $_POST['name'];
+    $type		= $_POST['type'];
+    $title		= $_POST['title'];
+	$id			= $_POST['id'];
+	
+	if(isset($_POST['requi'])){
+	 $requi = $_POST['requi'];
+	 }else{
+	 $requi = 0;
+	 }
+
+	$query='UPDATE '.MPS_OPTION_TABLE.' 
+	SET name = \''.$name.'\', type = \''.$type.'\', titre = \''.$title.'\', requi = \''.$requi.'\'
+	WHERE id = '.$id.'
+	;';
+    pwg_query($query);
+	
+	$query='DELETE FROM '.MPS_OPT_VAL_TABLE.' 
+	WHERE select_id =  '.$id.'
+	;';
+	pwg_query($query);
+   
+	if(isset($_POST['val'])){
+	$val		= $_POST['val'];
+
+    foreach($val as $val_ele)
+    {
+	
+	 $query='INSERT into '.MPS_OPT_VAL_TABLE.' (val,select_id) 
+			values (\''.$val_ele.'\',\''.$id.'\');';
+	 $result = pwg_query($query);
+    }
+	}
+   $page['infos']=l10n('Option registered');
+
+	}
+
+}
+
+if(isset($_POST['newOrder']))
+	{
+	$newOrder = explode(",", $_POST['newOrder']);
+	$ex = array_pop($newOrder);
+	
+	foreach( $newOrder as $order => $id )
+	{
+	$order = $order +1;
+
+      $query='UPDATE '.MPS_OPTION_TABLE.' SET `order` = \''.$order.'\' WHERE id = '.$id.';';
+	$result = pwg_query($query);
+    
+    $page['infos']=l10n('the order is changed');
+
+    }
+}
+
+  $query='
+  SELECT *  FROM '.MPS_OPTION_TABLE.' ORDER BY `order` ;';
+
+  $option = array();
+  $result = pwg_query($query);
+  while($row = pwg_db_fetch_assoc($result)){
+	 $query='
+	 SELECT *
+	 FROM '.MPS_OPT_VAL_TABLE.' 
+     WHERE select_id = '.$row['id'].'
+	 ;';
+	$val = array();	
+	$res = pwg_query($query);
+	 while($row1 = pwg_db_fetch_assoc($res)){
+	 $val[]= $row1['val'];
+	 }
+	$opt = array("id"	 =>$row['id'],
+				 "title" =>$row['titre'],
+				 "name"  =>$row['name'],
+				 "type"  =>$row['type'],
+				 "requi" =>$row['requi'],
+				 "val"   =>$val
+					);
+	$option[$row['id']] = $opt;
+	
+ }		
+
+
+   $template->assign(array(
+	 'mps_option'   => $option,
+	 'mps_type_opt' => $select_type_opt
+	 ));
+
+
+$template->set_filename('mps_content', realpath(MPS_PATH . 'admin/template/options.tpl'));
Index: /extensions/MyPiwiShop/admin/product.php
===================================================================
--- /extensions/MyPiwiShop/admin/product.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/product.php	(revision 27568)
@@ -0,0 +1,196 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+  if(isset($_POST['check'])){
+   foreach($_POST['check'] AS $delete_id){
+   
+   $query='DELETE FROM '.MPS_PRODUCT_TABLE.' 
+   WHERE id = '.$delete_id.';';
+   pwg_query($query);
+   $page['infos']=l10n('deleted');
+   
+   $query='DELETE FROM '.MPS_PROD_OPT_TABLE.' 
+   WHERE product_id = '.$delete_id.';';
+   pwg_query($query);
+   
+
+   }
+   }   
+
+if(isset($_POST['product_add']))
+{
+if(!empty($_POST['id']))
+	{
+	$id 		= $_POST['id'];
+	$product	= $_POST['product'];
+	$noteAdmin	= $_POST['noteAdmin'];
+	$price		= $_POST['price'];
+
+	$query='UPDATE '.MPS_PRODUCT_TABLE.' 
+	SET product = \''.$product.'\',noteAdmin = \''.$noteAdmin.'\',price=\''.$price.'\'
+	WHERE id = '.$id.';';
+   pwg_query($query);
+   
+    $query = 'DELETE FROM '.MPS_PROD_OPT_TABLE.' WHERE product_id IN ('.$id.');';
+	pwg_query($query);
+	
+	if(isset($_POST['opt']))
+    {
+	$opt		= $_POST['opt'];
+    $inserts 	= array();
+    foreach ($opt as $opt_id)
+    {
+      $inserts[] = array(
+          'opt_id' 	   => $opt_id,
+          'product_id' => $id,
+        );
+    }
+    mass_inserts(
+    MPS_PROD_OPT_TABLE,
+    array_keys($inserts[0]),
+    $inserts
+    );
+   }
+
+   $page['infos']=l10n('Edit');
+  }
+  
+
+if (empty($_POST['id'])and isset($_POST['product'])and isset($_POST['price'])and is_numeric($_POST['price'])) 
+	{
+	$order = array();
+	$query ='SELECT * FROM '.MPS_PRODUCT_TABLE.';';
+	$result = pwg_query($query);
+	while($row = pwg_db_fetch_assoc($result)){
+    	$order[] = $row['order'];
+	}
+	if (count($order) == 0) {
+	$order = 1;
+	}else{
+	$order = max($order)+1;
+	}
+	
+	$product	= $_POST['product'];
+	$noteAdmin	= $_POST['noteAdmin'];
+	$price		= $_POST['price'];
+
+	
+   $query='INSERT into '.MPS_PRODUCT_TABLE.' (`order`,`product`,`noteAdmin`,`price`) 
+			values (\''.$order.'\',\''.$product.'\',\''.$noteAdmin.'\',\''.$price.'\');';
+   $result=pwg_query($query);
+	$prod = pwg_db_insert_id();
+   
+   if(isset($_POST['opt']))
+   {
+	$opt = $_POST['opt'];
+    $inserts = array();
+    foreach ($opt as $opt_id)
+    {
+      $inserts[] = array(
+          'opt_id' => $opt_id,
+          'product_id' => $prod,
+        );
+    }
+    mass_inserts(
+    MPS_PROD_OPT_TABLE,
+    array_keys($inserts[0]),
+    $inserts
+    );
+   }
+	$page['infos']=l10n('Product registered');
+  }
+}
+
+if(isset($_POST['newOrder']))
+	{
+	$newOrder = explode(",", $_POST['newOrder']);
+	$ex = array_pop($newOrder);
+	
+	foreach( $newOrder as $order => $id )
+	{
+	$order = $order +1;
+
+      $query='UPDATE '.MPS_PRODUCT_TABLE.' SET `order` = \''.$order.'\' WHERE id = '.$id.';';
+	$result = pwg_query($query);
+    
+    $page['infos']=l10n('the order is changed');
+
+    }
+}
+//_________________________________________________________________
+  $select_type_opt=array(
+  'select'   =>'select',
+  'radio'    =>'radio',
+  'text'     =>'text',
+  'textarea' =>'textarea',
+  'checkbox' =>'checkbox',
+  );
+  
+if (isset($_POST['option_add']))
+{
+
+	$name		= $_POST['name'];
+    $type		= $_POST['type'];
+    $title		= $_POST['title'];
+	
+	if(isset($_POST['requi'])){
+	 $requi = $_POST['requi'];
+	 }else{
+	 $requi = 0;
+	 }
+	
+	
+	$query='INSERT into '.MPS_OPTION_TABLE.' (name,type,titre,requi) 
+			values (\''.$name.'\',\''.$type.'\',\''.$title.'\',\''.$requi.'\');';
+   
+	pwg_query($query);		
+	$select_id = pwg_db_insert_id();			
+			
+	if(isset($_POST['val'])){
+	$val = $_POST['val'];
+     foreach($val as $val_ele)
+      {
+	  $query='INSERT into '.MPS_OPT_VAL_TABLE.' (val,select_id) 
+			values (\''.$val_ele.'\',\''.$select_id.'\');';
+	  pwg_query($query);
+     }
+	}
+	
+	 echo('<div><div id="idlastopt">'.$select_id.'</div></div>');
+	
+}
+//_____________________________________________________________________
+  
+ $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ORDER BY `order`;';
+  $result = pwg_query($query);
+  $products = array();
+  while($row = pwg_db_fetch_assoc($result)){
+  	$query='
+	SELECT *
+	FROM '.MPS_PROD_OPT_TABLE.' AS op
+	JOIN '.MPS_OPTION_TABLE.' AS p ON p.id = op.opt_id
+	WHERE product_id = '.$row['id'].'
+	;';
+	$res = pwg_query($query);
+	$opt = array();
+	while($row1 = pwg_db_fetch_assoc($res)){
+    $opt[] = $row1['name'];
+	}
+	$row['option'] = $opt ;
+	$products[$row['id']]=$row;
+  }
+  
+
+  $query='SELECT * FROM '.MPS_OPTION_TABLE.' ;';
+  $result = pwg_query($query);
+  $option = array();
+  while($row = pwg_db_fetch_assoc($result)){
+   $option[$row['id']] = $row['name'];
+  }
+
+$template->assign(array(
+  'mps_product'	=> $products,
+  'mps_option' 	=> $option,
+  'mps_type_opt'		=> $select_type_opt,
+  ));
+$template->set_filename('mps_content', realpath(MPS_PATH . 'admin/template/product.tpl'));
Index: /extensions/MyPiwiShop/admin/product_tablereload.php
===================================================================
--- /extensions/MyPiwiShop/admin/product_tablereload.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/product_tablereload.php	(revision 27568)
@@ -0,0 +1,24 @@
+<?php
+define('PHPWG_ROOT_PATH','../../../');
+include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
+
+ $query='SELECT * FROM '.MPS_PRODUCT_TABLE.' ORDER BY `order`;';
+  $result = pwg_query($query);
+  $products = array();
+  while($row = pwg_db_fetch_assoc($result)){
+  	$query='
+	SELECT *
+	FROM '.MPS_PROD_OPT_TABLE.' AS op
+	JOIN '.MPS_OPTION_TABLE.' AS p ON p.id = op.opt_id
+	WHERE product_id = '.$row['id'].'
+	;';
+	$res = pwg_query($query);
+	$opt = array();
+	while($row1 = pwg_db_fetch_assoc($res)){
+    $opt[] = $row1['name'];
+	}
+	$row['option'] = $opt ;
+	$products[$row['id']]=$row;
+  }
+
+echo json_encode($products);
Index: /extensions/MyPiwiShop/admin/template/MyPiwiShopBatch.tpl
===================================================================
--- /extensions/MyPiwiShop/admin/template/MyPiwiShopBatch.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/MyPiwiShopBatch.tpl	(revision 27568)
@@ -0,0 +1,105 @@
+{combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'}
+{combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"}
+
+{footer_script}{literal}
+(function($) {
+	$(document).ready(function(){
+
+		$oTable = $('#product_list').dataTable({
+			"iDisplayLength": 10,
+			"bStateSave": true,
+			"bAutoWidth":   false,
+			"aoColumns" : [
+                          { sWidth: '2%','sClass': 'center', 'bSortable': false, },
+                          { sWidth: '40%','sClass': 'product_row'  },
+                          { sWidth: '40%'},
+                          { sWidth: '7%' },
+                          ],
+			"oLanguage": {
+				"sProcessing":     "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}",
+				"sSearch":         '<span class="icon-search"></span>'+"{/literal}{'Search'|translate|escape:'javascript'}{literal}",
+				"sLengthMenu":     "{/literal}{'Display _MENU_ records per page'|translate|escape:'javascript'}{literal}",
+				"sInfo":           "{/literal}{'Showing _START_ to _END_ of _TOTAL_ records'|translate|escape:'javascript'}{literal}",
+				"sInfoEmpty":      "{/literal}{'Showing 0 to 0 of 0 records'|translate|escape:'javascript'}{literal}",
+				"sInfoFiltered":   "{/literal}{'(filtered from _MAX_ total records)'|translate|escape:'javascript'}{literal}",
+				"sInfoPostFix":    "",
+				"sLoadingRecords": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}",
+				"sZeroRecords":    "{/literal}{'No matching option found'|translate|escape:'javascript'}{literal}",
+				"oPaginate": {
+					"sFirst":    "{/literal}{'First'|translate|escape:'javascript'}{literal}",
+					"sPrevious": '&larr; '+"{/literal}{'Previous'|translate|escape:'javascript'}{literal}",
+					"sNext":     "{/literal}{'Next'|translate|escape:'javascript'}{literal}"+' &rarr;',
+					"sLast":     "{/literal}{'Last'|translate|escape:'javascript'}{literal}",
+				},
+			},
+		});
+		
+		$(document).on('click', '#prodSelectAll', function () {
+			$('#product_list input[type=checkbox]').prop('checked', true);
+			return false;
+		});
+
+		$(document).on('click', '#prodSelectNone', function(){
+			$('#product_list input[type=checkbox]').prop('checked', false);
+			return false;
+		});
+
+		$(document).on('click', '#prodSelectInvert', function(){
+			$('#product_list input[type=checkbox]').each(function(){
+				if($(this).is (':checked')){
+					$(this).prop('checked', false);
+				}else{
+					$(this).prop('checked', true);
+				}
+			});
+			return false;
+		});
+		
+	});
+})(jQuery);
+{/literal}{/footer_script}
+
+
+<div class="titrePage">
+  <h2>{'Product'|@translate}</h2>
+</div>
+
+<div id=prod_table>
+<form id="form">
+	<table id=product_list>
+	<thead>
+		<tr>
+			<th></th>
+			<th>{'Product'|@translate}</th>
+			<th>{'Note administrator'|@translate}</th>
+			<th>{'Price'|@translate}</th>
+			
+		</tr>
+	</tread>
+	<tbody>
+	{foreach from=$mps_product item=product name=product}
+		<tr class="{if $smarty.foreach.product.index is odd}row1{else}row2{/if}">
+			<td><input type="checkbox" name="productcheck[]" value={$product.id}></td>
+			<td>{$product.product} </td>
+			<td>{$product.noteAdmin}</td>
+			<td>{$product.price} {$mps_conf.currency}</td>
+		</tr>
+
+
+	{/foreach}
+	</tbody>
+	</table>
+
+	<div style="clear:right"></div>
+
+	<p class="checkActions">
+	{'Select:'|@translate}
+	<a href="#" id="prodSelectAll">{'All'|@translate}</a>,
+	<a href="#" id="prodSelectNone">{'None'|@translate}</a>,
+	<a href="#" id="prodSelectInvert">{'Invert'|@translate}</a>
+	</p>
+	<input type="radio" name="thisprod" value="add" checked>{'Add the selected products for these images'|@translate}</input>&nbsp
+	<input type="radio" name="thisprod" value="del">{'Delete the selected products for these images'|@translate}</input>
+</form>  
+</div>
+  
Index: /extensions/MyPiwiShop/admin/template/MyPiwiShopBatchUnit.tpl
===================================================================
--- /extensions/MyPiwiShop/admin/template/MyPiwiShopBatchUnit.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/MyPiwiShopBatchUnit.tpl	(revision 27568)
@@ -0,0 +1,70 @@
+{combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'}
+{combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"}
+
+{footer_script}
+var sProcessing 	= '{'Loading...'|translate|escape:'javascript'}',
+	sSearch			= '{'Search'|translate|escape:'javascript'}',
+	sLengthMenu 	= '{'Display _MENU_ records per page'|translate|escape:'javascript'}',
+	sInfo			= '{'Showing _START_ to _END_ of _TOTAL_ records'|translate|escape:'javascript'}',
+	sInfoEmpty		= '{'Showing 0 to 0 of 0 records'|translate|escape:'javascript'}',
+	sInfoFiltered	= '{'(filtered from _MAX_ total records)'|translate|escape:'javascript'}',
+	sLoadingRecords	= '{'Loading...'|translate|escape:'javascript'}',
+	sZeroRecords	= '{'No matching option found'|translate|escape:'javascript'}',
+	sFirst			= '{'First'|translate|escape:'javascript'}',
+	sPrevious		= '{'Previous'|translate|escape:'javascript'}',
+	sNext			= '{'Next'|translate|escape:'javascript'}'+' &rarr;',
+	sLast			= '{'Last'|translate|escape:'javascript'}';
+
+{/footer_script}
+
+
+{foreach from=$mps_productcheck key=key item=products name=product}
+{if $key == $imgid}
+<br></br>
+
+<a href="#" class="showProd">{'see related products for this picture'|@translate} </a>
+
+<div class="batchUnit_prod_table-{$imgid}" style="display:none;margin-top:10px">
+<fieldset>
+<form class="formUnit-{$imgid}" method="post" name="img_prod" action="">
+	<table class="product_list">
+	<thead>
+		<tr>
+			<th></th>
+			<th>{'Product'|@translate}</th>
+			<th>{'Note administrator'|@translate}</th>
+			<th>{'Price'|@translate}</th>
+			
+		</tr>
+	</tread>
+	<tbody>
+	{foreach from=$products item=product name=product}
+		<tr class="{if $smarty.foreach.product.index is odd}row1{else}row2{/if}">
+			<td><input type="checkbox" name="productcheck[]" value={$product.id} {if $product.check == 'true'}checked{/if}></td>
+			<td>{$product.product} </td>
+			<td>{$product.noteAdmin}</td>
+			<td>{$product.price} {$mps_conf.currency}</td>
+		</tr>
+
+
+	{/foreach}
+	</tbody>
+	</table>
+
+	<div style="clear:right"></div>
+
+	<p class="checkActions">
+	{'Select:'|@translate}
+	<a href="#" class="prodSelectAll">{'All'|@translate}</a>,
+	<a href="#" class="prodSelectNone">{'None'|@translate}</a>,
+	<a href="#" class="prodSelectInvert">{'Invert'|@translate}</a>
+	</p>
+<input type="hidden" value="{$imgid}" name="imgid"></input>
+<p style="text-align:left;display:none"  class="submitchange"><input  type="submit" name="submitchange" value="{'Validate the change'|@translate}" ></input> <span class="infos" style="background-image:none;display:none">&#x2714; {'Registered'|@translate}</span></p>
+
+</form>  
+</fieldset>
+</div>
+
+{/if}
+{/foreach}
Index: /extensions/MyPiwiShop/admin/template/config.tpl
===================================================================
--- /extensions/MyPiwiShop/admin/template/config.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/config.tpl	(revision 27568)
@@ -0,0 +1,53 @@
+<div class="titrePage">
+	<h2>Configuration</h2>
+</div>
+
+<form method="post" action="" class="properties">
+
+<fieldset>
+ <legend>{'Configuration'|translate}</legend>
+  <ul>
+    <li>
+      <label>
+        <b>{'Your Paypal id'|translate}</b>
+        <input type="text" name="PPid" value="{$mps_conf.PPid}" size="15">
+      </label>
+    </li>
+    <li>
+      <label>
+        <b>{'Currency'|translate}</b>
+        {html_options name=currency options=$mps_currency selected=$mps_conf.currency}
+      </label>
+    </li>
+    <li>
+      <label>
+        <b>{'Shipping cost'|translate}</b>
+        <input type="text" name="ship" value="{$mps_conf.ship}" size="4">
+		<b>{$mps_conf.currency}</b>
+      </label>
+    </li>
+    <li>
+      <label>
+        <b>{'Comment'|translate}</b>
+        <textarea rows="8" cols="50" name="comm" >{$mps_conf.comm}</textarea>
+      </label>
+    </li>
+    <li>
+      <label>
+        <b>{'Presentation text for several products'|translate}</b>
+        <input type"text" size="50" name="tprmulti" value="{$mps_conf.tprmulti}">
+      </label>
+    </li>
+    <li>
+      <label>
+        <b>{'Presentation text for a single product'|translate}</b>
+        <input type"text" size="50" name="tpruniq" value="{$mps_conf.tpruniq}">
+      </label>
+    </li>
+
+  </ul>
+</fieldset>
+
+<p class="formButtons"><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p>
+
+</form>
Index: /extensions/MyPiwiShop/admin/template/home.tpl
===================================================================
--- /extensions/MyPiwiShop/admin/template/home.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/home.tpl	(revision 27568)
@@ -0,0 +1,18 @@
+{combine_css path=$MPS_PATH|@cat:"admin/template/style.css"}
+
+{html_style}{literal}
+h4 { text-align:left !important; }
+{/literal}{/html_style}
+
+<div class="titrePage">
+	<h2>MyPiwiShop</h2>
+</div>
+
+<form method="post" action="" class="properties">
+<fieldset>
+  <legend>{'What is MyPiwiShop?'|translate}</legend>
+  
+  {$INTRO_CONTENT}
+</fieldset>
+  
+</form>
Index: /extensions/MyPiwiShop/admin/template/index.php
===================================================================
--- /extensions/MyPiwiShop/admin/template/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/admin/template/js/batchmanagerunit.js
===================================================================
--- /extensions/MyPiwiShop/admin/template/js/batchmanagerunit.js	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/js/batchmanagerunit.js	(revision 27568)
@@ -0,0 +1,95 @@
+(function($) {
+	$(document).ready(function(){
+		table();
+		
+		function table(){
+			$oTable = $('.product_list').dataTable({
+				"bStateSave": true,
+				"bAutoWidth":   false,
+				"aoColumns" : [
+							{ sWidth: '2%','sClass': 'center', 'bSortable': false, },
+							{ sWidth: '40%','sClass': 'product_row'  },
+							{ sWidth: '40%'},
+							{ sWidth: '7%' },
+							],
+				"oLanguage": {
+					"sProcessing"		: sProcessing,
+					"sSearch"			: '<span class="icon-search"></span>' + sSearch,
+					"sLengthMenu"		: sLengthMenu,
+					"sInfo"				: sInfo,
+					"sInfoEmpty"		: sInfoEmpty,
+					"sInfoFiltered"		: sInfoFiltered,
+					"sInfoPostFix"		: "",
+					"sLoadingRecords"	: sLoadingRecords,
+					"sZeroRecords"		: sZeroRecords,
+					"oPaginate": {
+						"sFirst"		: sFirst,
+						"sPrevious"		: '&larr;' + sPrevious,
+						"sNext"			: sNext+' &rarr;',
+						"sLast"			: sLast,
+					},
+				},
+			});
+		}
+		
+		$(document).on('click','.submitchange', function() {
+				var $form	= $(this).parent(),
+					$formCl	= $form.attr('class'),
+					$sData 	= $('input', $form).serialize();
+				$.ajax({
+					type	: 'post',
+					data	: $sData,
+					success	: function(){
+						var $info = $($form).find('.infos');
+						$info.show();
+						setTimeout(function() {
+							$($info).hide()
+						}, 3000);
+					}
+				})	
+			return false;
+		} );  
+		
+		$(document).on('click', '.prodSelectAll', function () {
+			var $parent = $(this).parents('.MyPiwiShopBatchUnit');
+			$('.product_list input[type=checkbox]', $parent).prop('checked', true);
+			delet_button()
+			return false;
+		});
+
+		$(document).on('click', '.prodSelectNone', function () {
+			var $parent = $(this).parents('.MyPiwiShopBatchUnit');
+			$('.product_list input[type=checkbox]', $parent).prop('checked', false);
+			delet_button()
+
+			return false;
+		});
+
+		$(document).on('click', '.prodSelectInvert', function () {
+			var $parent = $(this).parents('.MyPiwiShopBatchUnit');
+			$('.product_list input[type=checkbox]', $parent).each(function(){
+				if($(this).is (':checked')){
+					$(this).prop('checked', false);
+				}else{
+					$(this).prop('checked', true);
+				}
+			delet_button()
+			});
+			return false;
+		});
+		
+		$(document).on('click', '.showProd', function(){
+			$(this).next('div').toggle();
+			return false;
+		})
+		
+		$(document).on('change', '.product_list input[type=checkbox]', function () {
+			delet_button()
+		});
+				
+		function delet_button(){
+			$('.submitchange').css('display','block');
+		};
+
+	});
+})(jQuery);
Index: /extensions/MyPiwiShop/admin/template/options.tpl
===================================================================
--- /extensions/MyPiwiShop/admin/template/options.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/options.tpl	(revision 27568)
@@ -0,0 +1,403 @@
+{combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'}
+{combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"}
+{combine_css path=$MPS_PATH|@cat:"admin/template/style.css"}
+{combine_script id='jquery.ui.sortable' load='footer' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'}
+
+
+{footer_script}{literal}
+(function($) {
+	$(document).ready(function(){
+	
+		var $oTable,
+			$nEditing = null, 
+			$select	  = $('#select').html();
+			$val	  = $('.val').html();
+	
+		$('#table_option input[type=checkbox]').each(function(){
+			$(this).prop('checked', false)
+		});
+
+		$('.addedit').click(function() {
+			$('.Tadd').show();
+			$('#add_option').fadeIn();
+			$("input[name=name]").focus();
+			_verif_type_opt();
+			return false;
+		});
+		
+		$('#close_addoption').click(function() {  
+			$('#add_option').fadeOut(function(){
+				$('.tit').hide();
+				$('#add_option input[type=text]').attr('value','');
+				$('.val').remove();
+				$('.valeur').append($('<div/>').addClass('val').append($val));
+				$('select#optType option').each(function(){
+					$(this).removeAttr('selected');
+				});
+			});
+			return false
+		});
+		
+		$('#addopt_form').submit(function(){
+			var $return = true;
+			if($.trim($('input#optName',this).val()).length==0){
+				$return = false;
+				$('.errors').show();
+				setTimeout(function(){
+					$('.errors').hide()
+				},3000);
+			}
+			if($('.valeur').is(':hidden')){
+				$('.valeur').remove();
+			}
+			return $return
+		})
+
+		$(document).on('change','#optType',function(){	
+			 _verif_type_opt();
+		});
+				
+		function _verif_type_opt(){
+			var	$valSel = $('.addopt_table select#optType option:selected').attr('value');
+			if($valSel=="text" || $valSel=="textarea"){
+				$('.valeur').fadeOut('fast');
+			} else {
+				$('.valeur').fadeIn('fast')
+			}
+		}
+		
+		$('#option_add').click(function(){
+			if($('.valeur').is(':hidden')){
+				$('.valeur').remove();
+			}
+			$('#addopt_form').submit();
+			return false
+		})
+		
+		$('.addVal').click(function() {
+			$('.valeur').append($('<div/>').addClass('val').append($val));
+			return false;
+		})
+				
+		
+		$(document).on('click','.delVal',function(){
+			if (confirm("{/literal}{'Are you sure?'|translate|escape:javascript}{literal}")) {
+					var $Nval = $('.addopt_table .valeur input').length;
+				if($Nval>1){
+					$(this).parents('div.val').remove();
+				}else{
+					var $val = $(this).parents('div.val');
+					$('input', $val).val('').attr('value','');
+				}
+			}
+			return false
+		});
+		
+		$oTable = $('#table_option').dataTable({
+			"bAutoWidth":   false,
+			"bStateSave": true,
+			"aoColumns" : [
+                          { sWidth: '2%','sClass': 'center', 'bSortable': false, },
+                          { sWidth: '35%'},
+                          { sWidth: '36%'},
+                          { sWidth: '15%', 'bSortable': false},
+                          { sWidth: '7%' },
+                          { sWidth: '4%','sClass': 'center', 'bSortable': false, },
+                         ],
+			"oLanguage": {
+				"sProcessing":     "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}",
+				"sSearch":         '<span class="icon-search"></span>'+"{/literal}{'Search'|translate|escape:'javascript'}{literal}",
+				"sLengthMenu":     "{/literal}{'Display _MENU_ records per page'|translate|escape:'javascript'}{literal}",
+				"sInfo":           "{/literal}{'Showing _START_ to _END_ of _TOTAL_ records'|translate|escape:'javascript'}{literal}",
+				"sInfoEmpty":      "{/literal}{'Showing 0 to 0 of 0 records'|translate|escape:'javascript'}{literal}",
+				"sInfoFiltered":   "{/literal}{'(filtered from _MAX_ total records)'|translate|escape:'javascript'}{literal}",
+				"sInfoPostFix":    "",
+				"sLoadingRecords": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}",
+				"sZeroRecords":    "{/literal}{'No matching option found'|translate|escape:'javascript'}{literal}",
+				"oPaginate": {
+					"sFirst":    "{/literal}{'First'|translate|escape:'javascript'}{literal}",
+					"sPrevious": '&larr; '+"{/literal}{'Previous'|translate|escape:'javascript'}{literal}",
+					"sNext":     "{/literal}{'Next'|translate|escape:'javascript'}{literal}"+' &rarr;',
+					"sLast":     "{/literal}{'Last'|translate|escape:'javascript'}{literal}",
+				},
+			},
+		});
+		
+		$(document).on('click','#table_option .optEdit', function () {
+			var $this =$(this);
+			$('.Tedit').show();
+			_rempform($this);
+			$('#add_option').fadeIn();
+	
+			return false;
+		});	
+		
+		$(document).on('click','#table_option .optDupli', function () {
+			var $this =$(this);
+			$('.Tdupli').show();
+			_rempform($this);
+			$('input#optId').attr('value','');
+			$('#add_option').fadeIn();
+	
+			return false;
+		});	
+
+		function _rempform($this){
+			var $nRow 	  = $this.parents('tr')[0],
+				$jqInputs = $('input', $nRow),
+				$id 	  = $jqInputs[0].value,
+				$opt      = $('#optvar').data('option'),
+				$id		  = $opt[$id].id,
+				$name	  = $opt[$id].name,
+				$title	  = $opt[$id].title,
+				$type	  = $opt[$id].type,
+				$requi	  = $opt[$id].requi,
+				$value    = $opt[$id].val;
+				
+			$('input#optId').attr('value',$id);
+			$('input#optName').attr('value',$name);
+			$('input#optTitle').attr('value',$title);
+			if($requi==1){
+				$('input#optRequi').attr('checked','checked');
+			};
+			$('select#optType').remove();
+			
+			$('#typeOpt span:last').append($select)
+			$('select#optType option[value=' +$type+']').attr('selected','selected');
+			
+			if($value.length != 0){
+				$('.val').remove();
+				$.each($value,function(e,val){
+					$('.valeur').append($('<div />').addClass('val').append($val));
+					$('.val').last().find('input').attr('value',val)
+				});
+			}
+			_verif_type_opt();
+		
+		}
+		
+		$('#selectAll').click(function () {
+			$('#table_option input[type=checkbox]').prop('checked', true);
+			_delet_button()
+			return false;
+		});
+
+		$('#selectNone').click(function () {
+			$('#table_option input[type=checkbox]').prop('checked', false);
+			_delet_button()
+			return false;
+		});
+
+		$('#selectInvert').click(function () {
+			$('#table_option input[type=checkbox]').each(function(){
+				if($(this).is (':checked')){
+					$(this).prop('checked', false);
+				}else{
+					$(this).prop('checked', true);
+				}
+				_delet_button()
+			});
+			return false;
+		});
+		
+		$('#table_option td.del input[type=checkbox]').change(function () {
+			_delet_button()
+		});
+				
+		function _delet_button(){
+			if($('#table_option td.del input[type=checkbox]:checked').length > 0){
+				$('#forbidAction').css('display','none');
+				$('#permitAction').css('display','block');
+			}else{
+				$('#forbidAction').css('display','block');
+				$('#permitAction').css('display','none');
+			}
+		};
+
+		$("#listOrder").sortable({ 
+			placeholder: 'highlight', 
+			update: function() {  
+				var $order = $("#listOrder").sortable("toArray");
+                $('#newOrder').val($order.join(","));	
+			}
+		});
+		
+		$("#listOrder").disableSelection();
+		
+		$('#ChangeOrder').click(function() {
+			$("#change_Order").fadeIn(
+			);
+			return false;
+		});
+		
+		$('#close_changeOrder').click(function() {
+			$("#change_Order").fadeOut();
+
+			return false;
+		});
+		
+		
+	})
+	
+})(jQuery);
+{/literal}{/footer_script}		
+		
+<div id="optvar" class="titrePage" data-option='{$mps_option|@json_encode}'>
+	<h2>{'Options'|translate}</h2>
+</div>
+
+<p class="showCreateAlbum" id="showAddProd">
+  <a href="#" class="addedit icon-plus-circled">{'Add a option'|translate}</a>
+</p>
+
+<div id="add_option" class="add_wrap" style="display:none">
+<div class="add_content">
+	<div class="boxtitre"><h1>
+	<span class="tit Tadd">{'Add a'|translate}</span>
+	<span class="tit Tedit">{'Edit the'|translate}</span>
+	<span class="tit Tdupli">{'Duplicate the'|translate}</span>
+	<span>{' option'|translate}</span>
+	</h1></div>
+	<span id="close_addoption" class="close_box_add"></span>
+
+<form id="addopt_form" method="post" name="add_opt" action="">
+ <div style="margin: 0 0 10px 5px" >
+	<div class="addopt_table">
+    <div>
+		<span>{'Name'|translate}</span>
+		<span><input id="optId" type="hidden" name="id"></span>
+		<span><input id="optName" type="text" name="name" size="40"></span>
+	</div>
+    
+	<div id="typeOpt">
+      <span valign="top">{'Type of option'|translate}</span>
+      <span id="select">{html_options name=type options=$mps_type_opt selected="select" id="optType"}</span>
+    </div>
+ 
+	<div>
+      <span><label>{'The field is required'|@translate}
+      <input id="optRequi" type="checkbox" name="requi" value="1">
+	  </label><span>
+    </div>
+	<div>
+      <span>{'Note administrator'|@translate}</span>
+      <span><input id="optTitle" type="text" name="title" size="40"></span>
+    </div>
+
+	<div class="valeur">
+	<div>
+	<span>{'Option value'|@translate}</span>
+	<span><a class="icon-plus-circled addVal" href="#">{'add value'|@translate}</a></span>
+	</div>
+	
+	<div class="val">
+	<span>{'Value'|@translate}</span>
+	<span><input type="text" name="val[]" size="20"></span>
+	<span><a class="icon-cancel-circled delVal"  href="#">{'delete'|@translate}</a></span>
+	</div>
+	</div>
+	
+	</div>
+ </div>
+ 
+    <span class="actionButtons">
+	  <input name="option_add" type="hidden" value="{'Submit'|@translate}">
+      <input id="option_add" class="submit" type="submit" value="{'Submit'|@translate}">
+    </span>
+	  <span class="errors" style="display:none">{'you must enter the name of the option'|@translate}</span>
+
+</form>
+</div>
+</div>
+
+
+	
+<div class="optionCreate">
+<form id="formOption" method="post" name="formOption" action="">
+	<table id="table_option">
+		<thead>
+		<tr>
+			<th></th>
+			<th>{'Name'|@translate}</th>
+			<th>{'Note administrator'|@translate}</th>
+			<th></th>
+			<th>{'Type'|@translate}</th>
+			<th>{'Required'|@translate}</th>
+		</tr>
+	</thead>
+	<tbody>
+	{foreach from=$mps_option item=option name=option}
+	<tr>
+		<td class="del"><input type="checkbox" name="check[]" value={$option.id}></td>
+		<td>{$option.name} <a title="{'edit'|translate|escape:'javascript'}" class="optEdit icon-pencil tabact">{'edit'|translate}</a> <a title="{'duplicate'|translate|escape:'javascript'}" class="optDupli icon-pencil tabact">{'duplicate'|translate}</a></td>
+		<td>{$option.title}</td>
+		<td>
+		{if $option.type=="select"}
+		{html_options name=option options=$option.val}</td>
+		{/if}
+		{if $option.type=="radio"}
+		{html_radios name='option' options=$option.val separator='<br />'}</td>
+		{/if}
+		{if $option.type=="checkbox"}
+		{html_checkboxes name='option' options=$option.val separator='<br />'}</td>
+		{/if}
+
+		{if $option.type=="text"}
+		<input type="text" size="20"></td>
+		{/if}
+		{if $option.type=="textarea"}
+		<textarea rows="4" cols="50"></textarea></td>
+		{/if}
+		<td>{$option.type}</td>
+		<td>{if $option.requi=="1"}{'Yes'|@translate}{else}{'No'|@translate}{/if}</td>
+	</tr>
+		{/foreach}
+	</table>
+<div style="clear:right"></div>
+
+<p class="checkActions">
+  {'Select:'|@translate}
+  <a href="#" id="selectAll">{'All'|@translate}</a>,
+  <a href="#" id="selectNone">{'None'|@translate}</a>,
+  <a href="#" id="selectInvert">{'Invert'|@translate}</a>
+</p>
+
+</div>
+
+  <div id="forbidAction">{'No product selected'|@translate}</div>
+  <div id="permitAction" style="display:none">
+			
+<input type=submit name="delete" value="{'Delete'|@translate}">
+<br></br>
+  </div>
+</form>  	
+
+<p class="showCreateAlbum" id="showChangeOrder">
+  <a href="#" id="ChangeOrder" class="icon-plus-circled">{'Change the display order of options in the form'|translate}</a>
+</p>
+
+<div id="change_Order" class="add_wrap" style="display:none">
+<div class="add_content">
+<span id="close_changeOrder" class="close_box_add"></span>
+<div class="boxtitre"><h1>{'Change the display order of options in the form'|translate}</h1>
+	<p> {'drag / drop to change the order'|translate}</p></div>
+<div id="form_order">
+<form id="changeOrder"  method="post" name="add_prod" action="">
+<fieldset>   
+	
+ <ul id="listOrder">
+   	{foreach from=$mps_option item=option name=option}
+	<li id="{$option.id}">{$option.name} -> {$option.type}</li>
+	{/foreach}
+    <br />
+</fieldset>
+<input id="newOrder" type="hidden" value="" name="newOrder">
+<input id="sortable" type="submit" name="submit" value="{'Submit'|@translate}">
+
+</form>
+</div>
+</div>
+</div>
+
+
+
Index: /extensions/MyPiwiShop/admin/template/product.tpl
===================================================================
--- /extensions/MyPiwiShop/admin/template/product.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/product.tpl	(revision 27568)
@@ -0,0 +1,474 @@
+{combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'}
+{combine_css path="themes/default/js/plugins/datatables/css/jquery.dataTables.css"}
+{combine_css path=$MPS_PATH|@cat:"admin/template/style.css"}
+{combine_script id='jquery.ui.sortable' load='footer' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'}
+{combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'}
+{combine_css path="themes/default/js/plugins/chosen.css"}
+
+
+{footer_script}{literal}
+(function($) {
+	$(document).ready(function(){
+		
+		
+		var $oTable,
+			$nEditing = null,
+			$val	  = $('.val').html(),
+			$add_opt  = $('#add_option_prod').html();
+			
+		$('#product_list input[type=checkbox]').each(function(){
+			$(this).prop('checked', false)
+		});
+		
+		$('#AddProd').click(function() {
+			$('.Tadd').show();
+			$('#Add_product').fadeIn();
+			$('#showAddProd .infos').hide();
+			$('input[name=product]').focus();
+			return false;
+		});
+
+		$('#close_Add_product').click(function() {
+			$('#Add_product').fadeOut(function(){
+				$('#add_option_prod').hide();
+				$('.tit').hide();
+				$('#AddProdForm input[type=text]').attr('value','');
+				$('#AddProdForm textarea#noteAdmin').val('');
+				$('li.search-choice').remove();
+				$('select.chzn-select option').each(function(){
+					$(this).removeAttr('selected');
+				})
+			});
+			return false;
+		});
+		
+		$('#AddProdForm').submit(function(){
+			var $return = true;
+			if($.trim($('input#product',this).val()).length==0 || $.trim($('input#price',this).val()).length==0){
+				$return = false;
+				$('.errors').show();
+				setTimeout(function(){
+					$('.errors').hide()
+				},3000);
+			}
+			return $return
+		})
+		
+		$('#permitAction input[type="submit"]').click(function() {
+			if (!confirm("{/literal}{'Are you sure?'|translate|escape:javascript}{literal}")) {
+				$('#product_list input[type=checkbox]').each(function(){
+					$(this).prop('checked', false);
+					delet_button()
+				});
+			} else {
+				$('#formTab_prod').submit();
+			}
+			return false;
+		} );  
+		
+			$oTable = $('#product_list').dataTable({
+				"bAutoWidth":   false,
+				"bStateSave": true,
+				"aoColumns" : [
+                           { sWidth: '2%','sClass': 'center', 'bSortable': false},
+                           { sWidth: '38%','sClass': 'product_row'  },
+                           { sWidth: '38%'},
+                           { sWidth: '12%', 'bSortable': false,  },
+						   { sWidth: '8%', },
+                          ],
+				"oLanguage": {
+					"sProcessing":     "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}",
+					"sSearch":         '<span class="icon-search"></span>'+"{/literal}{'Search'|translate|escape:'javascript'}{literal}",
+					"sLengthMenu":     "{/literal}{'Display _MENU_ records per page'|translate|escape:'javascript'}{literal}",
+					"sInfo":           "{/literal}{'Showing _START_ to _END_ of _TOTAL_ records'|translate|escape:'javascript'}{literal}",
+					"sInfoEmpty":      "{/literal}{'Showing 0 to 0 of 0 records'|translate|escape:'javascript'}{literal}",
+					"sInfoFiltered":   "{/literal}{'(filtered from _MAX_ total records)'|translate|escape:'javascript'}{literal}",
+					"sInfoPostFix":    "",
+					"sLoadingRecords": "{/literal}{'Loading...'|translate|escape:'javascript'}{literal}",
+					"sZeroRecords":    "{/literal}{'No matching option found'|translate|escape:'javascript'}{literal}",
+					"oPaginate": {
+						"sFirst":    "{/literal}{'First'|translate|escape:'javascript'}{literal}",
+						"sPrevious": '&larr; '+"{/literal}{'Previous'|translate|escape:'javascript'}{literal}",
+						"sNext":     "{/literal}{'Next'|translate|escape:'javascript'}{literal}"+' &rarr;',
+						"sLast":     "{/literal}{'Last'|translate|escape:'javascript'}{literal}",
+					},
+				},
+			});
+		
+		function _rempform($this){
+			var $nRow 		= $this.parents('tr')[0],
+				$jqInputs 	= $('input', $nRow),
+				$id 		= $jqInputs[0].value,
+				$prod		= $('#prodvar').data('product'),
+				$product	= $prod[$id].product,
+				$Nadmin		= $prod[$id].noteAdmin,
+				$price		= $prod[$id].price,
+				$option		= $prod[$id].option;
+			for(key in $option) {
+				$('.chzn-select option').each(function(){
+					if($(this).text()==$option[key]){
+						$(this).attr('selected','selected');
+					}
+				});
+			}
+			$('.chzn-select').trigger("chosen:updated");
+			
+			$('input#product_id').attr('value',$id);
+			$('input#product').attr('value',$product);
+			$('textarea#noteAdmin').val($Nadmin);
+			$('input#price').attr('value',$price);
+		} 
+		
+		$(document).on('click','#formTab_prod .prodEdit', function () {
+			var $this	= $(this);
+			$('.Tedit').show();
+			_rempform($this);
+			$('#Add_product').fadeIn();
+	
+			return false;
+		});
+	    
+		$(document).on('click','#formTab_prod .prodDupli', function () {
+			var $this	= $(this);
+			$('.Tdupli').show();
+			_rempform($this);
+			$('input#product_id').attr('value','');
+			$('#Add_product').fadeIn();
+			
+			return false
+		});
+
+		$(document).on('click', '#selectAll', function () {
+			$('#product_list input[type=checkbox]').prop('checked', true);
+			delet_button()
+			return false;
+		});
+
+		$(document).on('click', '#selectNone', function () {
+			$('#product_list input[type=checkbox]').prop('checked', false);
+			delet_button()
+			return false;
+		});
+
+		$(document).on('click', '#selectInvert', function () {
+			$('#product_list input[type=checkbox]').each(function(){
+				if($(this).is (':checked')){
+					$(this).prop('checked', false);
+				}else{
+					$(this).prop('checked', true);
+				}
+				delet_button()
+			});
+			return false;
+		});
+		
+		$(document).on('change','#product_list input[type=checkbox]', function () {
+			delet_button()
+		});
+				
+		function delet_button(){
+			if($('#product_list input[type=checkbox]:checked').length > 0){
+				$('#forbidAction').css('display','none');
+				$('#permitAction').css('display','block');
+			}else{
+				$('#forbidAction').css('display','block');
+				$('#permitAction').css('display','none');
+			}
+		};
+		
+		$("#listOrder").sortable({ 
+			placeholder: 'highlight', 
+			update: function() {  
+				var $order = $("#listOrder").sortable("toArray");
+                $('#newOrder').val($order.join(","));	
+			}
+		});
+		
+		$("#listOrder").disableSelection();
+		
+		$('#ChangeOrder').click(function() {
+			$("#change_Order").fadeIn(
+			);
+			return false;
+		});
+		
+		$('#close_changeOrder').click(function() {
+			$("#change_Order").fadeOut();
+
+			return false;
+		});
+				
+		$('.chzn-select').chosen({width:"400px"})
+		
+		$('.addopt').click(function(){
+			$('#add_option_prod').show();
+			$('#sub_add_product').hide();
+		});
+				
+		$(document).on('change','#optType',function(){
+			var	$valSel = $('.addopt_table select#optType option:selected').attr('value');
+			if($valSel=="text" || $valSel=="textarea"){
+				$('.valeur').fadeOut('fast');
+			} else {
+				$('.valeur').fadeIn('fast')
+			}
+		});
+		
+		$('.addVal').click(function() {
+			$('.valeur').append($('<div/>').addClass('val').append($val));
+			;return false;
+		})
+
+		$(document).on('click','.delVal',function(){
+			if (confirm("{/literal}{'Are you sure?'|translate|escape:javascript}{literal}")) {
+					var $Nval = $('.addopt_table .valeur input').length;
+				if($Nval>1){
+					$(this).parents('div.val').remove();
+				}else{
+					var $val = $(this).parents('div.val');
+					$('input', $val).val('').attr('value','');
+				}
+			}
+			return false
+		});
+		
+		$(document).on('submit','#addopt_form',function(){
+			if($.trim($('input#optName',this).val()).length==0){
+				$('.erroropt').show();
+				setTimeout(function(){
+					$('.erroropt').hide()
+				},3000);
+			}else{
+				var $optecour = $('input#optName').val();
+				if($('.valeur').is(':hidden')){
+					$('.valeur').remove();
+				}
+				$('.optadded').show();
+				setTimeout(function(){
+					$('.optadded').hide()
+				},3000);
+				$.ajax({
+					type:"POST",
+					data: $(this).serialize(),
+					success: function(html){
+						var $idlo = $(html).find('#idlastopt').text();
+						console.debug($idlo);
+						$('#opt select').append($('<option />').attr({'value':$idlo,'selected':'selected'}).text($optecour));
+						$('.chzn-select').trigger("chosen:updated");
+					}
+				});
+				$('#sub_add_product').show();
+				$('#add_option_prod input[type=text]').attr('value','');
+				$('.val').remove();
+				$('.valeur').append($('<div/>').addClass('val').append($val));
+				$('select#optType option').each(function(){
+					$(this).removeAttr('selected');
+				});
+
+				$('#add_option_prod').hide().html($add_opt);
+			}
+			return false
+		})
+
+	});
+})(jQuery);
+{/literal}{/footer_script}
+
+<div id="prodvar" class="titrePage" data-product='{$mps_product|@json_encode}'>
+  <h2>{'Products'|@translate}</h2>
+</div>
+<p class="showCreateAlbum" id="showAddProd">
+  <a href="#" id="AddProd" class="icon-plus-circled">{'Add a product'|translate}</a>
+  <span class="infos" style="display:none"></span>
+</p>
+
+<div id="Add_product" class="add_wrap" style="display:none">
+<div class="add_content">
+<span id="close_Add_product" class="close_box_add"></span>
+	<div class="boxtitre"><h1>
+	<span class="tit Tadd">{'Add a'|translate}</span>
+	<span class="tit Tdupli">{'Duplicate the'|translate}</span>
+	<span class="tit Tedit">{'Edit the'|translate}</span>
+	<span>{' product'|translate}</span>
+	</h1></div>
+<form id="AddProdForm"  method="post" name="add_prod" action="">
+ <div style="margin: 0 0 10px 5px">
+	<div class="addprod_table">
+    <div>
+		<span>{'Product'|translate}</span>
+		<span><input id="product" type="text" name="product" size="100"></span>
+		<span><input id="product_id" type="hidden" name="id"></span>
+	</div>
+    
+	<div>
+      <span valign="top">{'Note administrator'|translate}</span>
+      <span><textarea id="noteAdmin" rows="8" cols="50" name="noteAdmin" maxlength="50"></textarea></span>
+    </div>
+    <div>
+      <span>{'Price'|@translate}</span>
+      <span><input id="price" type="text" name="price"> {$mps_conf.currency}</span>
+    </div>
+	<div id="opt">
+	  <span>{'Options'|@translate}</span>
+	  <span>
+      <select data-placeholder="{'select a option'|@translate}" class="chzn-select" multiple style="width:700px;" name="opt[]">
+	  {html_options options=$mps_option }
+	  </select>
+	  </span>
+<p class="showCreateAlbum" id="showAddProd">
+  <a href="#" class="addopt icon-plus-circled">{'Add a option'|translate}</a><span class="infos optadded" style="display:none">{'option registered'|translate}</span>
+
+</p>
+	</div>
+
+ </div>	
+ </div>
+    <span class="actionButtons">
+	  
+	  <input type="hidden" name="product_add">
+      <input id="sub_add_product" class="submit" name="product_add" type="submit" value="{'Submit'|@translate}">
+    </span>
+	<span class="errors" style="display:none">{'you must enter the product and not the price'|@translate}</span>
+</form>
+
+
+<div id="add_option_prod"  style="display:none">
+<div>
+
+<form id="addopt_form" method="post" name="add_opt" action="">
+ <div style="margin: 0 0 10px 5px" >
+	<div class="addopt_table">
+    <div>
+		<span>{'Name'|translate}</span>
+		<span><input id="optId" type="hidden" name="id"></span>
+		<span><input id="optName" type="text" name="name" size="40"></span>
+	</div>
+    
+	<div id="typeOpt">
+      <span valign="top">{'Type of option'|translate}</span>
+      <span id="select">{html_options name=type options=$mps_type_opt selected="select" id="optType"}</span>
+    </div>
+ 
+	<div>
+      <span><label>{'The field is required'|@translate}
+      <input id="optRequi" type="checkbox" name="requi" value="1">
+	  </label><span>
+    </div>
+	<div>
+      <span>{'Note administrator'|@translate}</span>
+      <span><input id="optTitle" type="text" name="title" size="40"></span>
+    </div>
+
+	<div class="valeur">
+	<div>
+	<span>{'Option value'|@translate}</span>
+	<span><a class="icon-plus-circled addVal" href="#">{'add value'|@translate}</a></span>
+	</div>
+	
+	<div class="val">
+	<span>{'Value'|@translate}</span>
+	<span><input type="text" name="val[]" size="20"></span>
+	<span><a class="icon-cancel-circled delVal"  href="#">{'delete'|@translate}</a></span>
+	</div>
+	</div>
+	
+	</div>
+ </div>
+ 
+    <span class="actionButtons">
+	  <input name="option_add" type="hidden" value="{'Submit'|@translate}">
+
+      <input id="option_add" class="submit" type="submit" value="{'Submit'|@translate}">
+    </span>
+	<span class="errors erroropt" style="display:none">{'you must enter the name of the option'|@translate}</span>
+
+</form>
+</div>
+</div>
+
+</div>
+</div>
+
+<div id=prod_table>
+<form id="formTab_prod" method="post" name="add_prod" action="">
+	<table id="product_list">
+	<thead>
+		<tr>
+			<th></th>
+			<th>{'Product'|@translate}</th>
+			<th>{'Note administrator'|@translate}</th>
+			<th>{'Options'|@translate}</th>
+			<th>{'Price'|@translate}</th>
+			
+		</tr>
+	</thead>
+	<tbody>
+	{foreach from=$mps_product item=product name=product}
+		<tr class="{if $smarty.foreach.product.index is odd}row1{else}row2{/if}">
+			<td><input type="checkbox" name="check[]" value={$product.id}></td>
+			<td><span>{$product.product}</span> <a title="{'edit'|translate|escape:'javascript'}" class="prodEdit icon-pencil tabact">{'edit'|translate}</a> <a title="{'duplicate'|translate|escape:'javascript'}" class="prodDupli icon-pencil tabact">{'duplicate'|translate}</a></td>
+			<td>{$product.noteAdmin} </td>
+			<td>{foreach from=$product.option item=option name=option}{$option}/{/foreach}</td>
+			<td>{$product.price} {$mps_conf.currency}</td>
+		</tr>
+
+
+	{/foreach}
+	</tbody>
+	</table>
+
+
+<div style="clear:right"></div>
+
+<p class="checkActions">
+  {'Select:'|@translate}
+  <a href="#" id="selectAll">{'All'|@translate}</a>,
+  <a href="#" id="selectNone">{'None'|@translate}</a>,
+  <a href="#" id="selectInvert">{'Invert'|@translate}</a>
+</p>
+
+</div>
+
+  <div id="forbidAction">{'No product selected'|@translate}</div>
+  <div id="permitAction" style="display:none">
+<input type="submit" name="delete" value="{'Delete'|@translate}">
+<br></br>
+  </div>
+</form>    
+  
+<p class="showCreateAlbum" id="showChangeOrder">
+  <a href="#" id="ChangeOrder" class="icon-plus-circled">{'Change the display order of products in the form'|translate}</a>
+</p>
+
+
+<div id="change_Order" class="add_wrap" style="display:none">
+<div class="add_content">
+<span id="close_changeOrder" class="close_box_add"></span>
+<div class="boxtitre"><h1>{'Change the display order of products in the form'|translate}</h1>
+	<p> {'drag / drop to change the order'|translate}</p></div>
+<div id="form_order">
+<form id="changeOrder"  method="post" name="add_prod" action="">
+<fieldset>   
+	
+ <ul id="listOrder">
+   	{foreach from=$mps_product item=product name=product}
+	<li id="{$product.id}">{$product.product} -> {$product.noteAdmin} -> {$product.price} {$mps_conf.currency}</li>
+	{/foreach}
+    <br />
+</fieldset>
+<input id="newOrder" type="hidden" value="" name="newOrder">
+<input id="sortable" type="submit" name="submit" value="{'Submit'|@translate}">
+
+</form>
+</div>
+</div>
+</div>
+
+
+  
+  
+  
+  
+  
+  
+  
Index: /extensions/MyPiwiShop/admin/template/style.css
===================================================================
--- /extensions/MyPiwiShop/admin/template/style.css	(revision 27568)
+++ /extensions/MyPiwiShop/admin/template/style.css	(revision 27568)
@@ -0,0 +1,143 @@
+body{
+	heigth:100%;
+	margin:0;
+    padding:0;
+}
+.square-list {
+	list-style:square !important;
+	margin-left:35px !important;
+}
+.square-list li {
+    margin-bottom:0 !important;
+  }
+.dataTables_wrapper, .dataTables_info {
+	clear:none;
+}
+table.dataTable {
+	clear:right;
+	padding-top:10px;
+}
+.dataTable td img {
+	margin-bottom: -6px;
+	margin-left: -6px;
+}
+.paginate_enabled_previous, .paginate_enabled_previous:hover, .paginate_disabled_previous, .paginate_enabled_next, .paginate_enabled_next:hover, .paginate_disabled_next {
+	background:none;
+}
+.paginate_enabled_previous, .paginate_enabled_next {
+	color:#005E89 !important;
+}
+.paginate_enabled_previous:hover, .paginate_enabled_next:hover {
+	color:#D54E21 !important; 
+	text-decoration:underline !important;
+}
+.paginate_disabled_next, .paginate_enabled_next {
+	padding-right:3px;
+}
+#applyActionBlock .actionButtons {
+	margin-left:0;
+}
+span.infos, span.errors {
+	background-image:none;
+	padding:2px 5px; 
+	margin:0;
+	border-radius:5px;
+}
+table.dataTable tr.odd td.sorting_1, table.dataTable tr.even td.sorting_1{
+	background:transparent!important
+}
+#prod_table{
+	width:99%;
+	margin:0 auto;
+}
+
+
+ul#listOrder{
+	list-style:none;
+	height:auto;
+	padding:0
+}
+ul#listOrder li{
+	border:1px solid #ddd;
+	border-radius:4px;
+	padding:10px;
+	cursor:move;
+	height:20px;
+	width:auto;
+	margin-right:10px;
+	background:#fff;
+	color:#212326;
+	font-size:12px;
+	-moz-box-shadow:2px 2px 5px #ccc;
+}
+ul#listOrder li.highlight{
+	background:#f2f2f2;
+	border:1px dashed #212326;
+}
+.add_wrap{
+	width:100%;
+	height:100%;
+	position:absolute;
+	top:0;
+	left:0;
+	background:rgba(255,255,255,0.7);
+	z-index:1000;
+}
+.add_content {
+	background:#ffffff;
+	padding:30px 20px;
+	border-radius:10px; 
+	position:relative;
+	border:2px solid #7c7c7c;
+	border-radius:10px;
+	top:100px;
+	display:inline-block;
+    vertical-align:middle;
+}
+#add_option_prod{
+	border-radius:10px; 
+	position:relative;
+	border:2px solid #7c7c7c;
+	padding:20px
+}
+.close_box_add{
+	Width:17px;
+	height:17px;
+	position:absolute;
+	top:-7px;
+	right:-7px;
+	border-radius:17px;
+	background:#7c7c7c;
+	line-height:16px;
+	vertical-align:center;
+	cursor:pointer;
+	border:2px solid #fff;
+}
+.close_box_add:before {
+    content: "X";
+	color:#fff
+}
+.boxtitre{
+	display:inline-block;
+	margin-bottom:20px;
+}
+.boxtitre h1{
+	color:#7c7c7c
+}
+#form_order{
+	overflow:auto
+}
+.addopt_table div,.addprod_table div{
+	margin:10px 0;
+}
+.addopt_table span,.addprod_table span{
+	margin:0 10px
+}
+.optionCreate{
+	width:99%;
+	margin:0 auto;
+}
+
+.tabact{visibility:hidden}
+ tr:hover .tabact{visibility:visible}
+ .tit{display:none}
Index: /extensions/MyPiwiShop/include/admin_events.inc.php
===================================================================
--- /extensions/MyPiwiShop/include/admin_events.inc.php	(revision 27568)
+++ /extensions/MyPiwiShop/include/admin_events.inc.php	(revision 27568)
@@ -0,0 +1,90 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+/**
+ * admin plugins menu link
+ */
+function mps_admin_plugin_menu_links($menu) 
+{
+  $menu[] = array(
+    'NAME' => l10n('MyPiwiShop'),
+    'URL' => MPS_ADMIN,
+    );
+
+  return $menu;
+}
+
+
+/**
+ * add an action to the Batch Manager unit
+*/
+
+function mps_loc_end_element_set_unit()
+{
+  include_once(MPS_PATH.'admin/MyPiwiShopBatchUnit.php');
+  
+  global $template;
+	$template->set_filename('mps_batch_unit', realpath(MPS_PATH.'admin/template/MyPiwiShopBatchUnit.tpl'));
+	$template->assign_var_from_handle('MPS_BATCH_UNIT', 'mps_batch_unit');
+
+	$template->set_prefilter('batch_manager_unit', 'batch_unit_form');
+}
+
+function batch_unit_form($content)
+{
+
+	$search = '#</table>(\s*)</fieldset>#s';
+	$replace ='</table>$1<div class="MyPiwiShopBatchUnit" style="text-align:left">{combine_script id="batchmanagerunit" load="footer" path="'.MPS_PATH.'/admin/template/js/batchmanagerunit.js"}
+	{include file="'.realpath(MPS_PATH).'/admin/template/MyPiwiShopBatchUnit.tpl" imgid=$element.id}</div>$1</fieldset>';
+
+  return preg_replace($search, $replace, $content);
+}
+
+/**
+ * add an action to the Batch Manager
+ */
+
+function mps_loc_end_element_set_global()
+{
+	 include_once(MPS_PATH.'admin/MyPiwiShopBatch.php');
+
+	global $template;
+	
+	$template->set_filename('mps_batch_global', (MPS_PATH.'admin/template/MyPiwiShopBatch.tpl'));
+  
+	$template->append('element_set_global_plugins_actions', array(
+    'ID' => 'mps', 
+    'NAME' => l10n('MyPiwiShop'), 
+    'CONTENT' => $template->parse('mps_batch_global', true)
+    ));
+}
+
+/**
+ * perform added action
+*/ 
+function mps_element_set_global_action($action, $collection)
+{
+	if ($action == 'mps')
+	{
+	global $page;
+	
+		if (empty($_POST['productcheck']))
+		{
+		$page['errors'][] = l10n('Select at least one product');
+		}
+		else if ($_POST['thisprod']=='del')
+		{
+		$product_id = $_POST['productcheck'];
+		deletAll_product_image($product_id, $collection);
+		$page['infos'][] = l10n('Products have been removed for these pictures');	
+		}
+		else
+		{
+		$product_id = $_POST['productcheck'];
+		add_product_image($product_id, $collection);
+		$page['infos'][] = l10n('products have been added to these images');	
+		}
+  } 
+  
+}
+
Index: /extensions/MyPiwiShop/include/functions.inc.php
===================================================================
--- /extensions/MyPiwiShop/include/functions.inc.php	(revision 27568)
+++ /extensions/MyPiwiShop/include/functions.inc.php	(revision 27568)
@@ -0,0 +1,132 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+/**
+*prefilte calcul
+**/
+function filter_sets_image_format($ratios)
+{
+  $res = array();
+  
+   $query = '
+   SELECT id, width, height
+   FROM '.IMAGES_TABLE.'
+   ;';
+   	
+   $result = pwg_query($query);
+   if (pwg_db_num_rows($result))
+   {
+    while ($row = pwg_db_fetch_assoc($result))
+    {
+    if ($row['width']>0 && $row['height']>0)
+     {
+     $ratio = floor($row['width'] / $row['height'] * 100) / 100;
+   		
+    if(($ratio > $ratios[0] && $ratio < $ratios[1]) || ($ratio > $ratios[2] && $ratio < $ratios[3]))
+     {
+      $res[] = $row['id']; 
+     }
+   	}
+   }
+ }
+	return $res;
+}
+
+/**
+*product/image
+**/
+function add_product_image($product, $images)
+{
+  if (count($product) == 0 or count($images) == 0)
+  {
+    return;
+  }
+
+  $query = '
+	DELETE
+	FROM '.MPS_PROD_IMG_TABLE.'
+	WHERE image_id IN ('.implode(',', $images).')
+	AND product_id IN ('.implode(',', $product).')
+
+	;';
+  pwg_query($query);
+
+  $inserts = array();
+  foreach ($images as $image_id)
+  {
+    foreach ( array_unique($product) as $product_id)
+    {
+      $inserts[] = array(
+          'image_id' => $image_id,
+          'product_id' => $product_id,
+        );
+    }
+  }
+    mass_inserts(
+    MPS_PROD_IMG_TABLE,
+    array_keys($inserts[0]),
+    $inserts
+    );
+}
+
+/**
+*product/image
+**/
+function deletAll_product_image($product, $images)
+{
+  $query = '
+	DELETE
+	FROM '.MPS_PROD_IMG_TABLE.'
+	WHERE image_id IN ('.implode(',', $images).')
+	AND product_id IN ('.implode(',', $product).')
+
+	;';
+  pwg_query($query);
+
+}
+
+function deletThis_image_Allproduct($images)
+{
+  $query = '
+	DELETE
+	FROM '.MPS_PROD_IMG_TABLE.'
+	WHERE image_id IN ('.$images.')
+
+	;';
+  pwg_query($query);
+
+}
+
+function add_product_Thisimage($product, $images)
+{
+  if (count($product) == 0 or count($images) == 0)
+  {
+    return;
+  }
+
+  $query = '
+	DELETE
+	FROM '.MPS_PROD_IMG_TABLE.'
+	WHERE image_id IN ('.implode(',', $images).')
+
+	;';
+  pwg_query($query);
+
+  $inserts = array();
+  foreach ($images as $image_id)
+  {
+    foreach ( array_unique($product) as $product_id)
+    {
+      $inserts[] = array(
+          'image_id' => $image_id,
+          'product_id' => $product_id,
+        );
+    }
+  }
+    mass_inserts(
+    MPS_PROD_IMG_TABLE,
+    array_keys($inserts[0]),
+    $inserts
+    );
+}
+
Index: /extensions/MyPiwiShop/include/index.php
===================================================================
--- /extensions/MyPiwiShop/include/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/include/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/include/public_events.inc.php
===================================================================
--- /extensions/MyPiwiShop/include/public_events.inc.php	(revision 27568)
+++ /extensions/MyPiwiShop/include/public_events.inc.php	(revision 27568)
@@ -0,0 +1,205 @@
+<?php
+defined('MPS_PATH') or die('Hacking attempt!');
+
+
+
+
+/*
+ * button on album and photos pages
+ */
+function mps_add_button()
+{
+  global $template, $conf;
+  
+ $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+    $result 	= pwg_query($query);
+    while($row = pwg_db_fetch_assoc($result)){
+    $config = $row ;
+   }
+
+	$template->assign(array(
+    'mps_conf'	=> $config,
+	'MPS_PATH'	=> MPS_PATH,
+    ));   
+//  $template->assign('MPS_PATH', MPS_PATH);
+  $template->set_filename('mps_button', realpath(MPS_PATH.'template/button_basket.tpl'));
+//  $template->assign('mps_conf' , $config);
+
+  $button = $template->parse('mps_button', true);
+  
+  if (script_basename()=='index')
+  {
+    $template->add_index_button($button, EVENT_HANDLER_PRIORITY_NEUTRAL);
+  }
+  else
+  {
+    $template->add_picture_button($button, EVENT_HANDLER_PRIORITY_NEUTRAL);
+  }
+}
+
+/**
+ * add a forms on photo page
+ */
+function mps_loc_end_picture()
+{
+  global $template;
+	$template->set_filename('MyPiwiShop', realpath(MPS_PATH.'template/MyPiwiShop.tpl'));
+	$template->assign_var_from_handle('MPS_CONTENT', 'MyPiwiShop');
+}
+
+function mps_picture_form($content)
+{
+	$search = '#</div>(\s*)</div>(\s*){if isset\(\$COMMENT_COUNT\)}#s';
+	$replace =  '</div>$1</div>$2<div id="MyPiwiShop">{$MPS_CONTENT}</div>{if isset(\$COMMENT_COUNT)}';
+
+	return preg_replace($search, $replace, $content);
+}
+
+function mps_picture_form_piwitheme($content)
+{
+	$search = '#{/foreach}(\s*){/foreach}(\s*)</table>(\s*){/if}(\s*)</div>#s';
+	$replace =  '{/foreach}$1{/foreach}$1</table>$1{/if}</div><div class="panelPP"><div id="MyPiwiShop">{$MPS_CONTENT}</div></div>';
+
+	$newcont = preg_replace($search, $replace, $content);
+
+	$search = '#<a class="trigger" href="\#">(\s*)infos(\s*)</a>(\s*)#s';
+	$replace =  '<a class="trigger" href="#">infos</a>$1<a class="triggerPP" href="#" >{\'Shop\'|@translate}</a>{footer_script}{literal}$(document).ready(function(){$(".triggerPP").click(function(){$(".panelPP").toggle("fast");$(this).toggleClass("active");return false;});});{/literal}{/footer_script}';
+
+	return preg_replace($search, $replace, $newcont);
+}
+
+function mps_picture_form_stripped($content)
+{
+	$search = '#<div style="clear: both;"></div>(\s*)</div>(\s*)</div>(\s*)</div>(\s*){/if}(\s*)</div>#s';
+	$replace =  '<div style="clear: both;"></div></div>$1</div></div>$2{/if}<div id="Tmps" class="tabBlock"><div id="MyPiwiShop">{$MPS_CONTENT}</div></div></div>';
+
+	$newcont = preg_replace($search, $replace, $content);
+
+	$search = '#{/if}(\s*)</ul>(\s*)#s';
+	$replace =  '{/if}$2<li id="tabTmps" class="tabTitle" title="{\'Shop\'|@translate}" name="shop">{\'Shop\'|@translate}</li></ul>';
+
+	return preg_replace($search, $replace, $newcont);
+}
+
+function mps_prepar_tpl()
+{
+  global $conf, $template, $picture, $user;
+	$image_id = $picture['current']['id'];
+  	
+   $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+      $result 	= pwg_query($query);
+      while($row = pwg_db_fetch_assoc($result)){
+      $config = $row ;
+     }
+
+   $query = '
+	SELECT *
+    FROM '.MPS_PROD_IMG_TABLE.' AS pi
+    INNER JOIN '.MPS_PRODUCT_TABLE.' AS p ON pi.product_id = p.id
+    WHERE image_id = '.$image_id .'
+	ORDER BY `order`
+    ;';
+	
+  	$result = pwg_query($query);
+  	$num_rows = pwg_db_num_rows($result);
+  	
+  	
+   if ($num_rows != 0)
+   {
+      while($row = pwg_db_fetch_assoc($result)){
+	  $product[$row['product']] = $row['product'].' '. $row['price'].' '. $config['currency'];
+
+      $price[] = $row['price'];
+      } 
+	
+
+  
+  $query='SELECT pi.product_id, po.product_id, p.price, p.product, o.name, o.type, o.requi, o.order, po.opt_id, ov.val  
+   FROM '.MPS_PROD_IMG_TABLE.' AS pi
+    LEFT JOIN '.MPS_PRODUCT_TABLE.' As p ON p.id = pi.product_id
+	LEFT JOIN '.MPS_PROD_OPT_TABLE.' AS po ON po.product_id = p.id
+	LEFT JOIN '.MPS_OPTION_TABLE.' AS o ON o.id = po.opt_id
+	LEFT JOIN '.MPS_OPT_VAL_TABLE.' AS ov ON ov.select_id = o.id
+	WHERE image_id = '.$image_id .'
+	AND po.opt_id IS NOT NULL
+	ORDER BY o.order
+
+	 ;';
+	  $result = pwg_query($query);
+	while($row = pwg_db_fetch_assoc($result)){
+	{
+		if (!isset($products[ $row['product']]['options'][ $row['order'] ]))
+		{
+			$products[ $row['product'] ]['options'][ $row['order'] ] = array(
+			'name'   => $row['name'],
+			'type'   => $row['type'],
+			'requi'  => $row['requi'],
+			'values' => array(),
+			);
+		}
+  
+	$products[ $row['product'] ]['options'][ $row['order'] ]['values'][] = $row['val'];
+	}
+    }
+	if(isset($products)){
+     $template->assign(array(
+	 'mps_options'  		=> $products,
+  	 ));
+	}
+  
+  	$template->assign(array(
+  	'mps_conf'	  		=> $config,
+	'mps_price'			=> $price,
+	'mps_product'		=> $product,
+  	));
+	
+
+	
+	
+	$theme = $user['theme'];
+	
+ switch ($theme) {
+    case 'stripped':
+        $template->set_prefilter('picture', 'mps_picture_form_stripped');
+        break;
+	case 'PwgCarbon_dft':
+	case 'PwgCarbon':
+	case 'Float':
+	case 'wood':
+	case 'Slimi':
+	case 'Slim':
+        $template->set_prefilter('picture', 'mps_picture_form_piwitheme');
+		$template->assign(array('bypiwitheme'=> 'bypiwitheme'));
+        break;
+    default:
+        $template->set_prefilter('picture', 'mps_picture_form');
+        break;
+}
+
+
+   }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  
Index: /extensions/MyPiwiShop/index.php
===================================================================
--- /extensions/MyPiwiShop/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/language/en_UK/description.txt
===================================================================
--- /extensions/MyPiwiShop/language/en_UK/description.txt	(revision 27568)
+++ /extensions/MyPiwiShop/language/en_UK/description.txt	(revision 27568)
@@ -0,0 +1,1 @@
+Create a micro shop of derivative products from your images
Index: /extensions/MyPiwiShop/language/en_UK/index.php
===================================================================
--- /extensions/MyPiwiShop/language/en_UK/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/language/en_UK/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/language/en_UK/intro.html
===================================================================
--- /extensions/MyPiwiShop/language/en_UK/intro.html	(revision 27568)
+++ /extensions/MyPiwiShop/language/en_UK/intro.html	(revision 27568)
@@ -0,0 +1,33 @@
+  <p>You want to offer your photos for sale, but some have 16:9 aspect ratio
+  and others 3:2 ? Some are 12-Megapixel pics and others only 5-Megapixel ? It
+  doesn't matter : with this plugin, you'll be able to display the right price(s)
+  and the right description(s) for each one. It'll be the same if you sell tee-shirts,
+  some being only available in extra large size : your customers won't be allowed
+  to select a medium size for them anymore. All you need is a PayPal account
+  and... this plugin.</p>
+  <h4>How to use it&nbsp;?</h4>
+  There are three stages :
+  <ul class="square-list">
+    <li>In the &quot;Configuration&quot; tab, enter your PayPal ID or the e-mail
+      address you use to register with PayPal. Select the currency. Enter the
+      shipment charges if they are the same for all your items. Either, add them
+      to each product's price. When required, write a sentence to present your
+      items (100% cotton tee-shirts made in China...).<br>
+    </li>
+    <li>Then, in the &quot;Product&quot; tab, set description and amount for <u>each
+        item</u> you want to sell ('large size yellow tee-shirt : 8 $, medium
+        size yellow tee-shirt : 7 $' or '30 x 20 cm paper print : 20 ? ; 45 x
+        30 cm paper print : 30 ? ; 40 x 30 cm paper print : 25 ?'...)<br>
+    </li>
+    <li>Finally, open the &quot;Photos/Batch manager&quot; tab on the Administration
+      page. Select one or several pictures (predefined aspect ratio filters have
+      been added&nbsp;: 16:9, 3:2, 4:3, square ; for other ratios, choose &quot;Add
+      a filter/Size&quot;). When all the pictures with same description(s) and
+      price(s) are checked, click on &quot;Choose an action/MyPiwishop&quot; and
+      assign to each picture its corresponding description(s) and amount(s).
+      It's of course possible to add or delete amounts at any time.</li>
+  </ul>
+  <br>
+  <h4>Licensing</h4>
+  <p>This work is in the public domain, without any license, you can entirely
+    re-use it and say it's your own work :-) </p>
Index: /extensions/MyPiwiShop/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/MyPiwiShop/language/en_UK/plugin.lang.php	(revision 27568)
+++ /extensions/MyPiwiShop/language/en_UK/plugin.lang.php	(revision 27568)
@@ -0,0 +1,16 @@
+<?php
+
+/*
+ * as much as possible prefer using comprehensive keys (such as "Check here") instead of
+ * formatted keys (eg "paypalperso_check_button"), it would make your code more readable and help
+ * the translation team as well
+ */
+
+$lang['Skeleton'] = 'Skeleton';
+$lang['What Skeleton can do for me?'] = 'What Skeleton can do for me?';
+$lang['Check me!'] = 'Check me!';
+$lang['Nothing appened, but you didn\'t check the box!'] = 'Nothing appened, but you didn\'t check the box!';
+$lang['Nothing appened, but you checked the box!'] = 'Nothing appened, but you checked the box!';
+$lang['Common configuration'] = 'Common configuration';
+
+?>
Index: /extensions/MyPiwiShop/language/fr_FR/description.txt
===================================================================
--- /extensions/MyPiwiShop/language/fr_FR/description.txt	(revision 27568)
+++ /extensions/MyPiwiShop/language/fr_FR/description.txt	(revision 27568)
@@ -0,0 +1,1 @@
+Créer une micro boutique de produits dérivés issus de vos images
Index: /extensions/MyPiwiShop/language/fr_FR/index.html
===================================================================
--- /extensions/MyPiwiShop/language/fr_FR/index.html	(revision 27568)
+++ /extensions/MyPiwiShop/language/fr_FR/index.html	(revision 27568)
@@ -0,0 +1,31 @@
+  <legend>Vous voulez proposer &agrave; la vente des photos de formats diff&eacute;rents,
+  de qualit&eacute;s diff&eacute;rentes et afficher pour chacune des tarifs et
+  des tailles de tirages adapt&eacute;s ? Vous vendez des Tee-shirts dont certains
+  ne sont disponibles qu'en taille XL et vous ne souhaitez donc pas que vos clients
+  puissent s&eacute;lectionner une taille M ? Si vous poss&eacute;dez un compte
+  Paypal, ce plugin est fait pour vous. </legend>
+  <h4>Comment l'utiliser&nbsp;?</h4>
+  Cela se fait en trois &eacute;tapes : Dans l'onglet &quot;Configuration&quot;,
+  entrez votre code client Paypal ou votre adresse mail Paypal, la monnaie &agrave; utiliser
+  et les frais d'envoi si ceux-ci sont fixes. (Sinon, incluez-les dans le prix
+  de chaque article). Si n&eacute;cessaire, entrez une pr&eacute;sentation de
+  vos produits (Tee-shirts 100% coton r&eacute;alis&eacute;s en Chine...).
+  <p>Dans l'onglet &quot;Produit&quot;, entrez la description de toutes les prestations
+    propos&eacute;es et le prix correspondant (Tee-shirt jaune taille XL : 8 &euro;,
+    Tee-shirt jaune taille L : 7 &euro; ou encore Tirage papier 30 x 20 cm :
+    20 &euro; ; Tirage papier 45 x 30 cm : 30 &euro; ; Tirage papier 40 x 30
+    cm : 25 &euro;...)</p>
+  <p>Rendez-vous enfin dans &quot;Photos&quot;/&quot;Gestion par lot&quot; dans
+    l'interface d'administration. S&eacute;lectionnez vos photos une par une
+    ou par lot (des filtres pr&eacute;d&eacute;finis de formats de photos ont &eacute;t&eacute; ajout&eacute;s&nbsp;:
+    16:9, 3:2, 4:3, carr&eacute; ; pour les autres formats, s&eacute;lectionnez &quot;Ajouter
+    un filtre&quot;/&quot;Dimensions&quot;). Quand une ou plusieurs photos correspondant
+    aux m&ecirc;mes tarifs sont s&eacute;lectionn&eacute;es, allez enfin dans &quot;Choisir
+    une action&quot;, &quot;Multiboutique&quot; et attribuez aux photos tous
+    les tarifs et descriptions qui leur correspondent. Il est bien s&ucirc;r
+    possible de supprimer ou d'ajouter des tarifs ult&eacute;rieurement.<br>
+  </p>
+  <h4>License</h4>
+  <p>Ce plugin est dans le domaine publique, aucune license ne s'y applique,
+    vous pouvez sans probl&egrave;me vous approprier le code sans contrepartie
+  ou mention :-) </p>
Index: /extensions/MyPiwiShop/language/fr_FR/index.php
===================================================================
--- /extensions/MyPiwiShop/language/fr_FR/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/language/fr_FR/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/language/fr_FR/intro.html
===================================================================
--- /extensions/MyPiwiShop/language/fr_FR/intro.html	(revision 27568)
+++ /extensions/MyPiwiShop/language/fr_FR/intro.html	(revision 27568)
@@ -0,0 +1,31 @@
+  <p>Vous voulez proposer &agrave; la vente des photos de formats diff&eacute;rents,
+  de qualit&eacute;s diff&eacute;rentes et afficher pour chacune des tarifs et
+  des tailles de tirages adapt&eacute;s ? Vous vendez des Tee-shirts dont certains
+  ne sont disponibles qu'en taille XL et vous ne souhaitez donc pas que vos clients
+  puissent s&eacute;lectionner une taille M ? Si vous poss&eacute;dez un compte
+  Paypal, ce plugin est fait pour vous. </p>
+  <h4>Comment l'utiliser&nbsp;?</h4>
+  Cela se fait en trois &eacute;tapes : Dans l'onglet &quot;Configuration&quot;,
+  entrez votre code client Paypal ou votre adresse mail Paypal, la monnaie &agrave; utiliser
+  et les frais d'envoi si ceux-ci sont fixes. (Sinon, incluez-les dans le prix
+  de chaque article). Si n&eacute;cessaire, entrez une pr&eacute;sentation de
+  vos produits (Tee-shirts 100% coton r&eacute;alis&eacute;s en Chine...).
+  <p>Dans l'onglet &quot;Produit&quot;, entrez la description de toutes les prestations
+    propos&eacute;es et le prix correspondant (Tee-shirt jaune taille XL : 8 &euro;,
+    Tee-shirt jaune taille L : 7 &euro; ou encore Tirage papier 30 x 20 cm :
+    20 &euro; ; Tirage papier 45 x 30 cm : 30 &euro; ; Tirage papier 40 x 30
+    cm : 25 &euro;...)</p>
+  <p>Rendez-vous enfin dans &quot;Photos&quot;/&quot;Gestion par lot&quot; dans
+    l'interface d'administration. S&eacute;lectionnez vos photos une par une
+    ou par lot (des filtres pr&eacute;d&eacute;finis de formats de photos ont &eacute;t&eacute; ajout&eacute;s&nbsp;:
+    16:9, 3:2, 4:3, carr&eacute; ; pour les autres formats, s&eacute;lectionnez &quot;Ajouter
+    un filtre&quot;/&quot;Dimensions&quot;). Quand une ou plusieurs photos correspondant
+    aux m&ecirc;mes tarifs sont s&eacute;lectionn&eacute;es, allez enfin dans &quot;Choisir
+    une action&quot;, &quot;Multiboutique&quot; et attribuez aux photos tous
+    les tarifs et descriptions qui leur correspondent. Il est bien s&ucirc;r
+    possible de supprimer ou d'ajouter des tarifs ult&eacute;rieurement.<br>
+  </p>
+  <h4>License</h4>
+  <p>Ce plugin est dans le domaine publique, aucune license ne s'y applique,
+    vous pouvez sans probl&egrave;me vous approprier le code sans contrepartie
+  ou mention :-) </p>
Index: /extensions/MyPiwiShop/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/MyPiwiShop/language/fr_FR/plugin.lang.php	(revision 27568)
+++ /extensions/MyPiwiShop/language/fr_FR/plugin.lang.php	(revision 27568)
@@ -0,0 +1,97 @@
+<?php
+$lang[' option']=' option';
+$lang[' product']=' produit';
+$lang['(filtered from _MAX_ total records)']='(filtré de _MAX_ éléments au total)';
+$lang['Add a option']='Ajouter une option';
+$lang['Add a product']='Ajouter un produit';
+$lang['Add a']='Ajouter une';
+$lang['Add the selected products for these images']='Ajouter les produits sélectionnés à ces images'; 
+$lang['Change the display order of products in the form']='Changer l\'ordre d\'affichage des produits dans le formulaire';
+$lang['Change the display order of options in the form']='Changer l\'ordre d\'affichage des options dans le formulaire';
+$lang['Configuration']='Configuration';
+$lang['Currency']='Monnaie';
+$lang['Delete the selected products for these images']='Supprimer les produits sélectionnés pour ces images'; 
+$lang['Display _MENU_ records per page']='Afficher _MENU_ éléments';
+$lang['Duplicate the']='Dupliquer l\'';
+$lang['Edit the']='Editer l\'';
+$lang['Edit']='Editer';
+$lang['Fields marked with * must be completed']='les champs marqués par * doivent être renseignés';
+$lang['Formats image 16/9']='Images au format 16/9';
+$lang['Formats image 3/2']='Images au format 3/2';
+$lang['Formats image 4/3']='Images au format 4/3';
+$lang['Formats image square']='Images au format carré';
+$lang['No matching option found']='aucun élément trouvé';
+$lang['No product selected']='Pas de produit sélectionné';
+$lang['Note administrator']='Note de l\'administrateur'; 
+$lang['Option registered']='Option enregistrée';
+$lang['Options']='Options';
+$lang['Option value']='Valeur de l\'option';
+$lang['Presentation text for a single product']='Texte de présentation pour un seul produit';
+$lang['Presentation text for several products']='Texte de présentation pour plusieurs produits';
+$lang['Price']='Prix'; 
+$lang['Product Register']='produits enregistrés';
+$lang['Product registered']='Produit enregistré';
+$lang['Product']='Produit';
+$lang['Products have been added to these images']='Produits ajoutés pour ces images';
+$lang['Products have been removed for these pictures']='Produits retirés pour ces images';
+$lang['Products']='Produits';
+$lang['Registered']='Enregistré';
+$lang['Required']='Requis';
+$lang['Select at least one product']='sélèctionner un produit dans la liste'; 
+$lang['Shipping cost']='frais d\'expédition';
+$lang['Shop']='Boutique';
+$lang['Showing 0 to 0 of 0 records']='Affichage de l\'élément 0 à 0 sur 0 éléments';
+$lang['Showing _START_ to _END_ of _TOTAL_ records']='Affichage de l\'élément _START_ à _END_ sur _TOTAL_ éléments';
+$lang['The field is required']='Le champ est requis';
+$lang['The order is changed']='L\'ordre est changé';
+$lang['Type of option']='Type d\'option';
+$lang['Type of option']='Type d\'option';
+$lang['Type']='Type';
+$lang['Validate the change']='Valider les changements';
+$lang['Value']='Valeur';
+$lang['What is MyPiwiShop?']='c\'est quoi MyPiwiShop';
+$lang['Your Paypal id']='votre id Paypal';
+$lang['Your Paypal id']='votre id Paypal';
+$lang['add value']='ajouter une valeur';
+$lang['drag / drop to change the order']='faites glisser/déposer pour changer l\'ordre';
+$lang['duplicate']='dupliquer';
+$lang['option registered']='option enregistrée';
+$lang['products have been added to these images']='les produits ont été ajouté pour ces images';
+$lang['products have been removed for these pictures']='les produits ont été suprimé pour ces images';
+$lang['see related products for this picture']='voir les produits associés à cette image';
+$lang['shipping fees']='frais d\'expédition';
+$lang['the order is changed']='l\'ordre est changé';
+$lang['you must enter the name of the option']='vous devez renseigner le nom de l\'option';
+$lang['you must enter the product and not the price']='vous devez renseigner le non du produit et son prix';
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: /extensions/MyPiwiShop/language/index.php
===================================================================
--- /extensions/MyPiwiShop/language/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/language/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/main.inc.php
===================================================================
--- /extensions/MyPiwiShop/main.inc.php	(revision 27568)
+++ /extensions/MyPiwiShop/main.inc.php	(revision 27568)
@@ -0,0 +1,106 @@
+<?php 
+/*
+Plugin Name: MyPiwiShop
+Version: auto
+Description: a litle shop for your piwigo.
+Plugin URI: auto
+Author: Miklfe/Harry
+Author URI: http://piwitheme.fr
+*/
+
+
+
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+global $prefixeTable, $template, $conf;
+
+
+// +-----------------------------------------------------------------------+
+// | Define plugin constants                                               |
+// +-----------------------------------------------------------------------+
+define('MPS_ID',      		 	basename(dirname(__FILE__)));
+define('MPS_PATH' ,   		 	PHPWG_PLUGINS_PATH . MPS_ID . '/');
+define('MPS_PRODUCT_TABLE',  	$prefixeTable . 'mps_product');
+define('MPS_PROD_IMG_TABLE', 	$prefixeTable . 'mps_prod_img');
+define('MPS_PROD_OPT_TABLE', 	$prefixeTable . 'mps_prod_opt');
+define('MPS_CONF_TABLE', 	 	$prefixeTable . 'mps_conf');
+define('MPS_OPTION_TABLE', 	 	$prefixeTable . 'mps_option');
+define('MPS_OPT_VAL_TABLE', 	$prefixeTable . 'mps_opt_val');
+define('MPS_ADMIN',    		 	get_root_url() . 'admin.php?page=plugin-' . MPS_ID);
+define('MPS_PUBLIC',         	get_absolute_root_url() . make_index_url(array('section' => 'MyPiwiShop')) . '/');
+define('MPS_DIR',            	PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'MyPiwiShop/');
+define('MPS_VERSION',        	'auto');
+
+
+// init the plugin
+add_event_handler('init', 'mps_init');
+
+if (defined('IN_ADMIN'))
+{
+  include_once(MPS_PATH . 'include/admin_events.inc.php');
+  
+  // admin plugins menu link
+  add_event_handler('get_admin_plugin_menu_links', 'mps_admin_plugin_menu_links');
+  
+  
+  // new action in Batch Manager
+  add_event_handler('loc_end_element_set_global', 'mps_loc_end_element_set_global');
+  add_event_handler('element_set_global_action', 'mps_element_set_global_action', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
+  add_event_handler('loc_end_element_set_unit', 'mps_loc_end_element_set_unit');
+
+}
+else
+{
+  // file containing all public handlers functions
+  include_once(MPS_PATH . 'include/public_events.inc.php');
+  
+  // add button on album and photos pages
+  add_event_handler('loc_end_index', 'mps_add_button');
+  add_event_handler('loc_end_picture', 'mps_add_button');
+  
+  // form on photo page
+  add_event_handler('loc_end_picture', 'mps_prepar_tpl');
+  add_event_handler('loc_end_picture', 'mps_loc_end_picture');
+}
+
+// files containing specific plugin functions
+include_once(MPS_PATH . 'include/functions.inc.php');
+
+/**
+ * plugin initialization
+ */
+function mps_init()
+{
+  global $conf, $template;
+  
+  // apply upgrade if needed
+  include_once(MPS_PATH . 'maintain.inc.php');
+  $maintain = new mps_maintain(MPS_ID);
+  $maintain->autoUpdate(MPS_VERSION, 'install');
+ 
+ 
+  // load plugin language file
+  load_language('plugin.lang', MPS_PATH);
+  
+  // prepare plugin configuration
+  $query='SELECT * FROM '.MPS_CONF_TABLE.';';
+  $result 	= pwg_query($query);
+  while($row = pwg_db_fetch_assoc($result)){
+   $config = $row ;
+  }
+  
+  $template->assign(array(
+  'mps_conf' => $config
+  ));  
+
+}
+
+
+  
+  
+  
+  
+  
+  
+  
+  
Index: /extensions/MyPiwiShop/maintain.inc.php
===================================================================
--- /extensions/MyPiwiShop/maintain.inc.php	(revision 27568)
+++ /extensions/MyPiwiShop/maintain.inc.php	(revision 27568)
@@ -0,0 +1,153 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class mps_maintain extends PluginMaintain
+{
+  private $installed = false;
+  
+
+	/*
+   * plugin installation
+   */
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf, $prefixeTable;
+
+    // add a new table
+  $tables = mps_get_tables();
+
+ if (!in_array($prefixeTable.'mps_conf', $tables))
+  {
+	 $query = "
+	CREATE TABLE IF NOT EXISTS ". $prefixeTable ."mps_conf (
+	  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+	  `PPid` varchar(100) NOT NULL,
+	  `currency` varchar(100),
+	  `ship` decimal NOT NULL,
+	  `comm` text ,
+	  `tprmulti` varchar(200) ,
+	  `tpruniq` varchar(200) ,
+	  PRIMARY KEY (`id`)
+	) ENGINE=MyISAM DEFAULT CHARSET=utf8
+	;";
+	
+    pwg_query($query);
+
+    single_insert(
+      $prefixeTable."mps_conf",
+      array(
+        'currency' => 'EUR',
+        )
+      );
+	}
+	
+	pwg_query('
+	CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'mps_product` (
+	  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+	  `order` int(20),
+	  `product` varchar(100) NOT NULL,
+	  `noteAdmin` varchar(255),
+	  `price` float NOT NULL,
+	  PRIMARY KEY (`id`)
+	) ENGINE=MyISAM DEFAULT CHARSET=utf8
+	;');
+	
+	pwg_query('
+	CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'mps_prod_img` (
+	  `image_id` MEDIUMINT (20) UNSIGNED NOT NULL,
+	  `product_id` MEDIUMINT (20) UNSIGNED NOT NULL,
+	  PRIMARY KEY (`product_id`,`image_id`)
+	) ENGINE=MyISAM DEFAULT CHARSET=utf8
+	;');
+	
+	pwg_query('
+	CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'mps_option` (
+	  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+	  `name` varchar(250) NOT NULL,
+	  `type` varchar(100) NOT NULL,
+	  `titre` varchar(200),
+	  `requi` int(10),
+	  `order` int(20),
+	  
+	  PRIMARY KEY (`id`)
+	) ENGINE=MyISAM DEFAULT CHARSET=utf8
+	;');
+
+	pwg_query('
+	CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'mps_opt_val` (
+	  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+	  `val` varchar(100) NOT NULL,
+	  `select_id` int(11) NOT NULL,
+	  PRIMARY KEY (`id`)
+	) ENGINE=MyISAM DEFAULT CHARSET=utf8
+	;');
+
+	pwg_query('
+	CREATE TABLE IF NOT EXISTS `'. $prefixeTable .'mps_prod_opt` (
+	  `opt_id` MEDIUMINT (20) UNSIGNED NOT NULL,
+	  `product_id` MEDIUMINT (20) UNSIGNED NOT NULL,
+	  PRIMARY KEY (`product_id`,`opt_id`)
+	) ENGINE=MyISAM DEFAULT CHARSET=utf8
+	;');
+	
+    $this->installed = true;
+  }
+  
+  /**
+   * plugin activation
+   */
+  function activate($plugin_version, &$errors=array())
+  {
+    if (!$this->installed)
+    {
+
+      $this->install($plugin_version, $errors);
+    }
+  }
+
+  /**
+   * plugin deactivation
+   */
+  function deactivate()
+  {
+  }
+
+  /**
+   * plugin uninstallation
+   */
+  function uninstall()
+  {
+    global $prefixeTable;
+
+    // delete table
+    pwg_query('DROP TABLE `'. $prefixeTable .'mps_conf`;');
+    pwg_query('DROP TABLE `'. $prefixeTable .'mps_product`;');
+    pwg_query('DROP TABLE `'. $prefixeTable .'mps_prod_img`;');
+    pwg_query('DROP TABLE `'. $prefixeTable .'mps_option`;');
+    pwg_query('DROP TABLE `'. $prefixeTable .'mps_opt_val`;');
+    pwg_query('DROP TABLE `'. $prefixeTable .'mps_prod_opt`;');
+ }
+}
+
+
+function mps_get_tables()
+{
+  global $prefixeTable;
+  
+  $tables = array();
+
+  $query = '
+SHOW TABLES
+;';
+  $result = pwg_query($query);
+
+  while ($row = pwg_db_fetch_row($result))
+  {
+    if (preg_match('/^'.$prefixeTable.'/', $row[0]))
+    {
+      array_push($tables, $row[0]);
+    }
+  }
+
+  return $tables;
+}
Index: /extensions/MyPiwiShop/template/MyPiwiShop.tpl
===================================================================
--- /extensions/MyPiwiShop/template/MyPiwiShop.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/template/MyPiwiShop.tpl	(revision 27568)
@@ -0,0 +1,76 @@
+﻿{combine_css path=$MPS_PATH|cat:'template/style.css'}
+{combine_css path=$MPS_PATH|cat:'template/elem_form_style.css'}
+{if isset($bypiwitheme)}
+{combine_css path=$MPS_PATH|cat:'template/piwitheme_style.css'}
+{/if}
+{combine_script id="mps" load="footer" path=$MPS_PATH|cat:'template/js/MyPiwiShop.js'}
+
+
+
+<div id=mps_content class="mps">
+<h1>{'Shop'|@translate}</h1>
+<div id="panier" data-prod='{if isset ($mps_options)}{$mps_options|@json_encode}{/if}'>
+{if isset ($mps_conf.comm)}
+	<div id="mps_com">{$mps_conf.comm}</div>
+{/if}
+<form id="buyprod" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
+<input type="hidden" name="cmd" value="_cart">
+<input type="hidden" name="business" value="{$mps_conf.PPid}">
+<input type="hidden" name="lc" value="FR">
+<input type="hidden" name="item_name" value="{$PAGE_TITLE}">
+<input type="hidden" name="button_subtype" value="products">
+<input type="hidden" name="currency_code" value="{$mps_conf.currency}">
+<input type="hidden" name="add" value="1">
+<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
+<input type="hidden" name="on0" value="taille et type d'impression :">
+
+<div id="prod-ch">
+
+{if count($mps_product) == 1}
+
+{foreach from=$mps_product item=product key=key name=hit}
+<div class="titre">{$mps_conf.tpruniq}</div>
+<span class="prod_uniq"><h1>{$product}</h1></span>
+<input type="hidden" name="os0" value="{$key}" id="prod_inp">
+{/foreach}
+{else}
+
+<div class="titre">{$mps_conf.tprmulti}</div>
+<div class="styled">
+<select name="os0" id="prod_sel">
+{html_options options=$mps_product }
+{/if}
+</select>
+</div>
+</div>
+
+<div id="options_prod" class="options"> 
+<span><h2>{'option du produit'|@translate}</h2>
+</span>
+<span id="req">{'Fields marked with * must be completed'|@translate}<span>
+</div>
+
+{if $mps_conf.ship != 0}
+<div>{'shipping fees'|@translate} {$mps_conf.ship} {$mps_conf.currency}</div>
+{/if}
+
+<div id="mps_sub">
+<span><input type="submit" class="action buy"  name="sub" value="{'Buy'|@translate}" alt="Buy" ></span>
+<span class="errors" style="display:none">{'Fields marked with * must be completed'|@translate}</span>
+</div>
+
+{foreach from=$mps_product item=foo key=key name=hit}
+<input type="hidden" name="option_select{math equation="x-y" x=$smarty.foreach.hit.iteration y=1}" value="{$key}">
+{/foreach}
+{foreach from=$mps_price item=foo key=key name=hit}
+<input type="hidden" name="option_amount{math equation="x-y" x=$smarty.foreach.hit.iteration y=1}" value="{$foo}">
+{/foreach}
+{if $mps_conf.ship != 0}
+<input type="hidden" name="shipping" value="{$mps_conf.ship}">
+{/if}
+<input type="hidden" name="option_index" value="0">
+</form>
+
+
+</div>
+</div>
Index: /extensions/MyPiwiShop/template/button_basket.tpl
===================================================================
--- /extensions/MyPiwiShop/template/button_basket.tpl	(revision 27568)
+++ /extensions/MyPiwiShop/template/button_basket.tpl	(revision 27568)
@@ -0,0 +1,37 @@
+{footer_script}{literal}
+(function($) {
+	$(document).ready(function(){
+		
+/*		var $Pbask 	= $('#basket').offset(),
+			$w_tit	= $('#tit').width(),
+			$h_tit	= $('#tit').height(),
+			$top	= $Pbask.top - $h_tit,
+			$left	= $Pbask.left - $w_tit;
+
+		$('#basket').hover(function(){
+			$(this).next().css({'position':'absolute','top':$top,'left':$left}).stop( true, true ).fadeToggle()
+			//console.debug($(this).next())
+			//$('#tit').css({'position':'absolute','top':$top,'left':$left}).show();
+		})
+		$('#basket').mouseleave(function(){
+			$('#tit').hide();
+		})*/
+	
+	})
+})(jQuery);
+{/literal}{/footer_script}	
+
+
+
+
+
+{strip}
+{combine_css path=$MPS_PATH|cat:'template/style.css'}
+<a class="pwg-state-default pwg-button-basket noslide" href="https://www.paypal.com/cgi-bin/webscr?cmd=_cart&business={$mps_conf.PPid}&display=1&submit=voir+le+panier"  target="_blank"><span id="basket" class="pwg-icon" style="background:url('{$ROOT_URL}{$MPS_PATH}template/bhover.png') center center no-repeat;"> </span>
+<div id="tit"><p>{'show your basket'|@translate}</p></div>
+</a>
+
+	</a>
+{/strip}
+
+
Index: /extensions/MyPiwiShop/template/elem_form_style.css
===================================================================
--- /extensions/MyPiwiShop/template/elem_form_style.css	(revision 27568)
+++ /extensions/MyPiwiShop/template/elem_form_style.css	(revision 27568)
@@ -0,0 +1,124 @@
+﻿
+/* ----------------------------------------------  Reset form elements ---------------------------------------------- */
+	
+	div.mps input, div.mps select,div.mps textarea {
+		margin:0; padding:0; font-size:0.85em; outline:none;
+		font-family:inherit;	
+		-moz-box-sizing:border-box; /* Firefox */
+		-webkit-box-sizing:border-box; /* Safari */
+		box-sizing:border-box;}
+
+/* ----------------------------------------------  Inputs, textareas and selects  ---------------------------------------------- */
+
+
+	div.mps input[type="text"],div.mps textarea,div.mps  select,div.mps div.styled,div.mps input[type="file"] {  
+		width:12em; border-radius:2px; border: solid 1px #ccc; padding:0.4em;}
+	
+	div.mps div.styled,div.mps select,div.mps input[type="submit"],div.mps input[type="button"], 
+	div.mps input[type="file"]:after {
+		background: white url(formelements-select.png) no-repeat center right;
+		-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2); 
+		box-shadow: 0 1px 3px rgba(0,0,0,0.2);}	
+	
+	div.mps input[type="text"],div.mps textarea,div.mps input[type="file"] { 
+		background-color: #f5f5f5;
+		-webkit-box-shadow: inset 0 2px 3px rgba(0,0,0,0.2);
+		box-shadow: inset 0 2px 3px rgba(0,0,0,0.2);}
+	
+		div.mps .ie9 input[type="text"] { line-height:normal; } /* Get the stuff to line up right */
+	
+	div.mps textarea { width:100%; height:10em; }
+	
+/* ----------------------------------------------  Select menu  ---------------------------------------------- */
+	
+	/* For IE and Firefox */
+
+	div.mps div.styled { overflow:hidden; padding:0; margin:0; }
+		
+		.ie7 div.styled {border:none;}
+
+	div.mps div.styled select {	
+		width:115%; background-color:rgba(255,255,255,0); background-image:none;
+		-webkit-appearance: none; border:none; box-shadow:none;}
+		
+		div.mps .ie7 div.styled select {
+			width:100%; background-color:#fff; border: solid 1px #ccc; 
+			padding:0.3em 0.5em;}	
+	
+/* ----------------------------------------------  File field  ----------------------------------------------  */
+
+	/* Webkit Only */
+	
+	div.mps input[type="file"] { 
+		position: relative; 
+		-webkit-appearance: none;
+		-webkit-box-sizing: border-box;
+		box-sizing: border-box;	width: 40%;	padding:0;}
+		
+	div.mps input[type=file]::-webkit-file-upload-button {
+		width: 0; padding: 0; margin: 0;-webkit-appearance: none; border: none;}	
+		
+	div.mps input[type="file"]:after {
+		content: 'Upload File';
+		margin:0 0 0 0.5em;
+		display: inline-block; left: 100%; position: relative;
+		background:white url(formelements-select.png) no-repeat center left;
+		padding:0.3em 0.5em; border: solid 1px #ccc !important;
+		-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.2); 
+		box-shadow: 0 1px 3px rgba(0,0,0,0.2);
+		border-radius:4px;}	
+		
+		
+		div.mps input[type="file"]:active:after {box-shadow:none;}
+	
+	
+/* ----------------------------------------------  Checkboxes and Radio inputs  ----------------------------------------------  */	
+		
+	div.mps input[type="radio"], 
+	div.mps input[type="checkbox"] { position: absolute; left: -999em; }
+		
+	div.mps label:before { 
+		display: inline-block; position: relative; top:0.25em; left:-2px; 
+		content:''; width:25px; height:25px;
+		background-image:url(formelements.png); }
+	
+	div.mps input[type="checkbox"] + label:before { background-position: 0 -25px;}
+	div.mps input[type="checkbox"]:checked + label:before {background-position: 0 0 ; }
+		 
+	div.mps input[type="radio"] + label:before { background-position: -25px -25px;}	 	
+	div.mps input[type="radio"]:checked + label:before { background-position: -25px 0;}
+	
+		/* Remove the custom styling for IE 7-8 */
+		
+		div.mps .ie8 label:before { display:none; content:none; }
+		
+		div.mps .ie8 input[type="checkbox"],
+		div.mps .ie8 input[type="radio"],
+		div.mps .ie7 input[type="checkbox"],
+		div.mps .ie7 input[type="radio"]{ 
+			position: static; left:0; }
+		
+		div.mps .ie8 input[type="checkbox"],
+		div.mps .ie8 input[type="radio"] { 
+			position:relative; top:5px; margin-right:0.5em;}	
+			
+	div.mps input[type="text"]:focus,div.mps textarea:focus {
+		border-color:#000;
+		}
+
+/* ---------------------------------------------- Form Submit and Next buttons ---------------------------------------------- */	
+
+	div.mps input[type="submit"], 
+	div.mps input[type="button"] { 
+		padding:0.5em 1em; line-height:1em; cursor:pointer;
+		border-radius:4px; color:#000; font-weight:bold; font-size:inherit;
+		border:solid 1px #ccc;	box-shadow:0 1px 5px rgba(0,0,0,0.2);
+		background-position: center bottom;}
+		
+		/* Gradient Generator by : http://www.colorzilla.com/gradient-editor/ */
+		
+	div.mps input[type="submit"]:active, 
+	div.mps input[type="button"]:active {-webkit-box-shadow: none; box-shadow:none;}
+		
+		/* IE7 needs you to change the background to transparent when using image background for submit buttons */	
+
Index: /extensions/MyPiwiShop/template/index.php
===================================================================
--- /extensions/MyPiwiShop/template/index.php	(revision 27568)
+++ /extensions/MyPiwiShop/template/index.php	(revision 27568)
@@ -0,0 +1,7 @@
+<?php
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/MyPiwiShop/template/js/MyPiwiShop.js
===================================================================
--- /extensions/MyPiwiShop/template/js/MyPiwiShop.js	(revision 27568)
+++ /extensions/MyPiwiShop/template/js/MyPiwiShop.js	(revision 27568)
@@ -0,0 +1,117 @@
+(function($) {
+	$(document).ready(function(){
+		if($('#prod_sel').length){
+			var	$Sel = $('#prod-ch select#prod_sel option:selected').attr('value');
+		}else{
+			var	$Sel = $('#prod-ch input#prod_inp').attr('value');
+		};
+		rempopt($Sel);
+	
+	
+		$(document).on('change','#prod_sel',function(){	
+			$('#options_prod').children('div').remove();
+			if($('#prod_sel').length){
+				var	$Sel = $('#prod-ch select#prod_sel option:selected').attr('value');
+			}else{
+				var	$Sel = $('#prod-ch input#prod_inp').attr('value');
+			}
+			rempopt($Sel);
+		});
+		
+		
+		function rempopt($Sel){
+			var $prod 	= $('#panier').data('prod'),
+				$r		= 1;
+				
+			if (typeof $prod[$Sel] != "undefined") {
+				var $option	= $prod[$Sel].options;	
+				$('#options_prod').show();
+				$.each($option,function(i, ele){
+					var $optName  = (ele.name),
+						$optType  = (ele.type),
+						$optRequi = (ele.requi),
+						$optVal	  = (ele.values);
+					if($optRequi==1){
+						var $requi = '*',
+							$req   = 'requi';
+						$('#requi').show();
+					}else{
+						var $requi ='',
+							$req   ='';
+					};
+						
+					switch($optType){
+					case 'radio':
+						var $optele = ($('<div />').addClass('inp').css('display','inline').append($('<input>').attr({'type':'hidden','value':$optName,'name':'on'+$r})));
+						$.each($optVal,function(e, ele){
+							var $i = ele.replace(/ /g,"");
+							$optele.append($('<input>').attr({'id':'val'+$i,'name':'os'+$r,'type':'radio','value':ele})).append($('<label />').text(ele).attr('for','val'+$i))
+						});
+					break;
+					case 'checkbox':
+						var $optele = ($('<div />').addClass('inp'));
+						$.each($optVal,function(e, ele){
+							var $i = ele.replace(/ /g,"");
+							$optele.append($('<input>').attr({'class':$optName,'id':'val'+$i,'name':'os'+$r,'type':'checkbox','value':ele})).append($('<label />').text(ele).attr('for','val'+$i)).append($('<br>'));
+							$r++
+						});
+					break;			
+					case 'select':
+						var $optele =($('<div />').addClass('styled').append($('<select />').attr({'name':'os'+$r,'id' :'opt_select'})).append($('<input>').attr({'type':'hidden','value':$optName,'name':'on'+$r})));
+						$.each($optVal,function(i, ele){
+							$('#opt_select', $optele).append($('<option />').attr('value',ele).text(ele));
+						});
+					break;	
+					case 'text':
+						var $optele = ($('<div />').addClass('inp').css('display','inline').append($('<input>').attr({'type':'text','name':'os'+$r})).append($('<input>').attr({'type':'hidden','value':$optName,'name':'on'+$r})));
+					break;	
+					case 'textarea':
+						var $optele = ($('<div />').addClass('inp').css('display','inline').append($('<textarea />').attr({'cols':'50','rows':'4','name':'os'+$r})).append($('<input>').attr({'type':'hidden','value':$optName,'name':'on'+$r})));
+					break;	
+					}
+					
+					$('#options_prod').append($('<div />').addClass('blockOpt '+ $optType +' '+ $req).append($('<div />').css('display','inline-block').text($optName + ' ' + $requi)).append($optele));
+	
+					$r++
+				});
+			}else{
+				$('#options_prod').hide();
+			}
+	
+	} 
+		
+		$(document).on('change','.checkbox input[type=checkbox]', function () {
+			var $on  	 = $(this).attr('name').substring(2),
+				$optName = $(this).attr('class');
+				
+			if($(this).is(':checked')){
+			 $('.checkbox').append($('<input>').attr({'type':'hidden','value':$optName,'name':'on'+$on}));
+			}else{
+				$('input[name=on'+$on+']').remove();
+			}
+		});
+		
+		$(document).on('submit','#buyprod', function(){
+			var $return = true;
+			$('.requi').each(function(){
+				var $this = $(this);
+
+				if ( ($this.hasClass('text') && $.trim($('.inp input[type="text"]',this).val()).length==0) 
+				|| ($this.hasClass('textarea') && $.trim($('.inp textarea',this).val()).length==0) 
+				|| ($this.hasClass('radio') && $('.inp input[type="radio"]:checked',this).length==0)
+				|| ($this.hasClass('checkbox') && $('.inp input[type="checkbox"]:checked',this).length==0)
+				){
+					$this.css({borderColor:'red'});
+					$('.errors').fadeIn();
+					setTimeout(function(){
+						$('.errors').fadeOut();
+						$this.css({borderColor:'transparent'})
+					},3000);
+
+					$return = false;
+				}				
+			})
+			return $return;
+		})
+	});
+})(jQuery);
Index: /extensions/MyPiwiShop/template/piwitheme_style.css
===================================================================
--- /extensions/MyPiwiShop/template/piwitheme_style.css	(revision 27568)
+++ /extensions/MyPiwiShop/template/piwitheme_style.css	(revision 27568)
@@ -0,0 +1,37 @@
+/*specifique theme piwitheme*/
+a.triggerPP{
+	position:absolute;
+	text-decoration:none;
+	left:0px;font-size:14px;
+	letter-spacing:-1px;
+	font-family:verdana,helvetica,arial,sans-serif;
+	color:#FFF;
+	font-weight:700;
+	background:#333;
+	border:1px solid #444;
+	border-top-right-radius:15px;
+	border-bottom-right-radius:15px;
+	display:block;
+	z-index:100000;
+	top:139px;
+	padding:10px 30px 10px 5px
+}
+a.triggerPP:hover{
+	background-color:#222
+}
+a.active.triggerPP{
+	background:#222
+}
+.panelPP{
+	position:absolute;
+	left:-40px;
+	display:none;
+	border:1px solid #111;
+	border-top-right-radius:20px;
+	border-bottom-right-radius:20px;
+	width:auto;min-width:330px;
+	height:auto;z-index:10000;
+	background:rgba(0, 0, 0, 0.7);
+	top:134px;color:#EFEFEF;
+	padding:10px 30px 30px 20px
+}
Index: /extensions/MyPiwiShop/template/style.css
===================================================================
--- /extensions/MyPiwiShop/template/style.css	(revision 27568)
+++ /extensions/MyPiwiShop/template/style.css	(revision 27568)
@@ -0,0 +1,88 @@
+div.mps select, div.mps input {all:initial}
+#mps_content{
+    background: none repeat scroll 0 0 #333333;
+    border: 1px solid #141414;
+    border-radius: 5px;
+    margin: 40px auto;
+    width: 90%;
+	padding:5px;
+}
+#tit{
+	display:none;
+	padding:none;
+	width:auto;
+	height:30px;
+	border-radius:15px;
+	border:1px solid #cccccc;
+	background:#ffffff;
+}
+#tit p{
+	margin:5px 10px 10px 5px;
+	color:#000000;
+	font-size:1.4em
+}
+#prod-ch, #options_prod{
+	display:inline-block;
+	width:45%
+}
+#prod-ch{
+	vertical-align:top;
+	text-align:left
+}
+#options_prod, #panier{
+	border:1px solid rgba(255,255,255,0.15);
+	border-radius:3px
+}
+.prod_uniq {
+	min-width:200px;
+	display:inline-block
+}
+
+div.mps .blockOpt{
+	margin:10px 20px
+}
+div.mps #mps_com{
+	margin: 0 auto 21px;
+    text-align: center;
+    width: 800px;
+}
+div.mps #panier form div {
+	margin:20px;
+}
+div.mps #panier #mps_sub{
+	margin-top:20px;
+	text-align:center
+}
+.requi{
+	border-radius:3px;
+	border-width:1px;
+	border-style:solid;
+	border-color:transparent
+}
+div.mps #panier form div.styled{
+	display:inline-block;
+	margin:0 20px;
+}
+div.mps #panier form div.styled select{
+	color:#000
+}
+div.mps #panier form div.styled option{
+	Background-color:#fff;
+}
+div.mps #panier form div.checkbox div.imp{
+	display:inline-block;
+}
+div.mps #panier form div.checkbox >div{
+	display:inline-block;
+	margin:0 20px;
+	vertical-align:middle
+}
+div.mps div#prod-ch {
+	font-size:1.2em;
+}
+div.mps div#prod-ch div.titre {
+	display:inline-block;
+	margin:5px 20px;
+	vertical-align:top;
+}
+
