diff --git a/admin-dev/tabs/AdminStores.php b/admin-dev/tabs/AdminStores.php
deleted file mode 100644
index a3a3a0de1..000000000
--- a/admin-dev/tabs/AdminStores.php
+++ /dev/null
@@ -1,324 +0,0 @@
-
-* @copyright 2007-2011 PrestaShop SA
-* @version Release: $Revision: 7310 $
-* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
-* International Registered Trademark & Property of PrestaShop SA
-*/
-
-include_once(dirname(__FILE__).'/../../classes/AdminTab.php');
-
-class AdminStores extends AdminTab
-{
- /** @var array countries list */
- private $countriesArray = array();
-
- public function __construct()
- {
- $this->context = Context::getContext();
- $this->table = 'store';
- $this->className = 'Store';
- $this->lang = false;
- $this->edit = true;
- $this->delete = true;
-
- $this->fieldImageSettings = array('name' => 'image', 'dir' => 'st');
-
- $this->_select = 'cl.`name` country, st.`name` state';
- $this->_join = '
- LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.')
- LEFT JOIN `'._DB_PREFIX_.'state` st ON (st.`id_state` = a.`id_state`)';
-
- $countries = Country::getCountries($this->context->language->id);
- foreach ($countries AS $country)
- $this->countriesArray[$country['id_country']] = $country['name'];
-
- $this->fieldsDisplay = array(
- 'id_store' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
- 'country' => array('title' => $this->l('Country'), 'width' => 100, 'filter_key' => 'cl!name'),
- 'state' => array('title' => $this->l('State'), 'width' => 100, 'filter_key' => 'st!name'),
- 'city' => array('title' => $this->l('City'), 'width' => 100),
- 'postcode' => array('title' => $this->l('Zip code'), 'width' => 50),
- 'name' => array('title' => $this->l('Name'), 'width' => 120, 'filter_key' => 'a!name'),
- 'phone' => array('title' => $this->l('Phone'), 'width' => 70),
- 'fax' => array('title' => $this->l('Fax'), 'width' => 70),
- 'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
- );
-
- $this->optionsList = array(
- 'general' => array(
- 'title' => $this->l('Parameters'),
- 'fields' => array(
- 'PS_STORES_DISPLAY_FOOTER' => array('title' => $this->l('Display in the footer:'), 'desc' => $this->l('Display a link to the store locator in the footer'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_STORES_DISPLAY_SITEMAP' => array('title' => $this->l('Display in the sitemap page:'), 'desc' => $this->l('Display a link to the store locator in the sitemap page'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_STORES_SIMPLIFIED' => array('title' => $this->l('Show a simplified store locator:'), 'desc' => $this->l('No map, no search, only a store directory'), 'cast' => 'intval', 'type' => 'bool'),
- 'PS_STORES_CENTER_LAT' => array('title' => $this->l('Latitude by default:'), 'desc' => $this->l('Used for the position by default of the map'), 'cast' => 'floatval', 'type' => 'text', 'size' => '10'),
- 'PS_STORES_CENTER_LONG' => array('title' => $this->l('Longitude by default:'), 'desc' => $this->l('Used for the position by default of the map'), 'cast' => 'floatval', 'type' => 'text', 'size' => '10')
- ),
- ),
- );
- parent::__construct();
- }
-
- protected function postImage($id)
- {
- $ret = parent::postImage($id);
- if (($id_store = (int)(Tools::getValue('id_store'))) AND isset($_FILES) AND sizeof($_FILES) AND file_exists(_PS_STORE_IMG_DIR_.$id_store.'.jpg'))
- {
- $imagesTypes = ImageType::getImagesTypes('stores');
- foreach ($imagesTypes AS $k => $imageType)
- imageResize(_PS_STORE_IMG_DIR_.$id_store.'.jpg', _PS_STORE_IMG_DIR_.$id_store.'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height']));
- }
- return $ret;
- }
-
- public function displayOptionsList()
- {
- parent::displayOptionsList();
-
- echo '
'.$this->l('You can also replace the icon representing your store in Google Maps. Go to the Preferences tab, and then the Appearance subtab.').'
';
- }
-
- public function postProcess()
- {
- if (isset($_POST['submitAdd'.$this->table]))
- {
- /* Cleaning fields */
- foreach ($_POST as $kp => $vp)
- $_POST[$kp] = trim($vp);
-
- /* If the selected country does not contain states */
- $id_state = (int)Tools::getValue('id_state');
- if ($id_country = Tools::getValue('id_country') AND $country = new Country((int)($id_country)) AND !(int)($country->contains_states) AND $id_state)
- $this->_errors[] = Tools::displayError('You have selected a state for a country that does not contain states.');
-
- /* If the selected country contains states, then a state have to be selected */
- if ((int)($country->contains_states) AND !$id_state)
- $this->_errors[] = Tools::displayError('An address located in a country containing states must have a state selected.');
-
- $latitude = (float)Tools::getValue('latitude');
- $longitude = (float)Tools::getValue('longitude');
-
- if(empty($latitude) OR empty($longitude))
- $this->_errors[] = Tools::displayError('Latitude and longitude are required.');
-
- /* Check zip code */
- if ($country->need_zip_code)
- {
- $zip_code_format = $country->zip_code_format;
- if (($postcode = Tools::getValue('postcode')) AND $zip_code_format)
- {
- $zip_regexp = '/^'.$zip_code_format.'$/ui';
- $zip_regexp = str_replace(' ', '( |)', $zip_regexp);
- $zip_regexp = str_replace('-', '(-|)', $zip_regexp);
- $zip_regexp = str_replace('N', '[0-9]', $zip_regexp);
- $zip_regexp = str_replace('L', '[a-zA-Z]', $zip_regexp);
- $zip_regexp = str_replace('C', $country->iso_code, $zip_regexp);
- if (!preg_match($zip_regexp, $postcode))
- $this->_errors[] = Tools::displayError('Your zip/postal code is incorrect.').' '.Tools::displayError('Must be typed as follows:').' '.str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $zip_code_format)));
- }
- elseif ($zip_code_format)
- $this->_errors[] = Tools::displayError('Postcode required.');
- elseif ($postcode AND !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode))
- $this->_errors[] = Tools::displayError('Your zip/postal code is incorrect.');
- }
-
- /* Store hours */
- $_POST['hours'] = array();
- for ($i = 1; $i < 8; $i++)
- $_POST['hours'][] .= Tools::getValue('hours_'.(int)($i));
- $_POST['hours'] = serialize($_POST['hours']);
- }
-
- if (!sizeof($this->_errors))
- parent::postProcess();
- }
-
- public function displayForm($isMainTab = true)
- {
- parent::displayForm();
-
- if (!($obj = $this->loadObject(true)))
- return;
- echo '
-
- ';
- }
-
-}
-
-
diff --git a/admin-dev/themes/template/stores/form.tpl b/admin-dev/themes/template/stores/form.tpl
new file mode 100644
index 000000000..e2ef4d996
--- /dev/null
+++ b/admin-dev/themes/template/stores/form.tpl
@@ -0,0 +1,294 @@
+{*
+* 2007-2011 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision: 8971 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+{if $firstCall}
+
+
+{/if}
+
+
+
+
+{if $firstCall}
+ {if $back}
+ {l s='Back'}
+ {else}
+ {l s='Back to list'}
+ {/if}
+
+{/if}
\ No newline at end of file
diff --git a/admin-dev/themes/template/stores/options.tpl b/admin-dev/themes/template/stores/options.tpl
new file mode 100644
index 000000000..bac3959d7
--- /dev/null
+++ b/admin-dev/themes/template/stores/options.tpl
@@ -0,0 +1,162 @@
+{*
+* 2007-2011 PrestaShop
+*
+* NOTICE OF LICENSE
+*
+* This source file is subject to the Academic Free License (AFL 3.0)
+* that is bundled with this package in the file LICENSE.txt.
+* It is also available through the world-wide-web at this URL:
+* http://opensource.org/licenses/afl-3.0.php
+* If you did not receive a copy of the license and are unable to
+* obtain it through the world-wide-web, please send an email
+* to license@prestashop.com so we can send you a copy immediately.
+*
+* DISCLAIMER
+*
+* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
+* versions in the future. If you wish to customize PrestaShop for your
+* needs please refer to http://www.prestashop.com for more information.
+*
+* @author PrestaShop SA
+* @copyright 2007-2011 PrestaShop SA
+* @version Release: $Revision: 9369 $
+* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+* International Registered Trademark & Property of PrestaShop SA
+*}
+
+
+
+
+
+
+ {l s='You can also replace the icon representing your store in Google Maps. Go to the Preferences tab, and then the Appearance subtab.'}
+