Index: trunk/www/vqmod/xml/dresscode_vqmod.xml
===================================================================
--- trunk/www/vqmod/xml/dresscode_vqmod.xml	(revision 0)
+++ trunk/www/vqmod/xml/dresscode_vqmod.xml	(revision 20)
@@ -0,0 +1,838 @@
+<modification>
+	<id>DRESSCODE</id>
+	<version>1.5.x</version>
+	<vqmver>2.X</vqmver>
+	<author>www.ethemeuk.com</author>
+    <file name="admin/controller/setting/setting.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->model_setting_setting->editSetting('config', $this->request->post);
+                ]]></search>
+            <add><![CDATA[
+                /*function*/
+            function loo_parse_queries($file) {
+                $sql_file = $file;
+                $contents = file_get_contents($sql_file);
+                $comment_patterns = array('/\/\*.*(\n)*.*(\*\/)?/', // comments
+                    '/\s*--.*\n/', //inline comments start with --
+                    '/\s*#.*\n/', //inline comments start with #
+                );
+                $contents = preg_replace($comment_patterns, "\n", $contents);
+                $contents = preg_replace('/(?<=t);(?=\n)/', "{{semicolon_in_text}}", $contents);
+                $statements = explode(";\n", $contents);
+                $queries = array();
+                foreach ($statements as $query) {
+                    if (trim($query) != '') {
+                        $query = str_replace("{{semicolon_in_text}}", ";", $query);
+                        //apply db prefix parametr
+                        preg_match("/\?:\w*/i", $query, $matches);
+                        $table_name = str_replace('?:', DB_PREFIX, $matches[0]);
+                        if ( !empty($table_name) ) {
+                            $query = str_replace(array($matches[0], 'key = '), array($table_name, '`key` = '), $query);
+                        }
+                        $queries[] = $query;
+                    }
+                }
+                return $queries;
+            }
+            /*function*/
+            if(file_exists(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql')) {
+				$tmpl_dir = dirname(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
+
+				if((bool)stristr($tmpl_dir, $this->config->get('config_template')) == false) {
+					// Parse and Run sql
+					$sql = loo_parse_queries(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
+					foreach ($sql as $query) {
+						$this->db->query($query);
+					}
+				}
+			}
+            // LOO (end)
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/controller/setting/store.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->model_setting_setting->editSetting('config', $this->request->post, $store_id);
+                ]]></search>
+            <add><![CDATA[
+                 /*function*/
+            function loo_parse_queries($file) {
+                $sql_file = $file;
+                $contents = file_get_contents($sql_file);
+                $comment_patterns = array('/\/\*.*(\n)*.*(\*\/)?/', // comments
+                    '/\s*--.*\n/', //inline comments start with --
+                    '/\s*#.*\n/', //inline comments start with #
+                );
+                $contents = preg_replace($comment_patterns, "\n", $contents);
+                $contents = preg_replace('/(?<=t);(?=\n)/', "{{semicolon_in_text}}", $contents);
+                $statements = explode(";\n", $contents);
+                $queries = array();
+                foreach ($statements as $query) {
+                    if (trim($query) != '') {
+                        $query = str_replace("{{semicolon_in_text}}", ";", $query);
+                        //apply db prefix parametr
+                        preg_match("/\?:\w*/i", $query, $matches);
+                        $table_name = str_replace('?:', DB_PREFIX, $matches[0]);
+                        if ( !empty($table_name) ) {
+                            $query = str_replace(array($matches[0], 'key = '), array($table_name, '`key` = '), $query);
+                        }
+                        $queries[] = $query;
+                    }
+                }
+                return $queries;
+            }
+			// LOO
+			if(file_exists(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql')) {
+				$tmpl_dir = dirname(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
+				if((bool)stristr($tmpl_dir, $this->config->get('config_template')) == false) {
+					// Parse and Run sql
+					$sql = loo_parse_queries(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
+					foreach ($sql as $query) {
+						$this->db->query($query);
+					}
+				}
+			}
+            // LOO (end)
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                $this->model_setting_setting->editSetting('config', $this->request->post, $this->request->get['store_id']);
+                ]]></search>
+            <add><![CDATA[
+                 // LOO
+			if(file_exists(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql')) {
+				$tmpl_dir = dirname(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
+				if((bool)stristr($tmpl_dir, $this->config->get('config_template')) == false) {
+					// Parse and Run sql
+					$sql = loo_parse_queries(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
+					foreach ($sql as $query) {
+						$this->db->query($query);
+					}
+				}
+			}
+			// LOO (end)
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/controller/catalog/product.php">
+		<operation>
+			<search position="after"><![CDATA[
+            private $error = array();
+            ]]></search>
+			<add><![CDATA[
+            protected function dbCheck(){
+                $query = $this->db->query("SHOW COLUMNS FROM `".DB_PREFIX."product` LIKE 'youtube'");
+                if(!$query->num_rows){
+                    $this->db->query("ALTER TABLE `".DB_PREFIX."product` ADD `youtube` TEXT NOT NULL");
+                }
+            }
+            ]]></add>
+		</operation>
+        <operation>
+            <search position="after"><![CDATA[
+            public function index() {
+            ]]></search>
+            <add><![CDATA[
+            $this->dbCheck();
+            ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+            $this->data['token'] = $this->session->data['token'];
+            ]]></search>
+            <add><![CDATA[
+            $this->data['tab_youtube'] = $this->language->get('tab_youtube');
+            ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+            $this->data['text_no'] = $this->language->get('text_no');
+            ]]></search>
+            <add><![CDATA[
+            $this->data['text_select_all'] = $this->language->get('text_select_all');
+		    $this->data['text_unselect_all'] = $this->language->get('text_unselect_all');
+            ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+            $this->data['tab_design'] = $this->language->get('tab_design');
+            ]]></search>
+            <add><![CDATA[
+            $this->data['tab_youtube'] = $this->language->get('tab_youtube');
+            ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+            $this->data['layouts'] = $this->model_design_layout->getLayouts();
+            ]]></search>
+            <add><![CDATA[
+            if (isset($this->request->post['youtube'])) {
+               $this->data['youtube'] = $this->request->post['youtube'];
+            } elseif (!empty($product_info)) {
+                $this->data['youtube'] = $product_info['youtube'];
+            } else {
+                $this->data['youtube'] = '';
+            }
+            ]]></add>
+        </operation>
+    </file>
+    <file name="admin/controller/common/header.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->data['heading_title'] = $this->language->get('heading_title');
+                ]]></search>
+            <add><![CDATA[
+                //Newsletter Subscribers
+                $this->data['text_newssubscribe'] = $this->language->get('text_newssubscribe');
+                //Newsletter Subscribers
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="before"><![CDATA[
+                $this->data['stores'] = array();
+                ]]></search>
+            <add><![CDATA[
+                //Newsletter Subscribers
+                $this->data['newssubscribe'] = $this->url->link('sale/newssubscribers', 'token=' . $this->session->data['token'], 'SSL');
+                //Newsletter Subscribers
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/controller/sale/contact.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $results = $this->model_sale_customer->getCustomers($customer_data);
+                ]]></search>
+            <add><![CDATA[
+                // Newsletter subscribers
+				$results = $this->model_sale_customer->getNewsletterSubscribers();
+				foreach ($results as $result) {
+					$emails["s".$result['id']] = $result['email_id'];
+				}
+ 				// Newsletter subscribers only
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/language/english/catalog/product.php">
+        <operation>
+            <search position="before"><![CDATA[
+                ?>
+                ]]></search>
+            <add><![CDATA[
+                $_['tab_youtube'] = 'Youtube Product';
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/language/english/common/header.php">
+        <operation>
+            <search position="before"><![CDATA[
+                ?>
+                ]]></search>
+            <add><![CDATA[
+                $_['text_newssubscribe']     = 'Newsletter Subscribers';
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/model/catalog/product.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $product_id = $this->db->getLastId();
+                ]]></search>
+            <add><![CDATA[
+                if (isset($data['youtube'])) {
+                    $this->db->query("UPDATE " . DB_PREFIX . "product SET youtube = '" . $this->db->escape($data['youtube']) . "' WHERE product_id = '" . (int)$product_id . "'");
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                $this->db->query("DELETE FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");
+                ]]></search>
+            <add><![CDATA[
+                if (isset($data['youtube'])) {
+                    $this->db->query("UPDATE " . DB_PREFIX . "product SET youtube = '" . $this->db->escape($data['youtube']) . "' WHERE product_id = '" . (int)$product_id . "'");
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+		        $this->db->query("DELETE FROM `" . DB_PREFIX . "product_profile` WHERE product_id = " . (int) $product_id);		if (isset($data['product_profiles'])) {			foreach ($data['product_profiles'] as $profile) {				$this->db->query("INSERT INTO `" . DB_PREFIX . "product_profile` SET `product_id` = " . (int) $product_id . ", customer_group_id = " . (int) $profile['customer_group_id'] . ", `profile_id` = " . (int) $profile['profile_id']);			}		}		$this->cache->delete('product');
+                ]]></search>
+            <add><![CDATA[
+                $this->cache->delete('product');
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/model/design/banner.php">
+        <operation>
+            <search position="replace"><![CDATA[
+                $banner_image_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner_image WHERE banner_id = '" . (int)$banner_id . "'");
+                ]]></search>
+            <add><![CDATA[
+                $banner_image_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner_image WHERE banner_id = '" . (int)$banner_id . "' ORDER BY banner_image_id");
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/model/sale/customer.php">
+        <operation>
+            <search position="before"><![CDATA[
+                public function getTotalRewards($customer_id) {
+                ]]></search>
+            <add><![CDATA[
+                public function getNewsletterSubscribers() {
+                    $query = $this->db->query("SELECT * FROM " . DB_PREFIX . "subscribe");
+                    return $query->rows;
+                }
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/view/template/catalog/product_form.tpl">
+        <operation>
+            <search position="after"><![CDATA[
+                <a href="#tab-design"><?php echo $tab_design; ?></a>
+                ]]></search>
+            <add><![CDATA[
+                <a href="#tab-youtube"><?php echo $tab_youtube; ?></a>
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/view/template/common/header.tpl">
+        <operation>
+            <search position="before"><![CDATA[
+                <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
+                ]]></search>
+            <add><![CDATA[
+                <li><a href="<?php echo $newssubscribe; ?>"><?php echo $text_newssubscribe; ?></a></li>
+                ]]></add>
+        </operation>
+    </file>
+    <file name="admin/view/template/design/banner_form.tpl">
+        <operation>
+            <search position="replace"><![CDATA[
+                html  = '<tbody id="image-row' + image_row + '">';
+                ]]></search>
+            <add><![CDATA[
+                html  = '<tbody class="MoveableRow" id="image-row' + image_row + '">';
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="replace"><![CDATA[
+                html += '<td class="left"><a onclick="$(\'#image-row' + image_row  + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
+                ]]></search>
+            <add><![CDATA[
+                html += '<td class="left"><a onclick="$(\'#image-row' + image_row  + '\').remove();" class="button"><?php echo $button_remove; ?></a><a class="down_button button">down</a><a class="up_button button">up</a></td>';
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="before"><![CDATA[
+                <?php echo $footer; ?>
+                ]]></search>
+            <add><![CDATA[
+                <script type="text/javascript"><!--
+                $(document).ready(function() {
+                    $('.down_button').live('click', function () {
+                        var rowToMove = $(this).parents('tbody.MoveableRow:first');
+                        var next = rowToMove.next('tbody.MoveableRow')
+                        if (next.length == 1) { next.after(rowToMove); }
+                    });
+
+                    $('.up_button').live('click', function () {
+                        var rowToMove = $(this).parents('tbody.MoveableRow:first');
+                        var prev = rowToMove.prev('tbody.MoveableRow')
+                        if (prev.length == 1) { prev.before(rowToMove); }
+                    });
+                });
+                //--></script>
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/common/column_left.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->load->model('catalog/information');
+                ]]></search>
+            <add><![CDATA[
+                $this->data['flash_title'] = $this->language->get('flash_title');
+                $this->data['link_1'] = $this->url->link('information/information&information_id=7');
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/common/footer.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->data['contact'] = $this->url->link('information/contact');
+                ]]></search>
+            <add><![CDATA[
+                $this->data['text_shopping_cart'] = $this->language->get('text_shopping_cart');
+                $this->data['shopping_cart'] = $this->url->link('checkout/cart');
+                $this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');
+                $this->data['logged'] = $this->customer->isLogged();
+                $this->data['account'] = $this->url->link('account/account', '', 'SSL');
+                $this->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
+                $this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/logout', '', 'SSL'));
+                $this->data['text_twitter_feeds'] = $this->language->get('text_twitter_feeds');
+                $this->data['text_facebook'] = $this->language->get('text_facebook');
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                $this->data['themecolor'] = $this->data['buyshop_general_settings']['themecolor'];
+                $this->data['contact_info'] = $this->language->get('contact_info');
+                $this->data['contact_phone'] = $this->language->get('contact_phone');
+                $this->data['phone_numbers'] = $this->language->get('phone_numbers');
+                $this->data['cell_phone'] = $this->language->get('cell_phone');
+                $this->data['mail_addresses'] = $this->language->get('mail_addresses');
+                $this->data['mail_sails'] = $this->language->get('mail_sails');
+                $this->data['mail_info'] = $this->language->get('mail_info');
+                $this->data['skype_title'] = $this->language->get('skype_title');
+                $this->data['skype_accounts'] = $this->language->get('skype_accounts');
+                $this->data['socials_title_1'] = $this->language->get('socials_title_1');
+                $this->data['socials_title_2'] = $this->language->get('socials_title_2');
+                $this->data['socials_title_3'] = $this->language->get('socials_title_3');
+                $this->data['socials_title_4'] = $this->language->get('socials_title_4');
+                $this->data['socials_title_5'] = $this->language->get('socials_title_5');
+                $this->data['socials_title_6'] = $this->language->get('socials_title_6');
+                $this->data['socials_link_1'] = $this->language->get('socials_link_1');
+                $this->data['socials_link_2'] = $this->language->get('socials_link_2');
+                $this->data['socials_link_3'] = $this->language->get('socials_link_3');
+                $this->data['socials_link_4'] = $this->language->get('socials_link_4');
+                $this->data['socials_link_5'] = $this->language->get('socials_link_5');
+                $this->data['socials_link_6'] = $this->language->get('socials_link_6');
+                $this->data['buyshop_social_settings'] = $this->config->get('bs_social');
+                if (!empty($this->data['buyshop_social_settings']['twitter'])) {
+                    $this->data['twitter_account_name'] = $this->data['buyshop_social_settings']['twitter'];
+                } else {
+                    $this->data['twitter_account_name'] = $this->language->get('account_twitter');
+                }
+                if (!empty($this->data['buyshop_social_settings']['facebook'])) {
+                        $this->data['facebook'] = $this->data['buyshop_social_settings']['facebook'];
+                } else {
+                    $this->data['facebook'] = $this->language->get('account_facebook');
+                }
+                $this->data['powered_dresscode'] = sprintf($this->language->get('powered_dresscode'), date('Y', time()));
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="before"><![CDATA[
+                $this->render();
+                ]]></search>
+            <add><![CDATA[
+                $this->children = array(
+                    'common/content_slider',
+                    'common/content_footer'
+                );
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/common/header.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->data['home'] = $this->url->link('common/home');
+                ]]></search>
+            <add><![CDATA[
+                 $this->data['text_search_dresscode'] = $this->language->get('text_search_dresscode');
+                $this->data['text_phone_number'] = $this->language->get('text_phone_number');
+                $this->data['text_service_tools'] = $this->language->get('text_service_tools');
+                $this->data['text_choose'] = $this->language->get('text_choose');
+                $this->data['text_option_1'] = $this->language->get('text_option_1');
+                $this->data['text_option_2'] = $this->language->get('text_option_2');
+                $this->data['text_choose_category'] = $this->language->get('text_choose_category');
+                $this->data['link_welcome_dresscode'] = $this->url->link('account/login', '', 'SSL');
+                $this->data['link_logged_dresscode'] = $this->url->link('account/logout', '', 'SSL');
+                $this->data['text_welcome_dresscode'] = $this->language->get('text_welcome_dresscode');
+                $this->data['text_logged_dresscode'] = $this->language->get('text_logged_dresscode');
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                $this->data['font'] = $this->data['buyshop_general_settings']['font'];
+                $this->data['bgpattern'] = $this->data['buyshop_general_settings']['bgpattern'];
+                $this->data['themecolor'] = $this->data['buyshop_general_settings']['themecolor'];
+                $this->data['contentbgcolor'] = $this->data['buyshop_general_settings']['contentbgcolor'];
+                $this->data['fontcolor'] = $this->data['buyshop_general_settings']['fontcolor'];
+                if (isset($this->data['buyshop_general_settings']['tagstack'])) {
+                    $this->data['tagstack'] = $this->data['buyshop_general_settings']['tagstack'];
+                }   else {
+                    $this->data['tagstack'] = '';
+                }
+                if (isset($this->data['buyshop_general_settings']['productrollover'])) {
+                    $this->data['productrollover'] = $this->data['buyshop_general_settings']['productrollover'];
+                }   else {
+                    $this->data['productrollover'] = '';
+                }
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                }   else {
+                     $this->data['ajaxcart'] = '';
+                }
+                if (isset($this->data['buyshop_general_settings']['response'])) {
+                    $this->data['response'] = $this->data['buyshop_general_settings']['response'];
+                }   else {
+                    $this->data['response'] = '';
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                $this->data['categories'][] = array(
+                ]]></search>
+            <add><![CDATA[
+                'description' => html_entity_decode($category['description'], ENT_QUOTES, 'UTF-8'),
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                $this->children = array(
+                ]]></search>
+            <add><![CDATA[
+                'common/custom_menu',
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/common/home.php">
+        <operation>
+            <search position="before"><![CDATA[
+                $this->children = array(
+                ]]></search>
+            <add><![CDATA[
+                $this->data['text_original_products'] = $this->language->get('text_original_products');
+                $this->data['text_free_shipping'] = $this->language->get('text_free_shipping');
+                $this->data['text_cash_delivery'] = $this->language->get('text_cash_delivery');
+                $this->data['text_day_returns'] = $this->language->get('text_day_returns');
+                $this->data['original_products'] = $this->url->link('information/information&amp;information_id=7');
+                $this->data['free_shipping'] = $this->url->link('information/information&amp;information_id=8');
+                $this->data['cash_delivery'] = $this->url->link('information/information&amp;information_id=9');
+                $this->data['day_returns'] = $this->url->link('information/information&amp;information_id=10');
+                $this->data['flash_title'] = $this->language->get('flash_title');
+                $this->data['text_new_products'] = $this->language->get('text_new_products');
+                $this->data['text_sale'] = $this->language->get('text_sale');
+                $this->data['text_bestsellers'] = $this->language->get('text_bestsellers');
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/product/category.php">
+        <operation>
+            <search position="before"><![CDATA[
+                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
+                ]]></search>
+            <add><![CDATA[
+                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
+                if ($results_images) {
+                    $first = true;
+                    foreach ($results_images as $results_image) {
+                        if ( $first ) {
+                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+                            $first = false;
+                        }
+                    }
+                } else {
+                    $popup = false;
+                }
+                $this->data['youtubes'] = array();
+                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
+                $youtubes = explode(',',$query->row['video']);
+                $this->data['youtubes'] = $youtubes;
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                } else {
+                    $this->data['ajaxcart'] = '';
+                }
+                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
+                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
+                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
+                } else {
+                    $this->data['sale'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
+                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
+                } else {
+                    $this->data['video'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
+                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
+                } else {
+                    $this->data['saleposition'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
+                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
+                } else {
+                    $this->data['videoposition'] = '';
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                'product_id'  => $result['product_id'],
+                ]]></search>
+            <add><![CDATA[
+                    'popup'   	 => $popup,
+                    'youtube_video' => $youtubes,
+                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/product/manufacturer.php">
+        <operation>
+            <search position="before"><![CDATA[
+                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
+                ]]></search>
+            <add><![CDATA[
+                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
+                if ($results_images) {
+                    $first = true;
+                    foreach ($results_images as $results_image) {
+                        if ( $first ) {
+                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+                            $first = false;
+                        }
+                    }
+                } else {
+                    $popup = false;
+                }
+                $this->data['youtubes'] = array();
+                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
+                $youtubes = explode(',',$query->row['video']);
+                $this->data['youtubes'] = $youtubes;
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                } else {
+                    $this->data['ajaxcart'] = '';
+                }
+                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
+                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
+                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
+                } else {
+                    $this->data['sale'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
+                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
+                } else {
+                    $this->data['video'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
+                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
+                } else {
+                    $this->data['saleposition'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
+                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
+                } else {
+                    $this->data['videoposition'] = '';
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                'product_id'  => $result['product_id'],
+                ]]></search>
+            <add><![CDATA[
+                    'popup'   	 => $popup,
+                    'youtube_video' => $youtubes,
+                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/product/search.php">
+        <operation>
+            <search position="before"><![CDATA[
+                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
+                ]]></search>
+            <add><![CDATA[
+                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
+                if ($results_images) {
+                    $first = true;
+                    foreach ($results_images as $results_image) {
+                        if ( $first ) {
+                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+                            $first = false;
+                        }
+                    }
+                } else {
+                    $popup = false;
+                }
+                $this->data['youtubes'] = array();
+                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
+                $youtubes = explode(',',$query->row['video']);
+                $this->data['youtubes'] = $youtubes;
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                } else {
+                    $this->data['ajaxcart'] = '';
+                }
+                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
+                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
+                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
+                } else {
+                    $this->data['sale'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
+                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
+                } else {
+                    $this->data['video'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
+                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
+                } else {
+                    $this->data['saleposition'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
+                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
+                } else {
+                    $this->data['videoposition'] = '';
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                'product_id'  => $result['product_id'],
+                ]]></search>
+            <add><![CDATA[
+                    'popup'   	 => $popup,
+                    'youtube_video' => $youtubes,
+                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/product/special.php">
+        <operation>
+            <search position="before"><![CDATA[
+                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
+                ]]></search>
+            <add><![CDATA[
+                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
+                if ($results_images) {
+                    $first = true;
+                    foreach ($results_images as $results_image) {
+                        if ( $first ) {
+                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+                            $first = false;
+                        }
+                    }
+                } else {
+                    $popup = false;
+                }
+                $this->data['youtubes'] = array();
+                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
+                $youtubes = explode(',',$query->row['video']);
+                $this->data['youtubes'] = $youtubes;
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                } else {
+                    $this->data['ajaxcart'] = '';
+                }
+                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
+                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
+                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
+                } else {
+                    $this->data['sale'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
+                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
+                } else {
+                    $this->data['video'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
+                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
+                } else {
+                    $this->data['saleposition'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
+                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
+                } else {
+                    $this->data['videoposition'] = '';
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                'product_id'  => $result['product_id'],
+                ]]></search>
+            <add><![CDATA[
+                    'popup'   	 => $popup,
+                    'youtube_video' => $youtubes,
+                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
+                ]]></add>
+        </operation>
+    </file>
+    <file name="catalog/controller/product/product.php">
+        <operation>
+            <search position="after"><![CDATA[
+                $this->data['product_id'] = $this->request->get['product_id'];
+                ]]></search>
+            <add><![CDATA[
+                $this->data['rollover_text'] = $this->language->get('rollover_text');
+                $this->data['no_rating'] = $this->language->get('no_rating');
+                $this->data['tab_youtube'] = $this->language->get('tab_youtube');
+                $this->data['youtube_empty'] = $this->language->get('youtube_empty');
+                $this->data['youtubes'] = array();
+                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$product_id."'");
+                $youtubes = explode(',',$query->row['video']);
+                $this->data['youtubes'] = $youtubes;
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="before" index="2"><![CDATA[
+                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
+                ]]></search>
+            <add><![CDATA[
+                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
+                if ($results_images) {
+                    $first = true;
+                    foreach ($results_images as $results_image) {
+                        if ( $first ) {
+                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+                            $first = false;
+                        }
+                    }
+                } else {
+                    $popup = false;
+                }
+                $this->data['youtubes_rel'] = array();
+                $query_rel = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                }
+                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
+                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
+                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
+                } else {
+                    $this->data['sale'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
+                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
+                } else {
+                    $this->data['video'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
+                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
+                } else {
+                    $this->data['saleposition'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
+                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
+                } else {
+                    $this->data['videoposition'] = '';
+                }
+                ]]></add>
+        </operation>
+        <operation>
+            <search position="after"><![CDATA[
+                'product_id' => $result['product_id'],
+                ]]></search>
+            <add><![CDATA[
+                    'popup'   	 => $popup,
+                    'youtube_video_rel' => $query_rel->row['video'],
+                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
+                ]]></add>
+        </operation>
+    </file>
+</modification>
\ No newline at end of file
Index: trunk/www/admin/model/design/banner.php
===================================================================
--- trunk/www/admin/model/design/banner.php	(revision 19)
+++ trunk/www/admin/model/design/banner.php	(revision 20)
@@ -1,118 +0,0 @@
-<?php
-class ModelDesignBanner extends Model {
-	public function addBanner($data) {
-		$this->db->query("INSERT INTO " . DB_PREFIX . "banner SET name = '" . $this->db->escape($data['name']) . "', status = '" . (int)$data['status'] . "'");
-	
-		$banner_id = $this->db->getLastId();
-	
-		if (isset($data['banner_image'])) {
-			foreach ($data['banner_image'] as $banner_image) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "banner_image SET banner_id = '" . (int)$banner_id . "', link = '" .  $this->db->escape($banner_image['link']) . "', image = '" .  $this->db->escape($banner_image['image']) . "'");
-				
-				$banner_image_id = $this->db->getLastId();
-				
-				foreach ($banner_image['banner_image_description'] as $language_id => $banner_image_description) {				
-					$this->db->query("INSERT INTO " . DB_PREFIX . "banner_image_description SET banner_image_id = '" . (int)$banner_image_id . "', language_id = '" . (int)$language_id . "', banner_id = '" . (int)$banner_id . "', title = '" .  $this->db->escape($banner_image_description['title']) . "'");
-				}
-			}
-		}		
-	}
-	
-	public function editBanner($banner_id, $data) {
-		$this->db->query("UPDATE " . DB_PREFIX . "banner SET name = '" . $this->db->escape($data['name']) . "', status = '" . (int)$data['status'] . "' WHERE banner_id = '" . (int)$banner_id . "'");
-
-		$this->db->query("DELETE FROM " . DB_PREFIX . "banner_image WHERE banner_id = '" . (int)$banner_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "banner_image_description WHERE banner_id = '" . (int)$banner_id . "'");
-			
-		if (isset($data['banner_image'])) {
-			foreach ($data['banner_image'] as $banner_image) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "banner_image SET banner_id = '" . (int)$banner_id . "', link = '" .  $this->db->escape($banner_image['link']) . "', image = '" .  $this->db->escape($banner_image['image']) . "'");
-				
-				$banner_image_id = $this->db->getLastId();
-				
-				foreach ($banner_image['banner_image_description'] as $language_id => $banner_image_description) {				
-					$this->db->query("INSERT INTO " . DB_PREFIX . "banner_image_description SET banner_image_id = '" . (int)$banner_image_id . "', language_id = '" . (int)$language_id . "', banner_id = '" . (int)$banner_id . "', title = '" .  $this->db->escape($banner_image_description['title']) . "'");
-				}
-			}
-		}			
-	}
-	
-	public function deleteBanner($banner_id) {
-		$this->db->query("DELETE FROM " . DB_PREFIX . "banner WHERE banner_id = '" . (int)$banner_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "banner_image WHERE banner_id = '" . (int)$banner_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "banner_image_description WHERE banner_id = '" . (int)$banner_id . "'");
-	}
-	
-	public function getBanner($banner_id) {
-		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "banner WHERE banner_id = '" . (int)$banner_id . "'");
-		
-		return $query->row;
-	}
-		
-	public function getBanners($data = array()) {
-		$sql = "SELECT * FROM " . DB_PREFIX . "banner";
-		
-		$sort_data = array(
-			'name',
-			'status'
-		);	
-		
-		if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
-			$sql .= " ORDER BY " . $data['sort'];	
-		} else {
-			$sql .= " ORDER BY name";	
-		}
-		
-		if (isset($data['order']) && ($data['order'] == 'DESC')) {
-			$sql .= " DESC";
-		} else {
-			$sql .= " ASC";
-		}
-		
-		if (isset($data['start']) || isset($data['limit'])) {
-			if ($data['start'] < 0) {
-				$data['start'] = 0;
-			}					
-
-			if ($data['limit'] < 1) {
-				$data['limit'] = 20;
-			}	
-		
-			$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
-		}		
-		
-		$query = $this->db->query($sql);
-
-		return $query->rows;
-	}
-		
-	public function getBannerImages($banner_id) {
-		$banner_image_data = array();
-		
-        $banner_image_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner_image WHERE banner_id = '" . (int)$banner_id . "' ORDER BY banner_image_id");
-		foreach ($banner_image_query->rows as $banner_image) {
-			$banner_image_description_data = array();
-			 
-			$banner_image_description_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner_image_description WHERE banner_image_id = '" . (int)$banner_image['banner_image_id'] . "' AND banner_id = '" . (int)$banner_id . "'");
-			
-			foreach ($banner_image_description_query->rows as $banner_image_description) {			
-				$banner_image_description_data[$banner_image_description['language_id']] = array('title' => $banner_image_description['title']);
-			}
-		
-			$banner_image_data[] = array(
-				'banner_image_description' => $banner_image_description_data,
-				'link'                     => $banner_image['link'],
-				'image'                    => $banner_image['image']	
-			);
-		}
-		
-		return $banner_image_data;
-	}
-		
-	public function getTotalBanners() {
-      	$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "banner");
-		
-		return $query->row['total'];
-	}	
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/model/catalog/product.php
===================================================================
--- trunk/www/admin/model/catalog/product.php	(revision 19)
+++ trunk/www/admin/model/catalog/product.php	(revision 20)
@@ -1,676 +0,0 @@
-<?php
-class ModelCatalogProduct extends Model {
-	public function addProduct($data) {
-		$this->db->query("INSERT INTO " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");
-		
-		$product_id = $this->db->getLastId();
-        if (isset($data['youtube'])) {
-            $this->db->query("UPDATE " . DB_PREFIX . "product SET youtube = '" . $this->db->escape($data['youtube']) . "' WHERE product_id = '" . (int)$product_id . "'");
-        }
-		if (isset($data['image'])) {
-			$this->db->query("UPDATE " . DB_PREFIX . "product SET image = '" . $this->db->escape(html_entity_decode($data['image'], ENT_QUOTES, 'UTF-8')) . "' WHERE product_id = '" . (int)$product_id . "'");
-		}
-		
-		foreach ($data['product_description'] as $language_id => $value) {
-			$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', tag = '" . $this->db->escape($value['tag']) . "'");
-		}
-		
-		if (isset($data['product_store'])) {
-			foreach ($data['product_store'] as $store_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_store SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "'");
-			}
-		}
-
-		if (isset($data['product_attribute'])) {
-			foreach ($data['product_attribute'] as $product_attribute) {
-				if ($product_attribute['attribute_id']) {
-					$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "' AND attribute_id = '" . (int)$product_attribute['attribute_id'] . "'");
-					
-					foreach ($product_attribute['product_attribute_description'] as $language_id => $product_attribute_description) {				
-						$this->db->query("INSERT INTO " . DB_PREFIX . "product_attribute SET product_id = '" . (int)$product_id . "', attribute_id = '" . (int)$product_attribute['attribute_id'] . "', language_id = '" . (int)$language_id . "', text = '" .  $this->db->escape($product_attribute_description['text']) . "'");
-					}
-				}
-			}
-		}
-	
-		if (isset($data['product_option'])) {
-			foreach ($data['product_option'] as $product_option) {
-				if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') {
-					$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', required = '" . (int)$product_option['required'] . "'");
-				
-					$product_option_id = $this->db->getLastId();
-				
-					if (isset($product_option['product_option_value']) && count($product_option['product_option_value']) > 0 ) {
-						foreach ($product_option['product_option_value'] as $product_option_value) {
-							$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET product_option_id = '" . (int)$product_option_id . "', product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', option_value_id = '" . (int)$product_option_value['option_value_id'] . "', quantity = '" . (int)$product_option_value['quantity'] . "', subtract = '" . (int)$product_option_value['subtract'] . "', price = '" . (float)$product_option_value['price'] . "', price_prefix = '" . $this->db->escape($product_option_value['price_prefix']) . "', points = '" . (int)$product_option_value['points'] . "', points_prefix = '" . $this->db->escape($product_option_value['points_prefix']) . "', weight = '" . (float)$product_option_value['weight'] . "', weight_prefix = '" . $this->db->escape($product_option_value['weight_prefix']) . "'");
-						} 
-					}else{
-						$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_option_id = '".$product_option_id."'");
-					}
-				} else { 
-					$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', option_value = '" . $this->db->escape($product_option['option_value']) . "', required = '" . (int)$product_option['required'] . "'");
-				}
-			}
-		}
-		
-		if (isset($data['product_discount'])) {
-			foreach ($data['product_discount'] as $product_discount) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");
-			}
-		}
-
-		if (isset($data['product_special'])) {
-			foreach ($data['product_special'] as $product_special) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_special SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_special['customer_group_id'] . "', priority = '" . (int)$product_special['priority'] . "', price = '" . (float)$product_special['price'] . "', date_start = '" . $this->db->escape($product_special['date_start']) . "', date_end = '" . $this->db->escape($product_special['date_end']) . "'");
-			}
-		}
-		
-		if (isset($data['product_image'])) {
-			foreach ($data['product_image'] as $product_image) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_image SET product_id = '" . (int)$product_id . "', image = '" . $this->db->escape(html_entity_decode($product_image['image'], ENT_QUOTES, 'UTF-8')) . "', sort_order = '" . (int)$product_image['sort_order'] . "'");
-			}
-		}
-		
-		if (isset($data['product_download'])) {
-			foreach ($data['product_download'] as $download_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_download SET product_id = '" . (int)$product_id . "', download_id = '" . (int)$download_id . "'");
-			}
-		}
-		
-		if (isset($data['product_category'])) {
-			foreach ($data['product_category'] as $category_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_category SET product_id = '" . (int)$product_id . "', category_id = '" . (int)$category_id . "'");
-			}
-		}
-		
-		if (isset($data['product_filter'])) {
-			foreach ($data['product_filter'] as $filter_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_filter SET product_id = '" . (int)$product_id . "', filter_id = '" . (int)$filter_id . "'");
-			}
-		}
-		
-		if (isset($data['product_related'])) {
-			foreach ($data['product_related'] as $related_id) {
-				$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "' AND related_id = '" . (int)$related_id . "'");
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$product_id . "', related_id = '" . (int)$related_id . "'");
-				$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$related_id . "' AND related_id = '" . (int)$product_id . "'");
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$related_id . "', related_id = '" . (int)$product_id . "'");
-			}
-		}
-
-		if (isset($data['product_reward'])) {
-			foreach ($data['product_reward'] as $customer_group_id => $product_reward) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_reward SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$customer_group_id . "', points = '" . (int)$product_reward['points'] . "'");
-			}
-		}
-
-		if (isset($data['product_layout'])) {
-			foreach ($data['product_layout'] as $store_id => $layout) {
-				if ($layout['layout_id']) {
-					$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_layout SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout['layout_id'] . "'");
-				}
-			}
-		}
-						
-		if ($data['keyword']) {
-			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
-		}
-						
-		$this->cache->delete('product');
-	}
-	
-	public function editProduct($product_id, $data) {
-		$this->db->query("UPDATE " . DB_PREFIX . "product SET model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', upc = '" . $this->db->escape($data['upc']) . "', ean = '" . $this->db->escape($data['ean']) . "', jan = '" . $this->db->escape($data['jan']) . "', isbn = '" . $this->db->escape($data['isbn']) . "', mpn = '" . $this->db->escape($data['mpn']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', points = '" . (int)$data['points'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . $this->db->escape($data['tax_class_id']) . "', sort_order = '" . (int)$data['sort_order'] . "', date_modified = NOW() WHERE product_id = '" . (int)$product_id . "'");
-
-		if (isset($data['image'])) {
-			$this->db->query("UPDATE " . DB_PREFIX . "product SET image = '" . $this->db->escape(html_entity_decode($data['image'], ENT_QUOTES, 'UTF-8')) . "' WHERE product_id = '" . (int)$product_id . "'");
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");
-        if (isset($data['youtube'])) {
-            $this->db->query("UPDATE " . DB_PREFIX . "product SET youtube = '" . $this->db->escape($data['youtube']) . "' WHERE product_id = '" . (int)$product_id . "'");
-        }
-		foreach ($data['product_description'] as $language_id => $value) {
-			$this->db->query("INSERT INTO " . DB_PREFIX . "product_description SET product_id = '" . (int)$product_id . "', language_id = '" . (int)$language_id . "', name = '" . $this->db->escape($value['name']) . "', meta_keyword = '" . $this->db->escape($value['meta_keyword']) . "', meta_description = '" . $this->db->escape($value['meta_description']) . "', description = '" . $this->db->escape($value['description']) . "', tag = '" . $this->db->escape($value['tag']) . "'");
-		}
-
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "'");
-
-		if (isset($data['product_store'])) {
-			foreach ($data['product_store'] as $store_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_store SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "'");
-			}
-		}
-	
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "'");
-
-		if (!empty($data['product_attribute'])) {
-			foreach ($data['product_attribute'] as $product_attribute) {
-				if ($product_attribute['attribute_id']) {
-					$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "' AND attribute_id = '" . (int)$product_attribute['attribute_id'] . "'");
-					
-					foreach ($product_attribute['product_attribute_description'] as $language_id => $product_attribute_description) {				
-						$this->db->query("INSERT INTO " . DB_PREFIX . "product_attribute SET product_id = '" . (int)$product_id . "', attribute_id = '" . (int)$product_attribute['attribute_id'] . "', language_id = '" . (int)$language_id . "', text = '" .  $this->db->escape($product_attribute_description['text']) . "'");
-					}
-				}
-			}
-		}
-
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_option_value WHERE product_id = '" . (int)$product_id . "'");
-		
-		if (isset($data['product_option'])) {
-			foreach ($data['product_option'] as $product_option) {
-				if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') {
-					$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_option_id = '" . (int)$product_option['product_option_id'] . "', product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', required = '" . (int)$product_option['required'] . "'");
-				
-					$product_option_id = $this->db->getLastId();
-				
-					if (isset($product_option['product_option_value'])  && count($product_option['product_option_value']) > 0 ) {
-						foreach ($product_option['product_option_value'] as $product_option_value) {
-							$this->db->query("INSERT INTO " . DB_PREFIX . "product_option_value SET product_option_value_id = '" . (int)$product_option_value['product_option_value_id'] . "', product_option_id = '" . (int)$product_option_id . "', product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', option_value_id = '" . (int)$product_option_value['option_value_id'] . "', quantity = '" . (int)$product_option_value['quantity'] . "', subtract = '" . (int)$product_option_value['subtract'] . "', price = '" . (float)$product_option_value['price'] . "', price_prefix = '" . $this->db->escape($product_option_value['price_prefix']) . "', points = '" . (int)$product_option_value['points'] . "', points_prefix = '" . $this->db->escape($product_option_value['points_prefix']) . "', weight = '" . (float)$product_option_value['weight'] . "', weight_prefix = '" . $this->db->escape($product_option_value['weight_prefix']) . "'");
-						}
-					}else{
-						$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_option_id = '".$product_option_id."'");
-					}
-				} else { 
-					$this->db->query("INSERT INTO " . DB_PREFIX . "product_option SET product_option_id = '" . (int)$product_option['product_option_id'] . "', product_id = '" . (int)$product_id . "', option_id = '" . (int)$product_option['option_id'] . "', option_value = '" . $this->db->escape($product_option['option_value']) . "', required = '" . (int)$product_option['required'] . "'");
-				}					
-			}
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "'");
- 
-		if (isset($data['product_discount'])) {
-			foreach ($data['product_discount'] as $product_discount) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_discount SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_discount['customer_group_id'] . "', quantity = '" . (int)$product_discount['quantity'] . "', priority = '" . (int)$product_discount['priority'] . "', price = '" . (float)$product_discount['price'] . "', date_start = '" . $this->db->escape($product_discount['date_start']) . "', date_end = '" . $this->db->escape($product_discount['date_end']) . "'");
-			}
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_special WHERE product_id = '" . (int)$product_id . "'");
-		
-		if (isset($data['product_special'])) {
-			foreach ($data['product_special'] as $product_special) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_special SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$product_special['customer_group_id'] . "', priority = '" . (int)$product_special['priority'] . "', price = '" . (float)$product_special['price'] . "', date_start = '" . $this->db->escape($product_special['date_start']) . "', date_end = '" . $this->db->escape($product_special['date_end']) . "'");
-			}
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "'");
-		
-		if (isset($data['product_image'])) {
-			foreach ($data['product_image'] as $product_image) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_image SET product_id = '" . (int)$product_id . "', image = '" . $this->db->escape(html_entity_decode($product_image['image'], ENT_QUOTES, 'UTF-8')) . "', sort_order = '" . (int)$product_image['sort_order'] . "'");
-			}
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
-		
-		if (isset($data['product_download'])) {
-			foreach ($data['product_download'] as $download_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_download SET product_id = '" . (int)$product_id . "', download_id = '" . (int)$download_id . "'");
-			}
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$product_id . "'");
-		
-		if (isset($data['product_category'])) {
-			foreach ($data['product_category'] as $category_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_category SET product_id = '" . (int)$product_id . "', category_id = '" . (int)$category_id . "'");
-			}		
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_filter WHERE product_id = '" . (int)$product_id . "'");
-		
-		if (isset($data['product_filter'])) {
-			foreach ($data['product_filter'] as $filter_id) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_filter SET product_id = '" . (int)$product_id . "', filter_id = '" . (int)$filter_id . "'");
-			}		
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE related_id = '" . (int)$product_id . "'");
-
-		if (isset($data['product_related'])) {
-			foreach ($data['product_related'] as $related_id) {
-				$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "' AND related_id = '" . (int)$related_id . "'");
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$product_id . "', related_id = '" . (int)$related_id . "'");
-				$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$related_id . "' AND related_id = '" . (int)$product_id . "'");
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_related SET product_id = '" . (int)$related_id . "', related_id = '" . (int)$product_id . "'");
-			}
-		}
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_reward WHERE product_id = '" . (int)$product_id . "'");
-
-		if (isset($data['product_reward'])) {
-			foreach ($data['product_reward'] as $customer_group_id => $value) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "product_reward SET product_id = '" . (int)$product_id . "', customer_group_id = '" . (int)$customer_group_id . "', points = '" . (int)$value['points'] . "'");
-			}
-		}
-
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_layout WHERE product_id = '" . (int)$product_id . "'");
-
-		if (isset($data['product_layout'])) {
-			foreach ($data['product_layout'] as $store_id => $layout) {
-				if ($layout['layout_id']) {
-					$this->db->query("INSERT INTO " . DB_PREFIX . "product_to_layout SET product_id = '" . (int)$product_id . "', store_id = '" . (int)$store_id . "', layout_id = '" . (int)$layout['layout_id'] . "'");
-				}
-			}
-		}
-						
-		$this->db->query("DELETE FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=" . (int)$product_id. "'");
-		
-		if ($data['keyword']) {
-			$this->db->query("INSERT INTO " . DB_PREFIX . "url_alias SET query = 'product_id=" . (int)$product_id . "', keyword = '" . $this->db->escape($data['keyword']) . "'");
-		}
-						
-		$this->cache->delete('product');
-	}
-	
-	public function copyProduct($product_id) {
-		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
-		
-		if ($query->num_rows) {
-			$data = array();
-			
-			$data = $query->row;
-			
-			$data['sku'] = '';
-			$data['upc'] = '';
-			$data['viewed'] = '0';
-			$data['keyword'] = '';
-			$data['status'] = '0';
-						
-			$data = array_merge($data, array('product_attribute' => $this->getProductAttributes($product_id)));
-			$data = array_merge($data, array('product_description' => $this->getProductDescriptions($product_id)));			
-			$data = array_merge($data, array('product_discount' => $this->getProductDiscounts($product_id)));
-			$data = array_merge($data, array('product_filter' => $this->getProductFilters($product_id)));
-			$data = array_merge($data, array('product_image' => $this->getProductImages($product_id)));		
-			$data = array_merge($data, array('product_option' => $this->getProductOptions($product_id)));
-			$data = array_merge($data, array('product_related' => $this->getProductRelated($product_id)));
-			$data = array_merge($data, array('product_reward' => $this->getProductRewards($product_id)));
-			$data = array_merge($data, array('product_special' => $this->getProductSpecials($product_id)));
-			$data = array_merge($data, array('product_category' => $this->getProductCategories($product_id)));
-			$data = array_merge($data, array('product_download' => $this->getProductDownloads($product_id)));
-			$data = array_merge($data, array('product_layout' => $this->getProductLayouts($product_id)));
-			$data = array_merge($data, array('product_store' => $this->getProductStores($product_id)));
-			
-			$this->addProduct($data);
-		}
-	}
-	
-	public function deleteProduct($product_id) {
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_filter WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_option_value WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE related_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_reward WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_special WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_layout WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "review WHERE product_id = '" . (int)$product_id . "'");
-		
-		$this->db->query("DELETE FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=" . (int)$product_id. "'");
-		
-		$this->cache->delete('product');
-	}
-	
-	public function getProduct($product_id) {
-		$query = $this->db->query("SELECT DISTINCT *, (SELECT keyword FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=" . (int)$product_id . "') AS keyword FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) WHERE p.product_id = '" . (int)$product_id . "' AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "'");
-				
-		return $query->row;
-	}
-	
-	public function getProducts($data = array()) {
-		$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id)";
-		
-		if (!empty($data['filter_category_id'])) {
-			$sql .= " LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id)";			
-		}
-				
-		$sql .= " WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'"; 
-		
-		if (!empty($data['filter_name'])) {
-			$sql .= " AND pd.name LIKE '" . $this->db->escape($data['filter_name']) . "%'";
-		}
-
-		if (!empty($data['filter_model'])) {
-			$sql .= " AND p.model LIKE '" . $this->db->escape($data['filter_model']) . "%'";
-		}
-		
-		if (!empty($data['filter_price'])) {
-			$sql .= " AND p.price LIKE '" . $this->db->escape($data['filter_price']) . "%'";
-		}
-		
-		if (isset($data['filter_quantity']) && !is_null($data['filter_quantity'])) {
-			$sql .= " AND p.quantity = '" . $this->db->escape($data['filter_quantity']) . "'";
-		}
-		
-		if (isset($data['filter_status']) && !is_null($data['filter_status'])) {
-			$sql .= " AND p.status = '" . (int)$data['filter_status'] . "'";
-		}
-		
-		$sql .= " GROUP BY p.product_id";
-					
-		$sort_data = array(
-			'pd.name',
-			'p.model',
-			'p.price',
-			'p.quantity',
-			'p.status',
-			'p.sort_order'
-		);	
-		
-		if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
-			$sql .= " ORDER BY " . $data['sort'];	
-		} else {
-			$sql .= " ORDER BY pd.name";	
-		}
-		
-		if (isset($data['order']) && ($data['order'] == 'DESC')) {
-			$sql .= " DESC";
-		} else {
-			$sql .= " ASC";
-		}
-	
-		if (isset($data['start']) || isset($data['limit'])) {
-			if ($data['start'] < 0) {
-				$data['start'] = 0;
-			}				
-
-			if ($data['limit'] < 1) {
-				$data['limit'] = 20;
-			}	
-		
-			$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
-		}	
-		
-		$query = $this->db->query($sql);
-	
-		return $query->rows;
-	}
-	
-	public function getProductsByCategoryId($category_id) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2c.category_id = '" . (int)$category_id . "' ORDER BY pd.name ASC");
-								  
-		return $query->rows;
-	} 
-	
-	public function getProductDescriptions($product_id) {
-		$product_description_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_description_data[$result['language_id']] = array(
-				'name'             => $result['name'],
-				'description'      => $result['description'],
-				'meta_keyword'     => $result['meta_keyword'],
-				'meta_description' => $result['meta_description'],
-				'tag'              => $result['tag']
-			);
-		}
-		
-		return $product_description_data;
-	}
-		
-	public function getProductCategories($product_id) {
-		$product_category_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_category_data[] = $result['category_id'];
-		}
-
-		return $product_category_data;
-	}
-	
-	public function getProductFilters($product_id) {
-		$product_filter_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_filter WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_filter_data[] = $result['filter_id'];
-		}
-				
-		return $product_filter_data;
-	}
-	
-	public function getProductAttributes($product_id) {
-		$product_attribute_data = array();
-		
-		$product_attribute_query = $this->db->query("SELECT attribute_id FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "' GROUP BY attribute_id");
-		
-		foreach ($product_attribute_query->rows as $product_attribute) {
-			$product_attribute_description_data = array();
-			
-			$product_attribute_description_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "' AND attribute_id = '" . (int)$product_attribute['attribute_id'] . "'");
-			
-			foreach ($product_attribute_description_query->rows as $product_attribute_description) {
-				$product_attribute_description_data[$product_attribute_description['language_id']] = array('text' => $product_attribute_description['text']);
-			}
-			
-			$product_attribute_data[] = array(
-				'attribute_id'                  => $product_attribute['attribute_id'],
-				'product_attribute_description' => $product_attribute_description_data
-			);
-		}
-		
-		return $product_attribute_data;
-	}
-	
-	public function getProductOptions($product_id) {
-		$product_option_data = array();
-		
-		$product_option_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "product_option` po LEFT JOIN `" . DB_PREFIX . "option` o ON (po.option_id = o.option_id) LEFT JOIN `" . DB_PREFIX . "option_description` od ON (o.option_id = od.option_id) WHERE po.product_id = '" . (int)$product_id . "' AND od.language_id = '" . (int)$this->config->get('config_language_id') . "'");
-		
-		foreach ($product_option_query->rows as $product_option) {
-			$product_option_value_data = array();	
-				
-			$product_option_value_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_option_value WHERE product_option_id = '" . (int)$product_option['product_option_id'] . "'");
-				
-			foreach ($product_option_value_query->rows as $product_option_value) {
-				$product_option_value_data[] = array(
-					'product_option_value_id' => $product_option_value['product_option_value_id'],
-					'option_value_id'         => $product_option_value['option_value_id'],
-					'quantity'                => $product_option_value['quantity'],
-					'subtract'                => $product_option_value['subtract'],
-					'price'                   => $product_option_value['price'],
-					'price_prefix'            => $product_option_value['price_prefix'],
-					'points'                  => $product_option_value['points'],
-					'points_prefix'           => $product_option_value['points_prefix'],						
-					'weight'                  => $product_option_value['weight'],
-					'weight_prefix'           => $product_option_value['weight_prefix']					
-				);
-			}
-				
-			$product_option_data[] = array(
-				'product_option_id'    => $product_option['product_option_id'],
-				'option_id'            => $product_option['option_id'],
-				'name'                 => $product_option['name'],
-				'type'                 => $product_option['type'],			
-				'product_option_value' => $product_option_value_data,
-				'option_value'         => $product_option['option_value'],
-				'required'             => $product_option['required']				
-			);
-		}
-		
-		return $product_option_data;
-	}
-	
-	public function getProductImages($product_id) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "'");
-		
-		return $query->rows;
-	}
-	
-	public function getProductDiscounts($product_id) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "' ORDER BY quantity, priority, price");
-		
-		return $query->rows;
-	}
-	
-	public function getProductSpecials($product_id) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_special WHERE product_id = '" . (int)$product_id . "' ORDER BY priority, price");
-		
-		return $query->rows;
-	}
-	
-	public function getProductRewards($product_id) {
-		$product_reward_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_reward WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_reward_data[$result['customer_group_id']] = array('points' => $result['points']);
-		}
-		
-		return $product_reward_data;
-	}
-		
-	public function getProductDownloads($product_id) {
-		$product_download_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_download_data[] = $result['download_id'];
-		}
-		
-		return $product_download_data;
-	}
-
-	public function getProductStores($product_id) {
-		$product_store_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "'");
-
-		foreach ($query->rows as $result) {
-			$product_store_data[] = $result['store_id'];
-		}
-		
-		return $product_store_data;
-	}
-
-	public function getProductLayouts($product_id) {
-		$product_layout_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_to_layout WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_layout_data[$result['store_id']] = $result['layout_id'];
-		}
-		
-		return $product_layout_data;
-	}
-
-	public function getProductRelated($product_id) {
-		$product_related_data = array();
-		
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "'");
-		
-		foreach ($query->rows as $result) {
-			$product_related_data[] = $result['related_id'];
-		}
-		
-		return $product_related_data;
-	}
-	
-	public function getTotalProducts($data = array()) {
-		$sql = "SELECT COUNT(DISTINCT p.product_id) AS total FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id)";
-
-		if (!empty($data['filter_category_id'])) {
-			$sql .= " LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (p.product_id = p2c.product_id)";			
-		}
-		 
-		$sql .= " WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
-		 			
-		if (!empty($data['filter_name'])) {
-			$sql .= " AND pd.name LIKE '" . $this->db->escape($data['filter_name']) . "%'";
-		}
-
-		if (!empty($data['filter_model'])) {
-			$sql .= " AND p.model LIKE '" . $this->db->escape($data['filter_model']) . "%'";
-		}
-		
-		if (!empty($data['filter_price'])) {
-			$sql .= " AND p.price LIKE '" . $this->db->escape($data['filter_price']) . "%'";
-		}
-		
-		if (isset($data['filter_quantity']) && !is_null($data['filter_quantity'])) {
-			$sql .= " AND p.quantity = '" . $this->db->escape($data['filter_quantity']) . "'";
-		}
-		
-		if (isset($data['filter_status']) && !is_null($data['filter_status'])) {
-			$sql .= " AND p.status = '" . (int)$data['filter_status'] . "'";
-		}
-		
-		$query = $this->db->query($sql);
-		
-		return $query->row['total'];
-	}	
-	
-	public function getTotalProductsByTaxClassId($tax_class_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product WHERE tax_class_id = '" . (int)$tax_class_id . "'");
-
-		return $query->row['total'];
-	}
-		
-	public function getTotalProductsByStockStatusId($stock_status_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product WHERE stock_status_id = '" . (int)$stock_status_id . "'");
-
-		return $query->row['total'];
-	}
-	
-	public function getTotalProductsByWeightClassId($weight_class_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product WHERE weight_class_id = '" . (int)$weight_class_id . "'");
-
-		return $query->row['total'];
-	}
-	
-	public function getTotalProductsByLengthClassId($length_class_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product WHERE length_class_id = '" . (int)$length_class_id . "'");
-
-		return $query->row['total'];
-	}
-
-	public function getTotalProductsByDownloadId($download_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product_to_download WHERE download_id = '" . (int)$download_id . "'");
-		
-		return $query->row['total'];
-	}
-	
-	public function getTotalProductsByManufacturerId($manufacturer_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product WHERE manufacturer_id = '" . (int)$manufacturer_id . "'");
-
-		return $query->row['total'];
-	}
-	
-	public function getTotalProductsByAttributeId($attribute_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product_attribute WHERE attribute_id = '" . (int)$attribute_id . "'");
-
-		return $query->row['total'];
-	}	
-	
-	public function getTotalProductsByOptionId($option_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product_option WHERE option_id = '" . (int)$option_id . "'");
-
-		return $query->row['total'];
-	}	
-	
-	public function getTotalProductsByLayoutId($layout_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "product_to_layout WHERE layout_id = '" . (int)$layout_id . "'");
-
-		return $query->row['total'];
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/model/sale/customer.php
===================================================================
--- trunk/www/admin/model/sale/customer.php	(revision 19)
+++ trunk/www/admin/model/sale/customer.php	(revision 20)
@@ -1,542 +0,0 @@
-<?php
-class ModelSaleCustomer extends Model {
-	public function addCustomer($data) {
-      	$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', status = '" . (int)$data['status'] . "', date_added = NOW()");
-      	
-      	$customer_id = $this->db->getLastId();
-      	
-      	if (isset($data['address'])) {		
-      		foreach ($data['address'] as $address) {	
-      			$this->db->query("INSERT INTO " . DB_PREFIX . "address SET customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($address['firstname']) . "', lastname = '" . $this->db->escape($address['lastname']) . "', company = '" . $this->db->escape($address['company']) . "', company_id = '" . $this->db->escape($address['company_id']) . "', tax_id = '" . $this->db->escape($address['tax_id']) . "', address_1 = '" . $this->db->escape($address['address_1']) . "', address_2 = '" . $this->db->escape($address['address_2']) . "', city = '" . $this->db->escape($address['city']) . "', postcode = '" . $this->db->escape($address['postcode']) . "', country_id = '" . (int)$address['country_id'] . "', zone_id = '" . (int)$address['zone_id'] . "'");
-				
-				if (isset($address['default'])) {
-					$address_id = $this->db->getLastId();
-					
-					$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . $address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");
-				}
-			}
-		}
-	}
-	
-	public function editCustomer($customer_id, $data) {
-		$this->db->query("UPDATE " . DB_PREFIX . "customer SET firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', newsletter = '" . (int)$data['newsletter'] . "', customer_group_id = '" . (int)$data['customer_group_id'] . "', status = '" . (int)$data['status'] . "' WHERE customer_id = '" . (int)$customer_id . "'");
-	
-      	if ($data['password']) {
-        	$this->db->query("UPDATE " . DB_PREFIX . "customer SET salt = '" . $this->db->escape($salt = substr(md5(uniqid(rand(), true)), 0, 9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "' WHERE customer_id = '" . (int)$customer_id . "'");
-      	}
-      	
-      	$this->db->query("DELETE FROM " . DB_PREFIX . "address WHERE customer_id = '" . (int)$customer_id . "'");
-      	
-      	if (isset($data['address'])) {
-      		foreach ($data['address'] as $address) {
-				$this->db->query("INSERT INTO " . DB_PREFIX . "address SET address_id = '" . (int)$address['address_id'] . "', customer_id = '" . (int)$customer_id . "', firstname = '" . $this->db->escape($address['firstname']) . "', lastname = '" . $this->db->escape($address['lastname']) . "', company = '" . $this->db->escape($address['company']) . "', company_id = '" . $this->db->escape($address['company_id']) . "', tax_id = '" . $this->db->escape($address['tax_id']) . "', address_1 = '" . $this->db->escape($address['address_1']) . "', address_2 = '" . $this->db->escape($address['address_2']) . "', city = '" . $this->db->escape($address['city']) . "', postcode = '" . $this->db->escape($address['postcode']) . "', country_id = '" . (int)$address['country_id'] . "', zone_id = '" . (int)$address['zone_id'] . "'");
-					
-				if (isset($address['default'])) {
-					$address_id = $this->db->getLastId();
-						
-					$this->db->query("UPDATE " . DB_PREFIX . "customer SET address_id = '" . (int)$address_id . "' WHERE customer_id = '" . (int)$customer_id . "'");
-				}
-			}
-		}
-	}
-
-	public function editToken($customer_id, $token) {
-		$this->db->query("UPDATE " . DB_PREFIX . "customer SET token = '" . $this->db->escape($token) . "' WHERE customer_id = '" . (int)$customer_id . "'");
-	}
-	
-	public function deleteCustomer($customer_id) {
-		$this->db->query("DELETE FROM " . DB_PREFIX . "customer WHERE customer_id = '" . (int)$customer_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "customer_reward WHERE customer_id = '" . (int)$customer_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "customer_transaction WHERE customer_id = '" . (int)$customer_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "customer_ip WHERE customer_id = '" . (int)$customer_id . "'");
-		$this->db->query("DELETE FROM " . DB_PREFIX . "address WHERE customer_id = '" . (int)$customer_id . "'");
-	}
-	
-	public function getCustomer($customer_id) {
-		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "customer WHERE customer_id = '" . (int)$customer_id . "'");
-	
-		return $query->row;
-	}
-	
-	public function getCustomerByEmail($email) {
-		$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "customer WHERE LCASE(email) = '" . $this->db->escape(utf8_strtolower($email)) . "'");
-	
-		return $query->row;
-	}
-			
-	public function getCustomers($data = array()) {
-		$sql = "SELECT *, CONCAT(c.firstname, ' ', c.lastname) AS name, cgd.name AS customer_group FROM " . DB_PREFIX . "customer c LEFT JOIN " . DB_PREFIX . "customer_group_description cgd ON (c.customer_group_id = cgd.customer_group_id) WHERE cgd.language_id = '" . (int)$this->config->get('config_language_id') . "'";
-
-		$implode = array();
-		
-		if (!empty($data['filter_name'])) {
-			$implode[] = "CONCAT(c.firstname, ' ', c.lastname) LIKE '%" . $this->db->escape($data['filter_name']) . "%'";
-		}
-		
-		if (!empty($data['filter_email'])) {
-			$implode[] = "c.email LIKE '" . $this->db->escape($data['filter_email']) . "%'";
-		}
-
-		if (isset($data['filter_newsletter']) && !is_null($data['filter_newsletter'])) {
-			$implode[] = "c.newsletter = '" . (int)$data['filter_newsletter'] . "'";
-		}	
-				
-		if (!empty($data['filter_customer_group_id'])) {
-			$implode[] = "c.customer_group_id = '" . (int)$data['filter_customer_group_id'] . "'";
-		}	
-			
-		if (!empty($data['filter_ip'])) {
-			$implode[] = "c.customer_id IN (SELECT customer_id FROM " . DB_PREFIX . "customer_ip WHERE ip = '" . $this->db->escape($data['filter_ip']) . "')";
-		}	
-				
-		if (isset($data['filter_status']) && !is_null($data['filter_status'])) {
-			$implode[] = "c.status = '" . (int)$data['filter_status'] . "'";
-		}	
-		
-		if (isset($data['filter_approved']) && !is_null($data['filter_approved'])) {
-			$implode[] = "c.approved = '" . (int)$data['filter_approved'] . "'";
-		}	
-				
-		if (!empty($data['filter_date_added'])) {
-			$implode[] = "DATE(c.date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')";
-		}
-		
-		if ($implode) {
-			$sql .= " AND " . implode(" AND ", $implode);
-		}
-		
-		$sort_data = array(
-			'name',
-			'c.email',
-			'customer_group',
-			'c.status',
-			'c.approved',
-			'c.ip',
-			'c.date_added'
-		);	
-			
-		if (isset($data['sort']) && in_array($data['sort'], $sort_data)) {
-			$sql .= " ORDER BY " . $data['sort'];	
-		} else {
-			$sql .= " ORDER BY name";	
-		}
-			
-		if (isset($data['order']) && ($data['order'] == 'DESC')) {
-			$sql .= " DESC";
-		} else {
-			$sql .= " ASC";
-		}
-		
-		if (isset($data['start']) || isset($data['limit'])) {
-			if ($data['start'] < 0) {
-				$data['start'] = 0;
-			}			
-
-			if ($data['limit'] < 1) {
-				$data['limit'] = 20;
-			}	
-			
-			$sql .= " LIMIT " . (int)$data['start'] . "," . (int)$data['limit'];
-		}		
-		
-		$query = $this->db->query($sql);
-		
-		return $query->rows;	
-	}
-	
-	public function approve($customer_id) {
-		$customer_info = $this->getCustomer($customer_id);
-
-		if ($customer_info) {
-			$this->db->query("UPDATE " . DB_PREFIX . "customer SET approved = '1' WHERE customer_id = '" . (int)$customer_id . "'");
-
-			$this->language->load('mail/customer');
-			
-			$this->load->model('setting/store');
-						
-			$store_info = $this->model_setting_store->getStore($customer_info['store_id']);
-			
-			if ($store_info) {
-				$store_name = $store_info['name'];
-				$store_url = $store_info['url'] . 'index.php?route=account/login';
-			} else {
-				$store_name = $this->config->get('config_name');
-				$store_url = HTTP_CATALOG . 'index.php?route=account/login';
-			}
-	
-			$message  = sprintf($this->language->get('text_approve_welcome'), $store_name) . "\n\n";
-			$message .= $this->language->get('text_approve_login') . "\n";
-			$message .= $store_url . "\n\n";
-			$message .= $this->language->get('text_approve_services') . "\n\n";
-			$message .= $this->language->get('text_approve_thanks') . "\n";
-			$message .= $store_name;
-	
-			$mail = new Mail();
-			$mail->protocol = $this->config->get('config_mail_protocol');
-			$mail->parameter = $this->config->get('config_mail_parameter');
-			$mail->hostname = $this->config->get('config_smtp_host');
-			$mail->username = $this->config->get('config_smtp_username');
-			$mail->password = $this->config->get('config_smtp_password');
-			$mail->port = $this->config->get('config_smtp_port');
-			$mail->timeout = $this->config->get('config_smtp_timeout');							
-			$mail->setTo($customer_info['email']);
-			$mail->setFrom($this->config->get('config_email'));
-			$mail->setSender($store_name);
-			$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_approve_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
-			$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
-			$mail->send();
-		}		
-	}
-		
-	public function getAddress($address_id) {
-		$address_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "address WHERE address_id = '" . (int)$address_id . "'");
-
-		if ($address_query->num_rows) {
-			$country_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "country` WHERE country_id = '" . (int)$address_query->row['country_id'] . "'");
-			
-			if ($country_query->num_rows) {
-				$country = $country_query->row['name'];
-				$iso_code_2 = $country_query->row['iso_code_2'];
-				$iso_code_3 = $country_query->row['iso_code_3'];
-				$address_format = $country_query->row['address_format'];
-			} else {
-				$country = '';
-				$iso_code_2 = '';
-				$iso_code_3 = '';	
-				$address_format = '';
-			}
-			
-			$zone_query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone` WHERE zone_id = '" . (int)$address_query->row['zone_id'] . "'");
-			
-			if ($zone_query->num_rows) {
-				$zone = $zone_query->row['name'];
-				$zone_code = $zone_query->row['code'];
-			} else {
-				$zone = '';
-				$zone_code = '';
-			}		
-		
-			return array(
-				'address_id'     => $address_query->row['address_id'],
-				'customer_id'    => $address_query->row['customer_id'],
-				'firstname'      => $address_query->row['firstname'],
-				'lastname'       => $address_query->row['lastname'],
-				'company'        => $address_query->row['company'],
-				'company_id'     => $address_query->row['company_id'],
-				'tax_id'         => $address_query->row['tax_id'],
-				'address_1'      => $address_query->row['address_1'],
-				'address_2'      => $address_query->row['address_2'],
-				'postcode'       => $address_query->row['postcode'],
-				'city'           => $address_query->row['city'],
-				'zone_id'        => $address_query->row['zone_id'],
-				'zone'           => $zone,
-				'zone_code'      => $zone_code,
-				'country_id'     => $address_query->row['country_id'],
-				'country'        => $country,	
-				'iso_code_2'     => $iso_code_2,
-				'iso_code_3'     => $iso_code_3,
-				'address_format' => $address_format
-			);
-		}
-	}
-		
-	public function getAddresses($customer_id) {
-		$address_data = array();
-		
-		$query = $this->db->query("SELECT address_id FROM " . DB_PREFIX . "address WHERE customer_id = '" . (int)$customer_id . "'");
-	
-		foreach ($query->rows as $result) {
-			$address_info = $this->getAddress($result['address_id']);
-		
-			if ($address_info) {
-				$address_data[$result['address_id']] = $address_info;
-			}
-		}		
-		
-		return $address_data;
-	}	
-				
-	public function getTotalCustomers($data = array()) {
-      	$sql = "SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer";
-		
-		$implode = array();
-		
-		if (!empty($data['filter_name'])) {
-			$implode[] = "CONCAT(firstname, ' ', lastname) LIKE '%" . $this->db->escape($data['filter_name']) . "%'";
-		}
-		
-		if (!empty($data['filter_email'])) {
-			$implode[] = "email LIKE '" . $this->db->escape($data['filter_email']) . "%'";
-		}
-		
-		if (isset($data['filter_newsletter']) && !is_null($data['filter_newsletter'])) {
-			$implode[] = "newsletter = '" . (int)$data['filter_newsletter'] . "'";
-		}
-				
-		if (!empty($data['filter_customer_group_id'])) {
-			$implode[] = "customer_group_id = '" . (int)$data['filter_customer_group_id'] . "'";
-		}	
-		
-		if (!empty($data['filter_ip'])) {
-			$implode[] = "customer_id IN (SELECT customer_id FROM " . DB_PREFIX . "customer_ip WHERE ip = '" . $this->db->escape($data['filter_ip']) . "')";
-		}	
-						
-		if (isset($data['filter_status']) && !is_null($data['filter_status'])) {
-			$implode[] = "status = '" . (int)$data['filter_status'] . "'";
-		}			
-		
-		if (isset($data['filter_approved']) && !is_null($data['filter_approved'])) {
-			$implode[] = "approved = '" . (int)$data['filter_approved'] . "'";
-		}		
-				
-		if (!empty($data['filter_date_added'])) {
-			$implode[] = "DATE(date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')";
-		}
-		
-		if ($implode) {
-			$sql .= " WHERE " . implode(" AND ", $implode);
-		}
-				
-		$query = $this->db->query($sql);
-				
-		return $query->row['total'];
-	}
-		
-	public function getTotalCustomersAwaitingApproval() {
-      	$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE status = '0' OR approved = '0'");
-
-		return $query->row['total'];
-	}
-	
-	public function getTotalAddressesByCustomerId($customer_id) {
-      	$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "address WHERE customer_id = '" . (int)$customer_id . "'");
-		
-		return $query->row['total'];
-	}
-	
-	public function getTotalAddressesByCountryId($country_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "address WHERE country_id = '" . (int)$country_id . "'");
-		
-		return $query->row['total'];
-	}	
-	
-	public function getTotalAddressesByZoneId($zone_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "address WHERE zone_id = '" . (int)$zone_id . "'");
-		
-		return $query->row['total'];
-	}
-	
-	public function getTotalCustomersByCustomerGroupId($customer_group_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE customer_group_id = '" . (int)$customer_group_id . "'");
-		
-		return $query->row['total'];
-	}
-
-	public function addHistory($customer_id, $comment) {
-      	$this->db->query("INSERT INTO " . DB_PREFIX . "customer_history SET customer_id = '" . (int)$customer_id . "', comment = '" . $this->db->escape(strip_tags($comment)) . "', date_added = NOW()");
-	}	
-	
-	public function getHistories($customer_id, $start = 0, $limit = 10) { 
-		if ($start < 0) {
-			$start = 0;
-		}
-		
-		if ($limit < 1) {
-			$limit = 10;
-		}	
-		
-		$query = $this->db->query("SELECT comment, date_added FROM " . DB_PREFIX . "customer_history WHERE customer_id = '" . (int)$customer_id . "' ORDER BY date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
-	
-		return $query->rows;
-	}	
-
-	public function getTotalHistories($customer_id) {
-	  	$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_history WHERE customer_id = '" . (int)$customer_id . "'");
-
-		return $query->row['total'];
-	}	
-			
-	public function addTransaction($customer_id, $description = '', $amount = '', $order_id = 0) {
-		$customer_info = $this->getCustomer($customer_id);
-		
-		if ($customer_info) { 
-			$this->db->query("INSERT INTO " . DB_PREFIX . "customer_transaction SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', description = '" . $this->db->escape($description) . "', amount = '" . (float)$amount . "', date_added = NOW()");
-
-			$this->language->load('mail/customer');
-			
-			if ($customer_info['store_id']) {
-				$this->load->model('setting/store');
-		
-				$store_info = $this->model_setting_store->getStore($customer_info['store_id']);
-				
-				if ($store_info) {
-					$store_name = $store_info['name'];
-				} else {
-					$store_name = $this->config->get('config_name');
-				}	
-			} else {
-				$store_name = $this->config->get('config_name');
-			}
-						
-			$message  = sprintf($this->language->get('text_transaction_received'), $this->currency->format($amount, $this->config->get('config_currency'))) . "\n\n";
-			$message .= sprintf($this->language->get('text_transaction_total'), $this->currency->format($this->getTransactionTotal($customer_id)));
-								
-			$mail = new Mail();
-			$mail->protocol = $this->config->get('config_mail_protocol');
-			$mail->parameter = $this->config->get('config_mail_parameter');
-			$mail->hostname = $this->config->get('config_smtp_host');
-			$mail->username = $this->config->get('config_smtp_username');
-			$mail->password = $this->config->get('config_smtp_password');
-			$mail->port = $this->config->get('config_smtp_port');
-			$mail->timeout = $this->config->get('config_smtp_timeout');
-			$mail->setTo($customer_info['email']);
-			$mail->setFrom($this->config->get('config_email'));
-			$mail->setSender($store_name);
-			$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_transaction_subject'), $this->config->get('config_name')), ENT_QUOTES, 'UTF-8'));
-			$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
-			$mail->send();
-		}
-	}
-	
-	public function deleteTransaction($order_id) {
-		$this->db->query("DELETE FROM " . DB_PREFIX . "customer_transaction WHERE order_id = '" . (int)$order_id . "'");
-	}
-	
-	public function getTransactions($customer_id, $start = 0, $limit = 10) {
-		if ($start < 0) {
-			$start = 0;
-		}
-		
-		if ($limit < 1) {
-			$limit = 10;
-		}	
-				
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_transaction WHERE customer_id = '" . (int)$customer_id . "' ORDER BY date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
-	
-		return $query->rows;
-	}
-
-	public function getTotalTransactions($customer_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total  FROM " . DB_PREFIX . "customer_transaction WHERE customer_id = '" . (int)$customer_id . "'");
-	
-		return $query->row['total'];
-	}
-			
-	public function getTransactionTotal($customer_id) {
-		$query = $this->db->query("SELECT SUM(amount) AS total FROM " . DB_PREFIX . "customer_transaction WHERE customer_id = '" . (int)$customer_id . "'");
-	
-		return $query->row['total'];
-	}
-	
-	public function getTotalTransactionsByOrderId($order_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_transaction WHERE order_id = '" . (int)$order_id . "'");
-	
-		return $query->row['total'];
-	}	
-				
-	public function addReward($customer_id, $description = '', $points = '', $order_id = 0) {
-		$customer_info = $this->getCustomer($customer_id);
-			
-		if ($customer_info) { 
-			$this->db->query("INSERT INTO " . DB_PREFIX . "customer_reward SET customer_id = '" . (int)$customer_id . "', order_id = '" . (int)$order_id . "', points = '" . (int)$points . "', description = '" . $this->db->escape($description) . "', date_added = NOW()");
-
-			$this->language->load('mail/customer');
-			
-			if ($order_id) {
-				$this->load->model('sale/order');
-		
-				$order_info = $this->model_sale_order->getOrder($order_id);
-				
-				if ($order_info) {
-					$store_name = $order_info['store_name'];
-				} else {
-					$store_name = $this->config->get('config_name');
-				}	
-			} else {
-				$store_name = $this->config->get('config_name');
-			}		
-				
-			$message  = sprintf($this->language->get('text_reward_received'), $points) . "\n\n";
-			$message .= sprintf($this->language->get('text_reward_total'), $this->getRewardTotal($customer_id));
-				
-			$mail = new Mail();
-			$mail->protocol = $this->config->get('config_mail_protocol');
-			$mail->parameter = $this->config->get('config_mail_parameter');
-			$mail->hostname = $this->config->get('config_smtp_host');
-			$mail->username = $this->config->get('config_smtp_username');
-			$mail->password = $this->config->get('config_smtp_password');
-			$mail->port = $this->config->get('config_smtp_port');
-			$mail->timeout = $this->config->get('config_smtp_timeout');
-			$mail->setTo($customer_info['email']);
-			$mail->setFrom($this->config->get('config_email'));
-			$mail->setSender($store_name);
-			$mail->setSubject(html_entity_decode(sprintf($this->language->get('text_reward_subject'), $store_name), ENT_QUOTES, 'UTF-8'));
-			$mail->setText(html_entity_decode($message, ENT_QUOTES, 'UTF-8'));
-			$mail->send();
-		}
-	}
-
-	public function deleteReward($order_id) {
-		$this->db->query("DELETE FROM " . DB_PREFIX . "customer_reward WHERE order_id = '" . (int)$order_id . "'");
-	}
-	
-	public function getRewards($customer_id, $start = 0, $limit = 10) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_reward WHERE customer_id = '" . (int)$customer_id . "' ORDER BY date_added DESC LIMIT " . (int)$start . "," . (int)$limit);
-	
-		return $query->rows;
-	}
-	
-	public function getTotalRewards($customer_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_reward WHERE customer_id = '" . (int)$customer_id . "'");
-	
-		return $query->row['total'];
-	}
-			
-	public function getRewardTotal($customer_id) {
-		$query = $this->db->query("SELECT SUM(points) AS total FROM " . DB_PREFIX . "customer_reward WHERE customer_id = '" . (int)$customer_id . "'");
-	
-		return $query->row['total'];
-	}		
-	
-	public function getTotalCustomerRewardsByOrderId($order_id) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_reward WHERE order_id = '" . (int)$order_id . "'");
-	
-		return $query->row['total'];
-	}
-	
-	public function getIpsByCustomerId($customer_id) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer_ip WHERE customer_id = '" . (int)$customer_id . "'");
-
-		return $query->rows;
-	}	
-	
-	public function getTotalCustomersByIp($ip) {
-		$query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer_ip WHERE ip = '" . $this->db->escape($ip) . "'");
-
-		return $query->row['total'];
-	}
-	
-	public function addBanIp($ip) {
-		$this->db->query("INSERT INTO `" . DB_PREFIX . "customer_ban_ip` SET `ip` = '" . $this->db->escape($ip) . "'");
-	}
-		
-	public function removeBanIp($ip) {
-		$this->db->query("DELETE FROM `" . DB_PREFIX . "customer_ban_ip` WHERE `ip` = '" . $this->db->escape($ip) . "'");
-	}
-			
-	public function getTotalBanIpsByIp($ip) {
-      	$query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "customer_ban_ip` WHERE `ip` = '" . $this->db->escape($ip) . "'");
-				 
-		return $query->row['total'];
-	}
-
-// Newsletter subscribers only
-	public function getNewsletterSubscribers() {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "subscribe");
-	
-		return $query->rows;
-	}
-	// Newsletter subscribers only
-	
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/controller/setting/store.php
===================================================================
--- trunk/www/admin/controller/setting/store.php	(revision 19)
+++ trunk/www/admin/controller/setting/store.php	(revision 20)
@@ -1,1093 +0,0 @@
-<?php
-class ControllerSettingStore extends Controller {
-	private $error = array(); 
-
-	public function index() {
-		$this->language->load('setting/store');
-
-		$this->document->setTitle($this->language->get('heading_title'));
-		 
-		$this->load->model('setting/store');
-
-		$this->getList();
-	}
-	      
-  	public function insert() {
-    	$this->language->load('setting/store');
-
-    	$this->document->setTitle($this->language->get('heading_title')); 
-		
-		$this->load->model('setting/store');
-		
-    	if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
-			$store_id = $this->model_setting_store->addStore($this->request->post);
-	  		
-			$this->load->model('setting/setting');
-			
-			$this->model_setting_setting->editSetting('config', $this->request->post, $store_id);
-
-            /*function*/
-            function loo_parse_queries($file) {
-                $sql_file = $file;
-
-                $contents = file_get_contents($sql_file);
-
-                $comment_patterns = array('/\/\*.*(\n)*.*(\*\/)?/', // comments
-                    '/\s*--.*\n/', //inline comments start with --
-                    '/\s*#.*\n/', //inline comments start with #
-                );
-                $contents = preg_replace($comment_patterns, "\n", $contents);
-
-                $contents = preg_replace('/(?<=t);(?=\n)/', "{{semicolon_in_text}}", $contents);
-
-                $statements = explode(";\n", $contents);
-//    $statements = preg_replace("/\s/", ' ', $statements);
-
-                $queries = array();
-                foreach ($statements as $query) {
-                    if (trim($query) != '') {
-
-                        $query = str_replace("{{semicolon_in_text}}", ";", $query);
-
-                        //apply db prefix parametr
-                        preg_match("/\?:\w*/i", $query, $matches);
-                        $table_name = str_replace('?:', DB_PREFIX, $matches[0]);
-                        if ( !empty($table_name) ) {
-                            $query = str_replace(array($matches[0], 'key = '), array($table_name, '`key` = '), $query);
-                        }
-
-                        $queries[] = $query;
-                    }
-                }
-
-                return $queries;
-            }
-            /*function*/
-
-			// LOO
-			if(file_exists(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql')) {
-				$tmpl_dir = dirname(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
-				
-				if((bool)stristr($tmpl_dir, $this->config->get('config_template')) == false) {
-					// Parse and Run sql
-					$sql = loo_parse_queries(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
-					foreach ($sql as $query) {
-						$this->db->query($query);
-					}
-				}
-			}
-            // LOO (end)
-
-            $this->session->data['success'] = $this->language->get('text_success');
-			
-			$this->redirect($this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL'));
-    	}
-	
-    	$this->getForm();
-  	}
-
-  	public function update() {
-    	$this->language->load('setting/store');
-
-    	$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->load->model('setting/store');
-	
-    	if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
-			$this->model_setting_store->editStore($this->request->get['store_id'], $this->request->post);
-			
-			$this->load->model('setting/setting');
-			
-			$this->model_setting_setting->editSetting('config', $this->request->post, $this->request->get['store_id']);
-			
-			// LOO 
-			if(file_exists(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql')) {
-				$tmpl_dir = dirname(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
-				
-				if((bool)stristr($tmpl_dir, $this->config->get('config_template')) == false) {
-					// Parse and Run sql
-					$sql = loo_parse_queries(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
-					foreach ($sql as $query) {
-						$this->db->query($query);
-					}
-				}
-			}
-			// LOO (end)
-			
-			$this->session->data['success'] = $this->language->get('text_success');
-			
-			$this->redirect($this->url->link('setting/store', 'token=' . $this->session->data['token'] . '&store_id=' . $this->request->get['store_id'], 'SSL'));
-		}
-
-    	$this->getForm();
-  	}
-
-  	public function delete() {
-    	$this->language->load('setting/store');
-
-    	$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->load->model('setting/store');
-		
-		$this->load->model('setting/setting');
-		
-		if (isset($this->request->post['selected']) && $this->validateDelete()) {
-			foreach ($this->request->post['selected'] as $store_id) {
-				$this->model_setting_store->deleteStore($store_id);
-				
-				$this->model_setting_setting->deleteSetting('config', $store_id);
-			}
-
-			$this->session->data['success'] = $this->language->get('text_success');
-			
-			$this->redirect($this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL'));
-		}
-
-    	$this->getList();
-  	}
-	
-	protected function getList() {
-		$url = '';
-			
-		if (isset($this->request->get['page'])) {
-			$url .= '&page=' . $this->request->get['page'];
-		}
-
-  		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => false
-   		);
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => ' :: '
-   		);
-							
-		$this->data['insert'] = $this->url->link('setting/store/insert', 'token=' . $this->session->data['token'], 'SSL');
-		$this->data['delete'] = $this->url->link('setting/store/delete', 'token=' . $this->session->data['token'], 'SSL');	
-
-		$this->data['stores'] = array();
-		
-		$action = array();
-					
-		$action[] = array(
-			'text' => $this->language->get('text_edit'),
-			'href' => $this->url->link('setting/setting', 'token=' . $this->session->data['token'], 'SSL')
-		);
-					
-		$this->data['stores'][] = array(
-			'store_id' => 0,
-			'name'     => $this->config->get('config_name') . $this->language->get('text_default'),
-			'url'      => HTTP_CATALOG,
-			'selected' => isset($this->request->post['selected']) && in_array(0, $this->request->post['selected']),
-			'action'   => $action
-		);
-					
-		$store_total = $this->model_setting_store->getTotalStores();
-	
-		$results = $this->model_setting_store->getStores();
- 
-    	foreach ($results as $result) {
-			$action = array();
-						
-			$action[] = array(
-				'text' => $this->language->get('text_edit'),
-				'href' => $this->url->link('setting/store/update', 'token=' . $this->session->data['token'] . '&store_id=' . $result['store_id'], 'SSL')
-			);
-						
-			$this->data['stores'][] = array(
-				'store_id' => $result['store_id'],
-				'name'     => $result['name'],
-				'url'      => $result['url'],
-				'selected' => isset($this->request->post['selected']) && in_array($result['store_id'], $this->request->post['selected']),
-				'action'   => $action
-			);
-		}	
-	
-		$this->data['heading_title'] = $this->language->get('heading_title');
-
-		$this->data['text_no_results'] = $this->language->get('text_no_results');
-
-		$this->data['column_name'] = $this->language->get('column_name');
-		$this->data['column_url'] = $this->language->get('column_url');
-		$this->data['column_action'] = $this->language->get('column_action');		
-		
-		$this->data['button_insert'] = $this->language->get('button_insert');
-		$this->data['button_delete'] = $this->language->get('button_delete');
- 
- 		if (isset($this->error['warning'])) {
-			$this->data['error_warning'] = $this->error['warning'];
-		} else {
-			$this->data['error_warning'] = '';
-		}
-		
-		if (isset($this->session->data['success'])) {
-			$this->data['success'] = $this->session->data['success'];
-		
-			unset($this->session->data['success']);
-		} else {
-			$this->data['success'] = '';
-		}
-
-		$this->template = 'setting/store_list.tpl';
-		$this->children = array(
-			'common/header',
-			'common/footer'
-		);
-				
-		$this->response->setOutput($this->render());
-	}
-	 
-	public function getForm() { 
-		$this->data['heading_title'] = $this->language->get('heading_title');
-		 
-		$this->data['text_select'] = $this->language->get('text_select');
-		$this->data['text_none'] = $this->language->get('text_none');
-		$this->data['text_yes'] = $this->language->get('text_yes');
-		$this->data['text_no'] = $this->language->get('text_no');
-		$this->data['text_items'] = $this->language->get('text_items');
-		$this->data['text_tax'] = $this->language->get('text_tax');
-		$this->data['text_account'] = $this->language->get('text_account');
-		$this->data['text_checkout'] = $this->language->get('text_checkout');
-		$this->data['text_stock'] = $this->language->get('text_stock');				
-		$this->data['text_image_manager'] = $this->language->get('text_image_manager');
- 		$this->data['text_browse'] = $this->language->get('text_browse');
-		$this->data['text_clear'] = $this->language->get('text_clear');			
-		$this->data['text_shipping'] = $this->language->get('text_shipping');	
-		$this->data['text_payment'] = $this->language->get('text_payment');	
-				
-		$this->data['entry_url'] = $this->language->get('entry_url');
-		$this->data['entry_ssl'] = $this->language->get('entry_ssl');	
-		$this->data['entry_name'] = $this->language->get('entry_name');
-		$this->data['entry_owner'] = $this->language->get('entry_owner');
-		$this->data['entry_address'] = $this->language->get('entry_address');
-		$this->data['entry_email'] = $this->language->get('entry_email');
-		$this->data['entry_telephone'] = $this->language->get('entry_telephone');
-		$this->data['entry_fax'] = $this->language->get('entry_fax');				
-		$this->data['entry_title'] = $this->language->get('entry_title');
-		$this->data['entry_meta_description'] = $this->language->get('entry_meta_description');
-		$this->data['entry_layout'] = $this->language->get('entry_layout');
-		$this->data['entry_template'] = $this->language->get('entry_template');
-		$this->data['entry_country'] = $this->language->get('entry_country');
-		$this->data['entry_zone'] = $this->language->get('entry_zone');
-		$this->data['entry_language'] = $this->language->get('entry_language');
-		$this->data['entry_currency'] = $this->language->get('entry_currency');
-		$this->data['entry_catalog_limit'] = $this->language->get('entry_catalog_limit');
-		$this->data['entry_tax'] = $this->language->get('entry_tax');
-		$this->data['entry_tax_default'] = $this->language->get('entry_tax_default');
-		$this->data['entry_tax_customer'] = $this->language->get('entry_tax_customer');		
-		$this->data['entry_customer_group'] = $this->language->get('entry_customer_group');
-		$this->data['entry_customer_group_display'] = $this->language->get('entry_customer_group_display');
-		$this->data['entry_customer_price'] = $this->language->get('entry_customer_price');
-		$this->data['entry_account'] = $this->language->get('entry_account');
-		$this->data['entry_cart_weight'] = $this->language->get('entry_cart_weight');
-		$this->data['entry_guest_checkout'] = $this->language->get('entry_guest_checkout');
-		$this->data['entry_checkout'] = $this->language->get('entry_checkout');
-		$this->data['entry_order_status'] = $this->language->get('entry_order_status');
-		$this->data['entry_stock_display'] = $this->language->get('entry_stock_display');
-		$this->data['entry_stock_checkout'] = $this->language->get('entry_stock_checkout');
-		$this->data['entry_ajax_cart'] = $this->language->get('entry_ajax_cart');
-		$this->data['entry_logo'] = $this->language->get('entry_logo');
-		$this->data['entry_icon'] = $this->language->get('entry_icon');
-		$this->data['entry_image_category'] = $this->language->get('entry_image_category');
-		$this->data['entry_image_thumb'] = $this->language->get('entry_image_thumb');
-		$this->data['entry_image_popup'] = $this->language->get('entry_image_popup');
-		$this->data['entry_image_product'] = $this->language->get('entry_image_product');
-		$this->data['entry_image_additional'] = $this->language->get('entry_image_additional');
-		$this->data['entry_image_related'] = $this->language->get('entry_image_related');
-		$this->data['entry_image_compare'] = $this->language->get('entry_image_compare');
-		$this->data['entry_image_wishlist'] = $this->language->get('entry_image_wishlist');
-		$this->data['entry_image_cart'] = $this->language->get('entry_image_cart');
-		$this->data['entry_secure'] = $this->language->get('entry_secure');
-				
-		$this->data['button_save'] = $this->language->get('button_save');
-		$this->data['button_cancel'] = $this->language->get('button_cancel');
-
-		$this->data['tab_general'] = $this->language->get('tab_general');
-		$this->data['tab_store'] = $this->language->get('tab_store');
-		$this->data['tab_local'] = $this->language->get('tab_local');
-		$this->data['tab_option'] = $this->language->get('tab_option');
-		$this->data['tab_image'] = $this->language->get('tab_image');
-		$this->data['tab_server'] = $this->language->get('tab_server');
-		
- 		if (isset($this->error['warning'])) {
-			$this->data['error_warning'] = $this->error['warning'];
-		} else {
-			$this->data['error_warning'] = '';
-		}
-		
- 		if (isset($this->error['url'])) {
-			$this->data['error_url'] = $this->error['url'];
-		} else {
-			$this->data['error_url'] = '';
-		}
-
- 		if (isset($this->error['name'])) {
-			$this->data['error_name'] = $this->error['name'];
-		} else {
-			$this->data['error_name'] = '';
-		}
-		
- 		if (isset($this->error['owner'])) {
-			$this->data['error_owner'] = $this->error['owner'];
-		} else {
-			$this->data['error_owner'] = '';
-		}
-
- 		if (isset($this->error['address'])) {
-			$this->data['error_address'] = $this->error['address'];
-		} else {
-			$this->data['error_address'] = '';
-		}
-		
- 		if (isset($this->error['email'])) {
-			$this->data['error_email'] = $this->error['email'];
-		} else {
-			$this->data['error_email'] = '';
-		}
-
-		if (isset($this->error['telephone'])) {
-			$this->data['error_telephone'] = $this->error['telephone'];
-		} else {
-			$this->data['error_telephone'] = '';
-		}
-
- 		if (isset($this->error['title'])) {
-			$this->data['error_title'] = $this->error['title'];
-		} else {
-			$this->data['error_title'] = '';
-		}
-		
-  		if (isset($this->error['customer_group_display'])) {
-			$this->data['error_customer_group_display'] = $this->error['customer_group_display'];
-		} else {
-			$this->data['error_customer_group_display'] = '';
-		}
-				
- 		if (isset($this->error['image_category'])) {
-			$this->data['error_image_category'] = $this->error['image_category'];
-		} else {
-			$this->data['error_image_category'] = '';
-		}
-		
- 		if (isset($this->error['image_thumb'])) {
-			$this->data['error_image_thumb'] = $this->error['image_thumb'];
-		} else {
-			$this->data['error_image_thumb'] = '';
-		}
-		
- 		if (isset($this->error['image_popup'])) {
-			$this->data['error_image_popup'] = $this->error['image_popup'];
-		} else {
-			$this->data['error_image_popup'] = '';
-		}
-		
- 		if (isset($this->error['image_product'])) {
-			$this->data['error_image_product'] = $this->error['image_product'];
-		} else {
-			$this->data['error_image_product'] = '';
-		}
-				
- 		if (isset($this->error['image_additional'])) {
-			$this->data['error_image_additional'] = $this->error['image_additional'];
-		} else {
-			$this->data['error_image_additional'] = '';
-		}	
-		
- 		if (isset($this->error['image_related'])) {
-			$this->data['error_image_related'] = $this->error['image_related'];
-		} else {
-			$this->data['error_image_related'] = '';
-		}
- 		
-		if (isset($this->error['image_compare'])) {
-			$this->data['error_image_compare'] = $this->error['image_compare'];
-		} else {
-			$this->data['error_image_compare'] = '';
-		}
-		
-		if (isset($this->error['image_wishlist'])) {
-			$this->data['error_image_wishlist'] = $this->error['image_wishlist'];
-		} else {
-			$this->data['error_image_wishlist'] = '';
-		}
-						
- 		if (isset($this->error['image_cart'])) {
-			$this->data['error_image_cart'] = $this->error['image_cart'];
-		} else {
-			$this->data['error_image_cart'] = '';
-		}
-		
-		if (isset($this->error['catalog_limit'])) {
-			$this->data['error_catalog_limit'] = $this->error['catalog_limit'];
-		} else {
-			$this->data['error_catalog_limit'] = '';
-		}
-		
-  		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => false
-   		);
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => ' :: '
-   		);
-		
-		if (isset($this->session->data['success'])) {
-			$this->data['success'] = $this->session->data['success'];
-		
-			unset($this->session->data['success']);
-		} else {
-			$this->data['success'] = '';
-		}
-		
-		if (!isset($this->request->get['store_id'])) {
-			$this->data['action'] = $this->url->link('setting/store/insert', 'token=' . $this->session->data['token'], 'SSL');
-		} else {
-			$this->data['action'] = $this->url->link('setting/store/update', 'token=' . $this->session->data['token'] . '&store_id=' . $this->request->get['store_id'], 'SSL');
-		}
-				
-		$this->data['cancel'] = $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL');
-	
-		if (isset($this->request->get['store_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
-			$this->load->model('setting/setting');
-			
-      		$store_info = $this->model_setting_setting->getSetting('config', $this->request->get['store_id']);
-    	}
-		
-		$this->data['token'] = $this->session->data['token'];
-		
-		if (isset($this->request->post['config_url'])) {
-			$this->data['config_url'] = $this->request->post['config_url'];
-		} elseif (isset($store_info['config_url'])) {
-			$this->data['config_url'] = $store_info['config_url'];
-		} else {
-			$this->data['config_url'] = '';
-		}
-		
-		if (isset($this->request->post['config_ssl'])) {
-			$this->data['config_ssl'] = $this->request->post['config_ssl'];
-		} elseif (isset($store_info['config_ssl'])) {
-			$this->data['config_ssl'] = $store_info['config_ssl'];
-		} else {
-			$this->data['config_ssl'] = '';
-		}
-				
-		if (isset($this->request->post['config_name'])) {
-			$this->data['config_name'] = $this->request->post['config_name'];
-		} elseif (isset($store_info['config_name'])) {
-			$this->data['config_name'] = $store_info['config_name'];
-		} else {
-			$this->data['config_name'] = '';
-		}
-	
-		if (isset($this->request->post['config_owner'])) {
-			$this->data['config_owner'] = $this->request->post['config_owner'];
-		} elseif (isset($store_info['config_owner'])) {
-			$this->data['config_owner'] = $store_info['config_owner'];		
-		} else {
-			$this->data['config_owner'] = '';
-		}
-
-		if (isset($this->request->post['config_address'])) {
-			$this->data['config_address'] = $this->request->post['config_address'];
-		} elseif (isset($store_info['config_address'])) {
-			$this->data['config_address'] = $store_info['config_address'];		
-		} else {
-			$this->data['config_address'] = '';
-		}
-		
-		if (isset($this->request->post['config_email'])) {
-			$this->data['config_email'] = $this->request->post['config_email'];
-		} elseif (isset($store_info['config_email'])) {
-			$this->data['config_email'] = $store_info['config_email'];		
-		} else {
-			$this->data['config_email'] = '';
-		}
-		
-		if (isset($this->request->post['config_telephone'])) {
-			$this->data['config_telephone'] = $this->request->post['config_telephone'];
-		} elseif (isset($store_info['config_telephone'])) {
-			$this->data['config_telephone'] = $store_info['config_telephone'];		
-		} else {
-			$this->data['config_telephone'] = '';
-		}
-
-		if (isset($this->request->post['config_fax'])) {
-			$this->data['config_fax'] = $this->request->post['config_fax'];
-		} elseif (isset($store_info['config_fax'])) {
-			$this->data['config_fax'] = $store_info['config_fax'];		
-		} else {
-			$this->data['config_fax'] = '';
-		}
-		
-		if (isset($this->request->post['config_title'])) {
-			$this->data['config_title'] = $this->request->post['config_title'];
-		} elseif (isset($store_info['config_title'])) {
-			$this->data['config_title'] = $store_info['config_title'];
-		} else {
-			$this->data['config_title'] = '';
-		}
-		
-		if (isset($this->request->post['config_meta_description'])) {
-			$this->data['config_meta_description'] = $this->request->post['config_meta_description'];
-		} elseif (isset($store_info['config_meta_description'])) {
-			$this->data['config_meta_description'] = $store_info['config_meta_description'];		
-		} else {
-			$this->data['config_meta_description'] = '';
-		}
-
-		if (isset($this->request->post['config_layout_id'])) {
-			$this->data['config_layout_id'] = $this->request->post['config_layout_id'];
-		} elseif (isset($store_info['config_layout_id'])) {
-			$this->data['config_layout_id'] = $store_info['config_layout_id'];
-		} else {
-			$this->data['config_layout_id'] = '';
-		}
-				
-		$this->load->model('design/layout');
-		
-		$this->data['layouts'] = $this->model_design_layout->getLayouts();
-
-		if (isset($this->request->post['config_template'])) {
-			$this->data['config_template'] = $this->request->post['config_template'];
-		} elseif (isset($store_info['config_template'])) {
-			$this->data['config_template'] = $store_info['config_template'];
-		} else {
-			$this->data['config_template'] = '';
-		}
-		
-		$this->data['templates'] = array();
-
-		$directories = glob(DIR_CATALOG . 'view/theme/*', GLOB_ONLYDIR);
-		
-		foreach ($directories as $directory) {
-			$this->data['templates'][] = basename($directory);
-		}	
-								
-		if (isset($this->request->post['config_country_id'])) {
-			$this->data['config_country_id'] = $this->request->post['config_country_id'];
-		} elseif (isset($store_info['config_country_id'])) {
-			$this->data['config_country_id'] = $store_info['config_country_id'];		
-		} else {
-			$this->data['config_country_id'] = $this->config->get('config_country_id');
-		}
-		
-		$this->load->model('localisation/country');
-		
-		$this->data['countries'] = $this->model_localisation_country->getCountries();
-
-		if (isset($this->request->post['config_zone_id'])) {
-			$this->data['config_zone_id'] = $this->request->post['config_zone_id'];
-		} elseif (isset($store_info['config_zone_id'])) {
-			$this->data['config_zone_id'] = $store_info['config_zone_id'];				
-		} else {
-			$this->data['config_zone_id'] = $this->config->get('config_zone_id');
-		}
-
-		if (isset($this->request->post['config_language'])) {
-			$this->data['config_language'] = $this->request->post['config_language'];
-		} elseif (isset($store_info['config_language'])) {
-			$this->data['config_language'] = $store_info['config_language'];			
-		} else {
-			$this->data['config_language'] = $this->config->get('config_language');
-		}
-		
-		$this->load->model('localisation/language');
-		
-		$this->data['languages'] = $this->model_localisation_language->getLanguages();
-
-		if (isset($this->request->post['config_currency'])) {
-			$this->data['config_currency'] = $this->request->post['config_currency'];
-		} elseif (isset($store_info['config_currency'])) {
-			$this->data['config_currency'] = $store_info['config_currency'];			
-		} else {
-			$this->data['config_currency'] = $this->config->get('config_currency');
-		}
-		
-		$this->load->model('localisation/currency');
-		
-		$this->data['currencies'] = $this->model_localisation_currency->getCurrencies();
-		
-		if (isset($this->request->post['config_catalog_limit'])) {
-			$this->data['config_catalog_limit'] = $this->request->post['config_catalog_limit'];
-		} elseif (isset($store_info['config_catalog_limit'])) {
-			$this->data['config_catalog_limit'] = $store_info['config_catalog_limit'];	
-		} else {
-			$this->data['config_catalog_limit'] = '12';
-		}		
-		
-		if (isset($this->request->post['config_tax'])) {
-			$this->data['config_tax'] = $this->request->post['config_tax'];
-		} elseif (isset($store_info['config_tax'])) {
-			$this->data['config_tax'] = $store_info['config_tax'];			
-		} else {
-			$this->data['config_tax'] = '';
-		}
-		
-		if (isset($this->request->post['config_tax_default'])) {
-			$this->data['config_tax_default'] = $this->request->post['config_tax_default'];
-		} elseif (isset($store_info['config_tax_default'])) {
-			$this->data['config_tax_default'] = $store_info['config_tax_default'];			
-		} else {
-			$this->data['config_tax_default'] = '';
-		}
-			
-		if (isset($this->request->post['config_tax_customer'])) {
-			$this->data['config_tax_customer'] = $this->request->post['config_tax_customer'];
-		} elseif (isset($store_info['config_tax_customer'])) {
-			$this->data['config_tax_customer'] = $store_info['config_tax_customer'];			
-		} else {
-			$this->data['config_tax_customer'] = '';
-		}
-
-		if (isset($this->request->post['config_customer_group_id'])) {
-			$this->data['config_customer_group_id'] = $this->request->post['config_customer_group_id'];
-		} elseif (isset($store_info['config_customer_group_id'])) {
-			$this->data['config_customer_group_id'] = $store_info['config_customer_group_id'];			
-		} else {
-			$this->data['config_customer_group_id'] = '';
-		}
-		
-		$this->load->model('sale/customer_group');
-		
-		$this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups();
-				
-		if (isset($this->request->post['config_customer_group_display'])) {
-			$this->data['config_customer_group_display'] = $this->request->post['config_customer_group_display'];
-		} elseif (isset($store_info['config_customer_group_display'])) {
-			$this->data['config_customer_group_display'] = $store_info['config_customer_group_display'];	
-		} else {
-			$this->data['config_customer_group_display'] = array();			
-		}
-				
-		if (isset($this->request->post['config_customer_price'])) {
-			$this->data['config_customer_price'] = $this->request->post['config_customer_price'];
-		} elseif (isset($store_info['config_customer_price'])) {
-			$this->data['config_customer_price'] = $store_info['config_customer_price'];			
-		} else {
-			$this->data['config_customer_price'] = '';
-		}
-		
-		if (isset($this->request->post['config_account_id'])) {
-			$this->data['config_account_id'] = $this->request->post['config_account_id'];
-		} elseif (isset($store_info['config_account_id'])) {
-			$this->data['config_account_id'] = $store_info['config_account_id'];			
-		} else {
-			$this->data['config_account_id'] = '';
-		}		
-
-		$this->load->model('catalog/information');
-		
-		$this->data['informations'] = $this->model_catalog_information->getInformations();
-				
-		if (isset($this->request->post['config_cart_weight'])) {
-			$this->data['config_cart_weight'] = $this->request->post['config_cart_weight'];
-		} elseif (isset($store_info['config_cart_weight'])) {
-			$this->data['config_cart_weight'] = $store_info['config_cart_weight'];	
-		} else {
-			$this->data['config_cart_weight'] = '';
-		}
-				
-		if (isset($this->request->post['config_guest_checkout'])) {
-			$this->data['config_guest_checkout'] = $this->request->post['config_guest_checkout'];
-		} elseif (isset($store_info['config_guest_checkout'])) {
-			$this->data['config_guest_checkout'] = $store_info['config_guest_checkout'];		
-		} else {
-			$this->data['config_guest_checkout'] = '';
-		}
-		
-		if (isset($this->request->post['config_checkout_id'])) {
-			$this->data['config_checkout_id'] = $this->request->post['config_checkout_id'];
-		} elseif (isset($store_info['config_checkout_id'])) {
-			$this->data['config_checkout_id'] = $store_info['config_checkout_id'];		
-		} else {
-			$this->data['config_checkout_id'] = '';
-		}
-
-		if (isset($this->request->post['config_order_status_id'])) {
-			$this->data['config_order_status_id'] = $this->request->post['config_order_status_id'];
-		} elseif (isset($store_info['config_order_status_id'])) {
-			$this->data['config_order_status_id'] = $store_info['config_order_status_id'];		
-		} else {
-			$this->data['config_order_status_id'] = '';
-		}
-		
-		$this->load->model('localisation/order_status');
-		
-		$this->data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();
-
-		if (isset($this->request->post['config_stock_display'])) {
-			$this->data['config_stock_display'] = $this->request->post['config_stock_display'];
-		} elseif (isset($store_info['config_stock_display'])) {
-			$this->data['config_stock_display'] = $store_info['config_stock_display'];			
-		} else {
-			$this->data['config_stock_display'] = '';
-		}
-
-		if (isset($this->request->post['config_stock_checkout'])) {
-			$this->data['config_stock_checkout'] = $this->request->post['config_stock_checkout'];
-		} elseif (isset($store_info['config_stock_checkout'])) {
-			$this->data['config_stock_checkout'] = $store_info['config_stock_checkout'];		
-		} else {
-			$this->data['config_stock_checkout'] = '';
-		}
-				
-		$this->load->model('tool/image');
-
-		if (isset($this->request->post['config_logo'])) {
-			$this->data['config_logo'] = $this->request->post['config_logo'];
-		} elseif (isset($store_info['config_logo'])) {
-			$this->data['config_logo'] = $store_info['config_logo'];			
-		} else {
-			$this->data['config_logo'] = '';
-		}
-
-		if (isset($store_info['config_logo']) && file_exists(DIR_IMAGE . $store_info['config_logo']) && is_file(DIR_IMAGE . $store_info['config_logo'])) {
-			$this->data['logo'] = $this->model_tool_image->resize($store_info['config_logo'], 100, 100);		
-		} else {
-			$this->data['logo'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-		}
-
-		if (isset($this->request->post['config_icon'])) {
-			$this->data['config_icon'] = $this->request->post['config_icon'];
-		} elseif (isset($store_info['config_icon'])) {
-			$this->data['config_icon'] = $store_info['config_icon'];			
-		} else {
-			$this->data['config_icon'] = '';
-		}
-		
-		if (isset($store_info['config_icon']) && file_exists(DIR_IMAGE . $store_info['config_icon']) && is_file(DIR_IMAGE . $store_info['config_icon'])) {
-			$this->data['icon'] = $this->model_tool_image->resize($store_info['config_icon'], 100, 100);
-		} else {
-			$this->data['icon'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-		}
-		
-		$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-		
-		if (isset($this->request->post['config_image_category_height'])) {
-			$this->data['config_image_category_height'] = $this->request->post['config_image_category_height'];
-		} elseif (isset($store_info['config_image_category_height'])) {
-			$this->data['config_image_category_height'] = $store_info['config_image_category_height'];			
-		} else {
-			$this->data['config_image_category_height'] = 80;
-		}	
-				
-		if (isset($this->request->post['config_image_thumb_width'])) {
-			$this->data['config_image_thumb_width'] = $this->request->post['config_image_thumb_width'];
-		} elseif (isset($store_info['config_image_thumb_width'])) {
-			$this->data['config_image_thumb_width'] = $store_info['config_image_thumb_width'];			
-		} else {
-			$this->data['config_image_thumb_width'] = 228;
-		}
-		
-		if (isset($this->request->post['config_image_thumb_height'])) {
-			$this->data['config_image_thumb_height'] = $this->request->post['config_image_thumb_height'];
-		} elseif (isset($store_info['config_image_thumb_height'])) {
-			$this->data['config_image_thumb_height'] = $store_info['config_image_thumb_height'];				
-		} else {
-			$this->data['config_image_thumb_height'] = 228;
-		}
-		
-		if (isset($this->request->post['config_image_popup_width'])) {
-			$this->data['config_image_popup_width'] = $this->request->post['config_image_popup_width'];
-		} elseif (isset($store_info['config_image_popup_width'])) {
-			$this->data['config_image_popup_width'] = $store_info['config_image_popup_width'];			
-		} else {
-			$this->data['config_image_popup_width'] = 500;
-		}
-		
-		if (isset($this->request->post['config_image_popup_height'])) {
-			$this->data['config_image_popup_height'] = $this->request->post['config_image_popup_height'];
-		} elseif (isset($store_info['config_image_popup_height'])) {
-			$this->data['config_image_popup_height'] = $store_info['config_image_popup_height'];			
-		} else {
-			$this->data['config_image_popup_height'] = 500;
-		}
-		
-		if (isset($this->request->post['config_image_product_width'])) {
-			$this->data['config_image_product_width'] = $this->request->post['config_image_product_width'];
-		} elseif (isset($store_info['config_image_product_width'])) {
-			$this->data['config_image_product_width'] = $store_info['config_image_product_width'];		
-		} else {
-			$this->data['config_image_product_width'] = 80;
-		}
-		
-		if (isset($this->request->post['config_image_product_height'])) {
-			$this->data['config_image_product_height'] = $this->request->post['config_image_product_height'];
-		} elseif (isset($store_info['config_image_product_height'])) {
-			$this->data['config_image_product_height'] = $store_info['config_image_product_height'];		
-		} else {
-			$this->data['config_image_product_height'] = 80;
-		}
-		
-		if (isset($this->request->post['config_image_category_width'])) {
-			$this->data['config_image_category_width'] = $this->request->post['config_image_category_width'];
-		} elseif (isset($store_info['config_image_category_width'])) {
-			$this->data['config_image_category_width'] = $store_info['config_image_category_width'];			
-		} else {
-			$this->data['config_image_category_width'] = 80;
-		}
-
-		if (isset($this->request->post['config_image_additional_width'])) {
-			$this->data['config_image_additional_width'] = $this->request->post['config_image_additional_width'];
-		} elseif (isset($store_info['config_image_additional_width'])) {
-			$this->data['config_image_additional_width'] = $store_info['config_image_additional_width'];			
-		} else {
-			$this->data['config_image_additional_width'] = 74;
-		}
-		
-		if (isset($this->request->post['config_image_additional_height'])) {
-			$this->data['config_image_additional_height'] = $this->request->post['config_image_additional_height'];
-		} elseif (isset($store_info['config_image_additional_height'])) {
-			$this->data['config_image_additional_height'] = $store_info['config_image_additional_height'];				
-		} else {
-			$this->data['config_image_additional_height'] = 74;
-		}
-		
-		if (isset($this->request->post['config_image_related_width'])) {
-			$this->data['config_image_related_width'] = $this->request->post['config_image_related_width'];
-		} elseif (isset($store_info['config_image_related_width'])) {
-			$this->data['config_image_related_width'] = $store_info['config_image_related_width'];		
-		} else {
-			$this->data['config_image_related_width'] = 80;
-		}
-		
-		if (isset($this->request->post['config_image_related_height'])) {
-			$this->data['config_image_related_height'] = $this->request->post['config_image_related_height'];
-		} elseif (isset($store_info['config_image_related_height'])) {
-			$this->data['config_image_related_height'] = $store_info['config_image_related_height'];			
-		} else {
-			$this->data['config_image_related_height'] = 80;
-		}
-		
-		if (isset($this->request->post['config_image_compare_width'])) {
-			$this->data['config_image_compare_width'] = $this->request->post['config_image_compare_width'];
-		} elseif (isset($store_info['config_image_compare_width'])) {
-			$this->data['config_image_compare_width'] = $store_info['config_image_compare_width'];			
-		} else {
-			$this->data['config_image_compare_width'] = 90;
-		}
-		
-		if (isset($this->request->post['config_image_compare_height'])) {
-			$this->data['config_image_compare_height'] = $this->request->post['config_image_compare_height'];
-		} elseif (isset($store_info['config_image_compare_height'])) {
-			$this->data['config_image_compare_height'] = $store_info['config_image_compare_height'];			
-		} else {
-			$this->data['config_image_compare_height'] = 90;
-		}
-		
-		if (isset($this->request->post['config_image_wishlist_width'])) {
-			$this->data['config_image_wishlist_width'] = $this->request->post['config_image_wishlist_width'];
-		} elseif (isset($store_info['config_image_wishlist_width'])) {
-			$this->data['config_image_wishlist_width'] = $store_info['config_image_wishlist_width'];			
-		} else {
-			$this->data['config_image_wishlist_width'] = 50;
-		}
-		
-		if (isset($this->request->post['config_image_wishlist_height'])) {
-			$this->data['config_image_wishlist_height'] = $this->request->post['config_image_wishlist_height'];
-		} elseif (isset($store_info['config_image_wishlist_height'])) {
-			$this->data['config_image_wishlist_height'] = $store_info['config_image_wishlist_height'];			
-		} else {
-			$this->data['config_image_wishlist_height'] = 50;
-		}
-				
-		if (isset($this->request->post['config_image_cart_width'])) {
-			$this->data['config_image_cart_width'] = $this->request->post['config_image_cart_width'];
-		} elseif (isset($store_info['config_image_cart_width'])) {
-			$this->data['config_image_cart_width'] = $store_info['config_image_cart_width'];			
-		} else {
-			$this->data['config_image_cart_width'] = 80;
-		}
-		
-		if (isset($this->request->post['config_image_cart_height'])) {
-			$this->data['config_image_cart_height'] = $this->request->post['config_image_cart_height'];
-		} elseif (isset($store_info['config_image_cart_height'])) {
-			$this->data['config_image_cart_height'] = $store_info['config_image_cart_height'];			
-		} else {
-			$this->data['config_image_cart_height'] = 80;
-		}
-
-		if (isset($this->request->post['config_secure'])) {
-			$this->data['config_secure'] = $this->request->post['config_secure'];
-		} elseif (isset($store_info['config_secure'])) {
-			$this->data['config_secure'] = $store_info['config_secure'];
-		} else {
-			$this->data['config_secure'] = '';
-		}
-
-		$this->template = 'setting/store_form.tpl';
-		$this->children = array(
-			'common/header',
-			'common/footer'
-		);
-				
-		$this->response->setOutput($this->render());
-	}
-
-	protected function validateForm() {
-		if (!$this->user->hasPermission('modify', 'setting/store')) {
-			$this->error['warning'] = $this->language->get('error_permission');
-		}
-		
-		if (!$this->request->post['config_url']) {
-			$this->error['url'] = $this->language->get('error_url');
-		}
-				
-		if (!$this->request->post['config_name']) {
-			$this->error['name'] = $this->language->get('error_name');
-		}	
-		
-		if ((utf8_strlen($this->request->post['config_owner']) < 3) || (utf8_strlen($this->request->post['config_owner']) > 64)) {
-			$this->error['owner'] = $this->language->get('error_owner');
-		}
-
-		if ((utf8_strlen($this->request->post['config_address']) < 3) || (utf8_strlen($this->request->post['config_address']) > 256)) {
-			$this->error['address'] = $this->language->get('error_address');
-		}
-		
-    	if ((utf8_strlen($this->request->post['config_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['config_email'])) {
-      		$this->error['email'] = $this->language->get('error_email');
-    	}
-
-    	if ((utf8_strlen($this->request->post['config_telephone']) < 3) || (utf8_strlen($this->request->post['config_telephone']) > 32)) {
-      		$this->error['telephone'] = $this->language->get('error_telephone');
-    	}
-		
-		if (!$this->request->post['config_title']) {
-			$this->error['title'] = $this->language->get('error_title');
-		}	
-		
-		if (!empty($this->request->post['config_customer_group_display']) && !in_array($this->request->post['config_customer_group_id'], $this->request->post['config_customer_group_display'])) {
-			$this->error['customer_group_display'] = $this->language->get('error_customer_group_display');
-		}	
-				
-		if (!$this->request->post['config_image_category_width'] || !$this->request->post['config_image_category_height']) {
-			$this->error['image_category'] = $this->language->get('error_image_category');
-		}
-				
-		if (!$this->request->post['config_image_thumb_width'] || !$this->request->post['config_image_thumb_height']) {
-			$this->error['image_thumb'] = $this->language->get('error_image_thumb');
-		}	
-		
-		if (!$this->request->post['config_image_popup_width'] || !$this->request->post['config_image_popup_height']) {
-			$this->error['image_popup'] = $this->language->get('error_image_popup');
-		}
-			
-		if (!$this->request->post['config_image_product_width'] || !$this->request->post['config_image_product_height']) {
-			$this->error['image_product'] = $this->language->get('error_image_product');
-		}
-		
-		if (!$this->request->post['config_image_additional_width'] || !$this->request->post['config_image_additional_height']) {
-			$this->error['image_additional'] = $this->language->get('error_image_additional');
-		}
-		
-		if (!$this->request->post['config_image_related_width'] || !$this->request->post['config_image_related_height']) {
-			$this->error['image_related'] = $this->language->get('error_image_related');
-		}
-		
-		if (!$this->request->post['config_image_compare_width'] || !$this->request->post['config_image_compare_height']) {
-			$this->error['image_compare'] = $this->language->get('error_image_compare');
-		}
-		
-		if (!$this->request->post['config_image_wishlist_width'] || !$this->request->post['config_image_wishlist_height']) {
-			$this->error['image_wishlist'] = $this->language->get('error_image_wishlist');
-		}
-						
-		if (!$this->request->post['config_image_cart_width'] || !$this->request->post['config_image_cart_height']) {
-			$this->error['image_cart'] = $this->language->get('error_image_cart');
-		}
-		
-		if (!$this->request->post['config_catalog_limit']) {
-			$this->error['catalog_limit'] = $this->language->get('error_limit');
-		}
-		
-		if ($this->error && !isset($this->error['warning'])) {
-			$this->error['warning'] = $this->language->get('error_warning');
-		}
-					
-		if (!$this->error) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-
-	protected function validateDelete() {
-		if (!$this->user->hasPermission('modify', 'setting/store')) {
-			$this->error['warning'] = $this->language->get('error_permission');
-		}
-		
-		$this->load->model('sale/order');
-		
-		foreach ($this->request->post['selected'] as $store_id) {
-			if (!$store_id) {
-				$this->error['warning'] = $this->language->get('error_default');
-			}
-			
-			$store_total = $this->model_sale_order->getTotalOrdersByStoreId($store_id);
-	
-			if ($store_total) {
-				$this->error['warning'] = sprintf($this->language->get('error_store'), $store_total);
-			}	
-		}
-		
-		if (!$this->error) {
-			return true; 
-		} else {
-			return false;
-		}
-	}
-	
-	public function template() {
-		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
-			$server = HTTPS_CATALOG;
-		} else {
-			$server = HTTP_CATALOG;
-		}		
-		
-		if (file_exists(DIR_IMAGE . 'templates/' . basename($this->request->get['template']) . '.png')) {
-			$image = $server . 'image/templates/' . basename($this->request->get['template']) . '.png';
-		} else {
-			$image = $server . 'image/no_image.jpg';
-		}
-		
-		$this->response->setOutput('<img src="' . $image . '" alt="" title="" style="border: 1px solid #EEEEEE;" />');
-	}		
-	
-	public function country() {
-		$json = array();
-		
-		$this->load->model('localisation/country');
-
-    	$country_info = $this->model_localisation_country->getCountry($this->request->get['country_id']);
-		
-		if ($country_info) {
-			$this->load->model('localisation/zone');
-
-			$json = array(
-				'country_id'        => $country_info['country_id'],
-				'name'              => $country_info['name'],
-				'iso_code_2'        => $country_info['iso_code_2'],
-				'iso_code_3'        => $country_info['iso_code_3'],
-				'address_format'    => $country_info['address_format'],
-				'postcode_required' => $country_info['postcode_required'],
-				'zone'              => $this->model_localisation_zone->getZonesByCountryId($this->request->get['country_id']),
-				'status'            => $country_info['status']		
-			);
-		}
-		
-		$this->response->setOutput(json_encode($json));
-	}	
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/controller/setting/setting.php
===================================================================
--- trunk/www/admin/controller/setting/setting.php	(revision 19)
+++ trunk/www/admin/controller/setting/setting.php	(revision 20)
@@ -1,1274 +0,0 @@
-<?php
-class ControllerSettingSetting extends Controller {
-	private $error = array();
- 
-	public function index() {
-		$this->language->load('setting/setting'); 
-
-		$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->load->model('setting/setting');
-		
-		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
-			
-			$this->model_setting_setting->editSetting('config', $this->request->post);
-
-            /*function*/
-            function loo_parse_queries($file) {
-                $sql_file = $file;
-
-                $contents = file_get_contents($sql_file);
-
-                $comment_patterns = array('/\/\*.*(\n)*.*(\*\/)?/', // comments
-                    '/\s*--.*\n/', //inline comments start with --
-                    '/\s*#.*\n/', //inline comments start with #
-                );
-                $contents = preg_replace($comment_patterns, "\n", $contents);
-
-                $contents = preg_replace('/(?<=t);(?=\n)/', "{{semicolon_in_text}}", $contents);
-
-                $statements = explode(";\n", $contents);
-//    $statements = preg_replace("/\s/", ' ', $statements);
-
-                $queries = array();
-                foreach ($statements as $query) {
-                    if (trim($query) != '') {
-
-                        $query = str_replace("{{semicolon_in_text}}", ";", $query);
-
-                        //apply db prefix parametr
-                        preg_match("/\?:\w*/i", $query, $matches);
-                        $table_name = str_replace('?:', DB_PREFIX, $matches[0]);
-                        if ( !empty($table_name) ) {
-                            $query = str_replace(array($matches[0], 'key = '), array($table_name, '`key` = '), $query);
-                        }
-
-                        $queries[] = $query;
-                    }
-                }
-
-                return $queries;
-            }
-            /*function*/
-
-            // LOO
-            if(file_exists(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql')) {
-				$tmpl_dir = dirname(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
-				
-				if((bool)stristr($tmpl_dir, $this->config->get('config_template')) == false) {
-					// Parse and Run sql
-					$sql = loo_parse_queries(DIR_CATALOG . 'view/theme/' . $this->request->post['config_template'] . '/install.sql');
-					foreach ($sql as $query) {
-						$this->db->query($query);
-					}
-				}
-			}
-            // LOO (end)
-
-            if ($this->config->get('config_currency_auto')) {
-				$this->load->model('localisation/currency');
-		
-				$this->model_localisation_currency->updateCurrencies();
-			}	
-			
-			$this->session->data['success'] = $this->language->get('text_success');
-
-			$this->redirect($this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL'));
-		}
-
-		$this->data['heading_title'] = $this->language->get('heading_title');
-		
-		$this->data['text_select'] = $this->language->get('text_select');
-		$this->data['text_none'] = $this->language->get('text_none');
-		$this->data['text_yes'] = $this->language->get('text_yes');
-		$this->data['text_no'] = $this->language->get('text_no');
-		$this->data['text_items'] = $this->language->get('text_items');
-		$this->data['text_product'] = $this->language->get('text_product');
-		$this->data['text_voucher'] = $this->language->get('text_voucher');
-		$this->data['text_tax'] = $this->language->get('text_tax');
-		$this->data['text_account'] = $this->language->get('text_account');
-		$this->data['text_checkout'] = $this->language->get('text_checkout');
-		$this->data['text_stock'] = $this->language->get('text_stock');
-		$this->data['text_affiliate'] = $this->language->get('text_affiliate');
-		$this->data['text_return'] = $this->language->get('text_return');
-		$this->data['text_image_manager'] = $this->language->get('text_image_manager');
- 		$this->data['text_browse'] = $this->language->get('text_browse');
-		$this->data['text_clear'] = $this->language->get('text_clear');	
-		$this->data['text_shipping'] = $this->language->get('text_shipping');	
-		$this->data['text_payment'] = $this->language->get('text_payment');					
-		$this->data['text_mail'] = $this->language->get('text_mail');
-		$this->data['text_smtp'] = $this->language->get('text_smtp');
-		
-		$this->data['entry_name'] = $this->language->get('entry_name');
-		$this->data['entry_owner'] = $this->language->get('entry_owner');
-		$this->data['entry_address'] = $this->language->get('entry_address');
-		$this->data['entry_email'] = $this->language->get('entry_email');
-		$this->data['entry_telephone'] = $this->language->get('entry_telephone');
-		$this->data['entry_fax'] = $this->language->get('entry_fax');		
-		$this->data['entry_title'] = $this->language->get('entry_title');
-		$this->data['entry_meta_description'] = $this->language->get('entry_meta_description');
-		$this->data['entry_layout'] = $this->language->get('entry_layout');
-		$this->data['entry_template'] = $this->language->get('entry_template');
-		$this->data['entry_country'] = $this->language->get('entry_country');
-		$this->data['entry_zone'] = $this->language->get('entry_zone');		
-		$this->data['entry_language'] = $this->language->get('entry_language');
-		$this->data['entry_admin_language'] = $this->language->get('entry_admin_language');
-		$this->data['entry_currency'] = $this->language->get('entry_currency');
-		$this->data['entry_currency_auto'] = $this->language->get('entry_currency_auto');
-		$this->data['entry_length_class'] = $this->language->get('entry_length_class');
-		$this->data['entry_weight_class'] = $this->language->get('entry_weight_class');
-		$this->data['entry_catalog_limit'] = $this->language->get('entry_catalog_limit');
-		$this->data['entry_admin_limit'] = $this->language->get('entry_admin_limit');
-		$this->data['entry_product_count'] = $this->language->get('entry_product_count');
-		$this->data['entry_review'] = $this->language->get('entry_review');
-		$this->data['entry_download'] = $this->language->get('entry_download');
-		$this->data['entry_voucher_min'] = $this->language->get('entry_voucher_min');
-		$this->data['entry_voucher_max'] = $this->language->get('entry_voucher_max');
-		$this->data['entry_tax'] = $this->language->get('entry_tax');
-		$this->data['entry_vat'] = $this->language->get('entry_vat');
-		$this->data['entry_tax_default'] = $this->language->get('entry_tax_default');
-		$this->data['entry_tax_customer'] = $this->language->get('entry_tax_customer');
-		$this->data['entry_customer_online'] = $this->language->get('entry_customer_online');
-		$this->data['entry_customer_group'] = $this->language->get('entry_customer_group');
-		$this->data['entry_customer_group_display'] = $this->language->get('entry_customer_group_display');
-		$this->data['entry_customer_price'] = $this->language->get('entry_customer_price');
-		$this->data['entry_account'] = $this->language->get('entry_account');
-		$this->data['entry_cart_weight'] = $this->language->get('entry_cart_weight');		
-		$this->data['entry_guest_checkout'] = $this->language->get('entry_guest_checkout');
-		$this->data['entry_checkout'] = $this->language->get('entry_checkout');		
-		$this->data['entry_order_edit'] = $this->language->get('entry_order_edit');
-		$this->data['entry_invoice_prefix'] = $this->language->get('entry_invoice_prefix');
-		$this->data['entry_order_status'] = $this->language->get('entry_order_status');
-		$this->data['entry_complete_status'] = $this->language->get('entry_complete_status');	
-		$this->data['entry_stock_display'] = $this->language->get('entry_stock_display');
-		$this->data['entry_stock_warning'] = $this->language->get('entry_stock_warning');
-		$this->data['entry_stock_checkout'] = $this->language->get('entry_stock_checkout');
-		$this->data['entry_stock_status'] = $this->language->get('entry_stock_status');
-		$this->data['entry_affiliate'] = $this->language->get('entry_affiliate');
-		$this->data['entry_commission'] = $this->language->get('entry_commission');
-		$this->data['entry_return'] = $this->language->get('entry_return');
-		$this->data['entry_return_status'] = $this->language->get('entry_return_status');
-		$this->data['entry_logo'] = $this->language->get('entry_logo');
-		$this->data['entry_icon'] = $this->language->get('entry_icon');
-		$this->data['entry_image_category'] = $this->language->get('entry_image_category');
-		$this->data['entry_image_thumb'] = $this->language->get('entry_image_thumb');
-		$this->data['entry_image_popup'] = $this->language->get('entry_image_popup');
-		$this->data['entry_image_product'] = $this->language->get('entry_image_product');
-		$this->data['entry_image_additional'] = $this->language->get('entry_image_additional');
-		$this->data['entry_image_related'] = $this->language->get('entry_image_related');
-		$this->data['entry_image_compare'] = $this->language->get('entry_image_compare');
-		$this->data['entry_image_wishlist'] = $this->language->get('entry_image_wishlist');
-		$this->data['entry_image_cart'] = $this->language->get('entry_image_cart');	
-		$this->data['entry_ftp_host'] = $this->language->get('entry_ftp_host');
-		$this->data['entry_ftp_port'] = $this->language->get('entry_ftp_port');
-		$this->data['entry_ftp_username'] = $this->language->get('entry_ftp_username');
-		$this->data['entry_ftp_password'] = $this->language->get('entry_ftp_password');
-		$this->data['entry_ftp_root'] = $this->language->get('entry_ftp_root');
-		$this->data['entry_ftp_status'] = $this->language->get('entry_ftp_status');
-		$this->data['entry_mail_protocol'] = $this->language->get('entry_mail_protocol');
-		$this->data['entry_mail_parameter'] = $this->language->get('entry_mail_parameter');
-		$this->data['entry_smtp_host'] = $this->language->get('entry_smtp_host');
-		$this->data['entry_smtp_username'] = $this->language->get('entry_smtp_username');
-		$this->data['entry_smtp_password'] = $this->language->get('entry_smtp_password');
-		$this->data['entry_smtp_port'] = $this->language->get('entry_smtp_port');
-		$this->data['entry_smtp_timeout'] = $this->language->get('entry_smtp_timeout');
-		$this->data['entry_alert_mail'] = $this->language->get('entry_alert_mail');
-		$this->data['entry_account_mail'] = $this->language->get('entry_account_mail');
-		$this->data['entry_alert_emails'] = $this->language->get('entry_alert_emails');
-		$this->data['entry_fraud_detection'] = $this->language->get('entry_fraud_detection');
-		$this->data['entry_fraud_key'] = $this->language->get('entry_fraud_key');
-		$this->data['entry_fraud_score'] = $this->language->get('entry_fraud_score');
-		$this->data['entry_fraud_status'] = $this->language->get('entry_fraud_status');
-		$this->data['entry_secure'] = $this->language->get('entry_secure');
-		$this->data['entry_shared'] = $this->language->get('entry_shared');
-		$this->data['entry_robots'] = $this->language->get('entry_robots');
-		$this->data['entry_file_extension_allowed'] = $this->language->get('entry_file_extension_allowed');
-		$this->data['entry_file_mime_allowed'] = $this->language->get('entry_file_mime_allowed');		
-		$this->data['entry_maintenance'] = $this->language->get('entry_maintenance');
-		$this->data['entry_password'] = $this->language->get('entry_password');
-		$this->data['entry_encryption'] = $this->language->get('entry_encryption');
-		$this->data['entry_seo_url'] = $this->language->get('entry_seo_url');
-		$this->data['entry_compression'] = $this->language->get('entry_compression');
-		$this->data['entry_error_display'] = $this->language->get('entry_error_display');
-		$this->data['entry_error_log'] = $this->language->get('entry_error_log');
-		$this->data['entry_error_filename'] = $this->language->get('entry_error_filename');
-		$this->data['entry_google_analytics'] = $this->language->get('entry_google_analytics');
-		
-		$this->data['button_save'] = $this->language->get('button_save');
-		$this->data['button_cancel'] = $this->language->get('button_cancel');
-
-		$this->data['tab_general'] = $this->language->get('tab_general');
-		$this->data['tab_store'] = $this->language->get('tab_store');
-		$this->data['tab_local'] = $this->language->get('tab_local');
-		$this->data['tab_option'] = $this->language->get('tab_option');
-		$this->data['tab_image'] = $this->language->get('tab_image');
-		$this->data['tab_ftp'] = $this->language->get('tab_ftp');
-		$this->data['tab_mail'] = $this->language->get('tab_mail');
-		$this->data['tab_fraud'] = $this->language->get('tab_fraud');
-		$this->data['tab_server'] = $this->language->get('tab_server');
-
- 		if (isset($this->error['warning'])) {
-			$this->data['error_warning'] = $this->error['warning'];
-		} else {
-			$this->data['error_warning'] = '';
-		}
-		
- 		if (isset($this->error['name'])) {
-			$this->data['error_name'] = $this->error['name'];
-		} else {
-			$this->data['error_name'] = '';
-		}
-		
- 		if (isset($this->error['owner'])) {
-			$this->data['error_owner'] = $this->error['owner'];
-		} else {
-			$this->data['error_owner'] = '';
-		}
-
- 		if (isset($this->error['address'])) {
-			$this->data['error_address'] = $this->error['address'];
-		} else {
-			$this->data['error_address'] = '';
-		}
-		
- 		if (isset($this->error['email'])) {
-			$this->data['error_email'] = $this->error['email'];
-		} else {
-			$this->data['error_email'] = '';
-		}
-
-		if (isset($this->error['telephone'])) {
-			$this->data['error_telephone'] = $this->error['telephone'];
-		} else {
-			$this->data['error_telephone'] = '';
-		}
- 
-  		if (isset($this->error['title'])) {
-			$this->data['error_title'] = $this->error['title'];
-		} else {
-			$this->data['error_title'] = '';
-		}
-		
-  		if (isset($this->error['customer_group_display'])) {
-			$this->data['error_customer_group_display'] = $this->error['customer_group_display'];
-		} else {
-			$this->data['error_customer_group_display'] = '';
-		}
-				
-  		if (isset($this->error['voucher_min'])) {
-			$this->data['error_voucher_min'] = $this->error['voucher_min'];
-		} else {
-			$this->data['error_voucher_min'] = '';
-		}	
-			
-  		if (isset($this->error['voucher_max'])) {
-			$this->data['error_voucher_max'] = $this->error['voucher_max'];
-		} else {
-			$this->data['error_voucher_max'] = '';
-		}
-		
- 		if (isset($this->error['ftp_host'])) {
-			$this->data['error_ftp_host'] = $this->error['ftp_host'];
-		} else {
-			$this->data['error_ftp_host'] = '';
-		}
-		
- 		if (isset($this->error['ftp_port'])) {
-			$this->data['error_ftp_port'] = $this->error['ftp_port'];
-		} else {
-			$this->data['error_ftp_port'] = '';
-		}
-		
- 		if (isset($this->error['ftp_username'])) {
-			$this->data['error_ftp_username'] = $this->error['ftp_username'];
-		} else {
-			$this->data['error_ftp_username'] = '';
-		}
-		
- 		if (isset($this->error['ftp_password'])) {
-			$this->data['error_ftp_password'] = $this->error['ftp_password'];
-		} else {
-			$this->data['error_ftp_password'] = '';
-		}
-														
- 		if (isset($this->error['image_category'])) {
-			$this->data['error_image_category'] = $this->error['image_category'];
-		} else {
-			$this->data['error_image_category'] = '';
-		}
-				
- 		if (isset($this->error['image_thumb'])) {
-			$this->data['error_image_thumb'] = $this->error['image_thumb'];
-		} else {
-			$this->data['error_image_thumb'] = '';
-		}
-		
- 		if (isset($this->error['image_popup'])) {
-			$this->data['error_image_popup'] = $this->error['image_popup'];
-		} else {
-			$this->data['error_image_popup'] = '';
-		}
-		
- 		if (isset($this->error['image_product'])) {
-			$this->data['error_image_product'] = $this->error['image_product'];
-		} else {
-			$this->data['error_image_product'] = '';
-		}
-		
- 		if (isset($this->error['image_additional'])) {
-			$this->data['error_image_additional'] = $this->error['image_additional'];
-		} else {
-			$this->data['error_image_additional'] = '';
-		}	
-		
- 		if (isset($this->error['image_related'])) {
-			$this->data['error_image_related'] = $this->error['image_related'];
-		} else {
-			$this->data['error_image_related'] = '';
-		}
-		
- 		if (isset($this->error['image_compare'])) {
-			$this->data['error_image_compare'] = $this->error['image_compare'];
-		} else {
-			$this->data['error_image_compare'] = '';
-		}
-		
-  		if (isset($this->error['image_wishlist'])) {
-			$this->data['error_image_wishlist'] = $this->error['image_wishlist'];
-		} else {
-			$this->data['error_image_wishlist'] = '';
-		}
-				
-		if (isset($this->error['image_cart'])) {
-			$this->data['error_image_cart'] = $this->error['image_cart'];
-		} else {
-			$this->data['error_image_cart'] = '';
-		}
-				
-		if (isset($this->error['error_filename'])) {
-			$this->data['error_error_filename'] = $this->error['error_filename'];
-		} else {
-			$this->data['error_error_filename'] = '';
-		}		
-		
-		if (isset($this->error['catalog_limit'])) {
-			$this->data['error_catalog_limit'] = $this->error['catalog_limit'];
-		} else {
-			$this->data['error_catalog_limit'] = '';
-		}
-		
-		if (isset($this->error['admin_limit'])) {
-			$this->data['error_admin_limit'] = $this->error['admin_limit'];
-		} else {
-			$this->data['error_admin_limit'] = '';
-		}
-		
-		if (isset($this->error['encryption'])) {
-			$this->data['error_encryption'] = $this->error['encryption'];
-		} else {
-			$this->data['error_encryption'] = '';
-		}		
-		
-  		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => false
-   		);
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('setting/setting', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => ' :: '
-   		);
-		
-		if (isset($this->session->data['success'])) {
-			$this->data['success'] = $this->session->data['success'];
-		
-			unset($this->session->data['success']);
-		} else {
-			$this->data['success'] = '';
-		}
-
-		$this->data['action'] = $this->url->link('setting/setting', 'token=' . $this->session->data['token'], 'SSL');
-		
-		$this->data['cancel'] = $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL');
-		
-		$this->data['token'] = $this->session->data['token'];
-
-		if (isset($this->request->post['config_name'])) {
-			$this->data['config_name'] = $this->request->post['config_name'];
-		} else {
-			$this->data['config_name'] = $this->config->get('config_name');
-		}
-		
-		if (isset($this->request->post['config_owner'])) {
-			$this->data['config_owner'] = $this->request->post['config_owner'];
-		} else {
-			$this->data['config_owner'] = $this->config->get('config_owner');
-		}
-
-		if (isset($this->request->post['config_address'])) {
-			$this->data['config_address'] = $this->request->post['config_address'];
-		} else {
-			$this->data['config_address'] = $this->config->get('config_address');
-		}
-		
-		if (isset($this->request->post['config_email'])) {
-			$this->data['config_email'] = $this->request->post['config_email'];
-		} else {
-			$this->data['config_email'] = $this->config->get('config_email');
-		}
-		
-		if (isset($this->request->post['config_telephone'])) {
-			$this->data['config_telephone'] = $this->request->post['config_telephone'];
-		} else {
-			$this->data['config_telephone'] = $this->config->get('config_telephone');
-		}
-
-		if (isset($this->request->post['config_fax'])) {
-			$this->data['config_fax'] = $this->request->post['config_fax'];
-		} else {
-			$this->data['config_fax'] = $this->config->get('config_fax');
-		}
-
-		if (isset($this->request->post['config_title'])) {
-			$this->data['config_title'] = $this->request->post['config_title'];
-		} else {
-			$this->data['config_title'] = $this->config->get('config_title');
-		}
-		
-		if (isset($this->request->post['config_meta_description'])) {
-			$this->data['config_meta_description'] = $this->request->post['config_meta_description'];
-		} else {
-			$this->data['config_meta_description'] = $this->config->get('config_meta_description');
-		}
-		
-		if (isset($this->request->post['config_layout_id'])) {
-			$this->data['config_layout_id'] = $this->request->post['config_layout_id'];
-		} else {
-			$this->data['config_layout_id'] = $this->config->get('config_layout_id');
-		}
-				
-		$this->load->model('design/layout');
-		
-		$this->data['layouts'] = $this->model_design_layout->getLayouts();
-				
-		if (isset($this->request->post['config_template'])) {
-			$this->data['config_template'] = $this->request->post['config_template'];
-		} else {
-			$this->data['config_template'] = $this->config->get('config_template');
-		}
-		
-		$this->data['templates'] = array();
-
-		$directories = glob(DIR_CATALOG . 'view/theme/*', GLOB_ONLYDIR);
-		
-		foreach ($directories as $directory) {
-			$this->data['templates'][] = basename($directory);
-		}					
-				
-		if (isset($this->request->post['config_country_id'])) {
-			$this->data['config_country_id'] = $this->request->post['config_country_id'];
-		} else {
-			$this->data['config_country_id'] = $this->config->get('config_country_id');
-		}
-		
-		$this->load->model('localisation/country');
-		
-		$this->data['countries'] = $this->model_localisation_country->getCountries();
-
-		if (isset($this->request->post['config_zone_id'])) {
-			$this->data['config_zone_id'] = $this->request->post['config_zone_id'];
-		} else {
-			$this->data['config_zone_id'] = $this->config->get('config_zone_id');
-		}		
-		
-		if (isset($this->request->post['config_language'])) {
-			$this->data['config_language'] = $this->request->post['config_language'];
-		} else {
-			$this->data['config_language'] = $this->config->get('config_language');
-		}
-
-		$this->load->model('localisation/language');
-		
-		$this->data['languages'] = $this->model_localisation_language->getLanguages();
-				
-		if (isset($this->request->post['config_admin_language'])) {
-			$this->data['config_admin_language'] = $this->request->post['config_admin_language'];
-		} else {
-			$this->data['config_admin_language'] = $this->config->get('config_admin_language');
-		}
-
-		if (isset($this->request->post['config_currency'])) {
-			$this->data['config_currency'] = $this->request->post['config_currency'];
-		} else {
-			$this->data['config_currency'] = $this->config->get('config_currency');
-		}
-
-		if (isset($this->request->post['config_currency_auto'])) {
-			$this->data['config_currency_auto'] = $this->request->post['config_currency_auto'];
-		} else {
-			$this->data['config_currency_auto'] = $this->config->get('config_currency_auto');
-		}
-		
-		$this->load->model('localisation/currency');
-		
-		$this->data['currencies'] = $this->model_localisation_currency->getCurrencies();
-		
-		if (isset($this->request->post['config_length_class_id'])) {
-			$this->data['config_length_class_id'] = $this->request->post['config_length_class_id'];
-		} else {
-			$this->data['config_length_class_id'] = $this->config->get('config_length_class_id');
-		}
-		
-		$this->load->model('localisation/length_class');
-		
-		$this->data['length_classes'] = $this->model_localisation_length_class->getLengthClasses();
-		
-		if (isset($this->request->post['config_weight_class_id'])) {
-			$this->data['config_weight_class_id'] = $this->request->post['config_weight_class_id'];
-		} else {
-			$this->data['config_weight_class_id'] = $this->config->get('config_weight_class_id');
-		}
-		
-		$this->load->model('localisation/weight_class');
-		
-		$this->data['weight_classes'] = $this->model_localisation_weight_class->getWeightClasses();
-	
-		if (isset($this->request->post['config_catalog_limit'])) {
-			$this->data['config_catalog_limit'] = $this->request->post['config_catalog_limit'];
-		} else {
-			$this->data['config_catalog_limit'] = $this->config->get('config_catalog_limit');
-		}	
-						
-		if (isset($this->request->post['config_admin_limit'])) {
-			$this->data['config_admin_limit'] = $this->request->post['config_admin_limit'];
-		} else {
-			$this->data['config_admin_limit'] = $this->config->get('config_admin_limit');
-		}
-		
-		if (isset($this->request->post['config_product_count'])) {
-			$this->data['config_product_count'] = $this->request->post['config_product_count'];
-		} else {
-			$this->data['config_product_count'] = $this->config->get('config_product_count');
-		}
-				
-		if (isset($this->request->post['config_review_status'])) {
-			$this->data['config_review_status'] = $this->request->post['config_review_status'];
-		} else {
-			$this->data['config_review_status'] = $this->config->get('config_review_status');
-		}
-		
-		if (isset($this->request->post['config_download'])) {
-			$this->data['config_download'] = $this->request->post['config_download'];
-		} else {
-			$this->data['config_download'] = $this->config->get('config_download');
-		}
-		
-		if (isset($this->request->post['config_voucher_min'])) {
-			$this->data['config_voucher_min'] = $this->request->post['config_voucher_min'];
-		} else {
-			$this->data['config_voucher_min'] = $this->config->get('config_voucher_min');
-		}	
-		
-		if (isset($this->request->post['config_voucher_max'])) {
-			$this->data['config_voucher_max'] = $this->request->post['config_voucher_max'];
-		} else {
-			$this->data['config_voucher_max'] = $this->config->get('config_voucher_max');
-		}				
-		
-		if (isset($this->request->post['config_tax'])) {
-			$this->data['config_tax'] = $this->request->post['config_tax'];
-		} else {
-			$this->data['config_tax'] = $this->config->get('config_tax');			
-		}
-		
-		if (isset($this->request->post['config_vat'])) {
-			$this->data['config_vat'] = $this->request->post['config_vat'];
-		} else {
-			$this->data['config_vat'] = $this->config->get('config_vat');			
-		}
-				
-		if (isset($this->request->post['config_tax_default'])) {
-			$this->data['config_tax_default'] = $this->request->post['config_tax_default'];
-		} else {
-			$this->data['config_tax_default'] = $this->config->get('config_tax_default');			
-		}	
-			
-		if (isset($this->request->post['config_tax_customer'])) {
-			$this->data['config_tax_customer'] = $this->request->post['config_tax_customer'];
-		} else {
-			$this->data['config_tax_customer'] = $this->config->get('config_tax_customer');			
-		}	
-		
-		if (isset($this->request->post['config_customer_online'])) {
-			$this->data['config_customer_online'] = $this->request->post['config_customer_online'];
-		} else {
-			$this->data['config_customer_online'] = $this->config->get('config_customer_online');			
-		}
-						
-		if (isset($this->request->post['config_customer_group_id'])) {
-			$this->data['config_customer_group_id'] = $this->request->post['config_customer_group_id'];
-		} else {
-			$this->data['config_customer_group_id'] = $this->config->get('config_customer_group_id');			
-		}
-		
-		$this->load->model('sale/customer_group');
-		
-		$this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups();
-
-		if (isset($this->request->post['config_customer_group_display'])) {
-			$this->data['config_customer_group_display'] = $this->request->post['config_customer_group_display'];
-		} elseif ($this->config->get('config_customer_group_display')) {
-			$this->data['config_customer_group_display'] = $this->config->get('config_customer_group_display');	
-		} else {
-			$this->data['config_customer_group_display'] = array();			
-		}
-								
-		if (isset($this->request->post['config_customer_price'])) {
-			$this->data['config_customer_price'] = $this->request->post['config_customer_price'];
-		} else {
-			$this->data['config_customer_price'] = $this->config->get('config_customer_price');			
-		}
-						
-		if (isset($this->request->post['config_account_id'])) {
-			$this->data['config_account_id'] = $this->request->post['config_account_id'];
-		} else {
-			$this->data['config_account_id'] = $this->config->get('config_account_id');			
-		}
-				
-		$this->load->model('catalog/information');
-		
-		$this->data['informations'] = $this->model_catalog_information->getInformations();
-								
-		if (isset($this->request->post['config_cart_weight'])) {
-			$this->data['config_cart_weight'] = $this->request->post['config_cart_weight'];
-		} else {
-			$this->data['config_cart_weight'] = $this->config->get('config_cart_weight');
-		}							
-						
-		if (isset($this->request->post['config_guest_checkout'])) {
-			$this->data['config_guest_checkout'] = $this->request->post['config_guest_checkout'];
-		} else {
-			$this->data['config_guest_checkout'] = $this->config->get('config_guest_checkout');		
-		}
-
-		if (isset($this->request->post['config_checkout_id'])) {
-			$this->data['config_checkout_id'] = $this->request->post['config_checkout_id'];
-		} else {
-			$this->data['config_checkout_id'] = $this->config->get('config_checkout_id');		
-		}
-
-		if (isset($this->request->post['config_order_edit'])) {
-			$this->data['config_order_edit'] = $this->request->post['config_order_edit'];
-		} elseif ($this->config->get('config_order_edit')) {
-			$this->data['config_order_edit'] = $this->config->get('config_order_edit');			
-		} else {
-			$this->data['config_order_edit'] = 7;
-		}
-									
-		if (isset($this->request->post['config_invoice_prefix'])) {
-			$this->data['config_invoice_prefix'] = $this->request->post['config_invoice_prefix'];
-		} elseif ($this->config->get('config_invoice_prefix')) {
-			$this->data['config_invoice_prefix'] = $this->config->get('config_invoice_prefix');			
-		} else {
-			$this->data['config_invoice_prefix'] = 'INV-' . date('Y') . '-00';
-		}
-		
-		if (isset($this->request->post['config_order_status_id'])) {
-			$this->data['config_order_status_id'] = $this->request->post['config_order_status_id'];
-		} else {
-			$this->data['config_order_status_id'] = $this->config->get('config_order_status_id');		
-		}
-		
-		if (isset($this->request->post['config_complete_status_id'])) {
-			$this->data['config_complete_status_id'] = $this->request->post['config_complete_status_id'];
-		} else {
-			$this->data['config_complete_status_id'] = $this->config->get('config_complete_status_id');
-		}	
-		
-		$this->load->model('localisation/order_status');
-		
-		$this->data['order_statuses'] = $this->model_localisation_order_status->getOrderStatuses();	
-
-		if (isset($this->request->post['config_stock_display'])) {
-			$this->data['config_stock_display'] = $this->request->post['config_stock_display'];
-		} else {
-			$this->data['config_stock_display'] = $this->config->get('config_stock_display');			
-		}
-		
-		if (isset($this->request->post['config_stock_warning'])) {
-			$this->data['config_stock_warning'] = $this->request->post['config_stock_warning'];
-		} else {
-			$this->data['config_stock_warning'] = $this->config->get('config_stock_warning');		
-		}
-
-		if (isset($this->request->post['config_stock_checkout'])) {
-			$this->data['config_stock_checkout'] = $this->request->post['config_stock_checkout'];
-		} else {
-			$this->data['config_stock_checkout'] = $this->config->get('config_stock_checkout');		
-		}
-
-		if (isset($this->request->post['config_stock_status_id'])) {
-			$this->data['config_stock_status_id'] = $this->request->post['config_stock_status_id'];
-		} else {
-			$this->data['config_stock_status_id'] = $this->config->get('config_stock_status_id');			
-		}
-		
-		$this->load->model('localisation/stock_status');
-		
-		$this->data['stock_statuses'] = $this->model_localisation_stock_status->getStockStatuses();
-
-		if (isset($this->request->post['config_affiliate_id'])) {
-			$this->data['config_affiliate_id'] = $this->request->post['config_affiliate_id'];
-		} else {
-			$this->data['config_affiliate_id'] = $this->config->get('config_affiliate_id');		
-		}
-		
-		if (isset($this->request->post['config_commission'])) {
-			$this->data['config_commission'] = $this->request->post['config_commission'];
-		} elseif ($this->config->has('config_commission')) {
-			$this->data['config_commission'] = $this->config->get('config_commission');		
-		} else {
-			$this->data['config_commission'] = '5.00';
-		}
-
-		if (isset($this->request->post['config_return_id'])) {
-			$this->data['config_return_id'] = $this->request->post['config_return_id'];
-		} else {
-			$this->data['config_return_id'] = $this->config->get('config_return_id');		
-		}
-						
-		if (isset($this->request->post['config_return_status_id'])) {
-			$this->data['config_return_status_id'] = $this->request->post['config_return_status_id'];
-		} else {
-			$this->data['config_return_status_id'] = $this->config->get('config_return_status_id');		
-		}
-		
-		$this->load->model('localisation/return_status');
-		
-		$this->data['return_statuses'] = $this->model_localisation_return_status->getReturnStatuses();	
-			
-		$this->load->model('tool/image');
-
-		if (isset($this->request->post['config_logo'])) {
-			$this->data['config_logo'] = $this->request->post['config_logo'];
-		} else {
-			$this->data['config_logo'] = $this->config->get('config_logo');			
-		}
-
-		if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo')) && is_file(DIR_IMAGE . $this->config->get('config_logo'))) {
-			$this->data['logo'] = $this->model_tool_image->resize($this->config->get('config_logo'), 100, 100);		
-		} else {
-			$this->data['logo'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-		}
-
-		if (isset($this->request->post['config_icon'])) {
-			$this->data['config_icon'] = $this->request->post['config_icon'];
-		} else {
-			$this->data['config_icon'] = $this->config->get('config_icon');			
-		}
-		
-		if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon')) && is_file(DIR_IMAGE . $this->config->get('config_icon'))) {
-			$this->data['icon'] = $this->model_tool_image->resize($this->config->get('config_icon'), 100, 100);		
-		} else {
-			$this->data['icon'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-		}
-		
-		$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-
-		if (isset($this->request->post['config_image_category_width'])) {
-			$this->data['config_image_category_width'] = $this->request->post['config_image_category_width'];
-		} else {
-			$this->data['config_image_category_width'] = $this->config->get('config_image_category_width');
-		}
-		
-		if (isset($this->request->post['config_image_category_height'])) {
-			$this->data['config_image_category_height'] = $this->request->post['config_image_category_height'];
-		} else {
-			$this->data['config_image_category_height'] = $this->config->get('config_image_category_height');
-		}
-				
-		if (isset($this->request->post['config_image_thumb_width'])) {
-			$this->data['config_image_thumb_width'] = $this->request->post['config_image_thumb_width'];
-		} else {
-			$this->data['config_image_thumb_width'] = $this->config->get('config_image_thumb_width');
-		}
-		
-		if (isset($this->request->post['config_image_thumb_height'])) {
-			$this->data['config_image_thumb_height'] = $this->request->post['config_image_thumb_height'];
-		} else {
-			$this->data['config_image_thumb_height'] = $this->config->get('config_image_thumb_height');
-		}
-		
-		if (isset($this->request->post['config_image_popup_width'])) {
-			$this->data['config_image_popup_width'] = $this->request->post['config_image_popup_width'];
-		} else {
-			$this->data['config_image_popup_width'] = $this->config->get('config_image_popup_width');
-		}
-		
-		if (isset($this->request->post['config_image_popup_height'])) {
-			$this->data['config_image_popup_height'] = $this->request->post['config_image_popup_height'];
-		} else {
-			$this->data['config_image_popup_height'] = $this->config->get('config_image_popup_height');
-		}
-		
-		if (isset($this->request->post['config_image_product_width'])) {
-			$this->data['config_image_product_width'] = $this->request->post['config_image_product_width'];
-		} else {
-			$this->data['config_image_product_width'] = $this->config->get('config_image_product_width');
-		}
-		
-		if (isset($this->request->post['config_image_product_height'])) {
-			$this->data['config_image_product_height'] = $this->request->post['config_image_product_height'];
-		} else {
-			$this->data['config_image_product_height'] = $this->config->get('config_image_product_height');
-		}
-
-		if (isset($this->request->post['config_image_additional_width'])) {
-			$this->data['config_image_additional_width'] = $this->request->post['config_image_additional_width'];
-		} else {
-			$this->data['config_image_additional_width'] = $this->config->get('config_image_additional_width');
-		}
-		
-		if (isset($this->request->post['config_image_additional_height'])) {
-			$this->data['config_image_additional_height'] = $this->request->post['config_image_additional_height'];
-		} else {
-			$this->data['config_image_additional_height'] = $this->config->get('config_image_additional_height');
-		}
-		
-		if (isset($this->request->post['config_image_related_width'])) {
-			$this->data['config_image_related_width'] = $this->request->post['config_image_related_width'];
-		} else {
-			$this->data['config_image_related_width'] = $this->config->get('config_image_related_width');
-		}
-		
-		if (isset($this->request->post['config_image_related_height'])) {
-			$this->data['config_image_related_height'] = $this->request->post['config_image_related_height'];
-		} else {
-			$this->data['config_image_related_height'] = $this->config->get('config_image_related_height');
-		}
-		
-		if (isset($this->request->post['config_image_compare_width'])) {
-			$this->data['config_image_compare_width'] = $this->request->post['config_image_compare_width'];
-		} else {
-			$this->data['config_image_compare_width'] = $this->config->get('config_image_compare_width');
-		}
-		
-		if (isset($this->request->post['config_image_compare_height'])) {
-			$this->data['config_image_compare_height'] = $this->request->post['config_image_compare_height'];
-		} else {
-			$this->data['config_image_compare_height'] = $this->config->get('config_image_compare_height');
-		}	
-		
-		if (isset($this->request->post['config_image_wishlist_width'])) {
-			$this->data['config_image_wishlist_width'] = $this->request->post['config_image_wishlist_width'];
-		} else {
-			$this->data['config_image_wishlist_width'] = $this->config->get('config_image_wishlist_width');
-		}
-		
-		if (isset($this->request->post['config_image_wishlist_height'])) {
-			$this->data['config_image_wishlist_height'] = $this->request->post['config_image_wishlist_height'];
-		} else {
-			$this->data['config_image_wishlist_height'] = $this->config->get('config_image_wishlist_height');
-		}	
-						
-		if (isset($this->request->post['config_image_cart_width'])) {
-			$this->data['config_image_cart_width'] = $this->request->post['config_image_cart_width'];
-		} else {
-			$this->data['config_image_cart_width'] = $this->config->get('config_image_cart_width');
-		}
-		
-		if (isset($this->request->post['config_image_cart_height'])) {
-			$this->data['config_image_cart_height'] = $this->request->post['config_image_cart_height'];
-		} else {
-			$this->data['config_image_cart_height'] = $this->config->get('config_image_cart_height');
-		}		
-				
-		if (isset($this->request->post['config_ftp_host'])) {
-			$this->data['config_ftp_host'] = $this->request->post['config_ftp_host'];
-		} elseif ($this->config->get('config_ftp_host')) {
-			$this->data['config_ftp_host'] = $this->config->get('config_ftp_host');		
-		} else {
-			$this->data['config_ftp_host'] = str_replace('www.', '', $this->request->server['HTTP_HOST']);
-		}
-		
-		if (isset($this->request->post['config_ftp_port'])) {
-			$this->data['config_ftp_port'] = $this->request->post['config_ftp_port'];
-		} elseif ($this->config->get('config_ftp_port')) {
-			$this->data['config_ftp_port'] = $this->config->get('config_ftp_port');
-		} else {
-			$this->data['config_ftp_port'] = 21;
-		}
-		
-		if (isset($this->request->post['config_ftp_username'])) {
-			$this->data['config_ftp_username'] = $this->request->post['config_ftp_username'];
-		} else {
-			$this->data['config_ftp_username'] = $this->config->get('config_ftp_username');
-		}
-		
-		if (isset($this->request->post['config_ftp_password'])) {
-			$this->data['config_ftp_password'] = $this->request->post['config_ftp_password'];
-		} else {
-			$this->data['config_ftp_password'] = $this->config->get('config_ftp_password');
-		}
-		
-		if (isset($this->request->post['config_ftp_root'])) {
-			$this->data['config_ftp_root'] = $this->request->post['config_ftp_root'];
-		} else {
-			$this->data['config_ftp_root'] = $this->config->get('config_ftp_root');
-		}
-		
-		if (isset($this->request->post['config_ftp_status'])) {
-			$this->data['config_ftp_status'] = $this->request->post['config_ftp_status'];
-		} else {
-			$this->data['config_ftp_status'] = $this->config->get('config_ftp_status');
-		}
-												
-		if (isset($this->request->post['config_mail_protocol'])) {
-			$this->data['config_mail_protocol'] = $this->request->post['config_mail_protocol'];
-		} else {
-			$this->data['config_mail_protocol'] = $this->config->get('config_mail_protocol');
-		}
-		
-		if (isset($this->request->post['config_mail_parameter'])) {
-			$this->data['config_mail_parameter'] = $this->request->post['config_mail_parameter'];
-		} else {
-			$this->data['config_mail_parameter'] = $this->config->get('config_mail_parameter');
-		}
-				
-		if (isset($this->request->post['config_smtp_host'])) {
-			$this->data['config_smtp_host'] = $this->request->post['config_smtp_host'];
-		} else {
-			$this->data['config_smtp_host'] = $this->config->get('config_smtp_host');
-		}		
-
-		if (isset($this->request->post['config_smtp_username'])) {
-			$this->data['config_smtp_username'] = $this->request->post['config_smtp_username'];
-		} else {
-			$this->data['config_smtp_username'] = $this->config->get('config_smtp_username');
-		}	
-		
-		if (isset($this->request->post['config_smtp_password'])) {
-			$this->data['config_smtp_password'] = $this->request->post['config_smtp_password'];
-		} else {
-			$this->data['config_smtp_password'] = $this->config->get('config_smtp_password');
-		}	
-		
-		if (isset($this->request->post['config_smtp_port'])) {
-			$this->data['config_smtp_port'] = $this->request->post['config_smtp_port'];
-		} elseif ($this->config->get('config_smtp_port')) {
-			$this->data['config_smtp_port'] = $this->config->get('config_smtp_port');
-		} else {
-			$this->data['config_smtp_port'] = 25;
-		}	
-		
-		if (isset($this->request->post['config_smtp_timeout'])) {
-			$this->data['config_smtp_timeout'] = $this->request->post['config_smtp_timeout'];
-		} elseif ($this->config->get('config_smtp_timeout')) {
-			$this->data['config_smtp_timeout'] = $this->config->get('config_smtp_timeout');
-		} else {
-			$this->data['config_smtp_timeout'] = 5;	
-		}	
-		
-		if (isset($this->request->post['config_alert_mail'])) {
-			$this->data['config_alert_mail'] = $this->request->post['config_alert_mail'];
-		} else {
-			$this->data['config_alert_mail'] = $this->config->get('config_alert_mail');
-		}
-
-		if (isset($this->request->post['config_account_mail'])) {
-			$this->data['config_account_mail'] = $this->request->post['config_account_mail'];
-		} else {
-			$this->data['config_account_mail'] = $this->config->get('config_account_mail');
-		}
-		
-		if (isset($this->request->post['config_alert_emails'])) {
-			$this->data['config_alert_emails'] = $this->request->post['config_alert_emails'];
-		} else {
-			$this->data['config_alert_emails'] = $this->config->get('config_alert_emails');
-		}
-		
-		if (isset($this->request->post['config_fraud_detection'])) {
-			$this->data['config_fraud_detection'] = $this->request->post['config_fraud_detection']; 
-		} else {
-			$this->data['config_fraud_detection'] = $this->config->get('config_fraud_detection');
-		}	
-				
-		if (isset($this->request->post['config_fraud_key'])) {
-			$this->data['config_fraud_key'] = $this->request->post['config_fraud_key']; 
-		} else {
-			$this->data['config_fraud_key'] = $this->config->get('config_fraud_key');
-		}		
-
-		if (isset($this->request->post['config_fraud_score'])) {
-			$this->data['config_fraud_score'] = $this->request->post['config_fraud_score']; 
-		} else {
-			$this->data['config_fraud_score'] = $this->config->get('config_fraud_score');
-		}	
-			
-		if (isset($this->request->post['config_fraud_status_id'])) {
-			$this->data['config_fraud_status_id'] = $this->request->post['config_fraud_status_id']; 
-		} else {
-			$this->data['config_fraud_status_id'] = $this->config->get('config_fraud_status_id');
-		}		
-				
-		if (isset($this->request->post['config_secure'])) {
-			$this->data['config_secure'] = $this->request->post['config_secure'];
-		} else {
-			$this->data['config_secure'] = $this->config->get('config_secure');
-		}
-
-		if (isset($this->request->post['config_shared'])) {
-			$this->data['config_shared'] = $this->request->post['config_shared'];
-		} else {
-			$this->data['config_shared'] = $this->config->get('config_shared');
-		}
-		
-		if (isset($this->request->post['config_robots'])) {
-			$this->data['config_robots'] = $this->request->post['config_robots'];
-		} else {
-			$this->data['config_robots'] = $this->config->get('config_robots');
-		}
-						
-		if (isset($this->request->post['config_seo_url'])) {
-			$this->data['config_seo_url'] = $this->request->post['config_seo_url'];
-		} else {
-			$this->data['config_seo_url'] = $this->config->get('config_seo_url');
-		}
-		
-		if (isset($this->request->post['config_file_extension_allowed'])) {
-			$this->data['config_file_extension_allowed'] = $this->request->post['config_file_extension_allowed'];
-		} else {
-			$this->data['config_file_extension_allowed'] = $this->config->get('config_file_extension_allowed');
-		}
-		
-		if (isset($this->request->post['config_file_mime_allowed'])) {
-			$this->data['config_file_mime_allowed'] = $this->request->post['config_file_mime_allowed'];
-		} else {
-			$this->data['config_file_mime_allowed'] = $this->config->get('config_file_mime_allowed');
-		}		
-				
-		if (isset($this->request->post['config_maintenance'])) {
-			$this->data['config_maintenance'] = $this->request->post['config_maintenance'];
-		} else {
-			$this->data['config_maintenance'] = $this->config->get('config_maintenance');
-		}
-		
-		if (isset($this->request->post['config_password'])) {
-			$this->data['config_password'] = $this->request->post['config_password'];
-		} else {
-			$this->data['config_password'] = $this->config->get('config_password');
-		}
-				
-		if (isset($this->request->post['config_encryption'])) {
-			$this->data['config_encryption'] = $this->request->post['config_encryption'];
-		} else {
-			$this->data['config_encryption'] = $this->config->get('config_encryption');
-		}
-		
-		if (isset($this->request->post['config_compression'])) {
-			$this->data['config_compression'] = $this->request->post['config_compression']; 
-		} else {
-			$this->data['config_compression'] = $this->config->get('config_compression');
-		}
-
-		if (isset($this->request->post['config_error_display'])) {
-			$this->data['config_error_display'] = $this->request->post['config_error_display']; 
-		} else {
-			$this->data['config_error_display'] = $this->config->get('config_error_display');
-		}
-
-		if (isset($this->request->post['config_error_log'])) {
-			$this->data['config_error_log'] = $this->request->post['config_error_log']; 
-		} else {
-			$this->data['config_error_log'] = $this->config->get('config_error_log');
-		}
-
-		if (isset($this->request->post['config_error_filename'])) {
-			$this->data['config_error_filename'] = $this->request->post['config_error_filename']; 
-		} else {
-			$this->data['config_error_filename'] = $this->config->get('config_error_filename');
-		}
-				
-		if (isset($this->request->post['config_google_analytics'])) {
-			$this->data['config_google_analytics'] = $this->request->post['config_google_analytics']; 
-		} else {
-			$this->data['config_google_analytics'] = $this->config->get('config_google_analytics');
-		}
-						
-		$this->template = 'setting/setting.tpl';
-		$this->children = array(
-			'common/header',
-			'common/footer'
-		);
-				
-		$this->response->setOutput($this->render());
-	}
-
-	protected function validate() {
-		if (!$this->user->hasPermission('modify', 'setting/setting')) {
-			$this->error['warning'] = $this->language->get('error_permission');
-		}
-
-		if (!$this->request->post['config_name']) {
-			$this->error['name'] = $this->language->get('error_name');
-		}	
-		
-		if ((utf8_strlen($this->request->post['config_owner']) < 3) || (utf8_strlen($this->request->post['config_owner']) > 64)) {
-			$this->error['owner'] = $this->language->get('error_owner');
-		}
-
-		if ((utf8_strlen($this->request->post['config_address']) < 3) || (utf8_strlen($this->request->post['config_address']) > 256)) {
-			$this->error['address'] = $this->language->get('error_address');
-		}
-		
-    	if ((utf8_strlen($this->request->post['config_email']) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['config_email'])) {
-      		$this->error['email'] = $this->language->get('error_email');
-    	}
-
-    	if ((utf8_strlen($this->request->post['config_telephone']) < 3) || (utf8_strlen($this->request->post['config_telephone']) > 32)) {
-      		$this->error['telephone'] = $this->language->get('error_telephone');
-    	}
-
-		if (!$this->request->post['config_title']) {
-			$this->error['title'] = $this->language->get('error_title');
-		}	
-		
-		if (!empty($this->request->post['config_customer_group_display']) && !in_array($this->request->post['config_customer_group_id'], $this->request->post['config_customer_group_display'])) {
-			$this->error['customer_group_display'] = $this->language->get('error_customer_group_display');
-		}	
-		
-		if (!$this->request->post['config_voucher_min']) {
-			$this->error['voucher_min'] = $this->language->get('error_voucher_min');
-		}	
-		
-		if (!$this->request->post['config_voucher_max']) {
-			$this->error['voucher_max'] = $this->language->get('error_voucher_max');
-		}	
-								
-		if (!$this->request->post['config_image_category_width'] || !$this->request->post['config_image_category_height']) {
-			$this->error['image_category'] = $this->language->get('error_image_category');
-		} 
-				
-		if (!$this->request->post['config_image_thumb_width'] || !$this->request->post['config_image_thumb_height']) {
-			$this->error['image_thumb'] = $this->language->get('error_image_thumb');
-		}	
-		
-		if (!$this->request->post['config_image_popup_width'] || !$this->request->post['config_image_popup_height']) {
-			$this->error['image_popup'] = $this->language->get('error_image_popup');
-		}	
-		
-		if (!$this->request->post['config_image_product_width'] || !$this->request->post['config_image_product_height']) {
-			$this->error['image_product'] = $this->language->get('error_image_product');
-		}
-				
-		if (!$this->request->post['config_image_additional_width'] || !$this->request->post['config_image_additional_height']) {
-			$this->error['image_additional'] = $this->language->get('error_image_additional');
-		}
-		
-		if (!$this->request->post['config_image_related_width'] || !$this->request->post['config_image_related_height']) {
-			$this->error['image_related'] = $this->language->get('error_image_related');
-		}
-		
-		if (!$this->request->post['config_image_compare_width'] || !$this->request->post['config_image_compare_height']) {
-			$this->error['image_compare'] = $this->language->get('error_image_compare');
-		}
-		
-		if (!$this->request->post['config_image_wishlist_width'] || !$this->request->post['config_image_wishlist_height']) {
-			$this->error['image_wishlist'] = $this->language->get('error_image_wishlist');
-		}			
-		
-		if (!$this->request->post['config_image_cart_width'] || !$this->request->post['config_image_cart_height']) {
-			$this->error['image_cart'] = $this->language->get('error_image_cart');
-		}
-		
-		if ($this->request->post['config_ftp_status']) {
-			if (!$this->request->post['config_ftp_host']) {
-				$this->error['ftp_host'] = $this->language->get('error_ftp_host');
-			}
-			
-			if (!$this->request->post['config_ftp_port']) {
-				$this->error['ftp_port'] = $this->language->get('error_ftp_port');
-			}
-			
-			if (!$this->request->post['config_ftp_username']) {
-				$this->error['ftp_username'] = $this->language->get('error_ftp_username');
-			}	
-			
-			if (!$this->request->post['config_ftp_password']) {
-				$this->error['ftp_password'] = $this->language->get('error_ftp_password');
-			}											
-		}
-	
-		if (!$this->request->post['config_error_filename']) {
-			$this->error['error_filename'] = $this->language->get('error_error_filename');
-		}
-		
-		if (!$this->request->post['config_catalog_limit']) {
-			$this->error['catalog_limit'] = $this->language->get('error_limit');
-		}
-		
-		if (!$this->request->post['config_admin_limit']) {
-			$this->error['admin_limit'] = $this->language->get('error_limit');
-		}
-				
-		if ((utf8_strlen($this->request->post['config_encryption']) < 3) || (utf8_strlen($this->request->post['config_encryption']) > 32)) {
-			$this->error['encryption'] = $this->language->get('error_encryption');
-		}
-		
-		if ($this->error && !isset($this->error['warning'])) {
-			$this->error['warning'] = $this->language->get('error_warning');
-		}
-			
-		if (!$this->error) {
-			return true;
-		} else {
-			return false;
-		}
-	}
-	
-	public function template() {
-		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
-			$server = HTTPS_CATALOG;
-		} else {
-			$server = HTTP_CATALOG;
-		}
-		
-		if (file_exists(DIR_IMAGE . 'templates/' . basename($this->request->get['template']) . '.png')) {
-			$image = $server . 'image/templates/' . basename($this->request->get['template']) . '.png';
-		} else {
-			$image = $server . 'image/no_image.jpg';
-		}
-		
-		$this->response->setOutput('<img src="' . $image . '" alt="" title="" style="border: 1px solid #EEEEEE;" />');
-	}		
-		
-	public function country() {
-		$json = array();
-		
-		$this->load->model('localisation/country');
-
-    	$country_info = $this->model_localisation_country->getCountry($this->request->get['country_id']);
-		
-		if ($country_info) {
-			$this->load->model('localisation/zone');
-
-			$json = array(
-				'country_id'        => $country_info['country_id'],
-				'name'              => $country_info['name'],
-				'iso_code_2'        => $country_info['iso_code_2'],
-				'iso_code_3'        => $country_info['iso_code_3'],
-				'address_format'    => $country_info['address_format'],
-				'postcode_required' => $country_info['postcode_required'],
-				'zone'              => $this->model_localisation_zone->getZonesByCountryId($this->request->get['country_id']),
-				'status'            => $country_info['status']		
-			);
-		}
-		
-		$this->response->setOutput(json_encode($json));
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/controller/common/header.php
===================================================================
--- trunk/www/admin/controller/common/header.php	(revision 19)
+++ trunk/www/admin/controller/common/header.php	(revision 20)
@@ -1,203 +0,0 @@
-<?php 
-class ControllerCommonHeader extends Controller {
-	protected function index() {
-		$this->data['title'] = $this->document->getTitle(); 
-		
-		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
-			$this->data['base'] = HTTPS_SERVER;
-		} else {
-			$this->data['base'] = HTTP_SERVER;
-		}
-		
-		$this->data['description'] = $this->document->getDescription();
-		$this->data['keywords'] = $this->document->getKeywords();
-		$this->data['links'] = $this->document->getLinks();	
-		$this->data['styles'] = $this->document->getStyles();
-		$this->data['scripts'] = $this->document->getScripts();
-		$this->data['lang'] = $this->language->get('code');
-		$this->data['direction'] = $this->language->get('direction');
-		
-		$this->language->load('common/header');
-
-		$this->data['heading_title'] = $this->language->get('heading_title');
-		
-		$this->data['text_affiliate'] = $this->language->get('text_affiliate');
-		$this->data['text_attribute'] = $this->language->get('text_attribute');
-		$this->data['text_attribute_group'] = $this->language->get('text_attribute_group');
-		$this->data['text_backup'] = $this->language->get('text_backup');
-		$this->data['text_banner'] = $this->language->get('text_banner');
-		$this->data['text_catalog'] = $this->language->get('text_catalog');
-		$this->data['text_category'] = $this->language->get('text_category');
-		$this->data['text_confirm'] = $this->language->get('text_confirm');
-		$this->data['text_country'] = $this->language->get('text_country');
-		$this->data['text_coupon'] = $this->language->get('text_coupon');
-		$this->data['text_currency'] = $this->language->get('text_currency');			
-		$this->data['text_customer'] = $this->language->get('text_customer');
-		$this->data['text_customer_group'] = $this->language->get('text_customer_group');
-		$this->data['text_customer_field'] = $this->language->get('text_customer_field');
-		$this->data['text_customer_ban_ip'] = $this->language->get('text_customer_ban_ip');
-		$this->data['text_custom_field'] = $this->language->get('text_custom_field');
-		$this->data['text_sale'] = $this->language->get('text_sale');
-		$this->data['text_design'] = $this->language->get('text_design');
-		$this->data['text_documentation'] = $this->language->get('text_documentation');
-		$this->data['text_download'] = $this->language->get('text_download');
-		$this->data['text_error_log'] = $this->language->get('text_error_log');
-		$this->data['text_extension'] = $this->language->get('text_extension');
-		$this->data['text_feed'] = $this->language->get('text_feed');
-		$this->data['text_filter'] = $this->language->get('text_filter');
-		$this->data['text_front'] = $this->language->get('text_front');
-		$this->data['text_geo_zone'] = $this->language->get('text_geo_zone');
-		$this->data['text_dashboard'] = $this->language->get('text_dashboard');
-		$this->data['text_help'] = $this->language->get('text_help');
-		$this->data['text_information'] = $this->language->get('text_information');
-		$this->data['text_language'] = $this->language->get('text_language');
-		$this->data['text_layout'] = $this->language->get('text_layout');
-		$this->data['text_localisation'] = $this->language->get('text_localisation');
-		$this->data['text_logout'] = $this->language->get('text_logout');
-		$this->data['text_contact'] = $this->language->get('text_contact');
-		$this->data['text_manager'] = $this->language->get('text_manager');
-		$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-		$this->data['text_module'] = $this->language->get('text_module');
-		$this->data['text_option'] = $this->language->get('text_option');
-		$this->data['text_order'] = $this->language->get('text_order');
-		$this->data['text_order_status'] = $this->language->get('text_order_status');
-		$this->data['text_opencart'] = $this->language->get('text_opencart');
-		$this->data['text_payment'] = $this->language->get('text_payment');
-		$this->data['text_product'] = $this->language->get('text_product'); 
-		$this->data['text_reports'] = $this->language->get('text_reports');
-		$this->data['text_report_sale_order'] = $this->language->get('text_report_sale_order');
-		$this->data['text_report_sale_tax'] = $this->language->get('text_report_sale_tax');
-		$this->data['text_report_sale_shipping'] = $this->language->get('text_report_sale_shipping');
-		$this->data['text_report_sale_return'] = $this->language->get('text_report_sale_return');
-		$this->data['text_report_sale_coupon'] = $this->language->get('text_report_sale_coupon');
-		$this->data['text_report_product_viewed'] = $this->language->get('text_report_product_viewed');
-		$this->data['text_report_product_purchased'] = $this->language->get('text_report_product_purchased');
-		$this->data['text_report_customer_online'] = $this->language->get('text_report_customer_online');
-		$this->data['text_report_customer_order'] = $this->language->get('text_report_customer_order');
-		$this->data['text_report_customer_reward'] = $this->language->get('text_report_customer_reward');
-		$this->data['text_report_customer_credit'] = $this->language->get('text_report_customer_credit');
-		$this->data['text_report_affiliate_commission'] = $this->language->get('text_report_affiliate_commission');
-		$this->data['text_report_sale_return'] = $this->language->get('text_report_sale_return');
-		$this->data['text_report_product_viewed'] = $this->language->get('text_report_product_viewed');
-		$this->data['text_report_customer_order'] = $this->language->get('text_report_customer_order');
-		$this->data['text_review'] = $this->language->get('text_review');
-		$this->data['text_return'] = $this->language->get('text_return');
-		$this->data['text_return_action'] = $this->language->get('text_return_action');
-		$this->data['text_return_reason'] = $this->language->get('text_return_reason');
-		$this->data['text_return_status'] = $this->language->get('text_return_status');
-		$this->data['text_support'] = $this->language->get('text_support'); 
-		$this->data['text_shipping'] = $this->language->get('text_shipping');		
-		$this->data['text_setting'] = $this->language->get('text_setting');
-		$this->data['text_stock_status'] = $this->language->get('text_stock_status');
-		$this->data['text_system'] = $this->language->get('text_system');
-		$this->data['text_tax'] = $this->language->get('text_tax');
-		$this->data['text_tax_class'] = $this->language->get('text_tax_class');
-		$this->data['text_tax_rate'] = $this->language->get('text_tax_rate');
-		$this->data['text_total'] = $this->language->get('text_total');
-		$this->data['text_user'] = $this->language->get('text_user');
-		$this->data['text_user_group'] = $this->language->get('text_user_group');
-		$this->data['text_users'] = $this->language->get('text_users');
-		$this->data['text_voucher'] = $this->language->get('text_voucher');
-		$this->data['text_voucher_theme'] = $this->language->get('text_voucher_theme');
-		$this->data['text_weight_class'] = $this->language->get('text_weight_class');
-		$this->data['text_length_class'] = $this->language->get('text_length_class');
-		$this->data['text_zone'] = $this->language->get('text_zone');
-		//Newsletter Subscribers
-		$this->data['text_newssubscribe'] = $this->language->get('text_newssubscribe');
-		//Newsletter Subscribers
-		
-		if (!$this->user->isLogged() || !isset($this->request->get['token']) || !isset($this->session->data['token']) || ($this->request->get['token'] != $this->session->data['token'])) {
-			$this->data['logged'] = '';
-			
-			$this->data['home'] = $this->url->link('common/login', '', 'SSL');
-		} else {
-			$this->data['logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
-	
-			$this->data['home'] = $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['affiliate'] = $this->url->link('sale/affiliate', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['attribute'] = $this->url->link('catalog/attribute', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['attribute_group'] = $this->url->link('catalog/attribute_group', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['backup'] = $this->url->link('tool/backup', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['banner'] = $this->url->link('design/banner', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['category'] = $this->url->link('catalog/category', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['country'] = $this->url->link('localisation/country', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['coupon'] = $this->url->link('sale/coupon', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['currency'] = $this->url->link('localisation/currency', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['customer'] = $this->url->link('sale/customer', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['customer_fields'] = $this->url->link('sale/customer_field', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['customer_group'] = $this->url->link('sale/customer_group', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['customer_ban_ip'] = $this->url->link('sale/customer_ban_ip', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['custom_field'] = $this->url->link('design/custom_field', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['download'] = $this->url->link('catalog/download', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['error_log'] = $this->url->link('tool/error_log', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['feed'] = $this->url->link('extension/feed', 'token=' . $this->session->data['token'], 'SSL');	
-			$this->data['filter'] = $this->url->link('catalog/filter', 'token=' . $this->session->data['token'], 'SSL');			
-			$this->data['geo_zone'] = $this->url->link('localisation/geo_zone', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['information'] = $this->url->link('catalog/information', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['language'] = $this->url->link('localisation/language', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['layout'] = $this->url->link('design/layout', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['logout'] = $this->url->link('common/logout', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['contact'] = $this->url->link('sale/contact', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['manager'] = $this->url->link('extension/manager', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['manufacturer'] = $this->url->link('catalog/manufacturer', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['module'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['option'] = $this->url->link('catalog/option', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['order'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['order_status'] = $this->url->link('localisation/order_status', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['payment'] = $this->url->link('extension/payment', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['product'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_sale_order'] = $this->url->link('report/sale_order', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_sale_tax'] = $this->url->link('report/sale_tax', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_sale_shipping'] = $this->url->link('report/sale_shipping', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_sale_return'] = $this->url->link('report/sale_return', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_sale_coupon'] = $this->url->link('report/sale_coupon', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_product_viewed'] = $this->url->link('report/product_viewed', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_product_purchased'] = $this->url->link('report/product_purchased', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_customer_online'] = $this->url->link('report/customer_online', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_customer_order'] = $this->url->link('report/customer_order', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_customer_reward'] = $this->url->link('report/customer_reward', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_customer_credit'] = $this->url->link('report/customer_credit', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['report_affiliate_commission'] = $this->url->link('report/affiliate_commission', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['review'] = $this->url->link('catalog/review', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['return'] = $this->url->link('sale/return', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['return_action'] = $this->url->link('localisation/return_action', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['return_reason'] = $this->url->link('localisation/return_reason', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['return_status'] = $this->url->link('localisation/return_status', 'token=' . $this->session->data['token'], 'SSL');			
-			$this->data['shipping'] = $this->url->link('extension/shipping', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['setting'] = $this->url->link('setting/store', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['store'] = HTTP_CATALOG;
-			$this->data['stock_status'] = $this->url->link('localisation/stock_status', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['tax_class'] = $this->url->link('localisation/tax_class', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['tax_rate'] = $this->url->link('localisation/tax_rate', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['total'] = $this->url->link('extension/total', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['user'] = $this->url->link('user/user', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['user_group'] = $this->url->link('user/user_permission', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['voucher'] = $this->url->link('sale/voucher', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['voucher_theme'] = $this->url->link('sale/voucher_theme', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['weight_class'] = $this->url->link('localisation/weight_class', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['length_class'] = $this->url->link('localisation/length_class', 'token=' . $this->session->data['token'], 'SSL');
-			$this->data['zone'] = $this->url->link('localisation/zone', 'token=' . $this->session->data['token'], 'SSL');
-			//Newsletter Subscribers
-			$this->data['newssubscribe'] = $this->url->link('sale/newssubscribers', 'token=' . $this->session->data['token'], 'SSL'); 						
-			//Newsletter Subscribers
-			
-			$this->data['stores'] = array();
-			
-			$this->load->model('setting/store');
-			
-			$results = $this->model_setting_store->getStores();
-			
-			foreach ($results as $result) {
-				$this->data['stores'][] = array(
-					'name' => $result['name'],
-					'href' => $result['url']
-				);
-			}			
-		}
-		
-		$this->template = 'common/header.tpl';
-		
-		$this->render();
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/controller/catalog/product.php
===================================================================
--- trunk/www/admin/controller/catalog/product.php	(revision 19)
+++ trunk/www/admin/controller/catalog/product.php	(revision 20)
@@ -1,1414 +0,0 @@
-<?php 
-class ControllerCatalogProduct extends Controller {
-	private $error = array();
-    protected function dbCheck(){
-        $query = $this->db->query("SHOW COLUMNS FROM `".DB_PREFIX."product` LIKE 'youtube'");
-        if(!$query->num_rows){
-            $this->db->query("ALTER TABLE `".DB_PREFIX."product` ADD `youtube` TEXT NOT NULL");
-        }
-    }
-  	public function index() {
-          $this->dbCheck();
-		$this->language->load('catalog/product');
-    	
-		$this->document->setTitle($this->language->get('heading_title')); 
-		
-		$this->load->model('catalog/product');
-		
-		$this->getList();
-  	}
-  
-  	public function insert() {
-    	$this->language->load('catalog/product');
-
-    	$this->document->setTitle($this->language->get('heading_title')); 
-		
-		$this->load->model('catalog/product');
-		
-    	if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
-			$this->model_catalog_product->addProduct($this->request->post);
-	  		
-			$this->session->data['success'] = $this->language->get('text_success');
-	  
-			$url = '';
-			
-			if (isset($this->request->get['filter_name'])) {
-				$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-			}
-		
-			if (isset($this->request->get['filter_model'])) {
-				$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['filter_price'])) {
-				$url .= '&filter_price=' . $this->request->get['filter_price'];
-			}
-			
-			if (isset($this->request->get['filter_quantity'])) {
-				$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-			}
-			
-			if (isset($this->request->get['filter_status'])) {
-				$url .= '&filter_status=' . $this->request->get['filter_status'];
-			}
-					
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-			
-			$this->redirect($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'));
-    	}
-	
-    	$this->getForm();
-  	}
-
-  	public function update() {
-    	$this->language->load('catalog/product');
-
-    	$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->load->model('catalog/product');
-	
-    	if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validateForm()) {
-			$this->model_catalog_product->editProduct($this->request->get['product_id'], $this->request->post);
-			
-			$this->session->data['success'] = $this->language->get('text_success');
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter_name'])) {
-				$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-			}
-		
-			if (isset($this->request->get['filter_model'])) {
-				$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['filter_price'])) {
-				$url .= '&filter_price=' . $this->request->get['filter_price'];
-			}
-			
-			if (isset($this->request->get['filter_quantity'])) {
-				$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-			}	
-		
-			if (isset($this->request->get['filter_status'])) {
-				$url .= '&filter_status=' . $this->request->get['filter_status'];
-			}
-					
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-			
-			$this->redirect($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'));
-		}
-
-    	$this->getForm();
-  	}
-
-  	public function delete() {
-    	$this->language->load('catalog/product');
-
-    	$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->load->model('catalog/product');
-		
-		if (isset($this->request->post['selected']) && $this->validateDelete()) {
-			foreach ($this->request->post['selected'] as $product_id) {
-				$this->model_catalog_product->deleteProduct($product_id);
-	  		}
-
-			$this->session->data['success'] = $this->language->get('text_success');
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter_name'])) {
-				$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-			}
-		
-			if (isset($this->request->get['filter_model'])) {
-				$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['filter_price'])) {
-				$url .= '&filter_price=' . $this->request->get['filter_price'];
-			}
-			
-			if (isset($this->request->get['filter_quantity'])) {
-				$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-			}	
-		
-			if (isset($this->request->get['filter_status'])) {
-				$url .= '&filter_status=' . $this->request->get['filter_status'];
-			}
-					
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-			
-			$this->redirect($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'));
-		}
-
-    	$this->getList();
-  	}
-
-  	public function copy() {
-    	$this->language->load('catalog/product');
-
-    	$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->load->model('catalog/product');
-		
-		if (isset($this->request->post['selected']) && $this->validateCopy()) {
-			foreach ($this->request->post['selected'] as $product_id) {
-				$this->model_catalog_product->copyProduct($product_id);
-	  		}
-
-			$this->session->data['success'] = $this->language->get('text_success');
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter_name'])) {
-				$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-			}
-		  
-			if (isset($this->request->get['filter_model'])) {
-				$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['filter_price'])) {
-				$url .= '&filter_price=' . $this->request->get['filter_price'];
-			}
-			
-			if (isset($this->request->get['filter_quantity'])) {
-				$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-			}	
-		
-			if (isset($this->request->get['filter_status'])) {
-				$url .= '&filter_status=' . $this->request->get['filter_status'];
-			}
-					
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-			
-			$this->redirect($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'));
-		}
-
-    	$this->getList();
-  	}
-	
-  	protected function getList() {				
-		if (isset($this->request->get['filter_name'])) {
-			$filter_name = $this->request->get['filter_name'];
-		} else {
-			$filter_name = null;
-		}
-
-		if (isset($this->request->get['filter_model'])) {
-			$filter_model = $this->request->get['filter_model'];
-		} else {
-			$filter_model = null;
-		}
-		
-		if (isset($this->request->get['filter_price'])) {
-			$filter_price = $this->request->get['filter_price'];
-		} else {
-			$filter_price = null;
-		}
-
-		if (isset($this->request->get['filter_quantity'])) {
-			$filter_quantity = $this->request->get['filter_quantity'];
-		} else {
-			$filter_quantity = null;
-		}
-
-		if (isset($this->request->get['filter_status'])) {
-			$filter_status = $this->request->get['filter_status'];
-		} else {
-			$filter_status = null;
-		}
-
-		if (isset($this->request->get['sort'])) {
-			$sort = $this->request->get['sort'];
-		} else {
-			$sort = 'pd.name';
-		}
-		
-		if (isset($this->request->get['order'])) {
-			$order = $this->request->get['order'];
-		} else {
-			$order = 'ASC';
-		}
-		
-		if (isset($this->request->get['page'])) {
-			$page = $this->request->get['page'];
-		} else {
-			$page = 1;
-		}
-						
-		$url = '';
-						
-		if (isset($this->request->get['filter_name'])) {
-			$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_model'])) {
-			$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_price'])) {
-			$url .= '&filter_price=' . $this->request->get['filter_price'];
-		}
-		
-		if (isset($this->request->get['filter_quantity'])) {
-			$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-		}		
-
-		if (isset($this->request->get['filter_status'])) {
-			$url .= '&filter_status=' . $this->request->get['filter_status'];
-		}
-						
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}
-
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-		
-		if (isset($this->request->get['page'])) {
-			$url .= '&page=' . $this->request->get['page'];
-		}
-
-  		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => false
-   		);
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'),       		
-      		'separator' => ' :: '
-   		);
-		
-		$this->data['insert'] = $this->url->link('catalog/product/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');
-		$this->data['copy'] = $this->url->link('catalog/product/copy', 'token=' . $this->session->data['token'] . $url, 'SSL');	
-		$this->data['delete'] = $this->url->link('catalog/product/delete', 'token=' . $this->session->data['token'] . $url, 'SSL');
-    	
-		$this->data['products'] = array();
-
-		$data = array(
-			'filter_name'	  => $filter_name, 
-			'filter_model'	  => $filter_model,
-			'filter_price'	  => $filter_price,
-			'filter_quantity' => $filter_quantity,
-			'filter_status'   => $filter_status,
-			'sort'            => $sort,
-			'order'           => $order,
-			'start'           => ($page - 1) * $this->config->get('config_admin_limit'),
-			'limit'           => $this->config->get('config_admin_limit')
-		);
-		
-		$this->load->model('tool/image');
-		
-		$product_total = $this->model_catalog_product->getTotalProducts($data);
-			
-		$results = $this->model_catalog_product->getProducts($data);
-				    	
-		foreach ($results as $result) {
-			$action = array();
-			
-			$action[] = array(
-				'text' => $this->language->get('text_edit'),
-				'href' => $this->url->link('catalog/product/update', 'token=' . $this->session->data['token'] . '&product_id=' . $result['product_id'] . $url, 'SSL')
-			);
-			
-			if ($result['image'] && file_exists(DIR_IMAGE . $result['image'])) {
-				$image = $this->model_tool_image->resize($result['image'], 40, 40);
-			} else {
-				$image = $this->model_tool_image->resize('no_image.jpg', 40, 40);
-			}
-	
-			$special = false;
-			
-			$product_specials = $this->model_catalog_product->getProductSpecials($result['product_id']);
-			
-			foreach ($product_specials  as $product_special) {
-				if (($product_special['date_start'] == '0000-00-00' || $product_special['date_start'] < date('Y-m-d')) && ($product_special['date_end'] == '0000-00-00' || $product_special['date_end'] > date('Y-m-d'))) {
-					$special = $product_special['price'];
-			
-					break;
-				}					
-			}
-	
-      		$this->data['products'][] = array(
-				'product_id' => $result['product_id'],
-				'name'       => $result['name'],
-				'model'      => $result['model'],
-				'price'      => $result['price'],
-				'special'    => $special,
-				'image'      => $image,
-				'quantity'   => $result['quantity'],
-				'status'     => ($result['status'] ? $this->language->get('text_enabled') : $this->language->get('text_disabled')),
-				'selected'   => isset($this->request->post['selected']) && in_array($result['product_id'], $this->request->post['selected']),
-				'action'     => $action
-			);
-    	}
-		
-		$this->data['heading_title'] = $this->language->get('heading_title');		
-				
-		$this->data['text_enabled'] = $this->language->get('text_enabled');		
-		$this->data['text_disabled'] = $this->language->get('text_disabled');		
-		$this->data['text_no_results'] = $this->language->get('text_no_results');		
-		$this->data['text_image_manager'] = $this->language->get('text_image_manager');		
-			
-		$this->data['column_image'] = $this->language->get('column_image');		
-		$this->data['column_name'] = $this->language->get('column_name');		
-		$this->data['column_model'] = $this->language->get('column_model');		
-		$this->data['column_price'] = $this->language->get('column_price');		
-		$this->data['column_quantity'] = $this->language->get('column_quantity');		
-		$this->data['column_status'] = $this->language->get('column_status');		
-		$this->data['column_action'] = $this->language->get('column_action');		
-				
-		$this->data['button_copy'] = $this->language->get('button_copy');		
-		$this->data['button_insert'] = $this->language->get('button_insert');		
-		$this->data['button_delete'] = $this->language->get('button_delete');		
-		$this->data['button_filter'] = $this->language->get('button_filter');
-		 
- 		$this->data['token'] = $this->session->data['token'];
-          $this->data['tab_youtube'] = $this->language->get('tab_youtube');
- 		if (isset($this->error['warning'])) {
-			$this->data['error_warning'] = $this->error['warning'];
-		} else {
-			$this->data['error_warning'] = '';
-		}
-
-		if (isset($this->session->data['success'])) {
-			$this->data['success'] = $this->session->data['success'];
-		
-			unset($this->session->data['success']);
-		} else {
-			$this->data['success'] = '';
-		}
-
-		$url = '';
-
-		if (isset($this->request->get['filter_name'])) {
-			$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_model'])) {
-			$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_price'])) {
-			$url .= '&filter_price=' . $this->request->get['filter_price'];
-		}
-		
-		if (isset($this->request->get['filter_quantity'])) {
-			$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-		}
-		
-		if (isset($this->request->get['filter_status'])) {
-			$url .= '&filter_status=' . $this->request->get['filter_status'];
-		}
-								
-		if ($order == 'ASC') {
-			$url .= '&order=DESC';
-		} else {
-			$url .= '&order=ASC';
-		}
-
-		if (isset($this->request->get['page'])) {
-			$url .= '&page=' . $this->request->get['page'];
-		}
-					
-		$this->data['sort_name'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=pd.name' . $url, 'SSL');
-		$this->data['sort_model'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.model' . $url, 'SSL');
-		$this->data['sort_price'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.price' . $url, 'SSL');
-		$this->data['sort_quantity'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.quantity' . $url, 'SSL');
-		$this->data['sort_status'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.status' . $url, 'SSL');
-		$this->data['sort_order'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . '&sort=p.sort_order' . $url, 'SSL');
-		
-		$url = '';
-
-		if (isset($this->request->get['filter_name'])) {
-			$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_model'])) {
-			$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_price'])) {
-			$url .= '&filter_price=' . $this->request->get['filter_price'];
-		}
-		
-		if (isset($this->request->get['filter_quantity'])) {
-			$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-		}
-
-		if (isset($this->request->get['filter_status'])) {
-			$url .= '&filter_status=' . $this->request->get['filter_status'];
-		}
-
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}
-												
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-				
-		$pagination = new Pagination();
-		$pagination->total = $product_total;
-		$pagination->page = $page;
-		$pagination->limit = $this->config->get('config_admin_limit');
-		$pagination->text = $this->language->get('text_pagination');
-		$pagination->url = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url . '&page={page}', 'SSL');
-			
-		$this->data['pagination'] = $pagination->render();
-	
-		$this->data['filter_name'] = $filter_name;
-		$this->data['filter_model'] = $filter_model;
-		$this->data['filter_price'] = $filter_price;
-		$this->data['filter_quantity'] = $filter_quantity;
-		$this->data['filter_status'] = $filter_status;
-		
-		$this->data['sort'] = $sort;
-		$this->data['order'] = $order;
-
-		$this->template = 'catalog/product_list.tpl';
-		$this->children = array(
-			'common/header',
-			'common/footer'
-		);
-				
-		$this->response->setOutput($this->render());
-  	}
-
-  	protected function getForm() {
-    	$this->data['heading_title'] = $this->language->get('heading_title');
- 
-    	$this->data['text_enabled'] = $this->language->get('text_enabled');
-    	$this->data['text_disabled'] = $this->language->get('text_disabled');
-    	$this->data['text_none'] = $this->language->get('text_none');
-    	$this->data['text_yes'] = $this->language->get('text_yes');
-    	$this->data['text_no'] = $this->language->get('text_no');
-		$this->data['text_select_all'] = $this->language->get('text_select_all');
-		$this->data['text_unselect_all'] = $this->language->get('text_unselect_all');
-		$this->data['text_plus'] = $this->language->get('text_plus');
-		$this->data['text_minus'] = $this->language->get('text_minus');
-		$this->data['text_default'] = $this->language->get('text_default');
-		$this->data['text_image_manager'] = $this->language->get('text_image_manager');
-		$this->data['text_browse'] = $this->language->get('text_browse');
-		$this->data['text_clear'] = $this->language->get('text_clear');
-		$this->data['text_option'] = $this->language->get('text_option');
-		$this->data['text_option_value'] = $this->language->get('text_option_value');
-		$this->data['text_select'] = $this->language->get('text_select');
-		$this->data['text_none'] = $this->language->get('text_none');
-		$this->data['text_percent'] = $this->language->get('text_percent');
-		$this->data['text_amount'] = $this->language->get('text_amount');
-
-		$this->data['entry_name'] = $this->language->get('entry_name');
-		$this->data['entry_meta_description'] = $this->language->get('entry_meta_description');
-		$this->data['entry_meta_keyword'] = $this->language->get('entry_meta_keyword');
-		$this->data['entry_description'] = $this->language->get('entry_description');
-		$this->data['entry_store'] = $this->language->get('entry_store');
-		$this->data['entry_keyword'] = $this->language->get('entry_keyword');
-    	$this->data['entry_model'] = $this->language->get('entry_model');
-		$this->data['entry_sku'] = $this->language->get('entry_sku');
-		$this->data['entry_upc'] = $this->language->get('entry_upc');
-		$this->data['entry_ean'] = $this->language->get('entry_ean');
-		$this->data['entry_jan'] = $this->language->get('entry_jan');
-		$this->data['entry_isbn'] = $this->language->get('entry_isbn');
-		$this->data['entry_mpn'] = $this->language->get('entry_mpn');
-		$this->data['entry_location'] = $this->language->get('entry_location');
-		$this->data['entry_minimum'] = $this->language->get('entry_minimum');
-		$this->data['entry_manufacturer'] = $this->language->get('entry_manufacturer');
-    	$this->data['entry_shipping'] = $this->language->get('entry_shipping');
-    	$this->data['entry_date_available'] = $this->language->get('entry_date_available');
-    	$this->data['entry_quantity'] = $this->language->get('entry_quantity');
-		$this->data['entry_stock_status'] = $this->language->get('entry_stock_status');
-    	$this->data['entry_price'] = $this->language->get('entry_price');
-		$this->data['entry_tax_class'] = $this->language->get('entry_tax_class');
-		$this->data['entry_points'] = $this->language->get('entry_points');
-		$this->data['entry_option_points'] = $this->language->get('entry_option_points');
-		$this->data['entry_subtract'] = $this->language->get('entry_subtract');
-    	$this->data['entry_weight_class'] = $this->language->get('entry_weight_class');
-    	$this->data['entry_weight'] = $this->language->get('entry_weight');
-		$this->data['entry_dimension'] = $this->language->get('entry_dimension');
-		$this->data['entry_length'] = $this->language->get('entry_length');
-    	$this->data['entry_image'] = $this->language->get('entry_image');
-    	$this->data['entry_download'] = $this->language->get('entry_download');
-    	$this->data['entry_category'] = $this->language->get('entry_category');
-		$this->data['entry_filter'] = $this->language->get('entry_filter');
-		$this->data['entry_related'] = $this->language->get('entry_related');
-		$this->data['entry_attribute'] = $this->language->get('entry_attribute');
-		$this->data['entry_text'] = $this->language->get('entry_text');
-		$this->data['entry_option'] = $this->language->get('entry_option');
-		$this->data['entry_option_value'] = $this->language->get('entry_option_value');
-		$this->data['entry_required'] = $this->language->get('entry_required');
-		$this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
-		$this->data['entry_status'] = $this->language->get('entry_status');
-		$this->data['entry_customer_group'] = $this->language->get('entry_customer_group');
-		$this->data['entry_date_start'] = $this->language->get('entry_date_start');
-		$this->data['entry_date_end'] = $this->language->get('entry_date_end');
-		$this->data['entry_priority'] = $this->language->get('entry_priority');
-		$this->data['entry_tag'] = $this->language->get('entry_tag');
-		$this->data['entry_customer_group'] = $this->language->get('entry_customer_group');
-		$this->data['entry_reward'] = $this->language->get('entry_reward');
-		$this->data['entry_layout'] = $this->language->get('entry_layout');
-				
-    	$this->data['button_save'] = $this->language->get('button_save');
-    	$this->data['button_cancel'] = $this->language->get('button_cancel');
-		$this->data['button_add_attribute'] = $this->language->get('button_add_attribute');
-		$this->data['button_add_option'] = $this->language->get('button_add_option');
-		$this->data['button_add_option_value'] = $this->language->get('button_add_option_value');
-		$this->data['button_add_discount'] = $this->language->get('button_add_discount');
-		$this->data['button_add_special'] = $this->language->get('button_add_special');
-		$this->data['button_add_image'] = $this->language->get('button_add_image');
-		$this->data['button_remove'] = $this->language->get('button_remove');
-		
-    	$this->data['tab_general'] = $this->language->get('tab_general');
-    	$this->data['tab_data'] = $this->language->get('tab_data');
-		$this->data['tab_attribute'] = $this->language->get('tab_attribute');
-		$this->data['tab_option'] = $this->language->get('tab_option');		
-		$this->data['tab_discount'] = $this->language->get('tab_discount');
-		$this->data['tab_special'] = $this->language->get('tab_special');
-    	$this->data['tab_image'] = $this->language->get('tab_image');		
-		$this->data['tab_links'] = $this->language->get('tab_links');
-		$this->data['tab_reward'] = $this->language->get('tab_reward');
-		$this->data['tab_design'] = $this->language->get('tab_design');
-          $this->data['tab_youtube'] = $this->language->get('tab_youtube');
- 		if (isset($this->error['warning'])) {
-			$this->data['error_warning'] = $this->error['warning'];
-		} else {
-			$this->data['error_warning'] = '';
-		}
-
- 		if (isset($this->error['name'])) {
-			$this->data['error_name'] = $this->error['name'];
-		} else {
-			$this->data['error_name'] = array();
-		}
-
- 		if (isset($this->error['meta_description'])) {
-			$this->data['error_meta_description'] = $this->error['meta_description'];
-		} else {
-			$this->data['error_meta_description'] = array();
-		}		
-   
-   		if (isset($this->error['description'])) {
-			$this->data['error_description'] = $this->error['description'];
-		} else {
-			$this->data['error_description'] = array();
-		}	
-		
-   		if (isset($this->error['model'])) {
-			$this->data['error_model'] = $this->error['model'];
-		} else {
-			$this->data['error_model'] = '';
-		}		
-     	
-		if (isset($this->error['date_available'])) {
-			$this->data['error_date_available'] = $this->error['date_available'];
-		} else {
-			$this->data['error_date_available'] = '';
-		}	
-
-		$url = '';
-
-		if (isset($this->request->get['filter_name'])) {
-			$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_model'])) {
-			$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['filter_price'])) {
-			$url .= '&filter_price=' . $this->request->get['filter_price'];
-		}
-		
-		if (isset($this->request->get['filter_quantity'])) {
-			$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
-		}	
-		
-		if (isset($this->request->get['filter_status'])) {
-			$url .= '&filter_status=' . $this->request->get['filter_status'];
-		}
-								
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}
-
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-		
-		if (isset($this->request->get['page'])) {
-			$url .= '&page=' . $this->request->get['page'];
-		}
-
-  		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
-			'separator' => false
-   		);
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'),
-      		'separator' => ' :: '
-   		);
-									
-		if (!isset($this->request->get['product_id'])) {
-			$this->data['action'] = $this->url->link('catalog/product/insert', 'token=' . $this->session->data['token'] . $url, 'SSL');
-		} else {
-			$this->data['action'] = $this->url->link('catalog/product/update', 'token=' . $this->session->data['token'] . '&product_id=' . $this->request->get['product_id'] . $url, 'SSL');
-		}
-		
-		$this->data['cancel'] = $this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL');
-
-		if (isset($this->request->get['product_id']) && ($this->request->server['REQUEST_METHOD'] != 'POST')) {
-      		$product_info = $this->model_catalog_product->getProduct($this->request->get['product_id']);
-    	}
-
-		$this->data['token'] = $this->session->data['token'];
-		
-		$this->load->model('localisation/language');
-		
-		$this->data['languages'] = $this->model_localisation_language->getLanguages();
-		
-		if (isset($this->request->post['product_description'])) {
-			$this->data['product_description'] = $this->request->post['product_description'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$this->data['product_description'] = $this->model_catalog_product->getProductDescriptions($this->request->get['product_id']);
-		} else {
-			$this->data['product_description'] = array();
-		}
-		
-		if (isset($this->request->post['model'])) {
-      		$this->data['model'] = $this->request->post['model'];
-    	} elseif (!empty($product_info)) {
-			$this->data['model'] = $product_info['model'];
-		} else {
-      		$this->data['model'] = '';
-    	}
-
-		if (isset($this->request->post['sku'])) {
-      		$this->data['sku'] = $this->request->post['sku'];
-    	} elseif (!empty($product_info)) {
-			$this->data['sku'] = $product_info['sku'];
-		} else {
-      		$this->data['sku'] = '';
-    	}
-		
-		if (isset($this->request->post['upc'])) {
-      		$this->data['upc'] = $this->request->post['upc'];
-    	} elseif (!empty($product_info)) {
-			$this->data['upc'] = $product_info['upc'];
-		} else {
-      		$this->data['upc'] = '';
-    	}
-		
-		if (isset($this->request->post['ean'])) {
-      		$this->data['ean'] = $this->request->post['ean'];
-    	} elseif (!empty($product_info)) {
-			$this->data['ean'] = $product_info['ean'];
-		} else {
-      		$this->data['ean'] = '';
-    	}
-		
-		if (isset($this->request->post['jan'])) {
-      		$this->data['jan'] = $this->request->post['jan'];
-    	} elseif (!empty($product_info)) {
-			$this->data['jan'] = $product_info['jan'];
-		} else {
-      		$this->data['jan'] = '';
-    	}
-		
-		if (isset($this->request->post['isbn'])) {
-      		$this->data['isbn'] = $this->request->post['isbn'];
-    	} elseif (!empty($product_info)) {
-			$this->data['isbn'] = $product_info['isbn'];
-		} else {
-      		$this->data['isbn'] = '';
-    	}
-		
-		if (isset($this->request->post['mpn'])) {
-      		$this->data['mpn'] = $this->request->post['mpn'];
-    	} elseif (!empty($product_info)) {
-			$this->data['mpn'] = $product_info['mpn'];
-		} else {
-      		$this->data['mpn'] = '';
-    	}								
-				
-		if (isset($this->request->post['location'])) {
-      		$this->data['location'] = $this->request->post['location'];
-    	} elseif (!empty($product_info)) {
-			$this->data['location'] = $product_info['location'];
-		} else {
-      		$this->data['location'] = '';
-    	}
-
-		$this->load->model('setting/store');
-		
-		$this->data['stores'] = $this->model_setting_store->getStores();
-		
-		if (isset($this->request->post['product_store'])) {
-			$this->data['product_store'] = $this->request->post['product_store'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$this->data['product_store'] = $this->model_catalog_product->getProductStores($this->request->get['product_id']);
-		} else {
-			$this->data['product_store'] = array(0);
-		}	
-		
-		if (isset($this->request->post['keyword'])) {
-			$this->data['keyword'] = $this->request->post['keyword'];
-		} elseif (!empty($product_info)) {
-			$this->data['keyword'] = $product_info['keyword'];
-		} else {
-			$this->data['keyword'] = '';
-		}
-		
-		if (isset($this->request->post['image'])) {
-			$this->data['image'] = $this->request->post['image'];
-		} elseif (!empty($product_info)) {
-			$this->data['image'] = $product_info['image'];
-		} else {
-			$this->data['image'] = '';
-		}
-		
-		$this->load->model('tool/image');
-		
-		if (isset($this->request->post['image']) && file_exists(DIR_IMAGE . $this->request->post['image'])) {
-			$this->data['thumb'] = $this->model_tool_image->resize($this->request->post['image'], 100, 100);
-		} elseif (!empty($product_info) && $product_info['image'] && file_exists(DIR_IMAGE . $product_info['image'])) {
-			$this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], 100, 100);
-		} else {
-			$this->data['thumb'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-		}
-		
-    	if (isset($this->request->post['shipping'])) {
-      		$this->data['shipping'] = $this->request->post['shipping'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['shipping'] = $product_info['shipping'];
-    	} else {
-			$this->data['shipping'] = 1;
-		}
-		
-    	if (isset($this->request->post['price'])) {
-      		$this->data['price'] = $this->request->post['price'];
-    	} elseif (!empty($product_info)) {
-			$this->data['price'] = $product_info['price'];
-		} else {
-      		$this->data['price'] = '';
-    	}
-		
-		$this->load->model('localisation/tax_class');
-		
-		$this->data['tax_classes'] = $this->model_localisation_tax_class->getTaxClasses();
-    	
-		if (isset($this->request->post['tax_class_id'])) {
-      		$this->data['tax_class_id'] = $this->request->post['tax_class_id'];
-    	} elseif (!empty($product_info)) {
-			$this->data['tax_class_id'] = $product_info['tax_class_id'];
-		} else {
-      		$this->data['tax_class_id'] = 0;
-    	}
-		      	
-		if (isset($this->request->post['date_available'])) {
-       		$this->data['date_available'] = $this->request->post['date_available'];
-		} elseif (!empty($product_info)) {
-			$this->data['date_available'] = date('Y-m-d', strtotime($product_info['date_available']));
-		} else {
-			$this->data['date_available'] = date('Y-m-d', time() - 86400);
-		}
-											
-    	if (isset($this->request->post['quantity'])) {
-      		$this->data['quantity'] = $this->request->post['quantity'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['quantity'] = $product_info['quantity'];
-    	} else {
-			$this->data['quantity'] = 1;
-		}
-		
-		if (isset($this->request->post['minimum'])) {
-      		$this->data['minimum'] = $this->request->post['minimum'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['minimum'] = $product_info['minimum'];
-    	} else {
-			$this->data['minimum'] = 1;
-		}
-		
-		if (isset($this->request->post['subtract'])) {
-      		$this->data['subtract'] = $this->request->post['subtract'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['subtract'] = $product_info['subtract'];
-    	} else {
-			$this->data['subtract'] = 1;
-		}
-		
-		if (isset($this->request->post['sort_order'])) {
-      		$this->data['sort_order'] = $this->request->post['sort_order'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['sort_order'] = $product_info['sort_order'];
-    	} else {
-			$this->data['sort_order'] = 1;
-		}
-
-		$this->load->model('localisation/stock_status');
-		
-		$this->data['stock_statuses'] = $this->model_localisation_stock_status->getStockStatuses();
-    	
-		if (isset($this->request->post['stock_status_id'])) {
-      		$this->data['stock_status_id'] = $this->request->post['stock_status_id'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['stock_status_id'] = $product_info['stock_status_id'];
-    	} else {
-			$this->data['stock_status_id'] = $this->config->get('config_stock_status_id');
-		}
-				
-    	if (isset($this->request->post['status'])) {
-      		$this->data['status'] = $this->request->post['status'];
-    	} elseif (!empty($product_info)) {
-			$this->data['status'] = $product_info['status'];
-		} else {
-      		$this->data['status'] = 1;
-    	}
-
-    	if (isset($this->request->post['weight'])) {
-      		$this->data['weight'] = $this->request->post['weight'];
-		} elseif (!empty($product_info)) {
-			$this->data['weight'] = $product_info['weight'];
-    	} else {
-      		$this->data['weight'] = '';
-    	} 
-		
-		$this->load->model('localisation/weight_class');
-		
-		$this->data['weight_classes'] = $this->model_localisation_weight_class->getWeightClasses();
-    	
-		if (isset($this->request->post['weight_class_id'])) {
-      		$this->data['weight_class_id'] = $this->request->post['weight_class_id'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['weight_class_id'] = $product_info['weight_class_id'];
-		} else {
-      		$this->data['weight_class_id'] = $this->config->get('config_weight_class_id');
-    	}
-		
-		if (isset($this->request->post['length'])) {
-      		$this->data['length'] = $this->request->post['length'];
-    	} elseif (!empty($product_info)) {
-			$this->data['length'] = $product_info['length'];
-		} else {
-      		$this->data['length'] = '';
-    	}
-		
-		if (isset($this->request->post['width'])) {
-      		$this->data['width'] = $this->request->post['width'];
-		} elseif (!empty($product_info)) {	
-			$this->data['width'] = $product_info['width'];
-    	} else {
-      		$this->data['width'] = '';
-    	}
-		
-		if (isset($this->request->post['height'])) {
-      		$this->data['height'] = $this->request->post['height'];
-		} elseif (!empty($product_info)) {
-			$this->data['height'] = $product_info['height'];
-    	} else {
-      		$this->data['height'] = '';
-    	}
-
-		$this->load->model('localisation/length_class');
-		
-		$this->data['length_classes'] = $this->model_localisation_length_class->getLengthClasses();
-    	
-		if (isset($this->request->post['length_class_id'])) {
-      		$this->data['length_class_id'] = $this->request->post['length_class_id'];
-    	} elseif (!empty($product_info)) {
-      		$this->data['length_class_id'] = $product_info['length_class_id'];
-    	} else {
-      		$this->data['length_class_id'] = $this->config->get('config_length_class_id');
-		}
-
-		$this->load->model('catalog/manufacturer');
-		
-    	if (isset($this->request->post['manufacturer_id'])) {
-      		$this->data['manufacturer_id'] = $this->request->post['manufacturer_id'];
-		} elseif (!empty($product_info)) {
-			$this->data['manufacturer_id'] = $product_info['manufacturer_id'];
-		} else {
-      		$this->data['manufacturer_id'] = 0;
-    	} 		
-		
-    	if (isset($this->request->post['manufacturer'])) {
-      		$this->data['manufacturer'] = $this->request->post['manufacturer'];
-		} elseif (!empty($product_info)) {
-			$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($product_info['manufacturer_id']);
-			
-			if ($manufacturer_info) {		
-				$this->data['manufacturer'] = $manufacturer_info['name'];
-			} else {
-				$this->data['manufacturer'] = '';
-			}	
-		} else {
-      		$this->data['manufacturer'] = '';
-    	} 
-		
-		// Categories
-		$this->load->model('catalog/category');
-		
-		if (isset($this->request->post['product_category'])) {
-			$categories = $this->request->post['product_category'];
-		} elseif (isset($this->request->get['product_id'])) {		
-			$categories = $this->model_catalog_product->getProductCategories($this->request->get['product_id']);
-		} else {
-			$categories = array();
-		}
-	
-		$this->data['product_categories'] = array();
-		
-		foreach ($categories as $category_id) {
-			$category_info = $this->model_catalog_category->getCategory($category_id);
-			
-			if ($category_info) {
-				$this->data['product_categories'][] = array(
-					'category_id' => $category_info['category_id'],
-					'name'        => ($category_info['path'] ? $category_info['path'] . ' &gt; ' : '') . $category_info['name']
-				);
-			}
-		}
-		
-		// Filters
-		$this->load->model('catalog/filter');
-		
-		if (isset($this->request->post['product_filter'])) {
-			$filters = $this->request->post['product_filter'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$filters = $this->model_catalog_product->getProductFilters($this->request->get['product_id']);
-		} else {
-			$filters = array();
-		}
-		
-		$this->data['product_filters'] = array();
-		
-		foreach ($filters as $filter_id) {
-			$filter_info = $this->model_catalog_filter->getFilter($filter_id);
-			
-			if ($filter_info) {
-				$this->data['product_filters'][] = array(
-					'filter_id' => $filter_info['filter_id'],
-					'name'      => $filter_info['group'] . ' &gt; ' . $filter_info['name']
-				);
-			}
-		}		
-		
-		// Attributes
-		$this->load->model('catalog/attribute');
-		
-		if (isset($this->request->post['product_attribute'])) {
-			$product_attributes = $this->request->post['product_attribute'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$product_attributes = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);
-		} else {
-			$product_attributes = array();
-		}
-		
-		$this->data['product_attributes'] = array();
-		
-		foreach ($product_attributes as $product_attribute) {
-			$attribute_info = $this->model_catalog_attribute->getAttribute($product_attribute['attribute_id']);
-			
-			if ($attribute_info) {
-				$this->data['product_attributes'][] = array(
-					'attribute_id'                  => $product_attribute['attribute_id'],
-					'name'                          => $attribute_info['name'],
-					'product_attribute_description' => $product_attribute['product_attribute_description']
-				);
-			}
-		}		
-		
-		// Options
-		$this->load->model('catalog/option');
-		
-		if (isset($this->request->post['product_option'])) {
-			$product_options = $this->request->post['product_option'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$product_options = $this->model_catalog_product->getProductOptions($this->request->get['product_id']);			
-		} else {
-			$product_options = array();
-		}			
-		
-		$this->data['product_options'] = array();
-			
-		foreach ($product_options as $product_option) {
-			if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') {
-				$product_option_value_data = array();
-				
-				foreach ($product_option['product_option_value'] as $product_option_value) {
-					$product_option_value_data[] = array(
-						'product_option_value_id' => $product_option_value['product_option_value_id'],
-						'option_value_id'         => $product_option_value['option_value_id'],
-						'quantity'                => $product_option_value['quantity'],
-						'subtract'                => $product_option_value['subtract'],
-						'price'                   => $product_option_value['price'],
-						'price_prefix'            => $product_option_value['price_prefix'],
-						'points'                  => $product_option_value['points'],
-						'points_prefix'           => $product_option_value['points_prefix'],						
-						'weight'                  => $product_option_value['weight'],
-						'weight_prefix'           => $product_option_value['weight_prefix']	
-					);						
-				}
-				
-				$this->data['product_options'][] = array(
-					'product_option_id'    => $product_option['product_option_id'],
-					'product_option_value' => $product_option_value_data,
-					'option_id'            => $product_option['option_id'],
-					'name'                 => $product_option['name'],
-					'type'                 => $product_option['type'],
-					'required'             => $product_option['required']
-				);				
-			} else {
-				$this->data['product_options'][] = array(
-					'product_option_id' => $product_option['product_option_id'],
-					'option_id'         => $product_option['option_id'],
-					'name'              => $product_option['name'],
-					'type'              => $product_option['type'],
-					'option_value'      => $product_option['option_value'],
-					'required'          => $product_option['required']
-				);				
-			}
-		}
-		
-		$this->data['option_values'] = array();
-		
-		foreach ($this->data['product_options'] as $product_option) {
-			if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') {
-				if (!isset($this->data['option_values'][$product_option['option_id']])) {
-					$this->data['option_values'][$product_option['option_id']] = $this->model_catalog_option->getOptionValues($product_option['option_id']);
-				}
-			}
-		}
-		
-		$this->load->model('sale/customer_group');
-		
-		$this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups();
-		
-		if (isset($this->request->post['product_discount'])) {
-			$this->data['product_discounts'] = $this->request->post['product_discount'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$this->data['product_discounts'] = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
-		} else {
-			$this->data['product_discounts'] = array();
-		}
-
-		if (isset($this->request->post['product_special'])) {
-			$this->data['product_specials'] = $this->request->post['product_special'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$this->data['product_specials'] = $this->model_catalog_product->getProductSpecials($this->request->get['product_id']);
-		} else {
-			$this->data['product_specials'] = array();
-		}
-		
-		// Images
-		if (isset($this->request->post['product_image'])) {
-			$product_images = $this->request->post['product_image'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$product_images = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
-		} else {
-			$product_images = array();
-		}
-		
-		$this->data['product_images'] = array();
-		
-		foreach ($product_images as $product_image) {
-			if ($product_image['image'] && file_exists(DIR_IMAGE . $product_image['image'])) {
-				$image = $product_image['image'];
-			} else {
-				$image = 'no_image.jpg';
-			}
-			
-			$this->data['product_images'][] = array(
-				'image'      => $image,
-				'thumb'      => $this->model_tool_image->resize($image, 100, 100),
-				'sort_order' => $product_image['sort_order']
-			);
-		}
-
-		$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
-
-		// Downloads
-		$this->load->model('catalog/download');
-		
-		if (isset($this->request->post['product_download'])) {
-			$product_downloads = $this->request->post['product_download'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$product_downloads = $this->model_catalog_product->getProductDownloads($this->request->get['product_id']);
-		} else {
-			$product_downloads = array();
-		}
-			
-		$this->data['product_downloads'] = array();
-		
-		foreach ($product_downloads as $download_id) {
-			$download_info = $this->model_catalog_download->getDownload($download_id);
-			
-			if ($download_info) {
-				$this->data['product_downloads'][] = array(
-					'download_id' => $download_info['download_id'],
-					'name'        => $download_info['name']
-				);
-			}
-		}
-		
-		if (isset($this->request->post['product_related'])) {
-			$products = $this->request->post['product_related'];
-		} elseif (isset($this->request->get['product_id'])) {		
-			$products = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
-		} else {
-			$products = array();
-		}
-	
-		$this->data['product_related'] = array();
-		
-		foreach ($products as $product_id) {
-			$related_info = $this->model_catalog_product->getProduct($product_id);
-			
-			if ($related_info) {
-				$this->data['product_related'][] = array(
-					'product_id' => $related_info['product_id'],
-					'name'       => $related_info['name']
-				);
-			}
-		}
-
-    	if (isset($this->request->post['points'])) {
-      		$this->data['points'] = $this->request->post['points'];
-    	} elseif (!empty($product_info)) {
-			$this->data['points'] = $product_info['points'];
-		} else {
-      		$this->data['points'] = '';
-    	}
-						
-		if (isset($this->request->post['product_reward'])) {
-			$this->data['product_reward'] = $this->request->post['product_reward'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$this->data['product_reward'] = $this->model_catalog_product->getProductRewards($this->request->get['product_id']);
-		} else {
-			$this->data['product_reward'] = array();
-		}
-		
-		if (isset($this->request->post['product_layout'])) {
-			$this->data['product_layout'] = $this->request->post['product_layout'];
-		} elseif (isset($this->request->get['product_id'])) {
-			$this->data['product_layout'] = $this->model_catalog_product->getProductLayouts($this->request->get['product_id']);
-		} else {
-			$this->data['product_layout'] = array();
-		}
-
-		$this->load->model('design/layout');
-		
-		$this->data['layouts'] = $this->model_design_layout->getLayouts();
-          if (isset($this->request->post['youtube'])) {
-              $this->data['youtube'] = $this->request->post['youtube'];
-          } elseif (!empty($product_info)) {
-              $this->data['youtube'] = $product_info['youtube'];
-          } else {
-              $this->data['youtube'] = '';
-          }
-		$this->template = 'catalog/product_form.tpl';
-		$this->children = array(
-			'common/header',
-			'common/footer'
-		);
-				
-		$this->response->setOutput($this->render());
-  	} 
-	
-  	protected function validateForm() { 
-    	if (!$this->user->hasPermission('modify', 'catalog/product')) {
-      		$this->error['warning'] = $this->language->get('error_permission');
-    	}
-
-    	foreach ($this->request->post['product_description'] as $language_id => $value) {
-      		if ((utf8_strlen($value['name']) < 1) || (utf8_strlen($value['name']) > 255)) {
-        		$this->error['name'][$language_id] = $this->language->get('error_name');
-      		}
-    	}
-		
-    	if ((utf8_strlen($this->request->post['model']) < 1) || (utf8_strlen($this->request->post['model']) > 64)) {
-      		$this->error['model'] = $this->language->get('error_model');
-    	}
-		
-		if ($this->error && !isset($this->error['warning'])) {
-			$this->error['warning'] = $this->language->get('error_warning');
-		}
-					
-    	if (!$this->error) {
-			return true;
-    	} else {
-      		return false;
-    	}
-  	}
-	
-  	protected function validateDelete() {
-    	if (!$this->user->hasPermission('modify', 'catalog/product')) {
-      		$this->error['warning'] = $this->language->get('error_permission');  
-    	}
-		
-		if (!$this->error) {
-	  		return true;
-		} else {
-	  		return false;
-		}
-  	}
-  	
-  	protected function validateCopy() {
-    	if (!$this->user->hasPermission('modify', 'catalog/product')) {
-      		$this->error['warning'] = $this->language->get('error_permission');  
-    	}
-		
-		if (!$this->error) {
-	  		return true;
-		} else {
-	  		return false;
-		}
-  	}
-		
-	public function autocomplete() {
-		$json = array();
-		
-		if (isset($this->request->get['filter_name']) || isset($this->request->get['filter_model']) || isset($this->request->get['filter_category_id'])) {
-			$this->load->model('catalog/product');
-			$this->load->model('catalog/option');
-			
-			if (isset($this->request->get['filter_name'])) {
-				$filter_name = $this->request->get['filter_name'];
-			} else {
-				$filter_name = '';
-			}
-			
-			if (isset($this->request->get['filter_model'])) {
-				$filter_model = $this->request->get['filter_model'];
-			} else {
-				$filter_model = '';
-			}
-			
-			if (isset($this->request->get['limit'])) {
-				$limit = $this->request->get['limit'];	
-			} else {
-				$limit = 20;	
-			}			
-						
-			$data = array(
-				'filter_name'  => $filter_name,
-				'filter_model' => $filter_model,
-				'start'        => 0,
-				'limit'        => $limit
-			);
-			
-			$results = $this->model_catalog_product->getProducts($data);
-			
-			foreach ($results as $result) {
-				$option_data = array();
-				
-				$product_options = $this->model_catalog_product->getProductOptions($result['product_id']);	
-				
-				foreach ($product_options as $product_option) {
-					$option_info = $this->model_catalog_option->getOption($product_option['option_id']);
-					
-					if ($option_info) {				
-						if ($option_info['type'] == 'select' || $option_info['type'] == 'radio' || $option_info['type'] == 'checkbox' || $option_info['type'] == 'image') {
-							$option_value_data = array();
-							
-							foreach ($product_option['product_option_value'] as $product_option_value) {
-								$option_value_info = $this->model_catalog_option->getOptionValue($product_option_value['option_value_id']);
-						
-								if ($option_value_info) {
-									$option_value_data[] = array(
-										'product_option_value_id' => $product_option_value['product_option_value_id'],
-										'option_value_id'         => $product_option_value['option_value_id'],
-										'name'                    => $option_value_info['name'],
-										'price'                   => (float)$product_option_value['price'] ? $this->currency->format($product_option_value['price'], $this->config->get('config_currency')) : false,
-										'price_prefix'            => $product_option_value['price_prefix']
-									);
-								}
-							}
-						
-							$option_data[] = array(
-								'product_option_id' => $product_option['product_option_id'],
-								'option_id'         => $product_option['option_id'],
-								'name'              => $option_info['name'],
-								'type'              => $option_info['type'],
-								'option_value'      => $option_value_data,
-								'required'          => $product_option['required']
-							);	
-						} else {
-							$option_data[] = array(
-								'product_option_id' => $product_option['product_option_id'],
-								'option_id'         => $product_option['option_id'],
-								'name'              => $option_info['name'],
-								'type'              => $option_info['type'],
-								'option_value'      => $product_option['option_value'],
-								'required'          => $product_option['required']
-							);				
-						}
-					}
-				}
-					
-				$json[] = array(
-					'product_id' => $result['product_id'],
-					'name'       => strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')),	
-					'model'      => $result['model'],
-					'option'     => $option_data,
-					'price'      => $result['price']
-				);	
-			}
-		}
-
-		$this->response->setOutput(json_encode($json));
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/controller/sale/contact.php
===================================================================
--- trunk/www/admin/controller/sale/contact.php	(revision 19)
+++ trunk/www/admin/controller/sale/contact.php	(revision 20)
@@ -1,267 +0,0 @@
-<?php 
-class ControllerSaleContact extends Controller {
-	private $error = array();
-	 
-	public function index() {
-		$this->language->load('sale/contact');
- 
-		$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->data['heading_title'] = $this->language->get('heading_title');
-		
-		$this->data['text_default'] = $this->language->get('text_default');
-		$this->data['text_newsletter'] = $this->language->get('text_newsletter');
-		$this->data['text_customer_all'] = $this->language->get('text_customer_all');	
-		$this->data['text_customer'] = $this->language->get('text_customer');	
-		$this->data['text_customer_group'] = $this->language->get('text_customer_group');
-		$this->data['text_affiliate_all'] = $this->language->get('text_affiliate_all');	
-		$this->data['text_affiliate'] = $this->language->get('text_affiliate');	
-		$this->data['text_product'] = $this->language->get('text_product');	
-
-		$this->data['entry_store'] = $this->language->get('entry_store');
-		$this->data['entry_to'] = $this->language->get('entry_to');
-		$this->data['entry_customer_group'] = $this->language->get('entry_customer_group');
-		$this->data['entry_customer'] = $this->language->get('entry_customer');
-		$this->data['entry_affiliate'] = $this->language->get('entry_affiliate');
-		$this->data['entry_product'] = $this->language->get('entry_product');
-		$this->data['entry_subject'] = $this->language->get('entry_subject');
-		$this->data['entry_message'] = $this->language->get('entry_message');
-		
-		$this->data['button_send'] = $this->language->get('button_send');
-		$this->data['button_cancel'] = $this->language->get('button_cancel');
-		
-		$this->data['token'] = $this->session->data['token'];
-
-  		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => false
-   		);
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('sale/contact', 'token=' . $this->session->data['token'], 'SSL'),
-      		'separator' => ' :: '
-   		);
-				
-    	$this->data['cancel'] = $this->url->link('sale/contact', 'token=' . $this->session->data['token'], 'SSL');
-		
-		$this->load->model('setting/store');
-		
-		$this->data['stores'] = $this->model_setting_store->getStores();
-		
-		$this->load->model('sale/customer_group');
-				
-		$this->data['customer_groups'] = $this->model_sale_customer_group->getCustomerGroups(0);
-				
-		$this->template = 'sale/contact.tpl';
-		$this->children = array(
-			'common/header',
-			'common/footer'
-		);
-				
-		$this->response->setOutput($this->render());
-	}
-	
-	public function send() {
-		$this->language->load('sale/contact');
-		
-		$json = array();
-		
-		if ($this->request->server['REQUEST_METHOD'] == 'POST') {
-			if (!$this->user->hasPermission('modify', 'sale/contact')) {
-				$json['error']['warning'] = $this->language->get('error_permission');
-			}
-					
-			if (!$this->request->post['subject']) {
-				$json['error']['subject'] = $this->language->get('error_subject');
-			}
-	
-			if (!$this->request->post['message']) {
-				$json['error']['message'] = $this->language->get('error_message');
-			}
-			
-			if (!$json) {
-				$this->load->model('setting/store');
-			
-				$store_info = $this->model_setting_store->getStore($this->request->post['store_id']);			
-				
-				if ($store_info) {
-					$store_name = $store_info['name'];
-				} else {
-					$store_name = $this->config->get('config_name');
-				}
-	
-				$this->load->model('sale/customer');
-				
-				$this->load->model('sale/customer_group');
-				
-				$this->load->model('sale/affiliate');
-	
-				$this->load->model('sale/order');
-	
-				if (isset($this->request->get['page'])) {
-					$page = $this->request->get['page'];
-				} else {
-					$page = 1;
-				}
-								
-				$email_total = 0;
-							
-				$emails = array();
-				
-				switch ($this->request->post['to']) {
-					case 'newsletter':
-						$customer_data = array(
-							'filter_newsletter' => 1,
-							'start'             => ($page - 1) * 10,
-							'limit'             => 10
-						);
-						
-						$email_total = $this->model_sale_customer->getTotalCustomers($customer_data);
-							
-						$results = $this->model_sale_customer->getCustomers($customer_data);
-					
-						foreach ($results as $result) {
-							$emails[] = $result['email'];
-						}
-						
-						// Newsletter subscribers
-					$results = $this->model_sale_customer->getNewsletterSubscribers();
-					    
-						foreach ($results as $result) {
-							$emails["s".$result['id']] = $result['email_id'];
-						}
- 				   // Newsletter subscribers only
-						
-						
-						break;
-					case 'customer_all':
-						$customer_data = array(
-							'start'  => ($page - 1) * 10,
-							'limit'  => 10
-						);
-									
-						$email_total = $this->model_sale_customer->getTotalCustomers($customer_data);
-										
-						$results = $this->model_sale_customer->getCustomers($customer_data);
-				
-						foreach ($results as $result) {
-							$emails[] = $result['email'];
-						}						
-						break;
-					case 'customer_group':
-						$customer_data = array(
-							'filter_customer_group_id' => $this->request->post['customer_group_id'],
-							'start'                    => ($page - 1) * 10,
-							'limit'                    => 10
-						);
-						
-						$email_total = $this->model_sale_customer->getTotalCustomers($customer_data);
-										
-						$results = $this->model_sale_customer->getCustomers($customer_data);
-				
-						foreach ($results as $result) {
-							$emails[$result['customer_id']] = $result['email'];
-						}						
-						break;
-					case 'customer':
-						if (!empty($this->request->post['customer'])) {					
-							foreach ($this->request->post['customer'] as $customer_id) {
-								$customer_info = $this->model_sale_customer->getCustomer($customer_id);
-								
-								if ($customer_info) {
-									$emails[] = $customer_info['email'];
-								}
-							}
-						}
-						break;	
-					case 'affiliate_all':
-						$affiliate_data = array(
-							'start'  => ($page - 1) * 10,
-							'limit'  => 10
-						);
-						
-						$email_total = $this->model_sale_affiliate->getTotalAffiliates($affiliate_data);		
-						
-						$results = $this->model_sale_affiliate->getAffiliates($affiliate_data);
-				
-						foreach ($results as $result) {
-							$emails[] = $result['email'];
-						}						
-						break;	
-					case 'affiliate':
-						if (!empty($this->request->post['affiliate'])) {					
-							foreach ($this->request->post['affiliate'] as $affiliate_id) {
-								$affiliate_info = $this->model_sale_affiliate->getAffiliate($affiliate_id);
-								
-								if ($affiliate_info) {
-									$emails[] = $affiliate_info['email'];
-								}
-							}
-						}
-						break;											
-					case 'product':
-						if (isset($this->request->post['product'])) {
-							$email_total = $this->model_sale_order->getTotalEmailsByProductsOrdered($this->request->post['product']);	
-							
-							$results = $this->model_sale_order->getEmailsByProductsOrdered($this->request->post['product'], ($page - 1) * 10, 10);
-													
-							foreach ($results as $result) {
-								$emails[] = $result['email'];
-							}
-						}
-						break;												
-				}
-				
-				if ($emails) {
-					$start = ($page - 1) * 10;
-					$end = $start + 10;
-					
-					if ($end < $email_total) {
-						$json['success'] = sprintf($this->language->get('text_sent'), $start, $email_total);
-					} else { 
-						$json['success'] = $this->language->get('text_success');
-					}				
-						
-					if ($end < $email_total) {
-						$json['next'] = str_replace('&amp;', '&', $this->url->link('sale/contact/send', 'token=' . $this->session->data['token'] . '&page=' . ($page + 1), 'SSL'));
-					} else {
-						$json['next'] = '';
-					}
-										
-					$message  = '<html dir="ltr" lang="en">' . "\n";
-					$message .= '  <head>' . "\n";
-					$message .= '    <title>' . $this->request->post['subject'] . '</title>' . "\n";
-					$message .= '    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">' . "\n";
-					$message .= '  </head>' . "\n";
-					$message .= '  <body>' . html_entity_decode($this->request->post['message'], ENT_QUOTES, 'UTF-8') . '</body>' . "\n";
-					$message .= '</html>' . "\n";
-					
-					foreach ($emails as $email) {
-						$mail = new Mail();	
-						$mail->protocol = $this->config->get('config_mail_protocol');
-						$mail->parameter = $this->config->get('config_mail_parameter');
-						$mail->hostname = $this->config->get('config_smtp_host');
-						$mail->username = $this->config->get('config_smtp_username');
-						$mail->password = $this->config->get('config_smtp_password');
-						$mail->port = $this->config->get('config_smtp_port');
-						$mail->timeout = $this->config->get('config_smtp_timeout');				
-						$mail->setTo($email);
-						$mail->setFrom($this->config->get('config_email'));
-						$mail->setSender($store_name);
-						$mail->setSubject(html_entity_decode($this->request->post['subject'], ENT_QUOTES, 'UTF-8'));					
-						
-						$mail->setHtml($message);
-						$mail->send();
-					}
-				}
-			}
-		}
-		
-		$this->response->setOutput(json_encode($json));	
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/admin/controller/module/dresscode_featured_multi.php
===================================================================
--- trunk/www/admin/controller/module/dresscode_featured_multi.php	(revision 0)
+++ trunk/www/admin/controller/module/dresscode_featured_multi.php	(revision 20)
@@ -0,0 +1,147 @@
+<?php
+class ControllerModuleDresscodeFeaturedMulti extends Controller {
+	private $error = array(); 
+	
+	public function index() {   
+		$this->language->load('module/dresscode_featured_multi');
+
+		$this->document->setTitle($this->language->get('heading_title'));
+		
+		$this->load->model('setting/setting');
+				
+		if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {			
+			$this->model_setting_setting->editSetting('dresscode_featured_multi', $this->request->post);
+			
+			$this->session->data['success'] = $this->language->get('text_success');
+			
+			$this->redirect($this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'));
+		}
+				
+		$this->data['heading_title'] = $this->language->get('heading_title');
+
+		$this->data['text_enabled'] = $this->language->get('text_enabled');
+		$this->data['text_disabled'] = $this->language->get('text_disabled');
+		$this->data['text_content_top'] = $this->language->get('text_content_top');
+		$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');		
+		$this->data['text_column_left'] = $this->language->get('text_column_left');
+		$this->data['text_column_right'] = $this->language->get('text_column_right');
+		
+		$this->data['entry_product'] = $this->language->get('entry_product');
+		$this->data['entry_limit'] = $this->language->get('entry_limit');
+		$this->data['entry_image'] = $this->language->get('entry_image');
+		$this->data['entry_layout'] = $this->language->get('entry_layout');
+		$this->data['entry_position'] = $this->language->get('entry_position');
+		$this->data['entry_status'] = $this->language->get('entry_status');
+		$this->data['entry_sort_order'] = $this->language->get('entry_sort_order');
+		
+		$this->data['button_save'] = $this->language->get('button_save');
+		$this->data['button_cancel'] = $this->language->get('button_cancel');
+		$this->data['button_add_module'] = $this->language->get('button_add_module');
+		$this->data['button_remove'] = $this->language->get('button_remove');
+		
+ 		if (isset($this->error['warning'])) {
+			$this->data['error_warning'] = $this->error['warning'];
+		} else {
+			$this->data['error_warning'] = '';
+		}
+		
+		if (isset($this->error['image'])) {
+			$this->data['error_image'] = $this->error['image'];
+		} else {
+			$this->data['error_image'] = array();
+		}
+				
+  		$this->data['breadcrumbs'] = array();
+
+   		$this->data['breadcrumbs'][] = array(
+       		'text'      => $this->language->get('text_home'),
+			'href'      => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
+      		'separator' => false
+   		);
+
+   		$this->data['breadcrumbs'][] = array(
+       		'text'      => $this->language->get('text_module'),
+			'href'      => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'),
+      		'separator' => ' :: '
+   		);
+		
+   		$this->data['breadcrumbs'][] = array(
+       		'text'      => $this->language->get('heading_title'),
+			'href'      => $this->url->link('module/dresscode_featured_multi', 'token=' . $this->session->data['token'], 'SSL'),
+      		'separator' => ' :: '
+   		);
+		
+		$this->data['action'] = $this->url->link('module/dresscode_featured_multi', 'token=' . $this->session->data['token'], 'SSL');
+		
+		$this->data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
+
+		$this->data['token'] = $this->session->data['token'];
+
+		if (isset($this->request->post['featured_product'])) {
+			$this->data['dresscode_featured_multi_product'] = $this->request->post['dresscode_featured_multi_product'];
+		} else {
+			$this->data['dresscode_featured_multi_product'] = $this->config->get('dresscode_featured_multi_product');
+		}	
+				
+		$this->load->model('catalog/product');
+				
+		if (isset($this->request->post['dresscode_featured_multi_product'])) {
+			$products = explode(',', $this->request->post['dresscode_featured_multi_product']);
+		} else {		
+			$products = explode(',', $this->config->get('dresscode_featured_multi_product'));
+		}
+		
+		$this->data['products'] = array();
+		
+		foreach ($products as $product_id) {
+			$product_info = $this->model_catalog_product->getProduct($product_id);
+			
+			if ($product_info) {
+				$this->data['products'][] = array(
+					'product_id' => $product_info['product_id'],
+					'name'       => $product_info['name']
+				);
+			}
+		}	
+			
+		$this->data['modules'] = array();
+		
+		if (isset($this->request->post['dresscode_featured_multi_module'])) {
+			$this->data['modules'] = $this->request->post['dresscode_featured_multi_module'];
+		} elseif ($this->config->get('dresscode_featured_multi_module')) {
+			$this->data['modules'] = $this->config->get('dresscode_featured_multi_module');
+		}		
+				
+		$this->load->model('design/layout');
+		
+		$this->data['layouts'] = $this->model_design_layout->getLayouts();
+
+		$this->template = 'module/dresscode_featured_multi.tpl';
+		$this->children = array(
+			'common/header',
+			'common/footer'
+		);
+				
+		$this->response->setOutput($this->render());
+	}
+	
+	protected function validate() {
+		if (!$this->user->hasPermission('modify', 'module/dresscode_featured_multi')) {
+			$this->error['warning'] = $this->language->get('error_permission');
+		}
+		
+		if (isset($this->request->post['dresscode_featured_multi_module'])) {
+			foreach ($this->request->post['dresscode_featured_multi_module'] as $key => $value) {
+				if (!$value['image_width'] || !$value['image_height']) {
+					$this->error['image'][$key] = $this->language->get('error_image');
+				}
+			}
+		}
+				
+		if (!$this->error) {
+			return true;
+		} else {
+			return false;
+		}	
+	}
+}
\ No newline at end of file
Index: trunk/www/admin/language/english/common/header.php
===================================================================
--- trunk/www/admin/language/english/common/header.php	(revision 19)
+++ trunk/www/admin/language/english/common/header.php	(revision 20)
@@ -1,87 +0,0 @@
-<?php
-// Heading
-$_['heading_title']                    = 'Administration';
-
-// Text
-$_['text_affiliate']                   = 'Affiliates';
-$_['text_attribute']                   = 'Attributes';
-$_['text_attribute_group']             = 'Attribute Groups';
-$_['text_backup']                      = 'Backup / Restore';
-$_['text_banner']                      = 'Banners';
-$_['text_catalog']                     = 'Catalog';
-$_['text_category']                    = 'Categories';
-$_['text_confirm']			           = 'Delete/Uninstall cannot be undone! Are you sure you want to do this?';
-$_['text_country']                     = 'Countries';
-$_['text_coupon']                      = 'Coupons';
-$_['text_currency']                    = 'Currencies';
-$_['text_customer']                    = 'Customers';
-$_['text_customer_group']              = 'Customer Groups';
-$_['text_customer_ban_ip']             = 'Banned IP';
-$_['text_custom_field']                = 'Custom Fields';
-$_['text_dashboard']                   = 'Dashboard';
-$_['text_design']                      = 'Design';
-$_['text_download']                    = 'Downloads';
-$_['text_error_log']                   = 'Error Logs';
-$_['text_extension']                   = 'Extensions';
-$_['text_feed']                        = 'Product Feeds';
-$_['text_filter']                      = 'Filters';
-$_['text_front']                       = 'Store Front';
-$_['text_geo_zone']                    = 'Geo Zones';
-$_['text_help']                        = 'Help';
-$_['text_information']                 = 'Information';
-$_['text_language']                    = 'Languages';
-$_['text_layout']                      = 'Layouts';
-$_['text_localisation']                = 'Localisation';
-$_['text_logged']                      = 'You are logged in as <span>%s</span>';
-$_['text_logout']                      = 'Logout';
-$_['text_contact']                     = 'Mail';
-$_['text_manager']                     = 'Extension Manager';
-$_['text_manufacturer']                = 'Manufacturers';
-$_['text_module']                      = 'Modules';
-$_['text_option']                      = 'Options';
-$_['text_order']                       = 'Orders';
-$_['text_order_status']                = 'Order Statuses';
-$_['text_opencart']                    = 'Homepage';
-$_['text_payment']                     = 'Payments';
-$_['text_product']                     = 'Products';
-$_['text_reports']                     = 'Reports';
-$_['text_report_sale_order']           = 'Orders';
-$_['text_report_sale_tax']             = 'Tax';
-$_['text_report_sale_shipping']        = 'Shipping';
-$_['text_report_sale_return']          = 'Returns';
-$_['text_report_sale_coupon']          = 'Coupons';
-$_['text_report_product_viewed']       = 'Viewed';
-$_['text_report_product_purchased']    = 'Purchased';
-$_['text_report_customer_online']      = 'Customers Online';
-$_['text_report_customer_order']       = 'Orders';
-$_['text_report_customer_reward']      = 'Reward Points';
-$_['text_report_customer_credit']      = 'Credit';
-$_['text_report_affiliate_commission'] = 'Commission';
-$_['text_review']                      = 'Reviews';
-$_['text_return']                      = 'Returns';
-$_['text_return_action']               = 'Return Actions';
-$_['text_return_reason']               = 'Return Reasons';
-$_['text_return_status']               = 'Return Statuses';
-$_['text_sale']                        = 'Sales';
-$_['text_shipping']                    = 'Shipping';
-$_['text_setting']                     = 'Settings';
-$_['text_stock_status']                = 'Stock Statuses';
-$_['text_support']                     = 'Support Forum';
-$_['text_system']                      = 'System';
-$_['text_tax']                         = 'Taxes';
-$_['text_tax_class']                   = 'Tax Classes';
-$_['text_tax_rate']                    = 'Tax Rates';
-$_['text_total']                       = 'Order Totals';
-$_['text_user']                        = 'Users';
-$_['text_documentation']               = 'Documentation';
-$_['text_users']                       = 'Users';
-$_['text_user_group']                  = 'User Groups';
-$_['text_voucher']                     = 'Gift Vouchers';
-$_['text_voucher_theme']               = 'Voucher Themes';
-$_['text_weight_class']                = 'Weight Classes';
-$_['text_length_class']                = 'Length Classes';
-$_['text_zone']                        = 'Zones';
-//Newsletter Subscribers
-$_['text_newssubscribe']     = 'Newsletter Subscribers';
-//Newsletter Subscribers
-?>
\ No newline at end of file
Index: trunk/www/admin/language/english/catalog/product.php
===================================================================
--- trunk/www/admin/language/english/catalog/product.php	(revision 19)
+++ trunk/www/admin/language/english/catalog/product.php	(revision 20)
@@ -1,85 +0,0 @@
-<?php
-// Heading
-$_['heading_title']          = 'Products'; 
-
-// Text  
-$_['text_success']           = 'Success: You have modified products!';
-$_['text_plus']              = '+';
-$_['text_minus']             = '-';
-$_['text_default']           = 'Default';
-$_['text_image_manager']     = 'Image Manager';
-$_['text_browse']            = 'Browse';
-$_['text_clear']             = 'Clear';
-$_['text_option']            = 'Option';
-$_['text_option_value']      = 'Option Value';
-$_['text_percent']           = 'Percentage';
-$_['text_amount']            = 'Fixed Amount';
-
-// Column
-$_['column_name']            = 'Product Name';
-$_['column_model']           = 'Model';
-$_['column_image']           = 'Image';
-$_['column_price']           = 'Price';
-$_['column_quantity']        = 'Quantity';
-$_['column_status']          = 'Status';
-$_['column_action']          = 'Action';
-
-// Entry
-$_['entry_name']             = 'Product Name:';
-$_['entry_meta_keyword'] 	 = 'Meta Tag Keywords:';
-$_['entry_meta_description'] = 'Meta Tag Description:';
-$_['entry_description']      = 'Description:';
-$_['entry_store']            = 'Stores:';
-$_['entry_keyword']          = 'SEO Keyword:<br /><span class="help">Do not use spaces instead replace spaces with - and make sure the keyword is globally unique.</span>';
-$_['entry_model']            = 'Model:';
-$_['entry_sku']              = 'SKU:<br/><span class="help">Stock Keeping Unit</span>';
-$_['entry_upc']              = 'UPC:<br/><span class="help">Universal Product Code</span>';
-$_['entry_ean']              = 'EAN:<br/><span class="help">European Article Number</span>';
-$_['entry_jan']              = 'JAN:<br/><span class="help">Japanese Article Number</span>';
-$_['entry_isbn']             = 'ISBN:<br/><span class="help">International Standard Book Number</span>';
-$_['entry_mpn']              = 'MPN:<br/><span class="help">Manufacturer Part Number</span>';
-$_['entry_location']         = 'Location:';
-$_['entry_shipping']         = 'Requires Shipping:'; 
-$_['entry_manufacturer']     = 'Manufacturer:<br /><span class="help">(Autocomplete)</span>';
-$_['entry_date_available']   = 'Date Available:';
-$_['entry_quantity']         = 'Quantity:';
-$_['entry_minimum']          = 'Minimum Quantity:<br/><span class="help">Force a minimum ordered amount</span>';
-$_['entry_stock_status']     = 'Out Of Stock Status:<br/><span class="help">Status shown when a product is out of stock</span>';
-$_['entry_price']            = 'Price:';
-$_['entry_tax_class']        = 'Tax Class:';
-$_['entry_points']           = 'Points:<br/><span class="help">Number of points needed to buy this item. If you don\'t want this product to be purchased with points leave as 0.</span>';
-$_['entry_option_points']    = 'Points:';
-$_['entry_subtract']         = 'Subtract Stock:';
-$_['entry_weight_class']     = 'Weight Class:';
-$_['entry_weight']           = 'Weight:';
-$_['entry_length']           = 'Length Class:';
-$_['entry_dimension']        = 'Dimensions (L x W x H):';
-$_['entry_image']            = 'Image:';
-$_['entry_customer_group']   = 'Customer Group:';
-$_['entry_date_start']       = 'Date Start:';
-$_['entry_date_end']         = 'Date End:';
-$_['entry_priority']         = 'Priority:';
-$_['entry_attribute']        = 'Attribute:';
-$_['entry_attribute_group']  = 'Attribute Group:';
-$_['entry_text']             = 'Text:';
-$_['entry_option']           = 'Option:';
-$_['entry_option_value']     = 'Option Value:';
-$_['entry_required']         = 'Required:';
-$_['entry_status']           = 'Status:';
-$_['entry_sort_order']       = 'Sort Order:';
-$_['entry_category']         = 'Categories:<br /><span class="help">(Autocomplete)</span>';
-$_['entry_filter']           = 'Filters:<br /><span class="help">(Autocomplete)</span>';
-$_['entry_download']         = 'Downloads:<br /><span class="help">(Autocomplete)</span>';
-$_['entry_related']          = 'Related Products:<br /><span class="help">(Autocomplete)</span>';
-$_['entry_tag']          	 = 'Product Tags:<br /><span class="help">comma separated</span>';
-$_['entry_reward']           = 'Reward Points:';
-$_['entry_layout']           = 'Layout Override:';
-
-// Error
-$_['error_warning']          = 'Warning: Please check the form carefully for errors!';
-$_['error_permission']       = 'Warning: You do not have permission to modify products!';
-$_['error_name']             = 'Product Name must be greater than 3 and less than 255 characters!';
-$_['error_model']            = 'Product Model must be greater than 3 and less than 64 characters!';
-
-$_['tab_youtube'] = 'Youtube Product';
-?>
\ No newline at end of file
Index: trunk/www/admin/language/english/module/dresscode_featured_multi.php
===================================================================
--- trunk/www/admin/language/english/module/dresscode_featured_multi.php	(revision 0)
+++ trunk/www/admin/language/english/module/dresscode_featured_multi.php	(revision 20)
@@ -0,0 +1,24 @@
+<?php
+// Heading
+$_['heading_title']       = 'Dresscode Featured Products Module';
+
+// Text
+$_['text_module']         = 'Modules';
+$_['text_success']        = 'Success: You have modified the module!';
+$_['text_content_top']    = 'Content Top';
+$_['text_content_bottom'] = 'Content Bottom';
+$_['text_column_left']    = 'Column Left';
+$_['text_column_right']   = 'Column Right';
+
+// Entry
+$_['entry_product']       = 'Products:<br /><span class="help">(Autocomplete)</span>';
+$_['entry_limit']         = 'Limit:';
+$_['entry_image']         = 'Image (W x H):';
+$_['entry_layout']        = 'Layout:';
+$_['entry_position']      = 'Position:';
+$_['entry_status']        = 'Status:';
+$_['entry_sort_order']    = 'Sort Order:';
+
+// Error 
+$_['error_permission']    = 'Warning: You do not have permission to modify the module!';
+$_['error_image']         = 'Image width &amp; height dimensions required!';
\ No newline at end of file
Index: trunk/www/admin/view/template/common/header.tpl
===================================================================
--- trunk/www/admin/view/template/common/header.tpl	(revision 19)
+++ trunk/www/admin/view/template/common/header.tpl	(revision 20)
@@ -1,218 +0,0 @@
-<!DOCTYPE html>
-<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
-<head>
-<meta charset="UTF-8" />
-<title><?php echo $title; ?></title>
-<base href="<?php echo $base; ?>" />
-<?php if ($description) { ?>
-<meta name="description" content="<?php echo $description; ?>" />
-<?php } ?>
-<?php if ($keywords) { ?>
-<meta name="keywords" content="<?php echo $keywords; ?>" />
-<?php } ?>
-<?php foreach ($links as $link) { ?>
-<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
-<?php } ?>
-<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" />
-<?php foreach ($styles as $style) { ?>
-<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
-<?php } ?>
-<script type="text/javascript" src="view/javascript/jquery/jquery-1.7.1.min.js"></script>
-<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
-<link type="text/css" href="view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
-<script type="text/javascript" src="view/javascript/jquery/tabs.js"></script>
-<script type="text/javascript" src="view/javascript/jquery/superfish/js/superfish.js"></script>
-<script type="text/javascript" src="view/javascript/common.js"></script>
-<?php foreach ($scripts as $script) { ?>
-<script type="text/javascript" src="<?php echo $script; ?>"></script>
-<?php } ?>
-<script type="text/javascript">
-//-----------------------------------------
-// Confirm Actions (delete, uninstall)
-//-----------------------------------------
-$(document).ready(function(){
-    // Confirm Delete
-    $('#form').submit(function(){
-        if ($(this).attr('action').indexOf('delete',1) != -1) {
-            if (!confirm('<?php echo $text_confirm; ?>')) {
-                return false;
-            }
-        }
-    });
-    	
-    // Confirm Uninstall
-    $('a').click(function(){
-        if ($(this).attr('href') != null && $(this).attr('href').indexOf('uninstall', 1) != -1) {
-            if (!confirm('<?php echo $text_confirm; ?>')) {
-                return false;
-            }
-        }
-    });
-});
-</script>
-</head>
-<body>
-<div id="container">
-<div id="header">
-  <div class="div1">
-    <div class="div2"><img src="view/image/logo.png" title="<?php echo $heading_title; ?>" onclick="location = '<?php echo $home; ?>'" /></div>
-    <?php if ($logged) { ?>
-    <div class="div3"><img src="view/image/lock.png" alt="" style="position: relative; top: 3px;" />&nbsp;<?php echo $logged; ?></div>
-    <?php } ?>
-  </div>
-  <?php if ($logged) { ?>
-  <div id="menu">
-    <ul class="left" style="display: none;">
-      <li id="dashboard"><a href="<?php echo $home; ?>" class="top"><?php echo $text_dashboard; ?></a></li>
-      <li id="catalog"><a class="top"><?php echo $text_catalog; ?></a>
-        <ul>
-          <li><a href="<?php echo $category; ?>"><?php echo $text_category; ?></a></li>
-          <li><a href="<?php echo $product; ?>"><?php echo $text_product; ?></a></li>
-          <li><a href="<?php echo $filter; ?>"><?php echo $text_filter; ?></a></li>
-          <li><a class="parent"><?php echo $text_attribute; ?></a>
-            <ul>
-              <li><a href="<?php echo $attribute; ?>"><?php echo $text_attribute; ?></a></li>
-              <li><a href="<?php echo $attribute_group; ?>"><?php echo $text_attribute_group; ?></a></li>
-            </ul>
-          </li>
-          <li><a href="<?php echo $option; ?>"><?php echo $text_option; ?></a></li>
-          <li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li>
-          <li><a href="<?php echo $download; ?>"><?php echo $text_download; ?></a></li>
-          <li><a href="<?php echo $review; ?>"><?php echo $text_review; ?></a></li>
-          <li><a href="<?php echo $information; ?>"><?php echo $text_information; ?></a></li>
-        </ul>
-      </li>
-      <li id="extension"><a class="top"><?php echo $text_extension; ?></a>
-        <ul>
-          <li><a href="<?php echo $module; ?>"><?php echo $text_module; ?></a></li>
-          <li><a href="<?php echo $shipping; ?>"><?php echo $text_shipping; ?></a></li>
-          <li><a href="<?php echo $payment; ?>"><?php echo $text_payment; ?></a></li>
-          <li><a href="<?php echo $total; ?>"><?php echo $text_total; ?></a></li>
-          <li><a href="<?php echo $feed; ?>"><?php echo $text_feed; ?></a></li>
-        </ul>
-      </li>
-      <li id="sale"><a class="top"><?php echo $text_sale; ?></a>
-        <ul>
-          <li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li>
-          <li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li>
-          <li><a class="parent"><?php echo $text_customer; ?></a>
-            <ul>
-              <li><a href="<?php echo $customer; ?>"><?php echo $text_customer; ?></a></li>
-              <li><a href="<?php echo $customer_group; ?>"><?php echo $text_customer_group; ?></a></li>
-              <li><a href="<?php echo $customer_ban_ip; ?>"><?php echo $text_customer_ban_ip; ?></a></li>
-            </ul>
-          </li>
-          <li><a href="<?php echo $affiliate; ?>"><?php echo $text_affiliate; ?></a></li>
-          <li><a href="<?php echo $coupon; ?>"><?php echo $text_coupon; ?></a></li>
-          <li><a class="parent"><?php echo $text_voucher; ?></a>
-            <ul>
-              <li><a href="<?php echo $voucher; ?>"><?php echo $text_voucher; ?></a></li>
-              <li><a href="<?php echo $voucher_theme; ?>"><?php echo $text_voucher_theme; ?></a></li>
-            </ul>
-          </li>
-		  
-		  		  <!--        //Newsletter Subscribers-->
-    	  <li><a href="<?php echo $newssubscribe; ?>"><?php echo $text_newssubscribe; ?></a></li>
-		  <!--        //Newsletter Subscribers-->  
-		  
-          <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
-        </ul>
-      </li>
-      <li id="system"><a class="top"><?php echo $text_system; ?></a>
-        <ul>
-          <li><a href="<?php echo $setting; ?>"><?php echo $text_setting; ?></a></li>
-          <li><a class="parent"><?php echo $text_design; ?></a>
-            <ul>
-              <li><a href="<?php echo $layout; ?>"><?php echo $text_layout; ?></a></li>
-              <li><a href="<?php echo $banner; ?>"><?php echo $text_banner; ?></a></li>
-            </ul>
-          </li>
-          <li><a class="parent"><?php echo $text_users; ?></a>
-            <ul>
-              <li><a href="<?php echo $user; ?>"><?php echo $text_user; ?></a></li>
-              <li><a href="<?php echo $user_group; ?>"><?php echo $text_user_group; ?></a></li>
-            </ul>
-          </li>
-          <li><a class="parent"><?php echo $text_localisation; ?></a>
-            <ul>
-              <li><a href="<?php echo $language; ?>"><?php echo $text_language; ?></a></li>
-              <li><a href="<?php echo $currency; ?>"><?php echo $text_currency; ?></a></li>
-              <li><a href="<?php echo $stock_status; ?>"><?php echo $text_stock_status; ?></a></li>
-              <li><a href="<?php echo $order_status; ?>"><?php echo $text_order_status; ?></a></li>
-              <li><a class="parent"><?php echo $text_return; ?></a>
-                <ul>
-                  <li><a href="<?php echo $return_status; ?>"><?php echo $text_return_status; ?></a></li>
-                  <li><a href="<?php echo $return_action; ?>"><?php echo $text_return_action; ?></a></li>
-                  <li><a href="<?php echo $return_reason; ?>"><?php echo $text_return_reason; ?></a></li>
-                </ul>
-              </li>
-              <li><a href="<?php echo $country; ?>"><?php echo $text_country; ?></a></li>
-              <li><a href="<?php echo $zone; ?>"><?php echo $text_zone; ?></a></li>
-              <li><a href="<?php echo $geo_zone; ?>"><?php echo $text_geo_zone; ?></a></li>
-              <li><a class="parent"><?php echo $text_tax; ?></a>
-                <ul>
-                  <li><a href="<?php echo $tax_class; ?>"><?php echo $text_tax_class; ?></a></li>
-                  <li><a href="<?php echo $tax_rate; ?>"><?php echo $text_tax_rate; ?></a></li>
-                </ul>
-              </li>
-              <li><a href="<?php echo $length_class; ?>"><?php echo $text_length_class; ?></a></li>
-              <li><a href="<?php echo $weight_class; ?>"><?php echo $text_weight_class; ?></a></li>
-            </ul>
-          </li>
-          <li><a href="<?php echo $error_log; ?>"><?php echo $text_error_log; ?></a></li>
-          <li><a href="<?php echo $backup; ?>"><?php echo $text_backup; ?></a></li>
-        </ul>
-      </li>
-      <li id="reports"><a class="top"><?php echo $text_reports; ?></a>
-        <ul>
-          <li><a class="parent"><?php echo $text_sale; ?></a>
-            <ul>
-              <li><a href="<?php echo $report_sale_order; ?>"><?php echo $text_report_sale_order; ?></a></li>
-              <li><a href="<?php echo $report_sale_tax; ?>"><?php echo $text_report_sale_tax; ?></a></li>
-              <li><a href="<?php echo $report_sale_shipping; ?>"><?php echo $text_report_sale_shipping; ?></a></li>
-              <li><a href="<?php echo $report_sale_return; ?>"><?php echo $text_report_sale_return; ?></a></li>
-              <li><a href="<?php echo $report_sale_coupon; ?>"><?php echo $text_report_sale_coupon; ?></a></li>
-            </ul>
-          </li>
-          <li><a class="parent"><?php echo $text_product; ?></a>
-            <ul>
-              <li><a href="<?php echo $report_product_viewed; ?>"><?php echo $text_report_product_viewed; ?></a></li>
-              <li><a href="<?php echo $report_product_purchased; ?>"><?php echo $text_report_product_purchased; ?></a></li>
-            </ul>
-          </li>
-          <li><a class="parent"><?php echo $text_customer; ?></a>
-            <ul>
-              <li><a href="<?php echo $report_customer_online; ?>"><?php echo $text_report_customer_online; ?></a></li>
-              <li><a href="<?php echo $report_customer_order; ?>"><?php echo $text_report_customer_order; ?></a></li>
-              <li><a href="<?php echo $report_customer_reward; ?>"><?php echo $text_report_customer_reward; ?></a></li>
-              <li><a href="<?php echo $report_customer_credit; ?>"><?php echo $text_report_customer_credit; ?></a></li>
-            </ul>
-          </li>
-          <li><a class="parent"><?php echo $text_affiliate; ?></a>
-            <ul>
-              <li><a href="<?php echo $report_affiliate_commission; ?>"><?php echo $text_report_affiliate_commission; ?></a></li>
-            </ul>
-          </li>
-        </ul>
-      </li>
-      <li id="help"><a class="top"><?php echo $text_help; ?></a>
-        <ul>
-          <li><a href="http://www.opencart.com" target="_blank"><?php echo $text_opencart; ?></a></li>
-          <li><a href="http://www.opencart.com/index.php?route=documentation/introduction" target="_blank"><?php echo $text_documentation; ?></a></li>
-          <li><a href="http://forum.opencart.com" target="_blank"><?php echo $text_support; ?></a></li>
-        </ul>
-      </li>
-    </ul>
-    <ul class="right" style="display: none;">
-      <li id="store"><a href="<?php echo $store; ?>" target="_blank" class="top"><?php echo $text_front; ?></a>
-        <ul>
-          <?php foreach ($stores as $stores) { ?>
-          <li><a href="<?php echo $stores['href']; ?>" target="_blank"><?php echo $stores['name']; ?></a></li>
-          <?php } ?>
-        </ul>
-      </li>
-      <li><a class="top" href="<?php echo $logout; ?>"><?php echo $text_logout; ?></a></li>
-    </ul>
-  </div>
-  <?php } ?>
-</div>
Index: trunk/www/admin/view/template/design/banner_form.tpl
===================================================================
--- trunk/www/admin/view/template/design/banner_form.tpl	(revision 19)
+++ trunk/www/admin/view/template/design/banner_form.tpl	(revision 20)
@@ -1,144 +0,0 @@
-<?php echo $header; ?>
-<div id="content">
-  <div class="breadcrumb">
-    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
-    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
-    <?php } ?>
-  </div>
-  <?php if ($error_warning) { ?>
-  <div class="warning"><?php echo $error_warning; ?></div>
-  <?php } ?>
-  <div class="box">
-    <div class="heading">
-      <h1><img src="view/image/banner.png" alt="" /> <?php echo $heading_title; ?></h1>
-      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
-    </div>
-    <div class="content">
-      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
-        <table class="form">
-          <tr>
-            <td><span class="required">*</span> <?php echo $entry_name; ?></td>
-            <td><input type="text" name="name" value="<?php echo $name; ?>" size="100" />
-              <?php if ($error_name) { ?>
-              <span class="error"><?php echo $error_name; ?></span>
-              <?php } ?></td>
-          </tr>
-          <tr>
-            <td><?php echo $entry_status; ?></td>
-            <td><select name="status">
-                <?php if ($status) { ?>
-                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
-                <option value="0"><?php echo $text_disabled; ?></option>
-                <?php } else { ?>
-                <option value="1"><?php echo $text_enabled; ?></option>
-                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
-                <?php } ?>
-              </select></td>
-          </tr>
-        </table>
-        <table id="images" class="list">
-          <thead>
-            <tr>
-              <td class="left"><?php echo $entry_title; ?></td>
-              <td class="left"><?php echo $entry_link; ?></td>
-              <td class="left"><?php echo $entry_image; ?></td>
-              <td></td>
-            </tr>
-          </thead>
-          <?php $image_row = 0; ?>
-          <?php foreach ($banner_images as $banner_image) { ?>
-          <tbody id="image-row<?php echo $image_row; ?>">
-            <tr>
-              <td class="left"><?php foreach ($languages as $language) { ?>
-                <input type="text" name="banner_image[<?php echo $image_row; ?>][banner_image_description][<?php echo $language['language_id']; ?>][title]" value="<?php echo isset($banner_image['banner_image_description'][$language['language_id']]) ? $banner_image['banner_image_description'][$language['language_id']]['title'] : ''; ?>" />
-                <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /><br />
-                <?php if (isset($error_banner_image[$image_row][$language['language_id']])) { ?>
-                <span class="error"><?php echo $error_banner_image[$image_row][$language['language_id']]; ?></span>
-                <?php } ?>
-                <?php } ?></td>
-              <td class="left"><input type="text" name="banner_image[<?php echo $image_row; ?>][link]" value="<?php echo $banner_image['link']; ?>" /></td>
-              <td class="left"><div class="image"><img src="<?php echo $banner_image['thumb']; ?>" alt="" id="thumb<?php echo $image_row; ?>" />
-                  <input type="hidden" name="banner_image[<?php echo $image_row; ?>][image]" value="<?php echo $banner_image['image']; ?>" id="image<?php echo $image_row; ?>"  />
-                  <br />
-                  <a onclick="image_upload('image<?php echo $image_row; ?>', 'thumb<?php echo $image_row; ?>');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb<?php echo $image_row; ?>').attr('src', '<?php echo $no_image; ?>'); $('#image<?php echo $image_row; ?>').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-              <td class="left"><a onclick="$('#image-row<?php echo $image_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
-            </tr>
-          </tbody>
-          <?php $image_row++; ?>
-          <?php } ?>
-          <tfoot>
-            <tr>
-              <td colspan="3"></td>
-              <td class="left"><a onclick="addImage();" class="button"><?php echo $button_add_banner; ?></a></td>
-            </tr>
-          </tfoot>
-        </table>
-      </form>
-    </div>
-  </div>
-</div>
-<script type="text/javascript"><!--
-var image_row = <?php echo $image_row; ?>;
-
-function addImage() {
-    html  = '<tbody class="MoveableRow" id="image-row' + image_row + '">';
-	html += '<tr>';
-    html += '<td class="left">';
-	<?php foreach ($languages as $language) { ?>
-	html += '<input type="text" name="banner_image[' + image_row + '][banner_image_description][<?php echo $language['language_id']; ?>][title]" value="" /> <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /><br />';
-    <?php } ?>
-	html += '</td>';	
-	html += '<td class="left"><input type="text" name="banner_image[' + image_row + '][link]" value="" /></td>';	
-	html += '<td class="left"><div class="image"><img src="<?php echo $no_image; ?>" alt="" id="thumb' + image_row + '" /><input type="hidden" name="banner_image[' + image_row + '][image]" value="" id="image' + image_row + '" /><br /><a onclick="image_upload(\'image' + image_row + '\', \'thumb' + image_row + '\');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$(\'#thumb' + image_row + '\').attr(\'src\', \'<?php echo $no_image; ?>\'); $(\'#image' + image_row + '\').attr(\'value\', \'\');"><?php echo $text_clear; ?></a></div></td>';
-	html += '<td class="left"><a onclick="$(\'#image-row' + image_row  + '\').remove();" class="button"><?php echo $button_remove; ?></a><a class="down_button button">down</a><a class="up_button button">up</a></td>';
-	html += '</tr>';
-	html += '</tbody>'; 
-	
-	$('#images tfoot').before(html);
-	
-	image_row++;
-}
-//--></script>
-<script type="text/javascript"><!--
-function image_upload(field, thumb) {
-	$('#dialog').remove();
-	
-	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
-	
-	$('#dialog').dialog({
-		title: '<?php echo $text_image_manager; ?>',
-		close: function (event, ui) {
-			if ($('#' + field).attr('value')) {
-				$.ajax({
-					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
-					dataType: 'text',
-					success: function(data) {
-						$('#' + thumb).replaceWith('<img src="' + data + '" alt="" id="' + thumb + '" />');
-					}
-				});
-			}
-		},	
-		bgiframe: false,
-		width: 700,
-		height: 400,
-		resizable: false,
-		modal: false
-	});
-};
-//--></script>
-<script type="text/javascript"><!--
-$(document).ready(function() {
-    $('.down_button').live('click', function () {
-        var rowToMove = $(this).parents('tbody.MoveableRow:first');
-        var next = rowToMove.next('tbody.MoveableRow')
-        if (next.length == 1) { next.after(rowToMove); }
-    });
-
-    $('.up_button').live('click', function () {
-        var rowToMove = $(this).parents('tbody.MoveableRow:first');
-        var prev = rowToMove.prev('tbody.MoveableRow')
-        if (prev.length == 1) { prev.before(rowToMove); }
-    });
-});
-//--></script>
-<?php echo $footer; ?>
\ No newline at end of file
Index: trunk/www/admin/view/template/catalog/product_form.tpl
===================================================================
--- trunk/www/admin/view/template/catalog/product_form.tpl	(revision 19)
+++ trunk/www/admin/view/template/catalog/product_form.tpl	(revision 20)
@@ -1,1266 +0,0 @@
-<?php echo $header; ?>
-<div id="content">
-  <div class="breadcrumb">
-    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
-    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
-    <?php } ?>
-  </div>
-  <?php if ($error_warning) { ?>
-  <div class="warning"><?php echo $error_warning; ?></div>
-  <?php } ?>
-  <div class="box">
-    <div class="heading">
-      <h1><img src="view/image/product.png" alt="" /> <?php echo $heading_title; ?></h1>
-      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
-    </div>
-    <div class="content">
-      <div id="tabs" class="htabs"><a href="#tab-general"><?php echo $tab_general; ?></a><a href="#tab-data"><?php echo $tab_data; ?></a><a href="#tab-links"><?php echo $tab_links; ?></a><a href="#tab-attribute"><?php echo $tab_attribute; ?></a><a href="#tab-option"><?php echo $tab_option; ?></a><a href="#tab-discount"><?php echo $tab_discount; ?></a><a href="#tab-special"><?php echo $tab_special; ?></a><a href="#tab-image"><?php echo $tab_image; ?></a><a href="#tab-reward"><?php echo $tab_reward; ?></a><a href="#tab-design"><?php echo $tab_design; ?></a><a href="#tab-youtube"><?php echo $tab_youtube; ?></a></div>
-      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
-        <div id="tab-general">
-          <div id="languages" class="htabs">
-            <?php foreach ($languages as $language) { ?>
-            <a href="#language<?php echo $language['language_id']; ?>"><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" /> <?php echo $language['name']; ?></a>
-            <?php } ?>
-          </div>
-          <?php foreach ($languages as $language) { ?>
-          <div id="language<?php echo $language['language_id']; ?>">
-            <table class="form">
-              <tr>
-                <td><span class="required">*</span> <?php echo $entry_name; ?></td>
-                <td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][name]" size="100" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['name'] : ''; ?>" />
-                  <?php if (isset($error_name[$language['language_id']])) { ?>
-                  <span class="error"><?php echo $error_name[$language['language_id']]; ?></span>
-                  <?php } ?></td>
-              </tr>
-              <tr>
-                <td><?php echo $entry_meta_description; ?></td>
-                <td><textarea name="product_description[<?php echo $language['language_id']; ?>][meta_description]" cols="40" rows="5"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_description'] : ''; ?></textarea></td>
-              </tr>
-              <tr>
-                <td><?php echo $entry_meta_keyword; ?></td>
-                <td><textarea name="product_description[<?php echo $language['language_id']; ?>][meta_keyword]" cols="40" rows="5"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_keyword'] : ''; ?></textarea></td>
-              </tr>
-              <tr>
-                <td><?php echo $entry_description; ?></td>
-                <td><textarea name="product_description[<?php echo $language['language_id']; ?>][description]" id="description<?php echo $language['language_id']; ?>"><?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['description'] : ''; ?></textarea></td>
-              </tr>
-              <tr>
-                <td><?php echo $entry_tag; ?></td>
-                <td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][tag]" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['tag'] : ''; ?>" size="80" /></td>
-              </tr>
-            </table>
-          </div>
-          <?php } ?>
-        </div>
-        <div id="tab-data">
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_model; ?></td>
-              <td><input type="text" name="model" value="<?php echo $model; ?>" />
-                <?php if ($error_model) { ?>
-                <span class="error"><?php echo $error_model; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_sku; ?></td>
-              <td><input type="text" name="sku" value="<?php echo $sku; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_upc; ?></td>
-              <td><input type="text" name="upc" value="<?php echo $upc; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ean; ?></td>
-              <td><input type="text" name="ean" value="<?php echo $ean; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_jan; ?></td>
-              <td><input type="text" name="jan" value="<?php echo $jan; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_isbn; ?></td>
-              <td><input type="text" name="isbn" value="<?php echo $isbn; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_mpn; ?></td>
-              <td><input type="text" name="mpn" value="<?php echo $mpn; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_location; ?></td>
-              <td><input type="text" name="location" value="<?php echo $location; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_price; ?></td>
-              <td><input type="text" name="price" value="<?php echo $price; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_tax_class; ?></td>
-              <td><select name="tax_class_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($tax_classes as $tax_class) { ?>
-                  <?php if ($tax_class['tax_class_id'] == $tax_class_id) { ?>
-                  <option value="<?php echo $tax_class['tax_class_id']; ?>" selected="selected"><?php echo $tax_class['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $tax_class['tax_class_id']; ?>"><?php echo $tax_class['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_quantity; ?></td>
-              <td><input type="text" name="quantity" value="<?php echo $quantity; ?>" size="2" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_minimum; ?></td>
-              <td><input type="text" name="minimum" value="<?php echo $minimum; ?>" size="2" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_subtract; ?></td>
-              <td><select name="subtract">
-                  <?php if ($subtract) { ?>
-                  <option value="1" selected="selected"><?php echo $text_yes; ?></option>
-                  <option value="0"><?php echo $text_no; ?></option>
-                  <?php } else { ?>
-                  <option value="1"><?php echo $text_yes; ?></option>
-                  <option value="0" selected="selected"><?php echo $text_no; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_stock_status; ?></td>
-              <td><select name="stock_status_id">
-                  <?php foreach ($stock_statuses as $stock_status) { ?>
-                  <?php if ($stock_status['stock_status_id'] == $stock_status_id) { ?>
-                  <option value="<?php echo $stock_status['stock_status_id']; ?>" selected="selected"><?php echo $stock_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $stock_status['stock_status_id']; ?>"><?php echo $stock_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_shipping; ?></td>
-              <td><?php if ($shipping) { ?>
-                <input type="radio" name="shipping" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="shipping" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="shipping" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="shipping" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_keyword; ?></td>
-              <td><input type="text" name="keyword" value="<?php echo $keyword; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_image; ?></td>
-              <td><div class="image"><img src="<?php echo $thumb; ?>" alt="" id="thumb" /><br />
-                  <input type="hidden" name="image" value="<?php echo $image; ?>" id="image" />
-                  <a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb').attr('src', '<?php echo $no_image; ?>'); $('#image').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_date_available; ?></td>
-              <td><input type="text" name="date_available" value="<?php echo $date_available; ?>" size="12" class="date" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_dimension; ?></td>
-              <td><input type="text" name="length" value="<?php echo $length; ?>" size="4" />
-                <input type="text" name="width" value="<?php echo $width; ?>" size="4" />
-                <input type="text" name="height" value="<?php echo $height; ?>" size="4" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_length; ?></td>
-              <td><select name="length_class_id">
-                  <?php foreach ($length_classes as $length_class) { ?>
-                  <?php if ($length_class['length_class_id'] == $length_class_id) { ?>
-                  <option value="<?php echo $length_class['length_class_id']; ?>" selected="selected"><?php echo $length_class['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $length_class['length_class_id']; ?>"><?php echo $length_class['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_weight; ?></td>
-              <td><input type="text" name="weight" value="<?php echo $weight; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_weight_class; ?></td>
-              <td><select name="weight_class_id">
-                  <?php foreach ($weight_classes as $weight_class) { ?>
-                  <?php if ($weight_class['weight_class_id'] == $weight_class_id) { ?>
-                  <option value="<?php echo $weight_class['weight_class_id']; ?>" selected="selected"><?php echo $weight_class['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $weight_class['weight_class_id']; ?>"><?php echo $weight_class['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_status; ?></td>
-              <td><select name="status">
-                  <?php if ($status) { ?>
-                  <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
-                  <option value="0"><?php echo $text_disabled; ?></option>
-                  <?php } else { ?>
-                  <option value="1"><?php echo $text_enabled; ?></option>
-                  <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_sort_order; ?></td>
-              <td><input type="text" name="sort_order" value="<?php echo $sort_order; ?>" size="2" /></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-links">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_manufacturer; ?></td>
-              <td><input type="text" name="manufacturer" value="<?php echo $manufacturer ?>" /><input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_category; ?></td>
-              <td><input type="text" name="category" value="" /></td>
-            </tr>
-            <tr>
-              <td>&nbsp;</td>
-              <td><div id="product-category" class="scrollbox">
-                  <?php $class = 'odd'; ?>
-                  <?php foreach ($product_categories as $product_category) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div id="product-category<?php echo $product_category['category_id']; ?>" class="<?php echo $class; ?>"><?php echo $product_category['name']; ?><img src="view/image/delete.png" alt="" />
-                    <input type="hidden" name="product_category[]" value="<?php echo $product_category['category_id']; ?>" />
-                  </div>
-                  <?php } ?>
-                </div></td>
-            </tr> 
-            <tr>
-              <td><?php echo $entry_filter; ?></td>
-              <td><input type="text" name="filter" value="" /></td>
-            </tr>
-            <tr>
-              <td>&nbsp;</td>
-              <td><div id="product-filter" class="scrollbox">
-                  <?php $class = 'odd'; ?>
-                  <?php foreach ($product_filters as $product_filter) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div id="product-filter<?php echo $product_filter['filter_id']; ?>" class="<?php echo $class; ?>"><?php echo $product_filter['name']; ?><img src="view/image/delete.png" alt="" />
-                    <input type="hidden" name="product_filter[]" value="<?php echo $product_filter['filter_id']; ?>" />
-                  </div>
-                  <?php } ?>
-                </div></td>
-            </tr>                       
-            <tr>
-              <td><?php echo $entry_store; ?></td>
-              <td><div class="scrollbox">
-                  <?php $class = 'even'; ?>
-                  <div class="<?php echo $class; ?>">
-                    <?php if (in_array(0, $product_store)) { ?>
-                    <input type="checkbox" name="product_store[]" value="0" checked="checked" />
-                    <?php echo $text_default; ?>
-                    <?php } else { ?>
-                    <input type="checkbox" name="product_store[]" value="0" />
-                    <?php echo $text_default; ?>
-                    <?php } ?>
-                  </div>
-                  <?php foreach ($stores as $store) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div class="<?php echo $class; ?>">
-                    <?php if (in_array($store['store_id'], $product_store)) { ?>
-                    <input type="checkbox" name="product_store[]" value="<?php echo $store['store_id']; ?>" checked="checked" />
-                    <?php echo $store['name']; ?>
-                    <?php } else { ?>
-                    <input type="checkbox" name="product_store[]" value="<?php echo $store['store_id']; ?>" />
-                    <?php echo $store['name']; ?>
-                    <?php } ?>
-                  </div>
-                  <?php } ?>
-                </div></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_download; ?></td>
-              <td><input type="text" name="download" value="" /></td>
-            </tr>			
-            <tr>
-              <td>&nbsp;</td>
-              <td><div id="product-download" class="scrollbox">
-                  <?php $class = 'odd'; ?>
-                  <?php foreach ($product_downloads as $product_download) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div id="product-download<?php echo $product_download['download_id']; ?>" class="<?php echo $class; ?>"> <?php echo $product_download['name']; ?><img src="view/image/delete.png" alt="" />
-                    <input type="hidden" name="product_download[]" value="<?php echo $product_download['download_id']; ?>" />
-                  </div>
-                  <?php } ?>
-                </div></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_related; ?></td>
-              <td><input type="text" name="related" value="" /></td>
-            </tr>
-            <tr>
-              <td>&nbsp;</td>
-              <td><div id="product-related" class="scrollbox">
-                  <?php $class = 'odd'; ?>
-                  <?php foreach ($product_related as $product_related) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div id="product-related<?php echo $product_related['product_id']; ?>" class="<?php echo $class; ?>"> <?php echo $product_related['name']; ?><img src="view/image/delete.png" alt="" />
-                    <input type="hidden" name="product_related[]" value="<?php echo $product_related['product_id']; ?>" />
-                  </div>
-                  <?php } ?>
-                </div></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-attribute">
-          <table id="attribute" class="list">
-            <thead>
-              <tr>
-                <td class="left"><?php echo $entry_attribute; ?></td>
-                <td class="left"><?php echo $entry_text; ?></td>
-                <td></td>
-              </tr>
-            </thead>
-            <?php $attribute_row = 0; ?>
-            <?php foreach ($product_attributes as $product_attribute) { ?>
-            <tbody id="attribute-row<?php echo $attribute_row; ?>">
-              <tr>
-                <td class="left"><input type="text" name="product_attribute[<?php echo $attribute_row; ?>][name]" value="<?php echo $product_attribute['name']; ?>" />
-                  <input type="hidden" name="product_attribute[<?php echo $attribute_row; ?>][attribute_id]" value="<?php echo $product_attribute['attribute_id']; ?>" /></td>
-                <td class="left"><?php foreach ($languages as $language) { ?>
-                  <textarea name="product_attribute[<?php echo $attribute_row; ?>][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"><?php echo isset($product_attribute['product_attribute_description'][$language['language_id']]) ? $product_attribute['product_attribute_description'][$language['language_id']]['text'] : ''; ?></textarea>
-                  <img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />
-                  <?php } ?></td>
-                <td class="left"><a onclick="$('#attribute-row<?php echo $attribute_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
-              </tr>
-            </tbody>
-            <?php $attribute_row++; ?>
-            <?php } ?>
-            <tfoot>
-              <tr>
-                <td colspan="2"></td>
-                <td class="left"><a onclick="addAttribute();" class="button"><?php echo $button_add_attribute; ?></a></td>
-              </tr>
-            </tfoot>
-          </table>
-        </div>
-        <div id="tab-option">
-          <div id="vtab-option" class="vtabs">
-            <?php $option_row = 0; ?>
-            <?php foreach ($product_options as $product_option) { ?>
-            <a href="#tab-option-<?php echo $option_row; ?>" id="option-<?php echo $option_row; ?>"><?php echo $product_option['name']; ?>&nbsp;<img src="view/image/delete.png" alt="" onclick="$('#option-<?php echo $option_row; ?>').remove(); $('#tab-option-<?php echo $option_row; ?>').remove(); $('#vtabs a:first').trigger('click'); return false;" /></a>
-            <?php $option_row++; ?>
-            <?php } ?>
-            <span id="option-add">
-            <input name="option" value="" style="width: 130px;" />
-            &nbsp;<img src="view/image/add.png" alt="<?php echo $button_add_option; ?>" title="<?php echo $button_add_option; ?>" /></span></div>
-          <?php $option_row = 0; ?>
-          <?php $option_value_row = 0; ?>
-          <?php foreach ($product_options as $product_option) { ?>
-          <div id="tab-option-<?php echo $option_row; ?>" class="vtabs-content">
-            <input type="hidden" name="product_option[<?php echo $option_row; ?>][product_option_id]" value="<?php echo $product_option['product_option_id']; ?>" />
-            <input type="hidden" name="product_option[<?php echo $option_row; ?>][name]" value="<?php echo $product_option['name']; ?>" />
-            <input type="hidden" name="product_option[<?php echo $option_row; ?>][option_id]" value="<?php echo $product_option['option_id']; ?>" />
-            <input type="hidden" name="product_option[<?php echo $option_row; ?>][type]" value="<?php echo $product_option['type']; ?>" />
-            <table class="form">
-              <tr>
-                <td><?php echo $entry_required; ?></td>
-                <td><select name="product_option[<?php echo $option_row; ?>][required]">
-                    <?php if ($product_option['required']) { ?>
-                    <option value="1" selected="selected"><?php echo $text_yes; ?></option>
-                    <option value="0"><?php echo $text_no; ?></option>
-                    <?php } else { ?>
-                    <option value="1"><?php echo $text_yes; ?></option>
-                    <option value="0" selected="selected"><?php echo $text_no; ?></option>
-                    <?php } ?>
-                  </select></td>
-              </tr>
-              <?php if ($product_option['type'] == 'text') { ?>
-              <tr>
-                <td><?php echo $entry_option_value; ?></td>
-                <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" /></td>
-              </tr>
-              <?php } ?>
-              <?php if ($product_option['type'] == 'textarea') { ?>
-              <tr>
-                <td><?php echo $entry_option_value; ?></td>
-                <td><textarea name="product_option[<?php echo $option_row; ?>][option_value]" cols="40" rows="5"><?php echo $product_option['option_value']; ?></textarea></td>
-              </tr>
-              <?php } ?>
-              <?php if ($product_option['type'] == 'file') { ?>
-              <tr style="display: none;">
-                <td><?php echo $entry_option_value; ?></td>
-                <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" /></td>
-              </tr>
-              <?php } ?>
-              <?php if ($product_option['type'] == 'date') { ?>
-              <tr>
-                <td><?php echo $entry_option_value; ?></td>
-                <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" class="date" /></td>
-              </tr>
-              <?php } ?>
-              <?php if ($product_option['type'] == 'datetime') { ?>
-              <tr>
-                <td><?php echo $entry_option_value; ?></td>
-                <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" class="datetime" /></td>
-              </tr>
-              <?php } ?>
-              <?php if ($product_option['type'] == 'time') { ?>
-              <tr>
-                <td><?php echo $entry_option_value; ?></td>
-                <td><input type="text" name="product_option[<?php echo $option_row; ?>][option_value]" value="<?php echo $product_option['option_value']; ?>" class="time" /></td>
-              </tr>
-              <?php } ?>
-            </table>
-            <?php if ($product_option['type'] == 'select' || $product_option['type'] == 'radio' || $product_option['type'] == 'checkbox' || $product_option['type'] == 'image') { ?>
-            <table id="option-value<?php echo $option_row; ?>" class="list">
-              <thead>
-                <tr>
-                  <td class="left"><?php echo $entry_option_value; ?></td>
-                  <td class="right"><?php echo $entry_quantity; ?></td>
-                  <td class="left"><?php echo $entry_subtract; ?></td>
-                  <td class="right"><?php echo $entry_price; ?></td>
-                  <td class="right"><?php echo $entry_option_points; ?></td>
-                  <td class="right"><?php echo $entry_weight; ?></td>
-                  <td></td>
-                </tr>
-              </thead>
-              <?php foreach ($product_option['product_option_value'] as $product_option_value) { ?>
-              <tbody id="option-value-row<?php echo $option_value_row; ?>">
-                <tr>
-                  <td class="left"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][option_value_id]">
-                      <?php if (isset($option_values[$product_option['option_id']])) { ?>
-                      <?php foreach ($option_values[$product_option['option_id']] as $option_value) { ?>
-                      <?php if ($option_value['option_value_id'] == $product_option_value['option_value_id']) { ?>
-                      <option value="<?php echo $option_value['option_value_id']; ?>" selected="selected"><?php echo $option_value['name']; ?></option>
-                      <?php } else { ?>
-                      <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></option>
-                      <?php } ?>
-                      <?php } ?>
-                      <?php } ?>
-                    </select>
-                    <input type="hidden" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][product_option_value_id]" value="<?php echo $product_option_value['product_option_value_id']; ?>" /></td>
-                  <td class="right"><input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][quantity]" value="<?php echo $product_option_value['quantity']; ?>" size="3" /></td>
-                  <td class="left"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][subtract]">
-                      <?php if ($product_option_value['subtract']) { ?>
-                      <option value="1" selected="selected"><?php echo $text_yes; ?></option>
-                      <option value="0"><?php echo $text_no; ?></option>
-                      <?php } else { ?>
-                      <option value="1"><?php echo $text_yes; ?></option>
-                      <option value="0" selected="selected"><?php echo $text_no; ?></option>
-                      <?php } ?>
-                    </select></td>
-                  <td class="right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][price_prefix]">
-                      <?php if ($product_option_value['price_prefix'] == '+') { ?>
-                      <option value="+" selected="selected">+</option>
-                      <?php } else { ?>
-                      <option value="+">+</option>
-                      <?php } ?>
-                      <?php if ($product_option_value['price_prefix'] == '-') { ?>
-                      <option value="-" selected="selected">-</option>
-                      <?php } else { ?>
-                      <option value="-">-</option>
-                      <?php } ?>
-                    </select>
-                    <input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][price]" value="<?php echo $product_option_value['price']; ?>" size="5" /></td>
-                  <td class="right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][points_prefix]">
-                      <?php if ($product_option_value['points_prefix'] == '+') { ?>
-                      <option value="+" selected="selected">+</option>
-                      <?php } else { ?>
-                      <option value="+">+</option>
-                      <?php } ?>
-                      <?php if ($product_option_value['points_prefix'] == '-') { ?>
-                      <option value="-" selected="selected">-</option>
-                      <?php } else { ?>
-                      <option value="-">-</option>
-                      <?php } ?>
-                    </select>
-                    <input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][points]" value="<?php echo $product_option_value['points']; ?>" size="5" /></td>
-                  <td class="right"><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][weight_prefix]">
-                      <?php if ($product_option_value['weight_prefix'] == '+') { ?>
-                      <option value="+" selected="selected">+</option>
-                      <?php } else { ?>
-                      <option value="+">+</option>
-                      <?php } ?>
-                      <?php if ($product_option_value['weight_prefix'] == '-') { ?>
-                      <option value="-" selected="selected">-</option>
-                      <?php } else { ?>
-                      <option value="-">-</option>
-                      <?php } ?>
-                    </select>
-                    <input type="text" name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][weight]" value="<?php echo $product_option_value['weight']; ?>" size="5" /></td>
-                  <td class="left"><a onclick="$('#option-value-row<?php echo $option_value_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
-                </tr>
-              </tbody>
-              <?php $option_value_row++; ?>
-              <?php } ?>
-              <tfoot>
-                <tr>
-                  <td colspan="6"></td>
-                  <td class="left"><a onclick="addOptionValue('<?php echo $option_row; ?>');" class="button"><?php echo $button_add_option_value; ?></a></td>
-                </tr>
-              </tfoot>
-            </table>
-            <select id="option-values<?php echo $option_row; ?>" style="display: none;">
-              <?php if (isset($option_values[$product_option['option_id']])) { ?>
-              <?php foreach ($option_values[$product_option['option_id']] as $option_value) { ?>
-              <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?></option>
-              <?php } ?>
-              <?php } ?>
-            </select>
-            <?php } ?>
-          </div>
-          <?php $option_row++; ?>
-          <?php } ?>
-        </div>
-        <div id="tab-discount">
-          <table id="discount" class="list">
-            <thead>
-              <tr>
-                <td class="left"><?php echo $entry_customer_group; ?></td>
-                <td class="right"><?php echo $entry_quantity; ?></td>
-                <td class="right"><?php echo $entry_priority; ?></td>
-                <td class="right"><?php echo $entry_price; ?></td>
-                <td class="left"><?php echo $entry_date_start; ?></td>
-                <td class="left"><?php echo $entry_date_end; ?></td>
-                <td></td>
-              </tr>
-            </thead>
-            <?php $discount_row = 0; ?>
-            <?php foreach ($product_discounts as $product_discount) { ?>
-            <tbody id="discount-row<?php echo $discount_row; ?>">
-              <tr>
-                <td class="left"><select name="product_discount[<?php echo $discount_row; ?>][customer_group_id]">
-                    <?php foreach ($customer_groups as $customer_group) { ?>
-                    <?php if ($customer_group['customer_group_id'] == $product_discount['customer_group_id']) { ?>
-                    <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
-                    <?php } else { ?>
-                    <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
-                    <?php } ?>
-                    <?php } ?>
-                  </select></td>
-                <td class="right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][quantity]" value="<?php echo $product_discount['quantity']; ?>" size="2" /></td>
-                <td class="right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][priority]" value="<?php echo $product_discount['priority']; ?>" size="2" /></td>
-                <td class="right"><input type="text" name="product_discount[<?php echo $discount_row; ?>][price]" value="<?php echo $product_discount['price']; ?>" /></td>
-                <td class="left"><input type="text" name="product_discount[<?php echo $discount_row; ?>][date_start]" value="<?php echo $product_discount['date_start']; ?>" class="date" /></td>
-                <td class="left"><input type="text" name="product_discount[<?php echo $discount_row; ?>][date_end]" value="<?php echo $product_discount['date_end']; ?>" class="date" /></td>
-                <td class="left"><a onclick="$('#discount-row<?php echo $discount_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
-              </tr>
-            </tbody>
-            <?php $discount_row++; ?>
-            <?php } ?>
-            <tfoot>
-              <tr>
-                <td colspan="6"></td>
-                <td class="left"><a onclick="addDiscount();" class="button"><?php echo $button_add_discount; ?></a></td>
-              </tr>
-            </tfoot>
-          </table>
-        </div>
-        <div id="tab-special">
-          <table id="special" class="list">
-            <thead>
-              <tr>
-                <td class="left"><?php echo $entry_customer_group; ?></td>
-                <td class="right"><?php echo $entry_priority; ?></td>
-                <td class="right"><?php echo $entry_price; ?></td>
-                <td class="left"><?php echo $entry_date_start; ?></td>
-                <td class="left"><?php echo $entry_date_end; ?></td>
-                <td></td>
-              </tr>
-            </thead>
-            <?php $special_row = 0; ?>
-            <?php foreach ($product_specials as $product_special) { ?>
-            <tbody id="special-row<?php echo $special_row; ?>">
-              <tr>
-                <td class="left"><select name="product_special[<?php echo $special_row; ?>][customer_group_id]">
-                    <?php foreach ($customer_groups as $customer_group) { ?>
-                    <?php if ($customer_group['customer_group_id'] == $product_special['customer_group_id']) { ?>
-                    <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
-                    <?php } else { ?>
-                    <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
-                    <?php } ?>
-                    <?php } ?>
-                  </select></td>
-                <td class="right"><input type="text" name="product_special[<?php echo $special_row; ?>][priority]" value="<?php echo $product_special['priority']; ?>" size="2" /></td>
-                <td class="right"><input type="text" name="product_special[<?php echo $special_row; ?>][price]" value="<?php echo $product_special['price']; ?>" /></td>
-                <td class="left"><input type="text" name="product_special[<?php echo $special_row; ?>][date_start]" value="<?php echo $product_special['date_start']; ?>" class="date" /></td>
-                <td class="left"><input type="text" name="product_special[<?php echo $special_row; ?>][date_end]" value="<?php echo $product_special['date_end']; ?>" class="date" /></td>
-                <td class="left"><a onclick="$('#special-row<?php echo $special_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
-              </tr>
-            </tbody>
-            <?php $special_row++; ?>
-            <?php } ?>
-            <tfoot>
-              <tr>
-                <td colspan="5"></td>
-                <td class="left"><a onclick="addSpecial();" class="button"><?php echo $button_add_special; ?></a></td>
-              </tr>
-            </tfoot>
-          </table>
-        </div>
-        <div id="tab-image">
-          <table id="images" class="list">
-            <thead>
-              <tr>
-                <td class="left"><?php echo $entry_image; ?></td>
-                <td class="right"><?php echo $entry_sort_order; ?></td>
-                <td></td>
-              </tr>
-            </thead>
-            <?php $image_row = 0; ?>
-            <?php foreach ($product_images as $product_image) { ?>
-            <tbody id="image-row<?php echo $image_row; ?>">
-              <tr>
-                <td class="left"><div class="image"><img src="<?php echo $product_image['thumb']; ?>" alt="" id="thumb<?php echo $image_row; ?>" />
-                    <input type="hidden" name="product_image[<?php echo $image_row; ?>][image]" value="<?php echo $product_image['image']; ?>" id="image<?php echo $image_row; ?>" />
-                    <br />
-                    <a onclick="image_upload('image<?php echo $image_row; ?>', 'thumb<?php echo $image_row; ?>');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb<?php echo $image_row; ?>').attr('src', '<?php echo $no_image; ?>'); $('#image<?php echo $image_row; ?>').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-                <td class="right"><input type="text" name="product_image[<?php echo $image_row; ?>][sort_order]" value="<?php echo $product_image['sort_order']; ?>" size="2" /></td>
-                <td class="left"><a onclick="$('#image-row<?php echo $image_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
-              </tr>
-            </tbody>
-            <?php $image_row++; ?>
-            <?php } ?>
-            <tfoot>
-              <tr>
-                <td colspan="2"></td>
-                <td class="left"><a onclick="addImage();" class="button"><?php echo $button_add_image; ?></a></td>
-              </tr>
-            </tfoot>
-          </table>
-        </div>
-        <div id="tab-reward">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_points; ?></td>
-              <td><input type="text" name="points" value="<?php echo $points; ?>" /></td>
-            </tr>
-          </table>
-          <table class="list">
-            <thead>
-              <tr>
-                <td class="left"><?php echo $entry_customer_group; ?></td>
-                <td class="right"><?php echo $entry_reward; ?></td>
-              </tr>
-            </thead>
-            <?php foreach ($customer_groups as $customer_group) { ?>
-            <tbody>
-              <tr>
-                <td class="left"><?php echo $customer_group['name']; ?></td>
-                <td class="right"><input type="text" name="product_reward[<?php echo $customer_group['customer_group_id']; ?>][points]" value="<?php echo isset($product_reward[$customer_group['customer_group_id']]) ? $product_reward[$customer_group['customer_group_id']]['points'] : ''; ?>" /></td>
-              </tr>
-            </tbody>
-            <?php } ?>
-          </table>
-        </div>
-        <div id="tab-design">
-          <table class="list">
-            <thead>
-              <tr>
-                <td class="left"><?php echo $entry_store; ?></td>
-                <td class="left"><?php echo $entry_layout; ?></td>
-              </tr>
-            </thead>
-            <tbody>
-              <tr>
-                <td class="left"><?php echo $text_default; ?></td>
-                <td class="left"><select name="product_layout[0][layout_id]">
-                    <option value=""></option>
-                    <?php foreach ($layouts as $layout) { ?>
-                    <?php if (isset($product_layout[0]) && $product_layout[0] == $layout['layout_id']) { ?>
-                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
-                    <?php } else { ?>
-                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
-                    <?php } ?>
-                    <?php } ?>
-                  </select></td>
-              </tr>
-            </tbody>
-            <?php foreach ($stores as $store) { ?>
-            <tbody>
-              <tr>
-                <td class="left"><?php echo $store['name']; ?></td>
-                <td class="left"><select name="product_layout[<?php echo $store['store_id']; ?>][layout_id]">
-                    <option value=""></option>
-                    <?php foreach ($layouts as $layout) { ?>
-                    <?php if (isset($product_layout[$store['store_id']]) && $product_layout[$store['store_id']] == $layout['layout_id']) { ?>
-                    <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
-                    <?php } else { ?>
-                    <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
-                    <?php } ?>
-                    <?php } ?>
-                  </select></td>
-              </tr>
-            </tbody>
-            <?php } ?>
-          </table>
-        </div>
-        <div id="tab-youtube">Youtube Url(s):E.g.http://www.youtube.com/watch?v=xRx3m0cP0Hg,...,...<br /><textarea name="youtube" cols="80" rows="10"><?php echo $youtube; ?></textarea>
-        </div></form>
-
-    </div>
-  </div>
-</div>
-<script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> 
-<script type="text/javascript"><!--
-<?php foreach ($languages as $language) { ?>
-CKEDITOR.replace('description<?php echo $language['language_id']; ?>', {
-	filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
-	filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
-	filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
-	filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
-	filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
-	filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
-});
-<?php } ?>
-//--></script> 
-<script type="text/javascript"><!--
-$.widget('custom.catcomplete', $.ui.autocomplete, {
-	_renderMenu: function(ul, items) {
-		var self = this, currentCategory = '';
-		
-		$.each(items, function(index, item) {
-			if (item.category != currentCategory) {
-				ul.append('<li class="ui-autocomplete-category">' + item.category + '</li>');
-				
-				currentCategory = item.category;
-			}
-			
-			self._renderItem(ul, item);
-		});
-	}
-});
-
-// Manufacturer
-$('input[name=\'manufacturer\']').autocomplete({
-	delay: 500,
-	source: function(request, response) {
-		$.ajax({
-			url: 'index.php?route=catalog/manufacturer/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-			dataType: 'json',
-			success: function(json) {		
-				response($.map(json, function(item) {
-					return {
-						label: item.name,
-						value: item.manufacturer_id
-					}
-				}));
-			}
-		});
-	}, 
-	select: function(event, ui) {
-		$('input[name=\'manufacturer\']').attr('value', ui.item.label);
-		$('input[name=\'manufacturer_id\']').attr('value', ui.item.value);
-	
-		return false;
-	},
-	focus: function(event, ui) {
-      return false;
-   }
-});
-
-// Category
-$('input[name=\'category\']').autocomplete({
-	delay: 500,
-	source: function(request, response) {
-		$.ajax({
-			url: 'index.php?route=catalog/category/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-			dataType: 'json',
-			success: function(json) {		
-				response($.map(json, function(item) {
-					return {
-						label: item.name,
-						value: item.category_id
-					}
-				}));
-			}
-		});
-	}, 
-	select: function(event, ui) {
-		$('#product-category' + ui.item.value).remove();
-		
-		$('#product-category').append('<div id="product-category' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_category[]" value="' + ui.item.value + '" /></div>');
-
-		$('#product-category div:odd').attr('class', 'odd');
-		$('#product-category div:even').attr('class', 'even');
-				
-		return false;
-	},
-	focus: function(event, ui) {
-      return false;
-   }
-});
-
-$('#product-category div img').live('click', function() {
-	$(this).parent().remove();
-	
-	$('#product-category div:odd').attr('class', 'odd');
-	$('#product-category div:even').attr('class', 'even');	
-});
-
-// Filter
-$('input[name=\'filter\']').autocomplete({
-	delay: 500,
-	source: function(request, response) {
-		$.ajax({
-			url: 'index.php?route=catalog/filter/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-			dataType: 'json',
-			success: function(json) {		
-				response($.map(json, function(item) {
-					return {
-						label: item.name,
-						value: item.filter_id
-					}
-				}));
-			}
-		});
-	}, 
-	select: function(event, ui) {
-		$('#product-filter' + ui.item.value).remove();
-		
-		$('#product-filter').append('<div id="product-filter' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_filter[]" value="' + ui.item.value + '" /></div>');
-
-		$('#product-filter div:odd').attr('class', 'odd');
-		$('#product-filter div:even').attr('class', 'even');
-				
-		return false;
-	},
-	focus: function(event, ui) {
-      return false;
-   }
-});
-
-$('#product-filter div img').live('click', function() {
-	$(this).parent().remove();
-	
-	$('#product-filter div:odd').attr('class', 'odd');
-	$('#product-filter div:even').attr('class', 'even');	
-});
-
-// Downloads
-$('input[name=\'download\']').autocomplete({
-	delay: 500,
-	source: function(request, response) {
-		$.ajax({
-			url: 'index.php?route=catalog/download/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-			dataType: 'json',
-			success: function(json) {		
-				response($.map(json, function(item) {
-					return {
-						label: item.name,
-						value: item.download_id
-					}
-				}));
-			}
-		});
-	}, 
-	select: function(event, ui) {
-		$('#product-download' + ui.item.value).remove();
-		
-		$('#product-download').append('<div id="product-download' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_download[]" value="' + ui.item.value + '" /></div>');
-
-		$('#product-download div:odd').attr('class', 'odd');
-		$('#product-download div:even').attr('class', 'even');
-				
-		return false;
-	},
-	focus: function(event, ui) {
-      return false;
-   }
-});
-
-$('#product-download div img').live('click', function() {
-	$(this).parent().remove();
-	
-	$('#product-download div:odd').attr('class', 'odd');
-	$('#product-download div:even').attr('class', 'even');	
-});
-
-// Related
-$('input[name=\'related\']').autocomplete({
-	delay: 500,
-	source: function(request, response) {
-		$.ajax({
-			url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-			dataType: 'json',
-			success: function(json) {		
-				response($.map(json, function(item) {
-					return {
-						label: item.name,
-						value: item.product_id
-					}
-				}));
-			}
-		});
-	}, 
-	select: function(event, ui) {
-		$('#product-related' + ui.item.value).remove();
-		
-		$('#product-related').append('<div id="product-related' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" alt="" /><input type="hidden" name="product_related[]" value="' + ui.item.value + '" /></div>');
-
-		$('#product-related div:odd').attr('class', 'odd');
-		$('#product-related div:even').attr('class', 'even');
-				
-		return false;
-	},
-	focus: function(event, ui) {
-      return false;
-   }
-});
-
-$('#product-related div img').live('click', function() {
-	$(this).parent().remove();
-	
-	$('#product-related div:odd').attr('class', 'odd');
-	$('#product-related div:even').attr('class', 'even');	
-});
-//--></script> 
-<script type="text/javascript"><!--
-var attribute_row = <?php echo $attribute_row; ?>;
-
-function addAttribute() {
-	html  = '<tbody id="attribute-row' + attribute_row + '">';
-    html += '  <tr>';
-	html += '    <td class="left"><input type="text" name="product_attribute[' + attribute_row + '][name]" value="" /><input type="hidden" name="product_attribute[' + attribute_row + '][attribute_id]" value="" /></td>';
-	html += '    <td class="left">';
-	<?php foreach ($languages as $language) { ?>
-	html += '<textarea name="product_attribute[' + attribute_row + '][product_attribute_description][<?php echo $language['language_id']; ?>][text]" cols="40" rows="5"></textarea><img src="view/image/flags/<?php echo $language['image']; ?>" title="<?php echo $language['name']; ?>" align="top" /><br />';
-    <?php } ?>
-	html += '    </td>';
-	html += '    <td class="left"><a onclick="$(\'#attribute-row' + attribute_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
-    html += '  </tr>';	
-    html += '</tbody>';
-	
-	$('#attribute tfoot').before(html);
-	
-	attributeautocomplete(attribute_row);
-	
-	attribute_row++;
-}
-
-function attributeautocomplete(attribute_row) {
-	$('input[name=\'product_attribute[' + attribute_row + '][name]\']').catcomplete({
-		delay: 500,
-		source: function(request, response) {
-			$.ajax({
-				url: 'index.php?route=catalog/attribute/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-				dataType: 'json',
-				success: function(json) {	
-					response($.map(json, function(item) {
-						return {
-							category: item.attribute_group,
-							label: item.name,
-							value: item.attribute_id
-						}
-					}));
-				}
-			});
-		}, 
-		select: function(event, ui) {
-			$('input[name=\'product_attribute[' + attribute_row + '][name]\']').attr('value', ui.item.label);
-			$('input[name=\'product_attribute[' + attribute_row + '][attribute_id]\']').attr('value', ui.item.value);
-			
-			return false;
-		},
-		focus: function(event, ui) {
-      		return false;
-   		}
-	});
-}
-
-$('#attribute tbody').each(function(index, element) {
-	attributeautocomplete(index);
-});
-//--></script> 
-<script type="text/javascript"><!--	
-var option_row = <?php echo $option_row; ?>;
-
-$('input[name=\'option\']').catcomplete({
-	delay: 500,
-	source: function(request, response) {
-		$.ajax({
-			url: 'index.php?route=catalog/option/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
-			dataType: 'json',
-			success: function(json) {
-				response($.map(json, function(item) {
-					return {
-						category: item.category,
-						label: item.name,
-						value: item.option_id,
-						type: item.type,
-						option_value: item.option_value
-					}
-				}));
-			}
-		});
-	}, 
-	select: function(event, ui) {
-		html  = '<div id="tab-option-' + option_row + '" class="vtabs-content">';
-		html += '	<input type="hidden" name="product_option[' + option_row + '][product_option_id]" value="" />';
-		html += '	<input type="hidden" name="product_option[' + option_row + '][name]" value="' + ui.item.label + '" />';
-		html += '	<input type="hidden" name="product_option[' + option_row + '][option_id]" value="' + ui.item.value + '" />';
-		html += '	<input type="hidden" name="product_option[' + option_row + '][type]" value="' + ui.item.type + '" />';
-		html += '	<table class="form">';
-		html += '	  <tr>';
-		html += '		<td><?php echo $entry_required; ?></td>';
-		html += '       <td><select name="product_option[' + option_row + '][required]">';
-		html += '	      <option value="1"><?php echo $text_yes; ?></option>';
-		html += '	      <option value="0"><?php echo $text_no; ?></option>';
-		html += '	    </select></td>';
-		html += '     </tr>';
-		
-		if (ui.item.type == 'text') {
-			html += '     <tr>';
-			html += '       <td><?php echo $entry_option_value; ?></td>';
-			html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" /></td>';
-			html += '     </tr>';
-		}
-		
-		if (ui.item.type == 'textarea') {
-			html += '     <tr>';
-			html += '       <td><?php echo $entry_option_value; ?></td>';
-			html += '       <td><textarea name="product_option[' + option_row + '][option_value]" cols="40" rows="5"></textarea></td>';
-			html += '     </tr>';						
-		}
-		 
-		if (ui.item.type == 'file') {
-			html += '     <tr style="display: none;">';
-			html += '       <td><?php echo $entry_option_value; ?></td>';
-			html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" /></td>';
-			html += '     </tr>';			
-		}
-						
-		if (ui.item.type == 'date') {
-			html += '     <tr>';
-			html += '       <td><?php echo $entry_option_value; ?></td>';
-			html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" class="date" /></td>';
-			html += '     </tr>';			
-		}
-		
-		if (ui.item.type == 'datetime') {
-			html += '     <tr>';
-			html += '       <td><?php echo $entry_option_value; ?></td>';
-			html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" class="datetime" /></td>';
-			html += '     </tr>';			
-		}
-		
-		if (ui.item.type == 'time') {
-			html += '     <tr>';
-			html += '       <td><?php echo $entry_option_value; ?></td>';
-			html += '       <td><input type="text" name="product_option[' + option_row + '][option_value]" value="" class="time" /></td>';
-			html += '     </tr>';			
-		}
-		
-		html += '  </table>';
-			
-		if (ui.item.type == 'select' || ui.item.type == 'radio' || ui.item.type == 'checkbox' || ui.item.type == 'image') {
-			html += '  <table id="option-value' + option_row + '" class="list">';
-			html += '  	 <thead>'; 
-			html += '      <tr>';
-			html += '        <td class="left"><?php echo $entry_option_value; ?></td>';
-			html += '        <td class="right"><?php echo $entry_quantity; ?></td>';
-			html += '        <td class="left"><?php echo $entry_subtract; ?></td>';
-			html += '        <td class="right"><?php echo $entry_price; ?></td>';
-			html += '        <td class="right"><?php echo $entry_option_points; ?></td>';
-			html += '        <td class="right"><?php echo $entry_weight; ?></td>';
-			html += '        <td></td>';
-			html += '      </tr>';
-			html += '  	 </thead>';
-			html += '    <tfoot>';
-			html += '      <tr>';
-			html += '        <td colspan="6"></td>';
-			html += '        <td class="left"><a onclick="addOptionValue(' + option_row + ');" class="button"><?php echo $button_add_option_value; ?></a></td>';
-			html += '      </tr>';
-			html += '    </tfoot>';
-			html += '  </table>';
-            html += '  <select id="option-values' + option_row + '" style="display: none;">';
-			
-            for (i = 0; i < ui.item.option_value.length; i++) {
-				html += '  <option value="' + ui.item.option_value[i]['option_value_id'] + '">' + ui.item.option_value[i]['name'] + '</option>';
-            }
-
-            html += '  </select>';			
-			html += '</div>';	
-		}
-		
-		$('#tab-option').append(html);
-		
-		$('#option-add').before('<a href="#tab-option-' + option_row + '" id="option-' + option_row + '">' + ui.item.label + '&nbsp;<img src="view/image/delete.png" alt="" onclick="$(\'#option-' + option_row + '\').remove(); $(\'#tab-option-' + option_row + '\').remove(); $(\'#vtab-option a:first\').trigger(\'click\'); return false;" /></a>');
-		
-		$('#vtab-option a').tabs();
-		
-		$('#option-' + option_row).trigger('click');		
-		
-		$('.date').datepicker({dateFormat: 'yy-mm-dd'});
-		$('.datetime').datetimepicker({
-			dateFormat: 'yy-mm-dd',
-			timeFormat: 'h:m'
-		});	
-			
-		$('.time').timepicker({timeFormat: 'h:m'});	
-				
-		option_row++;
-		
-		return false;
-	},
-	focus: function(event, ui) {
-      return false;
-   }
-});
-//--></script> 
-<script type="text/javascript"><!--		
-var option_value_row = <?php echo $option_value_row; ?>;
-
-function addOptionValue(option_row) {	
-	html  = '<tbody id="option-value-row' + option_value_row + '">';
-	html += '  <tr>';
-	html += '    <td class="left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][option_value_id]">';
-	html += $('#option-values' + option_row).html();
-	html += '    </select><input type="hidden" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][product_option_value_id]" value="" /></td>';
-	html += '    <td class="right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="" size="3" /></td>'; 
-	html += '    <td class="left"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][subtract]">';
-	html += '      <option value="1"><?php echo $text_yes; ?></option>';
-	html += '      <option value="0"><?php echo $text_no; ?></option>';
-	html += '    </select></td>';
-	html += '    <td class="right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][price_prefix]">';
-	html += '      <option value="+">+</option>';
-	html += '      <option value="-">-</option>';
-	html += '    </select>';
-	html += '    <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][price]" value="" size="5" /></td>';
-	html += '    <td class="right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][points_prefix]">';
-	html += '      <option value="+">+</option>';
-	html += '      <option value="-">-</option>';
-	html += '    </select>';
-	html += '    <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][points]" value="" size="5" /></td>';	
-	html += '    <td class="right"><select name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][weight_prefix]">';
-	html += '      <option value="+">+</option>';
-	html += '      <option value="-">-</option>';
-	html += '    </select>';
-	html += '    <input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][weight]" value="" size="5" /></td>';
-	html += '    <td class="left"><a onclick="$(\'#option-value-row' + option_value_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
-	html += '  </tr>';
-	html += '</tbody>';
-	
-	$('#option-value' + option_row + ' tfoot').before(html);
-
-	option_value_row++;
-}
-//--></script> 
-<script type="text/javascript"><!--
-var discount_row = <?php echo $discount_row; ?>;
-
-function addDiscount() {
-	html  = '<tbody id="discount-row' + discount_row + '">';
-	html += '  <tr>'; 
-    html += '    <td class="left"><select name="product_discount[' + discount_row + '][customer_group_id]">';
-    <?php foreach ($customer_groups as $customer_group) { ?>
-    html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>';
-    <?php } ?>
-    html += '    </select></td>';		
-    html += '    <td class="right"><input type="text" name="product_discount[' + discount_row + '][quantity]" value="" size="2" /></td>';
-    html += '    <td class="right"><input type="text" name="product_discount[' + discount_row + '][priority]" value="" size="2" /></td>';
-	html += '    <td class="right"><input type="text" name="product_discount[' + discount_row + '][price]" value="" /></td>';
-    html += '    <td class="left"><input type="text" name="product_discount[' + discount_row + '][date_start]" value="" class="date" /></td>';
-	html += '    <td class="left"><input type="text" name="product_discount[' + discount_row + '][date_end]" value="" class="date" /></td>';
-	html += '    <td class="left"><a onclick="$(\'#discount-row' + discount_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
-	html += '  </tr>';	
-    html += '</tbody>';
-	
-	$('#discount tfoot').before(html);
-		
-	$('#discount-row' + discount_row + ' .date').datepicker({dateFormat: 'yy-mm-dd'});
-	
-	discount_row++;
-}
-//--></script> 
-<script type="text/javascript"><!--
-var special_row = <?php echo $special_row; ?>;
-
-function addSpecial() {
-	html  = '<tbody id="special-row' + special_row + '">';
-	html += '  <tr>'; 
-    html += '    <td class="left"><select name="product_special[' + special_row + '][customer_group_id]">';
-    <?php foreach ($customer_groups as $customer_group) { ?>
-    html += '      <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>';
-    <?php } ?>
-    html += '    </select></td>';		
-    html += '    <td class="right"><input type="text" name="product_special[' + special_row + '][priority]" value="" size="2" /></td>';
-	html += '    <td class="right"><input type="text" name="product_special[' + special_row + '][price]" value="" /></td>';
-    html += '    <td class="left"><input type="text" name="product_special[' + special_row + '][date_start]" value="" class="date" /></td>';
-	html += '    <td class="left"><input type="text" name="product_special[' + special_row + '][date_end]" value="" class="date" /></td>';
-	html += '    <td class="left"><a onclick="$(\'#special-row' + special_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
-	html += '  </tr>';
-    html += '</tbody>';
-	
-	$('#special tfoot').before(html);
- 
-	$('#special-row' + special_row + ' .date').datepicker({dateFormat: 'yy-mm-dd'});
-	
-	special_row++;
-}
-//--></script> 
-<script type="text/javascript"><!--
-function image_upload(field, thumb) {
-	$('#dialog').remove();
-	
-	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
-	
-	$('#dialog').dialog({
-		title: '<?php echo $text_image_manager; ?>',
-		close: function (event, ui) {
-			if ($('#' + field).attr('value')) {
-				$.ajax({
-					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
-					dataType: 'text',
-					success: function(text) {
-						$('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
-					}
-				});
-			}
-		},	
-		bgiframe: false,
-		width: 800,
-		height: 400,
-		resizable: false,
-		modal: false
-	});
-};
-//--></script> 
-<script type="text/javascript"><!--
-var image_row = <?php echo $image_row; ?>;
-
-function addImage() {
-    html  = '<tbody id="image-row' + image_row + '">';
-	html += '  <tr>';
-	html += '    <td class="left"><div class="image"><img src="<?php echo $no_image; ?>" alt="" id="thumb' + image_row + '" /><input type="hidden" name="product_image[' + image_row + '][image]" value="" id="image' + image_row + '" /><br /><a onclick="image_upload(\'image' + image_row + '\', \'thumb' + image_row + '\');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$(\'#thumb' + image_row + '\').attr(\'src\', \'<?php echo $no_image; ?>\'); $(\'#image' + image_row + '\').attr(\'value\', \'\');"><?php echo $text_clear; ?></a></div></td>';
-	html += '    <td class="right"><input type="text" name="product_image[' + image_row + '][sort_order]" value="" size="2" /></td>';
-	html += '    <td class="left"><a onclick="$(\'#image-row' + image_row  + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
-	html += '  </tr>';
-	html += '</tbody>';
-	
-	$('#images tfoot').before(html);
-	
-	image_row++;
-}
-//--></script> 
-<script type="text/javascript" src="view/javascript/jquery/ui/jquery-ui-timepicker-addon.js"></script> 
-<script type="text/javascript"><!--
-$('.date').datepicker({dateFormat: 'yy-mm-dd'});
-$('.datetime').datetimepicker({
-	dateFormat: 'yy-mm-dd',
-	timeFormat: 'h:m'
-});
-$('.time').timepicker({timeFormat: 'h:m'});
-//--></script> 
-<script type="text/javascript"><!--
-$('#tabs a').tabs(); 
-$('#languages a').tabs(); 
-$('#vtab-option a').tabs();
-//--></script> 
-<?php echo $footer; ?>
\ No newline at end of file
Index: trunk/www/admin/view/template/setting/setting.tpl
===================================================================
--- trunk/www/admin/view/template/setting/setting.tpl	(revision 19)
+++ trunk/www/admin/view/template/setting/setting.tpl	(revision 20)
@@ -1,1095 +0,0 @@
-<?php echo $header; ?>
-<div id="content">
-  <div class="breadcrumb">
-    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
-    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
-    <?php } ?>
-  </div>
-  <?php if ($error_warning) { ?>
-  <div class="warning"><?php echo $error_warning; ?></div>
-  <?php } ?>
-  <?php if ($success) { ?>
-  <div class="success"><?php echo $success; ?></div>
-  <?php } ?>
-  <div class="box">
-    <div class="heading">
-      <h1><img src="view/image/setting.png" alt="" /> <?php echo $heading_title; ?></h1>
-      <div class="buttons"><a onclick="$('#form').submit();" class="button"><span><?php echo $button_save; ?></span></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><span><?php echo $button_cancel; ?></span></a></div>
-    </div>
-    <div class="content">
-      <div id="tabs" class="htabs"><a href="#tab-general"><?php echo $tab_general; ?></a><a href="#tab-store"><?php echo $tab_store; ?></a><a href="#tab-local"><?php echo $tab_local; ?></a><a href="#tab-option"><?php echo $tab_option; ?></a><a href="#tab-image"><?php echo $tab_image; ?></a><a href="#tab-mail"><?php echo $tab_mail; ?></a><a href="#tab-fraud"><?php echo $tab_fraud; ?></a><a href="#tab-server"><?php echo $tab_server; ?></a></div>
-      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
-        <div id="tab-general">
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_name; ?></td>
-              <td><input type="text" name="config_name" value="<?php echo $config_name; ?>" size="40" />
-                <?php if ($error_name) { ?>
-                <span class="error"><?php echo $error_name; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_owner; ?></td>
-              <td><input type="text" name="config_owner" value="<?php echo $config_owner; ?>" size="40" />
-                <?php if ($error_owner) { ?>
-                <span class="error"><?php echo $error_owner; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_address; ?></td>
-              <td><textarea name="config_address" cols="40" rows="5"><?php echo $config_address; ?></textarea>
-                <?php if ($error_address) { ?>
-                <span class="error"><?php echo $error_address; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_email; ?></td>
-              <td><input type="text" name="config_email" value="<?php echo $config_email; ?>" size="40" />
-                <?php if ($error_email) { ?>
-                <span class="error"><?php echo $error_email; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
-              <td><input type="text" name="config_telephone" value="<?php echo $config_telephone; ?>" />
-                <?php if ($error_telephone) { ?>
-                <span class="error"><?php echo $error_telephone; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_fax; ?></td>
-              <td><input type="text" name="config_fax" value="<?php echo $config_fax; ?>" /></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-store">
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_title; ?></td>
-              <td><input type="text" name="config_title" value="<?php echo $config_title; ?>" />
-                <?php if ($error_title) { ?>
-                <span class="error"><?php echo $error_title; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_meta_description; ?></td>
-              <td><textarea name="config_meta_description" cols="40" rows="5"><?php echo $config_meta_description; ?></textarea></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_template; ?></td>
-              <td><select name="config_template" onchange="$('#template').load('index.php?route=setting/setting/template&token=<?php echo $token; ?>&template=' + encodeURIComponent(this.value)); warningOutput(this.value);">
-                  <?php foreach ($templates as $template) { ?>
-                  <?php if ($template == $config_template) { ?>
-                  <option value="<?php echo $template; ?>" selected="selected"><?php echo $template; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $template; ?>"><?php echo $template; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-              <!--new changes-->
-              <tr id="warning_text" style="display:none;">
-              <td colspan="2"><span style="font-weight:bold; font-size:13px; color:#F00;">We recommend to back up your database. Layout settings will be changed with this template install.</span></td>
-            </tr>
-              <!--new changes-->
-              <tr>
-              <td></td>
-              <td id="template"></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_layout; ?></td>
-              <td><select name="config_layout_id">
-                  <?php foreach ($layouts as $layout) { ?>
-                  <?php if ($layout['layout_id'] == $config_layout_id) { ?>
-                  <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-local">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_country; ?></td>
-              <td><select name="config_country_id">
-                  <?php foreach ($countries as $country) { ?>
-                  <?php if ($country['country_id'] == $config_country_id) { ?>
-                  <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_zone; ?></td>
-              <td><select name="config_zone_id">
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_language; ?></td>
-              <td><select name="config_language">
-                  <?php foreach ($languages as $language) { ?>
-                  <?php if ($language['code'] == $config_language) { ?>
-                  <option value="<?php echo $language['code']; ?>" selected="selected"><?php echo $language['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $language['code']; ?>"><?php echo $language['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_admin_language; ?></td>
-              <td><select name="config_admin_language">
-                  <?php foreach ($languages as $language) { ?>
-                  <?php if ($language['code'] == $config_admin_language) { ?>
-                  <option value="<?php echo $language['code']; ?>" selected="selected"><?php echo $language['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $language['code']; ?>"><?php echo $language['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_currency; ?></td>
-              <td><select name="config_currency">
-                  <?php foreach ($currencies as $currency) { ?>
-                  <?php if ($currency['code'] == $config_currency) { ?>
-                  <option value="<?php echo $currency['code']; ?>" selected="selected"><?php echo $currency['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $currency['code']; ?>"><?php echo $currency['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_currency_auto; ?></td>
-              <td><?php if ($config_currency_auto) { ?>
-                <input type="radio" name="config_currency_auto" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_currency_auto" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_currency_auto" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_currency_auto" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_length_class; ?></td>
-              <td><select name="config_length_class_id">
-                  <?php foreach ($length_classes as $length_class) { ?>
-                  <?php if ($length_class['length_class_id'] == $config_length_class_id) { ?>
-                  <option value="<?php echo $length_class['length_class_id']; ?>" selected="selected"><?php echo $length_class['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $length_class['length_class_id']; ?>"><?php echo $length_class['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_weight_class; ?></td>
-              <td><select name="config_weight_class_id">
-                  <?php foreach ($weight_classes as $weight_class) { ?>
-                  <?php if ($weight_class['weight_class_id'] == $config_weight_class_id) { ?>
-                  <option value="<?php echo $weight_class['weight_class_id']; ?>" selected="selected"><?php echo $weight_class['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $weight_class['weight_class_id']; ?>"><?php echo $weight_class['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-option">
-          <h2><?php echo $text_items; ?></h2>
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_catalog_limit; ?></td>
-              <td><input type="text" name="config_catalog_limit" value="<?php echo $config_catalog_limit; ?>" size="3" />
-                <?php if ($error_catalog_limit) { ?>
-                <span class="error"><?php echo $error_catalog_limit; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_admin_limit; ?></td>
-              <td><input type="text" name="config_admin_limit" value="<?php echo $config_admin_limit; ?>" size="3" />
-                <?php if ($error_admin_limit) { ?>
-                <span class="error"><?php echo $error_admin_limit; ?></span>
-                <?php } ?></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_product; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_product_count; ?></td>
-              <td><?php if ($config_product_count) { ?>
-                <input type="radio" name="config_product_count" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_product_count" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_product_count" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_product_count" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_review; ?></td>
-              <td><?php if ($config_review_status) { ?>
-                <input type="radio" name="config_review_status" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_review_status" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_review_status" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_review_status" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_download; ?></td>
-              <td><?php if ($config_download) { ?>
-                <input type="radio" name="config_download" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_download" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_download" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_download" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>          
-          </table>
-          <h2><?php echo $text_voucher; ?></h2>
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_voucher_min; ?></td>
-              <td><input type="text" name="config_voucher_min" value="<?php echo $config_voucher_min; ?>" />
-                <?php if ($error_voucher_min) { ?>
-                <span class="error"><?php echo $error_voucher_min; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_voucher_max; ?></td>
-              <td><input type="text" name="config_voucher_max" value="<?php echo $config_voucher_max; ?>" />
-                <?php if ($error_voucher_max) { ?>
-                <span class="error"><?php echo $error_voucher_max; ?></span>
-                <?php } ?></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_tax; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_tax; ?></td>
-              <td><?php if ($config_tax) { ?>
-                <input type="radio" name="config_tax" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_tax" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_tax" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_tax" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_vat; ?></td>
-              <td><?php if ($config_vat) { ?>
-                <input type="radio" name="config_vat" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_vat" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_vat" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_vat" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_tax_default; ?></td>
-              <td><select name="config_tax_default">
-                  <option value=""><?php echo $text_none; ?></option>
-                  <?php  if ($config_tax_default == 'shipping') { ?>
-                  <option value="shipping" selected="selected"><?php echo $text_shipping; ?></option>
-                  <?php } else { ?>
-                  <option value="shipping"><?php echo $text_shipping; ?></option>
-                  <?php } ?>
-                  <?php  if ($config_tax_default == 'payment') { ?>
-                  <option value="payment" selected="selected"><?php echo $text_payment; ?></option>
-                  <?php } else { ?>
-                  <option value="payment"><?php echo $text_payment; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_tax_customer; ?></td>
-              <td><select name="config_tax_customer">
-                  <option value=""><?php echo $text_none; ?></option>
-                  <?php  if ($config_tax_customer == 'shipping') { ?>
-                  <option value="shipping" selected="selected"><?php echo $text_shipping; ?></option>
-                  <?php } else { ?>
-                  <option value="shipping"><?php echo $text_shipping; ?></option>
-                  <?php } ?>
-                  <?php  if ($config_tax_customer == 'payment') { ?>
-                  <option value="payment" selected="selected"><?php echo $text_payment; ?></option>
-                  <?php } else { ?>
-                  <option value="payment"><?php echo $text_payment; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_account; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_customer_online; ?></td>
-              <td><?php if ($config_customer_online) { ?>
-                <input type="radio" name="config_customer_online" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_customer_online" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_customer_online" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_customer_online" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>          
-            <tr>
-              <td><?php echo $entry_customer_group; ?></td>
-              <td><select name="config_customer_group_id">
-                  <?php foreach ($customer_groups as $customer_group) { ?>
-                  <?php if ($customer_group['customer_group_id'] == $config_customer_group_id) { ?>
-                  <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_customer_group_display; ?></td>
-              <td><div class="scrollbox">
-                  <?php $class = 'odd'; ?>
-                  <?php foreach ($customer_groups as $customer_group) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div class="<?php echo $class; ?>">
-                    <?php if (in_array($customer_group['customer_group_id'], $config_customer_group_display)) { ?>
-                    <input type="checkbox" name="config_customer_group_display[]" value="<?php echo $customer_group['customer_group_id']; ?>" checked="checked" />
-                    <?php echo $customer_group['name']; ?>
-                    <?php } else { ?>
-                    <input type="checkbox" name="config_customer_group_display[]" value="<?php echo $customer_group['customer_group_id']; ?>" />
-                    <?php echo $customer_group['name']; ?>
-                    <?php } ?>
-                  </div>
-                  <?php } ?>
-                </div>
-                <?php if ($error_customer_group_display) { ?>
-                <span class="error"><?php echo $error_customer_group_display; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_customer_price; ?></td>
-              <td><?php if ($config_customer_price) { ?>
-                <input type="radio" name="config_customer_price" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_customer_price" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_customer_price" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_customer_price" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_account; ?></td>
-              <td><select name="config_account_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($informations as $information) { ?>
-                  <?php if ($information['information_id'] == $config_account_id) { ?>
-                  <option value="<?php echo $information['information_id']; ?>" selected="selected"><?php echo $information['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $information['information_id']; ?>"><?php echo $information['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_checkout; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_cart_weight; ?></td>
-              <td><?php if ($config_cart_weight) { ?>
-                <input type="radio" name="config_cart_weight" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_cart_weight" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_cart_weight" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_cart_weight" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_guest_checkout; ?></td>
-              <td><?php if ($config_guest_checkout) { ?>
-                <input type="radio" name="config_guest_checkout" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_guest_checkout" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_guest_checkout" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_guest_checkout" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_checkout; ?></td>
-              <td><select name="config_checkout_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($informations as $information) { ?>
-                  <?php if ($information['information_id'] == $config_checkout_id) { ?>
-                  <option value="<?php echo $information['information_id']; ?>" selected="selected"><?php echo $information['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $information['information_id']; ?>"><?php echo $information['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_order_edit; ?></td>
-              <td><input type="text" name="config_order_edit" value="<?php echo $config_order_edit; ?>" size="3" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_invoice_prefix; ?></td>
-              <td><input type="text" name="config_invoice_prefix" value="<?php echo $config_invoice_prefix; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_order_status; ?></td>
-              <td><select name="config_order_status_id">
-                  <?php foreach ($order_statuses as $order_status) { ?>
-                  <?php if ($order_status['order_status_id'] == $config_order_status_id) { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_complete_status; ?></td>
-              <td><select name="config_complete_status_id">
-                  <?php foreach ($order_statuses as $order_status) { ?>
-                  <?php if ($order_status['order_status_id'] == $config_complete_status_id) { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_stock; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_stock_display; ?></td>
-              <td><?php if ($config_stock_display) { ?>
-                <input type="radio" name="config_stock_display" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_display" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_stock_display" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_display" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_stock_warning; ?></td>
-              <td><?php if ($config_stock_warning) { ?>
-                <input type="radio" name="config_stock_warning" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_warning" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_stock_warning" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_warning" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_stock_checkout; ?></td>
-              <td><?php if ($config_stock_checkout) { ?>
-                <input type="radio" name="config_stock_checkout" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_checkout" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_stock_checkout" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_checkout" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_stock_status; ?></td>
-              <td><select name="config_stock_status_id">
-                  <?php foreach ($stock_statuses as $stock_status) { ?>
-                  <?php if ($stock_status['stock_status_id'] == $config_stock_status_id) { ?>
-                  <option value="<?php echo $stock_status['stock_status_id']; ?>" selected="selected"><?php echo $stock_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $stock_status['stock_status_id']; ?>"><?php echo $stock_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_affiliate; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_affiliate; ?></td>
-              <td><select name="config_affiliate_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($informations as $information) { ?>
-                  <?php if ($information['information_id'] == $config_affiliate_id) { ?>
-                  <option value="<?php echo $information['information_id']; ?>" selected="selected"><?php echo $information['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $information['information_id']; ?>"><?php echo $information['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_commission; ?></td>
-              <td><input type="text" name="config_commission" value="<?php echo $config_commission; ?>" size="3" /></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_return; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_return; ?></td>
-              <td><select name="config_return_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($informations as $information) { ?>
-                  <?php if ($information['information_id'] == $config_return_id) { ?>
-                  <option value="<?php echo $information['information_id']; ?>" selected="selected"><?php echo $information['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $information['information_id']; ?>"><?php echo $information['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_return_status; ?></td>
-              <td><select name="config_return_status_id">
-                  <?php foreach ($return_statuses as $return_status) { ?>
-                  <?php if ($return_status['return_status_id'] == $config_return_status_id) { ?>
-                  <option value="<?php echo $return_status['return_status_id']; ?>" selected="selected"><?php echo $return_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $return_status['return_status_id']; ?>"><?php echo $return_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-image">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_logo; ?></td>
-              <td><div class="image"><img src="<?php echo $logo; ?>" alt="" id="thumb-logo" />
-                  <input type="hidden" name="config_logo" value="<?php echo $config_logo; ?>" id="logo" />
-                  <br />
-                  <a onclick="image_upload('logo', 'thumb-logo');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-logo').attr('src', '<?php echo $no_image; ?>'); $('#logo').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_icon; ?></td>
-              <td><div class="image"><img src="<?php echo $icon; ?>" alt="" id="thumb-icon" />
-                  <input type="hidden" name="config_icon" value="<?php echo $config_icon; ?>" id="icon" />
-                  <br />
-                  <a onclick="image_upload('icon', 'thumb-icon');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-icon').attr('src', '<?php echo $no_image; ?>'); $('#icon').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_category; ?></td>
-              <td><input type="text" name="config_image_category_width" value="<?php echo $config_image_category_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_category_height" value="<?php echo $config_image_category_height; ?>" size="3" />
-                <?php if ($error_image_category) { ?>
-                <span class="error"><?php echo $error_image_category; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_thumb; ?></td>
-              <td><input type="text" name="config_image_thumb_width" value="<?php echo $config_image_thumb_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_thumb_height" value="<?php echo $config_image_thumb_height; ?>" size="3" />
-                <?php if ($error_image_thumb) { ?>
-                <span class="error"><?php echo $error_image_thumb; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_popup; ?></td>
-              <td><input type="text" name="config_image_popup_width" value="<?php echo $config_image_popup_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_popup_height" value="<?php echo $config_image_popup_height; ?>" size="3" />
-                <?php if ($error_image_popup) { ?>
-                <span class="error"><?php echo $error_image_popup; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_product; ?></td>
-              <td><input type="text" name="config_image_product_width" value="<?php echo $config_image_product_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_product_height" value="<?php echo $config_image_product_height; ?>" size="3" />
-                <?php if ($error_image_product) { ?>
-                <span class="error"><?php echo $error_image_product; ?></span>
-                <?php } ?></td>
-            </tr>            
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_additional; ?></td>
-              <td><input type="text" name="config_image_additional_width" value="<?php echo $config_image_additional_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_additional_height" value="<?php echo $config_image_additional_height; ?>" size="3" />
-                <?php if ($error_image_additional) { ?>
-                <span class="error"><?php echo $error_image_additional; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_related; ?></td>
-              <td><input type="text" name="config_image_related_width" value="<?php echo $config_image_related_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_related_height" value="<?php echo $config_image_related_height; ?>" size="3" />
-                <?php if ($error_image_related) { ?>
-                <span class="error"><?php echo $error_image_related; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_compare; ?></td>
-              <td><input type="text" name="config_image_compare_width" value="<?php echo $config_image_compare_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_compare_height" value="<?php echo $config_image_compare_height; ?>" size="3" />
-                <?php if ($error_image_compare) { ?>
-                <span class="error"><?php echo $error_image_compare; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_wishlist; ?></td>
-              <td><input type="text" name="config_image_wishlist_width" value="<?php echo $config_image_wishlist_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_wishlist_height" value="<?php echo $config_image_wishlist_height; ?>" size="3" />
-                <?php if ($error_image_wishlist) { ?>
-                <span class="error"><?php echo $error_image_wishlist; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_cart; ?></td>
-              <td><input type="text" name="config_image_cart_width" value="<?php echo $config_image_cart_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_cart_height" value="<?php echo $config_image_cart_height; ?>" size="3" />
-                <?php if ($error_image_cart) { ?>
-                <span class="error"><?php echo $error_image_cart; ?></span>
-                <?php } ?></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-ftp">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_ftp_host; ?></td>
-              <td><input type="text" name="config_ftp_host" value="<?php echo $config_ftp_host; ?>" />
-                <?php if ($error_ftp_host) { ?>
-                <span class="error"><?php echo $error_ftp_host; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ftp_port; ?></td>
-              <td><input type="text" name="config_ftp_port" value="<?php echo $config_ftp_port; ?>" />
-                <?php if ($error_ftp_port) { ?>
-                <span class="error"><?php echo $error_ftp_port; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ftp_username; ?></td>
-              <td><input type="text" name="config_ftp_username" value="<?php echo $config_ftp_username; ?>" />
-                <?php if ($error_ftp_username) { ?>
-                <span class="error"><?php echo $error_ftp_username; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ftp_password; ?></td>
-              <td><input type="text" name="config_ftp_password" value="<?php echo $config_ftp_password; ?>" />
-                <?php if ($error_ftp_password) { ?>
-                <span class="error"><?php echo $error_ftp_password; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ftp_root; ?></td>
-              <td><input type="text" name="config_ftp_root" value="<?php echo $config_ftp_root; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ftp_status; ?></td>
-              <td><?php if ($config_ftp_status) { ?>
-                <input type="radio" name="config_ftp_status" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_ftp_status" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_ftp_status" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_ftp_status" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-mail">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_mail_protocol; ?></td>
-              <td><select name="config_mail_protocol">
-                  <?php if ($config_mail_protocol == 'mail') { ?>
-                  <option value="mail" selected="selected"><?php echo $text_mail; ?></option>
-                  <?php } else { ?>
-                  <option value="mail"><?php echo $text_mail; ?></option>
-                  <?php } ?>
-                  <?php if ($config_mail_protocol == 'smtp') { ?>
-                  <option value="smtp" selected="selected"><?php echo $text_smtp; ?></option>
-                  <?php } else { ?>
-                  <option value="smtp"><?php echo $text_smtp; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_mail_parameter; ?></td>
-              <td><input type="text" name="config_mail_parameter" value="<?php echo $config_mail_parameter; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_smtp_host; ?></td>
-              <td><input type="text" name="config_smtp_host" value="<?php echo $config_smtp_host; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_smtp_username; ?></td>
-              <td><input type="text" name="config_smtp_username" value="<?php echo $config_smtp_username; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_smtp_password; ?></td>
-              <td><input type="text" name="config_smtp_password" value="<?php echo $config_smtp_password; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_smtp_port; ?></td>
-              <td><input type="text" name="config_smtp_port" value="<?php echo $config_smtp_port; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_smtp_timeout; ?></td>
-              <td><input type="text" name="config_smtp_timeout" value="<?php echo $config_smtp_timeout; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_alert_mail; ?></td>
-              <td><?php if ($config_alert_mail) { ?>
-                <input type="radio" name="config_alert_mail" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_alert_mail" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_alert_mail" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_alert_mail" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_account_mail; ?></td>
-              <td><?php if ($config_account_mail) { ?>
-                <input type="radio" name="config_account_mail" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_account_mail" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_account_mail" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_account_mail" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_alert_emails; ?></td>
-              <td><textarea name="config_alert_emails" cols="40" rows="5"><?php echo $config_alert_emails; ?></textarea></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-fraud">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_fraud_detection; ?></td>
-              <td><?php if ($config_fraud_detection) { ?>
-                <input type="radio" name="config_fraud_detection" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_fraud_detection" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_fraud_detection" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_fraud_detection" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_fraud_key; ?></td>
-              <td><input type="text" name="config_fraud_key" value="<?php echo $config_fraud_key; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_fraud_score; ?></td>
-              <td><input type="text" name="config_fraud_score" value="<?php echo $config_fraud_score; ?>" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_fraud_status; ?></td>
-              <td><select name="config_fraud_status_id">
-                  <?php foreach ($order_statuses as $order_status) { ?>
-                  <?php if ($order_status['order_status_id'] == $config_fraud_status_id) { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-server">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_secure; ?></td>
-              <td><?php if ($config_secure) { ?>
-                <input type="radio" name="config_secure" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_secure" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_secure" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_secure" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_shared; ?></td>
-              <td><?php if ($config_shared) { ?>
-                <input type="radio" name="config_shared" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_shared" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_shared" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_shared" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_robots; ?></td>
-              <td><textarea name="config_robots" cols="40" rows="5"><?php echo $config_robots; ?></textarea></td>
-            </tr>                    
-            <tr>
-              <td><?php echo $entry_seo_url; ?></td>
-              <td><?php if ($config_seo_url) { ?>
-                <input type="radio" name="config_seo_url" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_seo_url" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_seo_url" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_seo_url" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_file_extension_allowed; ?></td>
-              <td><textarea name="config_file_extension_allowed" cols="40" rows="5"><?php echo $config_file_extension_allowed; ?></textarea></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_file_mime_allowed; ?></td>
-              <td><textarea name="config_file_mime_allowed" cols="60" rows="5"><?php echo $config_file_mime_allowed; ?></textarea></td>
-            </tr>              
-            <tr>
-              <td><?php echo $entry_maintenance; ?></td>
-              <td><?php if ($config_maintenance) { ?>
-                <input type="radio" name="config_maintenance" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_maintenance" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_maintenance" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_maintenance" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_password; ?></td>
-              <td><?php if ($config_password) { ?>
-                <input type="radio" name="config_password" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_password" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_password" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_password" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>            
-            <tr>
-              <td><?php echo $entry_encryption; ?></td>
-              <td><input type="text" name="config_encryption" value="<?php echo $config_encryption; ?>" />
-                <?php if ($error_encryption) { ?>
-                <span class="error"><?php echo $error_encryption; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_compression; ?></td>
-              <td><input type="text" name="config_compression" value="<?php echo $config_compression; ?>" size="3" /></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_error_display; ?></td>
-              <td><?php if ($config_error_display) { ?>
-                <input type="radio" name="config_error_display" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_error_display" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_error_display" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_error_display" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_error_log; ?></td>
-              <td><?php if ($config_error_log) { ?>
-                <input type="radio" name="config_error_log" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_error_log" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_error_log" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_error_log" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_error_filename; ?></td>
-              <td><input type="text" name="config_error_filename" value="<?php echo $config_error_filename; ?>" />
-                <?php if ($error_error_filename) { ?>
-                <span class="error"><?php echo $error_error_filename; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_google_analytics; ?></td>
-              <td><textarea name="config_google_analytics" cols="40" rows="5"><?php echo $config_google_analytics; ?></textarea></td>
-            </tr>
-          </table>
-        </div>
-      </form>
-    </div>
-  </div>
-</div>
-<script type="text/javascript"><!--
-function warningOutput(template) {
-	if(template != 'default') {
-		$('#warning_text').css('display', '');
-	}
-}
-
-$('#template').load('index.php?route=setting/setting/template&token=<?php echo $token; ?>&template=' + encodeURIComponent($('select[name=\'config_template\']').attr('value')));
-//--></script> 
-<script type="text/javascript"><!--
-$('select[name=\'config_country_id\']').bind('change', function() {
-	$.ajax({
-		url: 'index.php?route=setting/setting/country&token=<?php echo $token; ?>&country_id=' + this.value,
-		dataType: 'json',
-		beforeSend: function() {
-			$('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="view/image/loading.gif" alt="" /></span>');
-		},		
-		complete: function() {
-			$('.wait').remove();
-		},			
-		success: function(json) {
-			if (json['postcode_required'] == '1') {
-				$('#postcode-required').show();
-			} else {
-				$('#postcode-required').hide();
-			}
-			
-			html = '<option value=""><?php echo $text_select; ?></option>';
-			
-			if (json['zone'] != '') {
-				for (i = 0; i < json['zone'].length; i++) {
-        			html += '<option value="' + json['zone'][i]['zone_id'] + '"';
-	    			
-					if (json['zone'][i]['zone_id'] == '<?php echo $config_zone_id; ?>') {
-	      				html += ' selected="selected"';
-	    			}
-	
-	    			html += '>' + json['zone'][i]['name'] + '</option>';
-				}
-			} else {
-				html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
-			}
-			
-			$('select[name=\'config_zone_id\']').html(html);
-		},
-		error: function(xhr, ajaxOptions, thrownError) {
-			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
-		}
-	});
-});
-
-$('select[name=\'config_country_id\']').trigger('change');
-//--></script> 
-<script type="text/javascript"><!--
-function image_upload(field, thumb) {
-	$('#dialog').remove();
-	
-	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
-	
-	$('#dialog').dialog({
-		title: '<?php echo $text_image_manager; ?>',
-		close: function (event, ui) {
-			if ($('#' + field).attr('value')) {
-				$.ajax({
-					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).val()),
-					dataType: 'text',
-					success: function(data) {
-						$('#' + thumb).replaceWith('<img src="' + data + '" alt="" id="' + thumb + '" />');
-					}
-				});
-			}
-		},	
-		bgiframe: false,
-		width: 800,
-		height: 400,
-		resizable: false,
-		modal: false
-	});
-};
-//--></script> 
-<script type="text/javascript"><!--
-$('#tabs a').tabs();
-//--></script> 
-<?php echo $footer; ?>
\ No newline at end of file
Index: trunk/www/admin/view/template/setting/store_form.tpl
===================================================================
--- trunk/www/admin/view/template/setting/store_form.tpl	(revision 19)
+++ trunk/www/admin/view/template/setting/store_form.tpl	(revision 20)
@@ -1,583 +0,0 @@
-<?php echo $header; ?>
-<div id="content">
-  <div class="breadcrumb">
-    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
-    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
-    <?php } ?>
-  </div>
-  <?php if ($error_warning) { ?>
-  <div class="warning"><?php echo $error_warning; ?></div>
-  <?php } ?>
-  <?php if ($success) { ?>
-  <div class="success"><?php echo $success; ?></div>
-  <?php } ?>
-  <div class="box">
-    <div class="heading">
-      <h1><img src="view/image/setting.png" alt="" /> <?php echo $heading_title; ?></h1>
-      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
-    </div>
-    <div class="content">
-      <div id="tabs" class="htabs"><a href="#tab-general"><?php echo $tab_general; ?></a><a href="#tab-store"><?php echo $tab_store; ?></a><a href="#tab-local"><?php echo $tab_local; ?></a><a href="#tab-option"><?php echo $tab_option; ?></a><a href="#tab-image"><?php echo $tab_image; ?></a><a href="#tab-server"><?php echo $tab_server; ?></a></div>
-      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
-        <div id="tab-general">
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_url; ?></td>
-              <td><input type="text" name="config_url" value="<?php echo $config_url; ?>" size="40" />
-                <?php if ($error_url) { ?>
-                <span class="error"><?php echo $error_url; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_ssl; ?></td>
-              <td><input type="text" name="config_ssl" value="<?php echo $config_ssl; ?>" size="40" /></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_name; ?></td>
-              <td><input type="text" name="config_name" value="<?php echo $config_name; ?>" size="40" />
-                <?php if ($error_name) { ?>
-                <span class="error"><?php echo $error_name; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_owner; ?></td>
-              <td><input type="text" name="config_owner" value="<?php echo $config_owner; ?>" size="40" />
-                <?php if ($error_owner) { ?>
-                <span class="error"><?php echo $error_owner; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_address; ?></td>
-              <td><textarea name="config_address" cols="40" rows="5"><?php echo $config_address; ?></textarea>
-                <?php if ($error_address) { ?>
-                <span class="error"><?php echo $error_address; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_email; ?></td>
-              <td><input type="text" name="config_email" value="<?php echo $config_email; ?>" size="40" />
-                <?php if ($error_email) { ?>
-                <span class="error"><?php echo $error_email; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_telephone; ?></td>
-              <td><input type="text" name="config_telephone" value="<?php echo $config_telephone; ?>" />
-                <?php if ($error_telephone) { ?>
-                <span class="error"><?php echo $error_telephone; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_fax; ?></td>
-              <td><input type="text" name="config_fax" value="<?php echo $config_fax; ?>" /></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-store">
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_title; ?></td>
-              <td><input type="text" name="config_title" value="<?php echo $config_title; ?>" />
-                <?php if ($error_title) { ?>
-                <span class="error"><?php echo $error_title; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_meta_description; ?></td>
-              <td><textarea name="config_meta_description" cols="40" rows="5"><?php echo $config_meta_description; ?></textarea></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_template; ?></td>
-              <td><select name="config_template" onchange="$('#template').load('index.php?route=setting/store/template&token=<?php echo $token; ?>&template=' + encodeURIComponent(this.value)); warningOutput(this.value);">
-                  <?php foreach ($templates as $template) { ?>
-                  <?php if ($template == $config_template) { ?>
-                  <option value="<?php echo $template; ?>" selected="selected"><?php echo $template; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $template; ?>"><?php echo $template; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <!--new changes-->
-            <tr id="warning_text" style="display:none;">
-              <td colspan="2"><span style="font-weight:bold; font-size:13px; color:#F00;">We recommend to back up your database. Layout settings will be changed with this template install.</span></td>
-            </tr>
-              <!--new changes-->
-              <tr>
-              <td></td>
-              <td id="template"></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_layout; ?></td>
-              <td><select name="config_layout_id">
-                  <?php foreach ($layouts as $layout) { ?>
-                  <?php if ($layout['layout_id'] == $config_layout_id) { ?>
-                  <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-local">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_country; ?></td>
-              <td><select name="config_country_id">
-                  <?php foreach ($countries as $country) { ?>
-                  <?php if ($country['country_id'] == $config_country_id) { ?>
-                  <option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_zone; ?></td>
-              <td><select name="config_zone_id">
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_language; ?></td>
-              <td><select name="config_language">
-                  <?php foreach ($languages as $language) { ?>
-                  <?php if ($language['code'] == $config_language) { ?>
-                  <option value="<?php echo $language['code']; ?>" selected="selected"><?php echo $language['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $language['code']; ?>"><?php echo $language['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_currency; ?></td>
-              <td><select name="config_currency">
-                  <?php foreach ($currencies as $currency) { ?>
-                  <?php if ($currency['code'] == $config_currency) { ?>
-                  <option value="<?php echo $currency['code']; ?>" selected="selected"><?php echo $currency['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $currency['code']; ?>"><?php echo $currency['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-option">
-          <h2><?php echo $text_items; ?></h2>
-          <table class="form">
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_catalog_limit; ?></td>
-              <td><input type="text" name="config_catalog_limit" value="<?php echo $config_catalog_limit; ?>" size="3" />
-                <?php if ($error_catalog_limit) { ?>
-                <span class="error"><?php echo $error_catalog_limit; ?></span>
-                <?php } ?></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_tax; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_tax; ?></td>
-              <td><?php if ($config_tax) { ?>
-                <input type="radio" name="config_tax" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_tax" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_tax" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_tax" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_tax_default; ?></td>
-              <td><select name="config_tax_default">
-                  <option value=""><?php echo $text_none; ?></option>
-                  <?php  if ($config_tax_default == 'shipping') { ?>
-                  <option value="shipping" selected="selected"><?php echo $text_shipping; ?></option>
-                  <?php } else { ?>
-                  <option value="shipping"><?php echo $text_shipping; ?></option>
-                  <?php } ?>
-                  <?php  if ($config_tax_default == 'payment') { ?>
-                  <option value="payment" selected="selected"><?php echo $text_payment; ?></option>
-                  <?php } else { ?>
-                  <option value="payment"><?php echo $text_payment; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_tax_customer; ?></td>
-              <td><select name="config_tax_customer">
-                  <option value=""><?php echo $text_none; ?></option>
-                  <?php  if ($config_tax_customer == 'shipping') { ?>
-                  <option value="shipping" selected="selected"><?php echo $text_shipping; ?></option>
-                  <?php } else { ?>
-                  <option value="shipping"><?php echo $text_shipping; ?></option>
-                  <?php } ?>
-                  <?php  if ($config_tax_customer == 'payment') { ?>
-                  <option value="payment" selected="selected"><?php echo $text_payment; ?></option>
-                  <?php } else { ?>
-                  <option value="payment"><?php echo $text_payment; ?></option>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_account; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_customer_group; ?></td>
-              <td><select name="config_customer_group_id">
-                  <?php foreach ($customer_groups as $customer_group) { ?>
-                  <?php if ($customer_group['customer_group_id'] == $config_customer_group_id) { ?>
-                  <option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_customer_group_display; ?></td>
-              <td><div class="scrollbox">
-                  <?php $class = 'odd'; ?>
-                  <?php foreach ($customer_groups as $customer_group) { ?>
-                  <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
-                  <div class="<?php echo $class; ?>">
-                    <?php if (in_array($customer_group['customer_group_id'], $config_customer_group_display)) { ?>
-                    <input type="checkbox" name="config_customer_group_display[]" value="<?php echo $customer_group['customer_group_id']; ?>" checked="checked" />
-                    <?php echo $customer_group['name']; ?>
-                    <?php } else { ?>
-                    <input type="checkbox" name="config_customer_group_display[]" value="<?php echo $customer_group['customer_group_id']; ?>" />
-                    <?php echo $customer_group['name']; ?>
-                    <?php } ?>
-                  </div>
-                  <?php } ?>
-                </div>
-                <?php if ($error_customer_group_display) { ?>
-                <span class="error"><?php echo $error_customer_group_display; ?></span>
-                <?php } ?></td>
-            </tr>            
-            <tr>
-              <td><?php echo $entry_customer_price; ?></td>
-              <td><?php if ($config_customer_price) { ?>
-                <input type="radio" name="config_customer_price" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_customer_price" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_customer_price" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_customer_price" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_account; ?></td>
-              <td><select name="config_account_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($informations as $information) { ?>
-                  <?php if ($information['information_id'] == $config_account_id) { ?>
-                  <option value="<?php echo $information['information_id']; ?>" selected="selected"><?php echo $information['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $information['information_id']; ?>"><?php echo $information['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_checkout; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_cart_weight; ?></td>
-              <td><?php if ($config_cart_weight) { ?>
-                <input type="radio" name="config_cart_weight" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_cart_weight" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_cart_weight" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_cart_weight" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_guest_checkout; ?></td>
-              <td><?php if ($config_guest_checkout) { ?>
-                <input type="radio" name="config_guest_checkout" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_guest_checkout" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_guest_checkout" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_guest_checkout" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_checkout; ?></td>
-              <td><select name="config_checkout_id">
-                  <option value="0"><?php echo $text_none; ?></option>
-                  <?php foreach ($informations as $information) { ?>
-                  <?php if ($information['information_id'] == $config_checkout_id) { ?>
-                  <option value="<?php echo $information['information_id']; ?>" selected="selected"><?php echo $information['title']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $information['information_id']; ?>"><?php echo $information['title']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_order_status; ?></td>
-              <td><select name="config_order_status_id">
-                  <?php foreach ($order_statuses as $order_status) { ?>
-                  <?php if ($order_status['order_status_id'] == $config_order_status_id) { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>" selected="selected"><?php echo $order_status['name']; ?></option>
-                  <?php } else { ?>
-                  <option value="<?php echo $order_status['order_status_id']; ?>"><?php echo $order_status['name']; ?></option>
-                  <?php } ?>
-                  <?php } ?>
-                </select></td>
-            </tr>
-          </table>
-          <h2><?php echo $text_stock; ?></h2>
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_stock_display; ?></td>
-              <td><?php if ($config_stock_display) { ?>
-                <input type="radio" name="config_stock_display" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_display" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_stock_display" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_display" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_stock_checkout; ?></td>
-              <td><?php if ($config_stock_checkout) { ?>
-                <input type="radio" name="config_stock_checkout" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_checkout" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_stock_checkout" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_stock_checkout" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-image">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_logo; ?></td>
-              <td><div class="image"><img src="<?php echo $logo; ?>" alt="" id="thumb-logo" />
-                  <input type="hidden" name="config_logo" value="<?php echo $config_logo; ?>" id="logo" />
-                  <br />
-                  <a onclick="image_upload('logo', 'thumb-logo');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-logo').attr('src', '<?php echo $no_image; ?>'); $('#logo').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-            </tr>
-            <tr>
-              <td><?php echo $entry_icon; ?></td>
-              <td><div class="image"><img src="<?php echo $icon; ?>" alt="" id="thumb-icon" />
-                  <input type="hidden" name="config_icon" value="<?php echo $config_icon; ?>" id="icon" />
-                  <br />
-                  <a onclick="image_upload('icon', 'thumb-icon');"><?php echo $text_browse; ?></a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick="$('#thumb-icon').attr('src', '<?php echo $no_image; ?>'); $('#icon').attr('value', '');"><?php echo $text_clear; ?></a></div></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_category; ?></td>
-              <td><input type="text" name="config_image_category_width" value="<?php echo $config_image_category_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_category_height" value="<?php echo $config_image_category_height; ?>" size="3" />
-                <?php if ($error_image_category) { ?>
-                <span class="error"><?php echo $error_image_category; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_thumb; ?></td>
-              <td><input type="text" name="config_image_thumb_width" value="<?php echo $config_image_thumb_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_thumb_height" value="<?php echo $config_image_thumb_height; ?>" size="3" />
-                <?php if ($error_image_thumb) { ?>
-                <span class="error"><?php echo $error_image_thumb; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_popup; ?></td>
-              <td><input type="text" name="config_image_popup_width" value="<?php echo $config_image_popup_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_popup_height" value="<?php echo $config_image_popup_height; ?>" size="3" />
-                <?php if ($error_image_popup) { ?>
-                <span class="error"><?php echo $error_image_popup; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_product; ?></td>
-              <td><input type="text" name="config_image_product_width" value="<?php echo $config_image_product_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_product_height" value="<?php echo $config_image_product_height; ?>" size="3" />
-                <?php if ($error_image_product) { ?>
-                <span class="error"><?php echo $error_image_product; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_additional; ?></td>
-              <td><input type="text" name="config_image_additional_width" value="<?php echo $config_image_additional_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_additional_height" value="<?php echo $config_image_additional_height; ?>" size="3" />
-                <?php if ($error_image_additional) { ?>
-                <span class="error"><?php echo $error_image_additional; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_related; ?></td>
-              <td><input type="text" name="config_image_related_width" value="<?php echo $config_image_related_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_related_height" value="<?php echo $config_image_related_height; ?>" size="3" />
-                <?php if ($error_image_related) { ?>
-                <span class="error"><?php echo $error_image_related; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_compare; ?></td>
-              <td><input type="text" name="config_image_compare_width" value="<?php echo $config_image_compare_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_compare_height" value="<?php echo $config_image_compare_height; ?>" size="3" />
-                <?php if ($error_image_compare) { ?>
-                <span class="error"><?php echo $error_image_compare; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_wishlist; ?></td>
-              <td><input type="text" name="config_image_wishlist_width" value="<?php echo $config_image_wishlist_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_wishlist_height" value="<?php echo $config_image_wishlist_height; ?>" size="3" />
-                <?php if ($error_image_wishlist) { ?>
-                <span class="error"><?php echo $error_image_wishlist; ?></span>
-                <?php } ?></td>
-            </tr>
-            <tr>
-              <td><span class="required">*</span> <?php echo $entry_image_cart; ?></td>
-              <td><input type="text" name="config_image_cart_width" value="<?php echo $config_image_cart_width; ?>" size="3" />
-                x
-                <input type="text" name="config_image_cart_height" value="<?php echo $config_image_cart_height; ?>" size="3" />
-                <?php if ($error_image_cart) { ?>
-                <span class="error"><?php echo $error_image_cart; ?></span>
-                <?php } ?></td>
-            </tr>
-          </table>
-        </div>
-        <div id="tab-server">
-          <table class="form">
-            <tr>
-              <td><?php echo $entry_secure; ?></td>
-              <td><?php if ($config_secure) { ?>
-                <input type="radio" name="config_secure" value="1" checked="checked" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_secure" value="0" />
-                <?php echo $text_no; ?>
-                <?php } else { ?>
-                <input type="radio" name="config_secure" value="1" />
-                <?php echo $text_yes; ?>
-                <input type="radio" name="config_secure" value="0" checked="checked" />
-                <?php echo $text_no; ?>
-                <?php } ?></td>
-            </tr>
-          </table>
-        </div>
-      </form>
-    </div>
-  </div>
-</div>
-<script type="text/javascript"><!--
-function warningOutput(template) {
-	if(template != 'default') {
-		$('#warning_text').css('display', '');
-	}
-}
-$('#template').load('index.php?route=setting/store/template&token=<?php echo $token; ?>&template=' + encodeURIComponent($('select[name=\'config_template\']').attr('value')));
-//--></script> 
-<script type="text/javascript"><!--
-$('select[name=\'config_country_id\']').bind('change', function() {
-	$.ajax({
-		url: 'index.php?route=setting/store/country&token=<?php echo $token; ?>&country_id=' + this.value,
-		dataType: 'json',
-		beforeSend: function() {
-			$('select[name=\'country_id\']').after('<span class="wait">&nbsp;<img src="view/image/loading.gif" alt="" /></span>');
-		},		
-		complete: function() {
-			$('.wait').remove();
-		},			
-		success: function(json) {
-			if (json['postcode_required'] == '1') {
-				$('#postcode-required').show();
-			} else {
-				$('#postcode-required').hide();
-			}
-			
-			html = '<option value=""><?php echo $text_select; ?></option>';
-			
-			if (json['zone'] != '') {
-				for (i = 0; i < json['zone'].length; i++) {
-        			html += '<option value="' + json['zone'][i]['zone_id'] + '"';
-	    			
-					if (json['zone'][i]['zone_id'] == '<?php echo $config_zone_id; ?>') {
-	      				html += ' selected="selected"';
-	    			}
-	
-	    			html += '>' + json['zone'][i]['name'] + '</option>';
-				}
-			} else {
-				html += '<option value="0" selected="selected"><?php echo $text_none; ?></option>';
-			}
-			
-			$('select[name=\'config_zone_id\']').html(html);
-		},
-		error: function(xhr, ajaxOptions, thrownError) {
-			alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
-		}
-	});
-});
-
-$('select[name=\'config_country_id\']').trigger('change');
-//--></script> 
-<script type="text/javascript"><!--
-function image_upload(field, thumb) {
-	$('#dialog').remove();
-	
-	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
-	
-	$('#dialog').dialog({
-		title: '<?php echo $text_image_manager; ?>',
-		close: function (event, ui) {
-			if ($('#' + field).attr('value')) {
-				$.ajax({
-					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).val()),
-					dataType: 'text',
-					success: function(data) {
-						$('#' + thumb).replaceWith('<img src="' + data + '" alt="" id="' + thumb + '" />');
-					}
-				});
-			}
-		},	
-		bgiframe: false,
-		width: 800,
-		height: 400,
-		resizable: false,
-		modal: false
-	});
-};
-//--></script> 
-<script type="text/javascript"><!--
-$('#tabs a').tabs();
-//--></script> 
-<?php echo $footer; ?>
\ No newline at end of file
Index: trunk/www/admin/view/template/module/dresscode_featured_multi.tpl
===================================================================
--- trunk/www/admin/view/template/module/dresscode_featured_multi.tpl	(revision 0)
+++ trunk/www/admin/view/template/module/dresscode_featured_multi.tpl	(revision 20)
@@ -0,0 +1,207 @@
+<?php echo $header; ?>
+<div id="content">
+  <div class="breadcrumb">
+    <?php foreach ($breadcrumbs as $breadcrumb) { ?>
+    <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
+    <?php } ?>
+  </div>
+  <?php if ($error_warning) { ?>
+  <div class="warning"><?php echo $error_warning; ?></div>
+  <?php } ?>
+  <div class="box">
+    <div class="heading">
+      <h1><img src="view/image/module.png" alt="" /> <?php echo $heading_title; ?></h1>
+      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
+    </div>
+    <div class="content">
+      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
+        <table class="form">
+          <tr>
+            <td><?php echo $entry_product; ?></td>
+            <td><input type="text" name="product" value="" /></td>
+          </tr>
+          <tr>
+            <td>&nbsp;</td>
+            <td><div id="dresscode-featured-product" class="scrollbox">
+                <?php $class = 'odd'; ?>
+                <?php foreach ($products as $product) { ?>
+                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
+                <div id="dresscode-featured-product<?php echo $product['product_id']; ?>" class="<?php echo $class; ?>"><?php echo $product['name']; ?> <img src="view/image/delete.png" alt="" />
+                  <input type="hidden" value="<?php echo $product['product_id']; ?>" />
+                </div>
+                <?php } ?>
+              </div>
+              <input type="hidden" name="dresscode_featured_multi_product" value="<?php echo $dresscode_featured_multi_product; ?>" /></td>
+          </tr>
+        </table>
+        <table id="module" class="list">
+          <thead>
+            <tr>
+                <!--<td class="left"><?php echo $entry_limit; ?></td>-->
+    <td class="left"><?php echo $entry_image; ?></td>
+    <td class="left"><?php echo $entry_layout; ?></td>
+    <td class="left"><?php echo $entry_position; ?></td>
+    <td class="left"><?php echo $entry_status; ?></td>
+    <td class="right"><?php echo $entry_sort_order; ?></td>
+    <td></td>
+  </tr>
+</thead>
+<?php $module_row = 0; ?>
+<?php foreach ($modules as $module) { ?>
+<tbody id="module-row<?php echo $module_row; ?>">
+  <tr>
+
+              <td class="left"><input type="text" name="dresscode_featured_multi_module[<?php echo $module_row; ?>][image_width]" value="<?php echo $module['image_width']; ?>" size="3" />
+                <input type="text" name="dresscode_featured_multi_module[<?php echo $module_row; ?>][image_height]" value="<?php echo $module['image_height']; ?>" size="3" />
+                <?php if (isset($error_image[$module_row])) { ?>
+                <span class="error"><?php echo $error_image[$module_row]; ?></span>
+                <?php } ?></td>
+              <td class="left"><select name="dresscode_featured_multi_module[<?php echo $module_row; ?>][layout_id]">
+                  <?php foreach ($layouts as $layout) { ?>
+                  <?php if ($layout['layout_id'] == $module['layout_id']) { ?>
+                  <option value="<?php echo $layout['layout_id']; ?>" selected="selected"><?php echo $layout['name']; ?></option>
+                  <?php } else { ?>
+                  <option value="<?php echo $layout['layout_id']; ?>"><?php echo $layout['name']; ?></option>
+                  <?php } ?>
+                  <?php } ?>
+                </select></td>
+              <td class="left"><select name="dresscode_featured_multi_module[<?php echo $module_row; ?>][position]">
+                  <?php if ($module['position'] == 'content_footer') { ?>
+				  <option value="content_footer" selected="selected">Content Footer</option>
+				  <?php } else { ?>
+				  <option value="content_footer">Content Footer</option>
+				  <?php } ?>
+
+				  <?php if ($module['position'] == 'content_top') { ?>
+                  <option value="content_top" selected="selected"><?php echo $text_content_top; ?></option>
+                  <?php } else { ?>
+                  <option value="content_top"><?php echo $text_content_top; ?></option>
+                  <?php } ?>
+                  <?php if ($module['position'] == 'content_bottom') { ?>
+                  <option value="content_bottom" selected="selected"><?php echo $text_content_bottom; ?></option>
+                  <?php } else { ?>
+                  <option value="content_bottom"><?php echo $text_content_bottom; ?></option>
+                  <?php } ?>
+                  <?php if ($module['position'] == 'column_left') { ?>
+                  <option value="column_left" selected="selected"><?php echo $text_column_left; ?></option>
+                  <?php } else { ?>
+                  <option value="column_left"><?php echo $text_column_left; ?></option>
+                  <?php } ?>
+                  <?php if ($module['position'] == 'column_right') { ?>
+                  <option value="column_right" selected="selected"><?php echo $text_column_right; ?></option>
+                  <?php } else { ?>
+                  <option value="column_right"><?php echo $text_column_right; ?></option>
+                  <?php } ?>
+                </select></td>
+              <td class="left"><select name="dresscode_featured_multi_module[<?php echo $module_row; ?>][status]">
+                  <?php if ($module['status']) { ?>
+                  <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
+                  <option value="0"><?php echo $text_disabled; ?></option>
+                  <?php } else { ?>
+                  <option value="1"><?php echo $text_enabled; ?></option>
+                  <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
+                  <?php } ?>
+                </select></td>
+              <td class="right"><input type="text" name="dresscode_featured_multi_module[<?php echo $module_row; ?>][sort_order]" value="<?php echo $module['sort_order']; ?>" size="3" /></td>
+              <td class="left"><a onclick="$('#module-row<?php echo $module_row; ?>').remove();" class="button"><?php echo $button_remove; ?></a></td>
+            </tr>
+          </tbody>
+          <?php $module_row++; ?>
+          <?php } ?>
+          <tfoot>
+            <tr>
+              <td colspan="6"></td>
+              <td class="left"><a onclick="addModule();" class="button"><?php echo $button_add_module; ?></a></td>
+            </tr>
+          </tfoot>
+        </table>
+      </form>
+    </div>
+  </div>
+</div>
+<script type="text/javascript"><!--
+$('input[name=\'product\']').autocomplete({
+	delay: 500,
+	source: function(request, response) {
+		$.ajax({
+			url: 'index.php?route=catalog/product/autocomplete&token=<?php echo $token; ?>&filter_name=' +  encodeURIComponent(request.term),
+			dataType: 'json',
+			success: function(json) {
+				response($.map(json, function(item) {
+					return {
+						label: item.name,
+						value: item.product_id
+					}
+				}));
+			}
+		});
+	},
+	select: function(event, ui) {
+		$('#dresscode-featured-product' + ui.item.value).remove();
+
+		$('#dresscode-featured-product').append('<div id="dresscode-featured-product' + ui.item.value + '">' + ui.item.label + '<img src="view/image/delete.png" /><input type="hidden" value="' + ui.item.value + '" /></div>');
+
+		$('#dresscode-featured-product div:odd').attr('class', 'odd');
+		$('#dresscode-featured-product div:even').attr('class', 'even');
+
+		data = $.map($('#dresscode-featured-product input'), function(element){
+			return $(element).attr('value');
+		});
+
+		$('input[name=\'dresscode_featured_multi_product\']').attr('value', data.join());
+
+		return false;
+	},
+	focus: function(event, ui) {
+      	return false;
+   	}
+});
+
+$('#dresscode-featured-product div img').live('click', function() {
+	$(this).parent().remove();
+
+	$('#dresscode-featured-product div:odd').attr('class', 'odd');
+	$('#dresscode-featured-product div:even').attr('class', 'even');
+
+	data = $.map($('#dresscode-featured-product input'), function(element){
+		return $(element).attr('value');
+	});
+
+	$('input[name=\'dresscode_featured_multi_product\']').attr('value', data.join());
+});
+//--></script>
+<script type="text/javascript"><!--
+var module_row = <?php echo $module_row; ?>;
+
+function addModule() {	
+	html  = '<tbody id="module-row' + module_row + '">';
+	html += '  <tr>';
+	html += '    <td class="left"><input type="text" name="dresscode_featured_multi_module[' + module_row + '][limit]" value="5" size="1" /></td>';
+	html += '    <td class="left"><input type="text" name="dresscode_featured_multi_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="dresscode_featured_multi_module[' + module_row + '][image_height]" value="80" size="3" /></td>';
+	html += '    <td class="left"><select name="dresscode_featured_multi_module[' + module_row + '][layout_id]">';
+	<?php foreach ($layouts as $layout) { ?>
+	html += '      <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
+	<?php } ?>
+	html += '    </select></td>';
+	html += '    <td class="left"><select name="dresscode_featured_multi_module[' + module_row + '][position]">';
+	html += '      <option value="content_footer">Content Footer</option>';
+	html += '      <option value="content_top"><?php echo $text_content_top; ?></option>';
+	html += '      <option value="content_bottom"><?php echo $text_content_bottom; ?></option>';
+	html += '      <option value="column_left"><?php echo $text_column_left; ?></option>';
+	html += '      <option value="column_right"><?php echo $text_column_right; ?></option>';
+	html += '    </select></td>';
+	html += '    <td class="left"><select name="dresscode_featured_multi_module[' + module_row + '][status]">';
+    html += '      <option value="1" selected="selected"><?php echo $text_enabled; ?></option>';
+    html += '      <option value="0"><?php echo $text_disabled; ?></option>';
+    html += '    </select></td>';
+	html += '    <td class="right"><input type="text" name="dresscode_featured_multi_module[' + module_row + '][sort_order]" value="" size="3" /></td>';
+	html += '    <td class="left"><a onclick="$(\'#module-row' + module_row + '\').remove();" class="button"><?php echo $button_remove; ?></a></td>';
+	html += '  </tr>';
+	html += '</tbody>';
+	
+	$('#module tfoot').before(html);
+	
+	module_row++;
+}
+//--></script> 
+<?php echo $footer; ?>
\ No newline at end of file
Index: trunk/www/catalog/view/javascript/common.js
===================================================================
--- trunk/www/catalog/view/javascript/common.js	(revision 19)
+++ trunk/www/catalog/view/javascript/common.js	(revision 20)
@@ -1,236 +0,0 @@
-$(document).ready(function() {
-	/* Search */
-	$('.button-search').bind('click', function() {
-		url = $('base').attr('href') + 'index.php?route=product/search';
-				 
-		var search = $('input[name=\'search\']').attr('value');
-		
-		if (search) {
-			url += '&search=' + encodeURIComponent(search);
-		}
-		
-		location = url;
-	});
-	
-	$('#header input[name=\'search\']').bind('keydown', function(e) {
-		if (e.keyCode == 13) {
-			url = $('base').attr('href') + 'index.php?route=product/search';
-			 
-			var search = $('input[name=\'search\']').attr('value');
-			
-			if (search) {
-				url += '&search=' + encodeURIComponent(search);
-			}
-			
-			location = url;
-		}
-	});
-	
-	/* Ajax Cart */
-	$('#cart > .heading a').live('click', function() {
-		$('#cart').addClass('active');
-		
-		$('#cart').load('index.php?route=module/cart #cart > *');
-		
-		$('#cart').live('mouseleave', function() {
-			$(this).removeClass('active');
-		});
-	});
-	
-	/* Mega Menu */
-	$('#menu ul > li > a + div').each(function(index, element) {
-		// IE6 & IE7 Fixes
-		if ($.browser.msie && ($.browser.version == 7 || $.browser.version == 6)) {
-			var category = $(element).find('a');
-			var columns = $(element).find('ul').length;
-			
-			$(element).css('width', (columns * 143) + 'px');
-			$(element).find('ul').css('float', 'left');
-		}		
-		
-		var menu = $('#menu').offset();
-		var dropdown = $(this).parent().offset();
-		
-		i = (dropdown.left + $(this).outerWidth()) - (menu.left + $('#menu').outerWidth());
-		
-		if (i > 0) {
-			$(this).css('margin-left', '-' + (i + 5) + 'px');
-		}
-	});
-
-	// IE6 & IE7 Fixes
-	if ($.browser.msie) {
-		if ($.browser.version <= 6) {
-			$('#column-left + #column-right + #content, #column-left + #content').css('margin-left', '195px');
-			
-			$('#column-right + #content').css('margin-right', '195px');
-		
-			$('.box-category ul li a.active + ul').css('display', 'block');	
-		}
-		
-		if ($.browser.version <= 7) {
-			$('#menu > ul > li').bind('mouseover', function() {
-				$(this).addClass('active');
-			});
-				
-			$('#menu > ul > li').bind('mouseout', function() {
-				$(this).removeClass('active');
-			});	
-		}
-	}
-	
-	$('.success img, .warning img, .attention img, .information img').live('click', function() {
-		$(this).parent().fadeOut('slow', function() {
-			$(this).remove();
-		});
-	});	
-});
-
-function getURLVar(key) {
-	var value = [];
-	
-	var query = String(document.location).split('?');
-	
-	if (query[1]) {
-		var part = query[1].split('&');
-
-		for (i = 0; i < part.length; i++) {
-			var data = part[i].split('=');
-			
-			if (data[0] && data[1]) {
-				value[data[0]] = data[1];
-			}
-		}
-		
-		if (value[key]) {
-			return value[key];
-		} else {
-			return '';
-		}
-	}
-}
-
-function addToCart(product_id, quantity) {
-    quantity = typeof(quantity) != 'undefined' ? quantity : 1;
-
-	$.ajax({
-		url: 'index.php?route=checkout/cart/add',
-		type: 'post',
-		data: 'product_id=' + product_id + '&quantity=' + quantity,
-		dataType: 'json',
-		success: function(json) {
-			$('.success, .warning, .attention, .information, .error').remove();
-			
-			if (json['redirect']) {
-				location = json['redirect'];
-			}
-			
-			if (json['success']) {
-				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
-				
-				$('.success').fadeIn('slow');
-				
-				$('#cart-total').html(json['total']);
-				$('html, body').animate({ scrollTop: 0 }, 'slow');
-			}	
-		}
-	});
-}
-
-
-
-/* new function fly to cart*/
-function addToCartFly(ajaxFunction, product_id, quantity) {
-      quantity = typeof(quantity) != 'undefined' ? quantity : 1;
-
-      $.ajax({
-          url: 'index.php?route=checkout/cart/add',
-          type: 'post',
-          data: 'product_id=' + product_id + '&quantity=' + quantity,
-          dataType: 'json',
-          success: function(json) {
-              $('.success, .warning, .attention, .information, .error').remove();
-
-              if (json['redirect']) {
-                  location = json['redirect'];
-              }
-
-              if (json['success']) {
-                  $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
-
-                  $('.success').fadeIn('slow');
-
-                  $('#cart-total').html(json['total']);
-
-
-                  /* fly to cart*/
-                  if (ajaxFunction == 'enable') {
-                      var newImageWidth 	= jQuery(".image-"+product_id).width() / 5;
-                      var newImageHeight	= jQuery(".image-"+product_id).height() / 5;
-
-                      jQuery(".image-"+product_id)
-                          .clone()
-                          .css({'position' : 'absolute', 'z-index' : '100'})
-                          .prependTo("#cart")
-                          .animate({opacity: 0.4}, 100 )
-                          .animate({opacity: 0.5, marginLeft: 100, width: newImageWidth, height: newImageHeight}, 700, function() {
-                              jQuery(this).remove();
-                          });
-                  }
-
-                  /* fly to cart*/
-
-                  $('html, body').animate({ scrollTop: 0 }, 'slow');
-              }
-          }
-      });
-  }
-
-/* new function fly to cart*/
-
-
-
-
-function addToWishList(product_id) {
-	$.ajax({
-		url: 'index.php?route=account/wishlist/add',
-		type: 'post',
-		data: 'product_id=' + product_id,
-		dataType: 'json',
-		success: function(json) {
-			$('.success, .warning, .attention, .information').remove();
-						
-			if (json['success']) {
-				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
-				
-				$('.success').fadeIn('slow');
-				
-				$('#wishlist-total').html(json['total']);
-				
-				$('html, body').animate({ scrollTop: 0 }, 'slow');
-			}	
-		}
-	});
-}
-
-function addToCompare(product_id) { 
-	$.ajax({
-		url: 'index.php?route=product/compare/add',
-		type: 'post',
-		data: 'product_id=' + product_id,
-		dataType: 'json',
-		success: function(json) {
-			$('.success, .warning, .attention, .information').remove();
-						
-			if (json['success']) {
-				$('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
-				
-				$('.success').fadeIn('slow');
-				
-				$('#compare-total').html(json['total']);
-				
-				$('html, body').animate({ scrollTop: 0 }, 'slow'); 
-			}	
-		}
-	});
-}
\ No newline at end of file
Index: trunk/www/catalog/view/theme/dresscode/stylesheet/sliders_styles.css
===================================================================
--- trunk/www/catalog/view/theme/dresscode/stylesheet/sliders_styles.css	(revision 19)
+++ trunk/www/catalog/view/theme/dresscode/stylesheet/sliders_styles.css	(revision 20)
@@ -159,7 +159,8 @@
     float:left;
     margin-top:2px
 }
-.tabs div a{
+.tabs div a,
+.box-heading.featured-multi-heading{
     font-size:16px;
     line-height:16px;
     padding:4px 7px;
@@ -172,10 +173,12 @@
     font-family: 'Open Sans', sans-serif;
     text-transform: uppercase
 }
+.box-heading.featured-multi-heading{float:none;display:inline-block;margin-bottom: 20px;margin-top: 20px}
+.featured_block_multi{}
 
-
-.tabs div a:hover,  .tabs div a.active_slider,
-#bestsellers_activate:hover, #newproducts_activate:hover, #specials_activate:hover{
+.tabs div a:hover, .tabs div a.active_slider,
+#bestsellers_activate:hover, #newproducts_activate:hover, #specials_activate:hover,
+.box-heading.featured-multi-heading{
     background-color:#333333;
     color:#fff;
 }
Index: trunk/www/catalog/view/theme/dresscode/template/module/dresscode_featured_multi.tpl
===================================================================
--- trunk/www/catalog/view/theme/dresscode/template/module/dresscode_featured_multi.tpl	(revision 0)
+++ trunk/www/catalog/view/theme/dresscode/template/module/dresscode_featured_multi.tpl	(revision 20)
@@ -0,0 +1,81 @@
+
+<div class="featured_block_multi">
+
+    <div class="box-heading featured-multi-heading">
+        <table class="slider_table_style">
+            <tr class="slider_tr_style">
+                <td class="slider_td_style">
+                    <?php echo $heading_title; ?>
+                </td>
+            </tr>
+        </table>
+    </div>
+
+    <div class="clearfix">
+      <?php
+        $featured_count = 0;
+      foreach ($products as $product) {
+          $featured_count++;
+      ?>
+
+
+    <div class="four columns product <?php echo ($featured_count == 1 ? 'alpha' : ''); ?> <?php echo (($featured_count == 4) ? 'omega' : ''); ?>">
+        <?php if ($product['thumb']) { ?>
+        <div class="product-image-wrapper">
+
+            <?php if ( $sale !== 'disable') : ?>
+            <span class="product_sticker sticker_sale sticker_onsale_<?php echo $saleposition; ?> <?php echo ($sale ? ($product['special'] ? 'sticker_display' : 'sticker_display_none') : 'sticker_display_none'); ?>"></span>
+            <?php endif; ?>
+            <?php if ( $video !== 'disable') : ?>
+            <span class="product_sticker sticker_video sticker_video_<?php echo $videoposition; ?> <?php echo ($video ? (($product['youtube_video'][0] !== '') ? 'sticker_display' : 'sticker_display_none') : 'sticker_display_none'); ?>"></span>
+            <?php endif; ?>
+
+            <a class="img_conteiner" href="<?php echo $product['href']; ?>">
+                <img class="scale-with-grid image-<?php echo $product['product_id']; ?>" src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" />
+                <?php if ($product['popup']) { ?>
+                <div class="roll_over_img">
+                    <img class="scale-with-grid" src="<?php echo $product['popup']; ?>" alt="<?php echo $product['name']; ?>" />
+                </div>
+                <?php } ?>
+                <div class="product-image-wrapper-hover"></div>
+            </a>
+        </div>
+        <?php } ?>
+
+
+        <div class="wrapper-hover">
+            <div class="product-price">
+                <?php if ($product['price']) { ?>
+                <div class="price">
+                    <?php if (!$product['special']) { ?>
+                    <span><?php echo $product['price']; ?></span>
+                    <?php } else { ?>
+                    <span class="price-old"><?php echo $product['price']; ?></span>
+                    <span class="price-new"><?php echo $product['special']; ?></span>
+                    <?php } ?>
+                </div>
+                <?php } ?>
+            </div>
+
+            <div class="product-name">
+                <div class="clearfix">
+                    <a class="icon_cart_title" onclick="location.href='<?php echo $product['href']; ?>';">
+                        <?php echo $product['name-main']; ?>
+                    </a>
+                    <div class="icon_cart_rollover">
+                        <a onclick="addToCartFly('<?php echo $ajaxcart; ?>', '<?php echo $product['product_id']; ?>');"></a>
+                    </div>
+                </div>
+            </div>
+        </div>
+
+
+
+
+    </div>
+
+
+    <?php } ?>
+
+    </div>
+</div>
\ No newline at end of file
Index: trunk/www/catalog/view/theme/dresscode/js/custom.js
===================================================================
--- trunk/www/catalog/view/theme/dresscode/js/custom.js	(revision 19)
+++ trunk/www/catalog/view/theme/dresscode/js/custom.js	(revision 20)
@@ -146,7 +146,7 @@
     });
     jQuery('#carousel_newproducts').elastislide({
         easing		: 'easeInOutQuad',
-        speed		: 1200,
+        speed		: 1200
 
     });
     //end slider switch
@@ -236,6 +236,55 @@
     else return(false);
 }
 
+/* new function fly to cart*/
+function addToCartFly(ajaxFunction, product_id, quantity) {
+    quantity = typeof(quantity) != 'undefined' ? quantity : 1;
+
+    $.ajax({
+        url: 'index.php?route=checkout/cart/add',
+        type: 'post',
+        data: 'product_id=' + product_id + '&quantity=' + quantity,
+        dataType: 'json',
+        success: function(json) {
+            $('.success, .warning, .attention, .information, .error').remove();
+
+            if (json['redirect']) {
+                location = json['redirect'];
+            }
+
+            if (json['success']) {
+                $('#notification').html('<div class="success" style="display: none;">' + json['success'] + '<img src="catalog/view/theme/default/image/close.png" alt="" class="close" /></div>');
+
+                $('.success').fadeIn('slow');
+
+                $('#cart-total').html(json['total']);
+
+
+                /* fly to cart*/
+                if (ajaxFunction == 'enable') {
+                    var newImageWidth 	= jQuery(".image-"+product_id).width() / 5;
+                    var newImageHeight	= jQuery(".image-"+product_id).height() / 5;
+
+                    jQuery(".image-"+product_id)
+                        .clone()
+                        .css({'position' : 'absolute', 'z-index' : '100'})
+                        .prependTo("#cart")
+                        .animate({opacity: 0.4}, 100 )
+                        .animate({opacity: 0.5, marginLeft: 100, width: newImageWidth, height: newImageHeight}, 700, function() {
+                            jQuery(this).remove();
+                        });
+                }
+
+                /* fly to cart*/
+
+                $('html, body').animate({ scrollTop: 0 }, 'slow');
+            }
+        }
+    });
+}
+
+/* new function fly to cart*/
+
 jQuery(window).load(function() {
     var data = browserDetectNav();
     /*alert("browser: "+data[0]+", version: "+data[1]+"."+data[2]);*/
Index: trunk/www/catalog/view/theme/default/template/common/content_footer.tpl
===================================================================
--- trunk/www/catalog/view/theme/default/template/common/content_footer.tpl	(revision 0)
+++ trunk/www/catalog/view/theme/default/template/common/content_footer.tpl	(revision 20)
@@ -0,0 +1,3 @@
+<?php foreach ($modules as $module) { ?>
+   <?php echo $module; ?>
+<?php } ?>
\ No newline at end of file
Index: trunk/www/catalog/view/theme/default/template/common/content_slider.tpl
===================================================================
--- trunk/www/catalog/view/theme/default/template/common/content_slider.tpl	(revision 0)
+++ trunk/www/catalog/view/theme/default/template/common/content_slider.tpl	(revision 20)
@@ -0,0 +1,3 @@
+<?php foreach ($modules as $module) { ?>
+<?php echo $module; ?>
+<?php } ?>
\ No newline at end of file
Index: trunk/www/catalog/view/theme/default/template/common/custom_menu.tpl
===================================================================
--- trunk/www/catalog/view/theme/default/template/common/custom_menu.tpl	(revision 0)
+++ trunk/www/catalog/view/theme/default/template/common/custom_menu.tpl	(revision 20)
@@ -0,0 +1,3 @@
+<?php foreach ($modules as $module) { ?>
+<?php echo $module; ?>
+<?php } ?>
\ No newline at end of file
Index: trunk/www/catalog/model/design/banner.php
===================================================================
--- trunk/www/catalog/model/design/banner.php	(revision 19)
+++ trunk/www/catalog/model/design/banner.php	(revision 20)
@@ -1,9 +0,0 @@
-<?php
-class ModelDesignBanner extends Model {	
-	public function getBanner($banner_id) {
-		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "banner_image bi LEFT JOIN " . DB_PREFIX . "banner_image_description bid ON (bi.banner_image_id  = bid.banner_image_id) WHERE bi.banner_id = '" . (int)$banner_id . "' AND bid.language_id = '" . (int)$this->config->get('config_language_id') . "' ORDER BY bi.banner_image_id");
-		
-		return $query->rows;
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/product/manufacturer.php
===================================================================
--- trunk/www/catalog/controller/product/manufacturer.php	(revision 19)
+++ trunk/www/catalog/controller/product/manufacturer.php	(revision 20)
@@ -1,493 +0,0 @@
-<?php 
-class ControllerProductManufacturer extends Controller {  
-	public function index() { 
-		$this->language->load('product/manufacturer');
-		
-		$this->load->model('catalog/manufacturer');
-		
-		$this->load->model('tool/image');		
-		
-		$this->document->setTitle($this->language->get('heading_title'));
-		
-		$this->data['heading_title'] = $this->language->get('heading_title');
-		
-		$this->data['text_index'] = $this->language->get('text_index');
-		$this->data['text_empty'] = $this->language->get('text_empty');
-		
-		$this->data['button_continue'] = $this->language->get('button_continue');
-		
-		$this->data['breadcrumbs'] = array();
-		
-      	$this->data['breadcrumbs'][] = array(
-        	'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home'),
-        	'separator' => false
-      	);
-		
-		$this->data['breadcrumbs'][] = array(
-			'text'      => $this->language->get('text_brand'),
-			'href'      => $this->url->link('product/manufacturer'),
-			'separator' => $this->language->get('text_separator')
-		);
-		
-		$this->data['categories'] = array();
-									
-		$results = $this->model_catalog_manufacturer->getManufacturers();
-	
-		foreach ($results as $result) {
-			if (is_numeric(utf8_substr($result['name'], 0, 1))) {
-				$key = '0 - 9';
-			} else {
-				$key = utf8_substr(utf8_strtoupper($result['name']), 0, 1);
-			}
-			
-			if (!isset($this->data['manufacturers'][$key])) {
-				$this->data['categories'][$key]['name'] = $key;
-			}
-			
-			$this->data['categories'][$key]['manufacturer'][] = array(
-				'name' => $result['name'],
-				'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $result['manufacturer_id'])
-			);
-		}
-		
-		$this->data['continue'] = $this->url->link('common/home');
-
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/manufacturer_list.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/product/manufacturer_list.tpl';
-		} else {
-			$this->template = 'default/template/product/manufacturer_list.tpl';
-		}			
-		
-		$this->children = array(
-			'common/column_left',
-			'common/column_right',
-			'common/content_top',
-			'common/content_bottom',
-			'common/footer',
-			'common/header'
-		);
-				
-		$this->response->setOutput($this->render());										
-  	}
-	
-	public function info() {
-    	$this->language->load('product/manufacturer');
-		
-		$this->load->model('catalog/manufacturer');
-		
-		$this->load->model('catalog/product');
-		
-		$this->load->model('tool/image'); 
-		
-		if (isset($this->request->get['manufacturer_id'])) {
-			$manufacturer_id = (int)$this->request->get['manufacturer_id'];
-		} else {
-			$manufacturer_id = 0;
-		} 
-										
-		if (isset($this->request->get['sort'])) {
-			$sort = $this->request->get['sort'];
-		} else {
-			$sort = 'p.sort_order';
-		} 
-
-		if (isset($this->request->get['order'])) {
-			$order = $this->request->get['order'];
-		} else {
-			$order = 'ASC';
-		} 
-  		
-		if (isset($this->request->get['page'])) {
-			$page = $this->request->get['page'];
-		} else {
-			$page = 1;
-		}
-				
-		if (isset($this->request->get['limit'])) {
-			$limit = $this->request->get['limit'];
-		} else {
-			$limit = $this->config->get('config_catalog_limit');
-		}
-
-		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array( 
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home'),
-      		'separator' => false
-   		);
-   		
-		$this->data['breadcrumbs'][] = array( 
-       		'text'      => $this->language->get('text_brand'),
-			'href'      => $this->url->link('product/manufacturer'),
-      		'separator' => $this->language->get('text_separator')
-   		);
-		
-		$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($manufacturer_id);
-	
-		if ($manufacturer_info) {
-			$this->document->setTitle($manufacturer_info['name']);
-			$this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
-			
-			$url = '';
-			
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-	
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-					
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}	
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-		   			
-			$this->data['breadcrumbs'][] = array(
-       			'text'      => $manufacturer_info['name'],
-				'href'      => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url),
-      			'separator' => $this->language->get('text_separator')
-   			);
-		
-			$this->data['heading_title'] = $manufacturer_info['name'];
-			
-			$this->data['text_empty'] = $this->language->get('text_empty');
-			$this->data['text_quantity'] = $this->language->get('text_quantity');
-			$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-			$this->data['text_model'] = $this->language->get('text_model');
-			$this->data['text_price'] = $this->language->get('text_price');
-			$this->data['text_tax'] = $this->language->get('text_tax');
-			$this->data['text_points'] = $this->language->get('text_points');
-			$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
-			$this->data['text_display'] = $this->language->get('text_display');
-			$this->data['text_list'] = $this->language->get('text_list');
-			$this->data['text_grid'] = $this->language->get('text_grid');			
-			$this->data['text_sort'] = $this->language->get('text_sort');
-			$this->data['text_limit'] = $this->language->get('text_limit');
-			  
-			$this->data['button_cart'] = $this->language->get('button_cart');
-			$this->data['button_wishlist'] = $this->language->get('button_wishlist');
-			$this->data['button_compare'] = $this->language->get('button_compare');
-			$this->data['button_continue'] = $this->language->get('button_continue');
-			
-			$this->data['compare'] = $this->url->link('product/compare');
-			
-			$this->data['products'] = array();
-			
-			$data = array(
-				'filter_manufacturer_id' => $manufacturer_id, 
-				'sort'                   => $sort,
-				'order'                  => $order,
-				'start'                  => ($page - 1) * $limit,
-				'limit'                  => $limit
-			);
-					
-			$product_total = $this->model_catalog_product->getTotalProducts($data);
-								
-			$results = $this->model_catalog_product->getProducts($data);
-					
-			foreach ($results as $result) {
-				if ($result['image']) {
-					$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-				} else {
-					$image = false;
-				}
-
-                //addit image
-                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
-                if ($results_images) {
-                    $first = true;
-                    foreach ($results_images as $results_image) {
-                        if ( $first ) {
-                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-                            $first = false;
-                        }
-                    }
-                } else {
-                    $popup = false;
-                }
-
-                //addit image
-
-
-                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
-					$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$price = false;
-				}
-				
-				if ((float)$result['special']) {
-					$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$special = false;
-				}	
-				
-				if ($this->config->get('config_tax')) {
-					$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
-				} else {
-					$tax = false;
-				}				
-				
-				if ($this->config->get('config_review_status')) {
-					$rating = (int)$result['rating'];
-				} else {
-					$rating = false;
-				}
-                //youtube
-                $this->data['youtubes'] = array();
-                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
-                $youtubes = explode(',',$query->row['video']);
-                $this->data['youtubes'] = $youtubes;
-                //youtube
-
-                /* vars from admin panel labels settings */
-                $this->config->get('bs_general');
-                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
-                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
-                } else {
-                    $this->data['ajaxcart'] = '';
-                }
-
-                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
-
-                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
-                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
-                } else {
-                    $this->data['sale'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
-                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
-                } else {
-                    $this->data['video'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
-                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
-                } else {
-                    $this->data['saleposition'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
-                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
-                } else {
-                    $this->data['videoposition'] = '';
-                }
-
-
-                $this->data['products'][] = array(
-					'product_id'  => $result['product_id'],
-					'thumb'       => $image,
-                    //addit image
-                    'popup'   	 => $popup,
-                    //addit image
-                    //youtube video
-                    'youtube_video' => $youtubes,
-
-                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
-                    'name'        => $result['name'],
-                    'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
-					'price'       => $price,
-					'special'     => $special,
-					'tax'         => $tax,
-					'rating'      => $result['rating'],
-					'reviews'     => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
-					'href'        => $this->url->link('product/product', '&manufacturer_id=' . $result['manufacturer_id'] . '&product_id=' . $result['product_id'] . $url)
-				);
-			}
-					
-			$url = '';
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-						
-			$this->data['sorts'] = array();
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_default'),
-				'value' => 'p.sort_order-ASC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=p.sort_order&order=ASC' . $url)
-			);
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_name_asc'),
-				'value' => 'pd.name-ASC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=pd.name&order=ASC' . $url)
-			); 
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_name_desc'),
-				'value' => 'pd.name-DESC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=pd.name&order=DESC' . $url)
-			);
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_price_asc'),
-				'value' => 'p.price-ASC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=p.price&order=ASC' . $url)
-			); 
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_price_desc'),
-				'value' => 'p.price-DESC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=p.price&order=DESC' . $url)
-			); 
-			
-			if ($this->config->get('config_review_status')) {
-				$this->data['sorts'][] = array(
-					'text'  => $this->language->get('text_rating_desc'),
-					'value' => 'rating-DESC',
-					'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=rating&order=DESC' . $url)
-				); 
-				
-				$this->data['sorts'][] = array(
-					'text'  => $this->language->get('text_rating_asc'),
-					'value' => 'rating-ASC',
-					'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=rating&order=ASC' . $url)
-				);
-			}
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_asc'),
-				'value' => 'p.model-ASC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=p.model&order=ASC' . $url)
-			); 
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_desc'),
-				'value' => 'p.model-DESC',
-				'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . '&sort=p.model&order=DESC' . $url)
-			);
-	
-			$url = '';
-					
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-	
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-			
-			$this->data['limits'] = array();
-	
-			$limits = array_unique(array($this->config->get('config_catalog_limit'), 25, 50, 75, 100));
-			
-			sort($limits);
-	
-			foreach($limits as $limits){
-				$this->data['limits'][] = array(
-					'text'  => $limits,
-					'value' => $limits,
-					'href'  => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url . '&limit=' . $limits)
-				);
-			}
-			
-			$url = '';
-							
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-	
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-					
-			$pagination = new Pagination();
-			$pagination->total = $product_total;
-			$pagination->page = $page;
-			$pagination->limit = $limit;
-			$pagination->text = $this->language->get('text_pagination');
-			$pagination->url = $this->url->link('product/manufacturer/info','manufacturer_id=' . $this->request->get['manufacturer_id'] .  $url . '&page={page}');
-			
-			$this->data['pagination'] = $pagination->render();
-			
-			$this->data['sort'] = $sort;
-			$this->data['order'] = $order;
-			$this->data['limit'] = $limit;
-			
-			$this->data['continue'] = $this->url->link('common/home');
-			
-			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/manufacturer_info.tpl')) {
-				$this->template = $this->config->get('config_template') . '/template/product/manufacturer_info.tpl';
-			} else {
-				$this->template = 'default/template/product/manufacturer_info.tpl';
-			}
-			
-			$this->children = array(
-				'common/column_left',
-				'common/column_right',
-				'common/content_top',
-				'common/content_bottom',
-				'common/footer',
-				'common/header'
-			);
-					
-			$this->response->setOutput($this->render());
-		} else {
-			$url = '';
-			
-			if (isset($this->request->get['manufacturer_id'])) {
-				$url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
-			}
-									
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-				
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-						
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-						
-			$this->data['breadcrumbs'][] = array(
-				'text'      => $this->language->get('text_error'),
-				'href'      => $this->url->link('product/category', $url),
-				'separator' => $this->language->get('text_separator')
-			);
-				
-			$this->document->setTitle($this->language->get('text_error'));
-
-      		$this->data['heading_title'] = $this->language->get('text_error');
-
-      		$this->data['text_error'] = $this->language->get('text_error');
-
-      		$this->data['button_continue'] = $this->language->get('button_continue');
-
-      		$this->data['continue'] = $this->url->link('common/home');
-
-			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
-				$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
-			} else {
-				$this->template = 'default/template/error/not_found.tpl';
-			}
-			
-			$this->children = array(
-				'common/column_left',
-				'common/column_right',
-				'common/content_top',
-				'common/content_bottom',
-				'common/footer',
-				'common/header'
-			);
-					
-			$this->response->setOutput($this->render());
-		}
-  	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/product/category.php
===================================================================
--- trunk/www/catalog/controller/product/category.php	(revision 19)
+++ trunk/www/catalog/controller/product/category.php	(revision 20)
@@ -1,528 +0,0 @@
-<?php 
-class ControllerProductCategory extends Controller {  
-	public function index() { 
-		
-				
-		$this->language->load('product/category');
-		
-		$this->load->model('catalog/category');
-		
-		$this->load->model('catalog/product');
-		
-		$this->load->model('tool/image'); 
-		
-		if (isset($this->request->get['filter'])) {
-			$filter = $this->request->get['filter'];
-		} else {
-			$filter = '';
-		}
-				
-		if (isset($this->request->get['sort'])) {
-			$sort = $this->request->get['sort'];
-		} else {
-			$sort = 'p.sort_order';
-		}
-
-		if (isset($this->request->get['order'])) {
-			$order = $this->request->get['order'];
-		} else {
-			$order = 'ASC';
-		}
-		
-		if (isset($this->request->get['page'])) {
-			$page = $this->request->get['page'];
-		} else { 
-			$page = 1;
-		}	
-							
-		if (isset($this->request->get['limit'])) {
-			$limit = $this->request->get['limit'];
-		} else {
-			$limit = $this->config->get('config_catalog_limit');
-		}
-					
-		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home'),
-       		'separator' => false
-   		);	
-			
-		if (isset($this->request->get['path'])) {
-			$url = '';
-			
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}	
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-									
-			$path = '';
-		
-			$parts = explode('_', (string)$this->request->get['path']);
-		
-			$category_id = (int)array_pop($parts);
-		
-			foreach ($parts as $path_id) {
-				if (!$path) {
-					$path = (int)$path_id;
-				} else {
-					$path .= '_' . (int)$path_id;
-				}
-									
-				$category_info = $this->model_catalog_category->getCategory($path_id);
-				
-				if ($category_info) {
-	       			$this->data['breadcrumbs'][] = array(
-   	    				'text'      => $category_info['name'],
-						'href'      => $this->url->link('product/category', 'path=' . $path . $url),
-        				'separator' => $this->language->get('text_separator')
-        			);
-				}
-			}
-		} else {
-			$category_id = 0;
-		}
-				
-		$category_info = $this->model_catalog_category->getCategory($category_id);
-	
-		if ($category_info) {
-	  		$this->document->setTitle($category_info['name']);
-			$this->document->setDescription($category_info['meta_description']);
-			$this->document->setKeywords($category_info['meta_keyword']);
-			$this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
-			
-			$this->data['heading_title'] = $category_info['name'];
-			
-			$this->data['text_refine'] = $this->language->get('text_refine');
-			$this->data['text_empty'] = $this->language->get('text_empty');			
-			$this->data['text_quantity'] = $this->language->get('text_quantity');
-			$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-			$this->data['text_model'] = $this->language->get('text_model');
-			$this->data['text_price'] = $this->language->get('text_price');
-			$this->data['text_tax'] = $this->language->get('text_tax');
-			$this->data['text_points'] = $this->language->get('text_points');
-			$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
-			$this->data['text_display'] = $this->language->get('text_display');
-			$this->data['text_list'] = $this->language->get('text_list');
-			$this->data['text_grid'] = $this->language->get('text_grid');
-			$this->data['text_sort'] = $this->language->get('text_sort');
-			$this->data['text_limit'] = $this->language->get('text_limit');
-					
-			$this->data['button_cart'] = $this->language->get('button_cart');
-			$this->data['button_wishlist'] = $this->language->get('button_wishlist');
-			$this->data['button_compare'] = $this->language->get('button_compare');
-			$this->data['button_continue'] = $this->language->get('button_continue');
-			
-			// Set the last category breadcrumb		
-			$url = '';
-			
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}	
-			
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-									
-			$this->data['breadcrumbs'][] = array(
-				'text'      => $category_info['name'],
-				'href'      => $this->url->link('product/category', 'path=' . $this->request->get['path']),
-				'separator' => $this->language->get('text_separator')
-			);
-								
-			if ($category_info['image']) {
-				$this->data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
-			} else {
-				$this->data['thumb'] = '';
-			}
-									
-			$this->data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
-			$this->data['compare'] = $this->url->link('product/compare');
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}	
-						
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}	
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-								
-			$this->data['categories'] = array();
-			
-			$results = $this->model_catalog_category->getCategories($category_id);
-			
-			foreach ($results as $result) {
-				$data = array(
-					'filter_category_id'  => $result['category_id'],
-					'filter_sub_category' => true
-				);
-				
-				$product_total = $this->model_catalog_product->getTotalProducts($data);				
-				
-				$this->data['categories'][] = array(
-					'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
-					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
-				);
-			}
-			
-			$this->data['products'] = array();
-			
-			$data = array(
-				'filter_category_id' => $category_id,
-				'filter_filter'      => $filter, 
-				'sort'               => $sort,
-				'order'              => $order,
-				'start'              => ($page - 1) * $limit,
-				'limit'              => $limit
-			);
-					
-			$product_total = $this->model_catalog_product->getTotalProducts($data); 
-			
-			$results = $this->model_catalog_product->getProducts($data);
-			
-			foreach ($results as $result) {
-				if ($result['image']) {
-					$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-				} else {
-					$image = false;
-				}
-
-                //addit image
-                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
-                if ($results_images) {
-                    $first = true;
-                    foreach ($results_images as $results_image) {
-                        if ( $first ) {
-                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-                            $first = false;
-                        }
-                    }
-                } else {
-                    $popup = false;
-                }
-
-                //addit image
-				
-				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
-					$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$price = false;
-				}
-				
-				if ((float)$result['special']) {
-					$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$special = false;
-				}	
-				
-				if ($this->config->get('config_tax')) {
-					$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
-				} else {
-					$tax = false;
-				}				
-				
-				if ($this->config->get('config_review_status')) {
-					$rating = (int)$result['rating'];
-				} else {
-					$rating = false;
-				}
-
-                //youtube
-                $this->data['youtubes'] = array();
-                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
-                $youtubes = explode(',',$query->row['video']);
-                $this->data['youtubes'] = $youtubes;
-                //youtube
-
-                /* vars from admin panel labels settings */
-                $this->config->get('bs_general');
-                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
-                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
-                } else {
-                    $this->data['ajaxcart'] = '';
-                }
-
-                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
-
-                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
-                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
-                } else {
-                    $this->data['sale'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
-                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
-                } else {
-                    $this->data['video'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
-                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
-                } else {
-                    $this->data['saleposition'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
-                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
-                } else {
-                    $this->data['videoposition'] = '';
-                }
-
-
-
-
-                $this->data['products'][] = array(
-					'product_id'  => $result['product_id'],
-					'thumb'       => $image,
-
-                    //addit image
-                    'popup'   	 => $popup,
-                    //addit image
-                    //youtube video
-                    'youtube_video' => $youtubes,
-
-                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
-                    'name'        => $result['name'],
-                    'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
-					'price'       => $price,
-					'special'     => $special,
-					'tax'         => $tax,
-					'rating'      => $result['rating'],
-					'reviews'     => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
-					'href'        => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
-				);
-			}
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}
-				
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-							
-			$this->data['sorts'] = array();
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_default'),
-				'value' => 'p.sort_order-ASC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url)
-			);
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_name_asc'),
-				'value' => 'pd.name-ASC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url)
-			);
-
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_name_desc'),
-				'value' => 'pd.name-DESC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url)
-			);
-
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_price_asc'),
-				'value' => 'p.price-ASC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url)
-			); 
-
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_price_desc'),
-				'value' => 'p.price-DESC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url)
-			); 
-			
-			if ($this->config->get('config_review_status')) {
-				$this->data['sorts'][] = array(
-					'text'  => $this->language->get('text_rating_desc'),
-					'value' => 'rating-DESC',
-					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url)
-				); 
-				
-				$this->data['sorts'][] = array(
-					'text'  => $this->language->get('text_rating_asc'),
-					'value' => 'rating-ASC',
-					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url)
-				);
-			}
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_asc'),
-				'value' => 'p.model-ASC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=ASC' . $url)
-			);
-
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_desc'),
-				'value' => 'p.model-DESC',
-				'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.model&order=DESC' . $url)
-			);
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}
-				
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-			
-			$this->data['limits'] = array();
-	
-			$limits = array_unique(array($this->config->get('config_catalog_limit'), 25, 50, 75, 100));
-			
-			sort($limits);
-	
-			foreach($limits as $limits){
-				$this->data['limits'][] = array(
-					'text'  => $limits,
-					'value' => $limits,
-					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $limits)
-				);
-			}
-			
-			$url = '';
-			
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}
-				
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-	
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-					
-			$pagination = new Pagination();
-			$pagination->total = $product_total;
-			$pagination->page = $page;
-			$pagination->limit = $limit;
-			$pagination->text = $this->language->get('text_pagination');
-			$pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');
-		
-			$this->data['pagination'] = $pagination->render();
-		
-			$this->data['sort'] = $sort;
-			$this->data['order'] = $order;
-			$this->data['limit'] = $limit;
-		
-			$this->data['continue'] = $this->url->link('common/home');
-
-			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
-				$this->template = $this->config->get('config_template') . '/template/product/category.tpl';
-			} else {
-				$this->template = 'default/template/product/category.tpl';
-			}
-			
-			$this->children = array(
-				'common/column_left',
-				'common/column_right',
-				'common/content_top',
-				'common/content_bottom',
-				'common/footer',
-				'common/header'
-			);
-				
-			$this->response->setOutput($this->render());										
-    	} else {
-			$url = '';
-			
-			if (isset($this->request->get['path'])) {
-				$url .= '&path=' . $this->request->get['path'];
-			}
-			
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}
-												
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-				
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-						
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-						
-			$this->data['breadcrumbs'][] = array(
-				'text'      => $this->language->get('text_error'),
-				'href'      => $this->url->link('product/category', $url),
-				'separator' => $this->language->get('text_separator')
-			);
-				
-			$this->document->setTitle($this->language->get('text_error'));
-
-      		$this->data['heading_title'] = $this->language->get('text_error');
-
-      		$this->data['text_error'] = $this->language->get('text_error');
-
-      		$this->data['button_continue'] = $this->language->get('button_continue');
-
-      		$this->data['continue'] = $this->url->link('common/home');
-
-			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
-				$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
-			} else {
-				$this->template = 'default/template/error/not_found.tpl';
-			}
-			
-		
-			$this->children = array(
-				'common/column_left',
-				'common/column_right',
-				'common/content_top',
-				'common/content_bottom',
-				'common/footer',
-				'common/header'
-			);
-					
-			$this->response->setOutput($this->render());
-		}
-  	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/product/product.php
===================================================================
--- trunk/www/catalog/controller/product/product.php	(revision 19)
+++ trunk/www/catalog/controller/product/product.php	(revision 20)
@@ -1,791 +0,0 @@
-<?php  
-class ControllerProductProduct extends Controller {
-	private $error = array(); 
-	
-	public function index() { 
-		$this->language->load('product/product');
-	
-		$this->data['breadcrumbs'] = array();
-
-		$this->data['breadcrumbs'][] = array(
-			'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home'),			
-			'separator' => false
-		);
-		
-		$this->load->model('catalog/category');	
-		
-		if (isset($this->request->get['path'])) {
-			$path = '';
-			
-			$parts = explode('_', (string)$this->request->get['path']);
-			
-			$category_id = (int)array_pop($parts);
-				
-			foreach ($parts as $path_id) {
-				if (!$path) {
-					$path = $path_id;
-				} else {
-					$path .= '_' . $path_id;
-				}
-				
-				$category_info = $this->model_catalog_category->getCategory($path_id);
-				
-				if ($category_info) {
-					$this->data['breadcrumbs'][] = array(
-						'text'      => $category_info['name'],
-						'href'      => $this->url->link('product/category', 'path=' . $path),
-						'separator' => $this->language->get('text_separator')
-					);
-				}
-			}
-			
-			// Set the last category breadcrumb
-			$category_info = $this->model_catalog_category->getCategory($category_id);
-				
-			if ($category_info) {			
-				$url = '';
-				
-				if (isset($this->request->get['sort'])) {
-					$url .= '&sort=' . $this->request->get['sort'];
-				}	
-	
-				if (isset($this->request->get['order'])) {
-					$url .= '&order=' . $this->request->get['order'];
-				}	
-				
-				if (isset($this->request->get['page'])) {
-					$url .= '&page=' . $this->request->get['page'];
-				}
-				
-				if (isset($this->request->get['limit'])) {
-					$url .= '&limit=' . $this->request->get['limit'];
-				}
-										
-				$this->data['breadcrumbs'][] = array(
-					'text'      => $category_info['name'],
-					'href'      => $this->url->link('product/category', 'path=' . $this->request->get['path']),
-					'separator' => $this->language->get('text_separator')
-				);
-			}
-		}
-		
-		$this->load->model('catalog/manufacturer');	
-		
-		if (isset($this->request->get['manufacturer_id'])) {
-			$this->data['breadcrumbs'][] = array( 
-				'text'      => $this->language->get('text_brand'),
-				'href'      => $this->url->link('product/manufacturer'),
-				'separator' => $this->language->get('text_separator')
-			);	
-	
-			$url = '';
-			
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}	
-			
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-						
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-							
-			$manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']);
-
-			if ($manufacturer_info) {	
-				$this->data['breadcrumbs'][] = array(
-					'text'	    => $manufacturer_info['name'],
-					'href'	    => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url),					
-					'separator' => $this->language->get('text_separator')
-				);
-			}
-		}
-		
-		if (isset($this->request->get['search']) || isset($this->request->get['tag'])) {
-			$url = '';
-			
-			if (isset($this->request->get['search'])) {
-				$url .= '&search=' . $this->request->get['search'];
-			}
-						
-			if (isset($this->request->get['tag'])) {
-				$url .= '&tag=' . $this->request->get['tag'];
-			}
-						
-			if (isset($this->request->get['description'])) {
-				$url .= '&description=' . $this->request->get['description'];
-			}
-			
-			if (isset($this->request->get['category_id'])) {
-				$url .= '&category_id=' . $this->request->get['category_id'];
-			}	
-
-			if (isset($this->request->get['sub_category'])) {
-				$url .= '&sub_category=' . $this->request->get['sub_category'];
-			}
-
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-			
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-						
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-												
-			$this->data['breadcrumbs'][] = array(
-				'text'      => $this->language->get('text_search'),
-				'href'      => $this->url->link('product/search', $url),
-				'separator' => $this->language->get('text_separator')
-			); 	
-		}
-		
-		if (isset($this->request->get['product_id'])) {
-			$product_id = (int)$this->request->get['product_id'];
-		} else {
-			$product_id = 0;
-		}
-		
-		$this->load->model('catalog/product');
-		
-		$product_info = $this->model_catalog_product->getProduct($product_id);
-		
-		if ($product_info) {
-			$url = '';
-			
-			if (isset($this->request->get['path'])) {
-				$url .= '&path=' . $this->request->get['path'];
-			}
-						
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}
-						
-			if (isset($this->request->get['manufacturer_id'])) {
-				$url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
-			}			
-
-			if (isset($this->request->get['search'])) {
-				$url .= '&search=' . $this->request->get['search'];
-			}
-						
-			if (isset($this->request->get['tag'])) {
-				$url .= '&tag=' . $this->request->get['tag'];
-			}
-			
-			if (isset($this->request->get['description'])) {
-				$url .= '&description=' . $this->request->get['description'];
-			}	
-						
-			if (isset($this->request->get['category_id'])) {
-				$url .= '&category_id=' . $this->request->get['category_id'];
-			}
-			
-			if (isset($this->request->get['sub_category'])) {
-				$url .= '&sub_category=' . $this->request->get['sub_category'];
-			}	
-			
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}	
-			
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-						
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-																		
-			$this->data['breadcrumbs'][] = array(
-				'text'      => $product_info['name'],
-				'href'      => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']),
-				'separator' => $this->language->get('text_separator')
-			);			
-			
-			$this->document->setTitle($product_info['name']);
-			$this->document->setDescription($product_info['meta_description']);
-			$this->document->setKeywords($product_info['meta_keyword']);
-			$this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical');
-			$this->document->addScript('catalog/view/javascript/jquery/tabs.js');
-			$this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js');
-			$this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css');
-			
-			$this->data['heading_title'] = $product_info['name'];
-			
-			$this->data['text_select'] = $this->language->get('text_select');
-			$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-			$this->data['text_model'] = $this->language->get('text_model');
-			$this->data['text_reward'] = $this->language->get('text_reward');
-			$this->data['text_points'] = $this->language->get('text_points');	
-			$this->data['text_discount'] = $this->language->get('text_discount');
-			$this->data['text_stock'] = $this->language->get('text_stock');
-			$this->data['text_price'] = $this->language->get('text_price');
-			$this->data['text_tax'] = $this->language->get('text_tax');
-			$this->data['text_discount'] = $this->language->get('text_discount');
-			$this->data['text_option'] = $this->language->get('text_option');
-			$this->data['text_qty'] = $this->language->get('text_qty');
-			$this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']);
-			$this->data['text_or'] = $this->language->get('text_or');
-			$this->data['text_write'] = $this->language->get('text_write');
-			$this->data['text_note'] = $this->language->get('text_note');
-			$this->data['text_share'] = $this->language->get('text_share');
-			$this->data['text_wait'] = $this->language->get('text_wait');
-			$this->data['text_tags'] = $this->language->get('text_tags');
-			
-			$this->data['entry_name'] = $this->language->get('entry_name');
-			$this->data['entry_review'] = $this->language->get('entry_review');
-			$this->data['entry_rating'] = $this->language->get('entry_rating');
-			$this->data['entry_good'] = $this->language->get('entry_good');
-			$this->data['entry_bad'] = $this->language->get('entry_bad');
-			$this->data['entry_captcha'] = $this->language->get('entry_captcha');
-			
-			$this->data['button_cart'] = $this->language->get('button_cart');
-			$this->data['az_button_cart'] = $this->language->get('az_button_cart');
-			
-			$this->data['button_wishlist'] = $this->language->get('button_wishlist');
-			$this->data['button_compare'] = $this->language->get('button_compare');			
-			$this->data['button_upload'] = $this->language->get('button_upload');
-			$this->data['button_continue'] = $this->language->get('button_continue');
-
-            //dresscode constants
-            $this->data['rollover_text'] = $this->language->get('rollover_text');
-            $this->data['no_rating'] = $this->language->get('no_rating');
-
-            $this->load->model('catalog/review');
-
-			$this->data['tab_description'] = $this->language->get('tab_description');
-			$this->data['tab_attribute'] = $this->language->get('tab_attribute');
-			$this->data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']);
-			$this->data['tab_related'] = $this->language->get('tab_related');
-            $this->data['tab_youtube'] = $this->language->get('tab_youtube');
-            $this->data['youtube_empty'] = $this->language->get('youtube_empty');
-
-            $this->data['product_id'] = $this->request->get['product_id'];
-			$this->data['manufacturer'] = $product_info['manufacturer'];
-			$this->data['manufacturers'] = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $product_info['manufacturer_id']);
-			$this->data['model'] = $product_info['model'];
-			$this->data['reward'] = $product_info['reward'];
-			$this->data['points'] = $product_info['points'];
-
-            $this->data['youtubes'] = array();
-            $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$product_id."'");
-
-
-            $youtubes = explode(',',$query->row['video']);
-            $this->data['youtubes'] = $youtubes;
-
-
-
-
-
-
-			if ($product_info['quantity'] <= 0) {
-				$this->data['stock'] = $product_info['stock_status'];
-			} elseif ($this->config->get('config_stock_display')) {
-				$this->data['stock'] = $product_info['quantity'];
-			} else {
-				$this->data['stock'] = $this->language->get('text_instock');
-			}
-			
-			$this->load->model('tool/image');
-
-			if ($product_info['image']) {
-				$this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
-			} else {
-				$this->data['popup'] = '';
-			}
-			
-			if ($product_info['image']) {
-				$this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
-			} else {
-				$this->data['thumb'] = '';
-			}
-			
-			$this->data['images'] = array();
-			
-			$results = $this->model_catalog_product->getProductImages($this->request->get['product_id']);
-			
-			foreach ($results as $result) {
-				$this->data['images'][] = array(
-					'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
-					'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
-				);
-			}	
-						
-			if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
-				$this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
-			} else {
-				$this->data['price'] = false;
-			}
-						
-			if ((float)$product_info['special']) {
-				$this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
-			} else {
-				$this->data['special'] = false;
-			}
-			
-			if ($this->config->get('config_tax')) {
-				$this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']);
-			} else {
-				$this->data['tax'] = false;
-			}
-			
-			$discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']);
-			
-			$this->data['discounts'] = array(); 
-			
-			foreach ($discounts as $discount) {
-				$this->data['discounts'][] = array(
-					'quantity' => $discount['quantity'],
-					'price'    => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax')))
-				);
-			}
-			
-			$this->data['options'] = array();
-			
-			foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { 
-				if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') { 
-					$option_value_data = array();
-					
-					foreach ($option['option_value'] as $option_value) {
-						if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
-							if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
-								$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
-							} else {
-								$price = false;
-							}
-							
-							$option_value_data[] = array(
-								'product_option_value_id' => $option_value['product_option_value_id'],
-								'option_value_id'         => $option_value['option_value_id'],
-								'name'                    => $option_value['name'],
-								'image'                   => $this->model_tool_image->resize($option_value['image'], 50, 50),
-								'price'                   => $price,
-								'price_prefix'            => $option_value['price_prefix']
-							);
-						}
-					}
-					
-					$this->data['options'][] = array(
-						'product_option_id' => $option['product_option_id'],
-						'option_id'         => $option['option_id'],
-						'name'              => $option['name'],
-						'type'              => $option['type'],
-						'option_value'      => $option_value_data,
-						'required'          => $option['required']
-					);					
-				} elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') {
-					$this->data['options'][] = array(
-						'product_option_id' => $option['product_option_id'],
-						'option_id'         => $option['option_id'],
-						'name'              => $option['name'],
-						'type'              => $option['type'],
-						'option_value'      => $option['option_value'],
-						'required'          => $option['required']
-					);						
-				}
-			}
-							
-			if ($product_info['minimum']) {
-				$this->data['minimum'] = $product_info['minimum'];
-			} else {
-				$this->data['minimum'] = 1;
-			}
-			
-			$this->data['review_status'] = $this->config->get('config_review_status');
-			$this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']);
-			$this->data['rating'] = (int)$product_info['rating'];
-			$this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
-			$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']);
-			
-			$this->data['products'] = array();
-			
-			$results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']);
-			
-			foreach ($results as $result) {
-				if ($result['image']) {
-					$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
-				} else {
-					$image = false;
-				}
-
-
-                //addit image
-                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
-                if ($results_images) {
-                    $first = true;
-                    foreach ($results_images as $results_image) {
-                        if ( $first ) {
-                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-                            $first = false;
-                        }
-                    }
-                } else {
-                    $popup = false;
-                }
-
-                //addit image
-
-                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
-					$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$price = false;
-				}
-						
-				if ((float)$result['special']) {
-					$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$special = false;
-				}
-				
-				if ($this->config->get('config_review_status')) {
-					$rating = (int)$result['rating'];
-				} else {
-					$rating = false;
-				}
-
-                //related products youtube
-                $this->data['youtubes_rel'] = array();
-                $query_rel = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
-
-                //$youtubes_rel = explode(',',$query_rel->row['video']);
-                //$this->data['youtubes_rel'] = $youtubes_rel;
-                //related products youtube
-
-                /* vars from admin panel labels settings */
-                $this->config->get('bs_general');
-                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
-                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
-                }
-                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
-                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
-                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
-                } else {
-                    $this->data['sale'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
-                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
-                } else {
-                    $this->data['video'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
-                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
-                } else {
-                    $this->data['saleposition'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
-                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
-                } else {
-                    $this->data['videoposition'] = '';
-                }
-
-
-                $this->data['products'][] = array(
-					'product_id' => $result['product_id'],
-					'thumb'   	 => $image,
-                    //addit image
-                    'popup'   	 => $popup,
-                    //addit image
-                    //youtube video
-                    'youtube_video_rel' => $query_rel->row['video'],
-
-                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
-                    'name'        => $result['name'],
-
-                    'price'   	 => $price,
-					'special' 	 => $special,
-					'rating'     => $rating,
-					'reviews'    => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
-					'href'    	 => $this->url->link('product/product', 'product_id=' . $result['product_id'])
-				);
-			}	
-			
-			$this->data['tags'] = array();
-			
-			if ($product_info['tag']) {		
-				$tags = explode(',', $product_info['tag']);
-				
-				foreach ($tags as $tag) {
-					$this->data['tags'][] = array(
-						'tag'  => trim($tag),
-						'href' => $this->url->link('product/search', 'tag=' . trim($tag))
-					);
-				}
-			}
-			
-			$this->model_catalog_product->updateViewed($this->request->get['product_id']);
-			
-			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) {
-				$this->template = $this->config->get('config_template') . '/template/product/product.tpl';
-			} else {
-				$this->template = 'default/template/product/product.tpl';
-			}
-			
-			$this->children = array(
-				'common/column_left',
-				'common/column_right',
-				'common/content_top',
-				'common/content_bottom',
-				'common/footer',
-				'common/header'
-			);
-						
-			$this->response->setOutput($this->render());
-		} else {
-			$url = '';
-			
-			if (isset($this->request->get['path'])) {
-				$url .= '&path=' . $this->request->get['path'];
-			}
-						
-			if (isset($this->request->get['filter'])) {
-				$url .= '&filter=' . $this->request->get['filter'];
-			}	
-						
-			if (isset($this->request->get['manufacturer_id'])) {
-				$url .= '&manufacturer_id=' . $this->request->get['manufacturer_id'];
-			}			
-
-			if (isset($this->request->get['search'])) {
-				$url .= '&search=' . $this->request->get['search'];
-			}	
-					
-			if (isset($this->request->get['tag'])) {
-				$url .= '&tag=' . $this->request->get['tag'];
-			}
-							
-			if (isset($this->request->get['description'])) {
-				$url .= '&description=' . $this->request->get['description'];
-			}
-					
-			if (isset($this->request->get['category_id'])) {
-				$url .= '&category_id=' . $this->request->get['category_id'];
-			}
-			
-			if (isset($this->request->get['sub_category'])) {
-				$url .= '&sub_category=' . $this->request->get['sub_category'];
-			}	
-			
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}	
-			
-			if (isset($this->request->get['page'])) {
-				$url .= '&page=' . $this->request->get['page'];
-			}
-						
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-														
-      		$this->data['breadcrumbs'][] = array(
-        		'text'      => $this->language->get('text_error'),
-				'href'      => $this->url->link('product/product', $url . '&product_id=' . $product_id),
-        		'separator' => $this->language->get('text_separator')
-      		);			
-		
-      		$this->document->setTitle($this->language->get('text_error'));
-
-      		$this->data['heading_title'] = $this->language->get('text_error');
-
-      		$this->data['text_error'] = $this->language->get('text_error');
-
-      		$this->data['button_continue'] = $this->language->get('button_continue');
-
-      		$this->data['continue'] = $this->url->link('common/home');
-
-			if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
-				$this->template = $this->config->get('config_template') . '/template/error/not_found.tpl';
-			} else {
-				$this->template = 'default/template/error/not_found.tpl';
-			}
-			
-			$this->children = array(
-				'common/column_left',
-				'common/column_right',
-				'common/content_top',
-				'common/content_bottom',
-				'common/footer',
-				'common/header'
-			);
-						
-			$this->response->setOutput($this->render());
-    	}
-  	}
-	
-	public function review() {
-    	$this->language->load('product/product');
-		
-		$this->load->model('catalog/review');
-
-		$this->data['text_on'] = $this->language->get('text_on');
-		$this->data['text_no_reviews'] = $this->language->get('text_no_reviews');
-
-		if (isset($this->request->get['page'])) {
-			$page = $this->request->get['page'];
-		} else {
-			$page = 1;
-		}  
-		
-		$this->data['reviews'] = array();
-		
-		$review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
-			
-		$results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
-      		
-		foreach ($results as $result) {
-        	$this->data['reviews'][] = array(
-        		'author'     => $result['author'],
-				'text'       => $result['text'],
-				'rating'     => (int)$result['rating'],
-        		'reviews'    => sprintf($this->language->get('text_reviews'), (int)$review_total),
-        		'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
-        	);
-      	}			
-			
-		$pagination = new Pagination();
-		$pagination->total = $review_total;
-		$pagination->page = $page;
-		$pagination->limit = 5; 
-		$pagination->text = $this->language->get('text_pagination');
-		$pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');
-			
-		$this->data['pagination'] = $pagination->render();
-		
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/product/review.tpl';
-		} else {
-			$this->template = 'default/template/product/review.tpl';
-		}
-		
-		$this->response->setOutput($this->render());
-	}
-	
-	public function write() {
-		$this->language->load('product/product');
-		
-		$this->load->model('catalog/review');
-		
-		$json = array();
-		
-		if ($this->request->server['REQUEST_METHOD'] == 'POST') {
-			if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) {
-				$json['error'] = $this->language->get('error_name');
-			}
-			
-			if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) {
-				$json['error'] = $this->language->get('error_text');
-			}
-	
-			if (empty($this->request->post['rating'])) {
-				$json['error'] = $this->language->get('error_rating');
-			}
-	
-			if (empty($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) {
-				$json['error'] = $this->language->get('error_captcha');
-			}
-				
-			if (!isset($json['error'])) {
-				$this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post);
-				
-				$json['success'] = $this->language->get('text_success');
-			}
-		}
-		
-		$this->response->setOutput(json_encode($json));
-	}
-	
-	public function captcha() {
-		$this->load->library('captcha');
-		
-		$captcha = new Captcha();
-		
-		$this->session->data['captcha'] = $captcha->getCode();
-		
-		$captcha->showImage();
-	}
-	
-	public function upload() {
-		$this->language->load('product/product');
-		
-		$json = array();
-		
-		if (!empty($this->request->files['file']['name'])) {
-			$filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8')));
-			
-			if ((utf8_strlen($filename) < 3) || (utf8_strlen($filename) > 64)) {
-        		$json['error'] = $this->language->get('error_filename');
-	  		}	  	
-
-			// Allowed file extension types
-			$allowed = array();
-			
-			$filetypes = explode("\n", $this->config->get('config_file_extension_allowed'));
-			
-			foreach ($filetypes as $filetype) {
-				$allowed[] = trim($filetype);
-			}
-			
-			if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) {
-				$json['error'] = $this->language->get('error_filetype');
-       		}	
-			
-			// Allowed file mime types		
-		    $allowed = array();
-			
-			$filetypes = explode("\n", $this->config->get('config_file_mime_allowed'));
-			
-			foreach ($filetypes as $filetype) {
-				$allowed[] = trim($filetype);
-			}
-							
-			if (!in_array($this->request->files['file']['type'], $allowed)) {
-				$json['error'] = $this->language->get('error_filetype');
-       		}	
-						
-			if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) {
-				$json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']);
-			}
-		} else {
-			$json['error'] = $this->language->get('error_upload');
-		}
-		
-		if (!$json && is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) {
-			$file = basename($filename) . '.' . md5(mt_rand());
-			
-			// Hide the uploaded file name so people can not link to it directly.
-			$json['file'] = $this->encryption->encrypt($file);
-			
-			move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file);
-						
-			$json['success'] = $this->language->get('text_upload');
-		}	
-		
-		$this->response->setOutput(json_encode($json));		
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/product/special.php
===================================================================
--- trunk/www/catalog/controller/product/special.php	(revision 19)
+++ trunk/www/catalog/controller/product/special.php	(revision 20)
@@ -1,347 +0,0 @@
-<?php 
-class ControllerProductSpecial extends Controller { 	
-	public function index() { 
-    	$this->language->load('product/special');
-		
-		$this->load->model('catalog/product');
-		
-		$this->load->model('tool/image');
-		
-		if (isset($this->request->get['sort'])) {
-			$sort = $this->request->get['sort'];
-		} else {
-			$sort = 'p.sort_order';
-		}
-
-		if (isset($this->request->get['order'])) {
-			$order = $this->request->get['order'];
-		} else {
-			$order = 'ASC';
-		}
-			 
-  		if (isset($this->request->get['page'])) {
-			$page = $this->request->get['page'];
-		} else {
-			$page = 1;
-		}
-		
-		if (isset($this->request->get['limit'])) {
-			$limit = $this->request->get['limit'];
-		} else {
-			$limit = $this->config->get('config_catalog_limit');
-		}
-				    	
-		$this->document->setTitle($this->language->get('heading_title'));
-		$this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
-
-		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home'),
-      		'separator' => false
-   		);
-
-		$url = '';
-		
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}	
-
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-				
-		if (isset($this->request->get['page'])) {
-			$url .= '&page=' . $this->request->get['page'];
-		}	
-		
-		if (isset($this->request->get['limit'])) {
-			$url .= '&limit=' . $this->request->get['limit'];
-		}
-					
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('product/special', $url),
-      		'separator' => $this->language->get('text_separator')
-   		);
-		
-    	$this->data['heading_title'] = $this->language->get('heading_title');
-   
-		$this->data['text_empty'] = $this->language->get('text_empty');
-		$this->data['text_quantity'] = $this->language->get('text_quantity');
-		$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-		$this->data['text_model'] = $this->language->get('text_model');
-		$this->data['text_price'] = $this->language->get('text_price');
-		$this->data['text_tax'] = $this->language->get('text_tax');
-		$this->data['text_points'] = $this->language->get('text_points');
-		$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
-		$this->data['text_display'] = $this->language->get('text_display');
-		$this->data['text_list'] = $this->language->get('text_list');
-		$this->data['text_grid'] = $this->language->get('text_grid');		
-		$this->data['text_sort'] = $this->language->get('text_sort');
-		$this->data['text_limit'] = $this->language->get('text_limit');
-
-		$this->data['button_cart'] = $this->language->get('button_cart');	
-		$this->data['button_wishlist'] = $this->language->get('button_wishlist');
-		$this->data['button_compare'] = $this->language->get('button_compare');
-		
-		$this->data['compare'] = $this->url->link('product/compare');
-		
-		$this->data['products'] = array();
-
-		$data = array(
-			'sort'  => $sort,
-			'order' => $order,
-			'start' => ($page - 1) * $limit,
-			'limit' => $limit
-		);
-			
-		$product_total = $this->model_catalog_product->getTotalProductSpecials($data);
-			
-		$results = $this->model_catalog_product->getProductSpecials($data);
-			
-		foreach ($results as $result) {
-			if ($result['image']) {
-				$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-			} else {
-				$image = false;
-			}
-
-            //addit image
-            $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
-            if ($results_images) {
-                $first = true;
-                foreach ($results_images as $results_image) {
-                    if ( $first ) {
-                        $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-                        $first = false;
-                    }
-                }
-            } else {
-                $popup = false;
-            }
-
-            //addit image
-
-
-            if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
-				$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
-			} else {
-				$price = false;
-			}
-			
-			if ((float)$result['special']) {
-				$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
-			} else {
-				$special = false;
-			}	
-			
-			if ($this->config->get('config_tax')) {
-				$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
-			} else {
-				$tax = false;
-			}				
-			
-			if ($this->config->get('config_review_status')) {
-				$rating = (int)$result['rating'];
-			} else {
-				$rating = false;
-			}
-
-            //youtube
-            $this->data['youtubes'] = array();
-            $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
-            $youtubes = explode(',',$query->row['video']);
-            $this->data['youtubes'] = $youtubes;
-            //youtube
-
-            /* vars from admin panel labels settings */
-            $this->config->get('bs_general');
-            $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-            if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
-                $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
-            } else {
-                $this->data['ajaxcart'] = '';
-            }
-
-            $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
-
-            if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
-                $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
-            } else {
-                $this->data['sale'] = '';
-            }
-            if (isset($this->data['buyshop_productlabels_settings']['video'])) {
-                $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
-            } else {
-                $this->data['video'] = '';
-            }
-            if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
-                $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
-            } else {
-                $this->data['saleposition'] = '';
-            }
-            if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
-                $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
-            } else {
-                $this->data['videoposition'] = '';
-            }
-
-
-            $this->data['products'][] = array(
-				'product_id'  => $result['product_id'],
-				'thumb'       => $image,
-
-                //addit image
-                'popup'   	 => $popup,
-                //addit image
-                //youtube video
-                'youtube_video' => $youtubes,
-
-                'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
-                'name'        => $result['name'],
-                'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
-				'price'       => $price,
-				'special'     => $special,
-				'tax'         => $tax,
-				'rating'      => $result['rating'],
-				'reviews'     => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
-				'href'        => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url)
-			);
-		}
-
-		$url = '';
-
-		if (isset($this->request->get['limit'])) {
-			$url .= '&limit=' . $this->request->get['limit'];
-		}
-			
-		$this->data['sorts'] = array();
-		
-		$this->data['sorts'][] = array(
-			'text'  => $this->language->get('text_default'),
-			'value' => 'p.sort_order-ASC',
-			'href'  => $this->url->link('product/special', 'sort=p.sort_order&order=ASC' . $url)
-		);
-		
-		$this->data['sorts'][] = array(
-			'text'  => $this->language->get('text_name_asc'),
-			'value' => 'pd.name-ASC',
-			'href'  => $this->url->link('product/special', 'sort=pd.name&order=ASC' . $url)
-		); 
-
-		$this->data['sorts'][] = array(
-			'text'  => $this->language->get('text_name_desc'),
-			'value' => 'pd.name-DESC',
-			'href'  => $this->url->link('product/special', 'sort=pd.name&order=DESC' . $url)
-		);  
-
-		$this->data['sorts'][] = array(
-			'text'  => $this->language->get('text_price_asc'),
-			'value' => 'ps.price-ASC',
-			'href'  => $this->url->link('product/special', 'sort=ps.price&order=ASC' . $url)
-		); 
-
-		$this->data['sorts'][] = array(
-			'text'  => $this->language->get('text_price_desc'),
-			'value' => 'ps.price-DESC',
-			'href'  => $this->url->link('product/special', 'sort=ps.price&order=DESC' . $url)
-		); 
-		
-		if ($this->config->get('config_review_status')) {	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_rating_desc'),
-				'value' => 'rating-DESC',
-				'href'  => $this->url->link('product/special', 'sort=rating&order=DESC' . $url)
-			); 
-				
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_rating_asc'),
-				'value' => 'rating-ASC',
-				'href'  => $this->url->link('product/special', 'sort=rating&order=ASC' . $url)
-			);
-		}
-		
-		$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_asc'),
-				'value' => 'p.model-ASC',
-				'href'  => $this->url->link('product/special', 'sort=p.model&order=ASC' . $url)
-		); 
-
-		$this->data['sorts'][] = array(
-			'text'  => $this->language->get('text_model_desc'),
-			'value' => 'p.model-DESC',
-			'href'  => $this->url->link('product/special', 'sort=p.model&order=DESC' . $url)
-		);
-		
-		$url = '';
-
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}	
-
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-						
-		$this->data['limits'] = array();
-
-		$limits = array_unique(array($this->config->get('config_catalog_limit'), 25, 50, 75, 100));
-		
-		sort($limits);
-
-		foreach($limits as $limit){
-			$this->data['limits'][] = array(
-				'text'  => $limit,
-				'value' => $limit,
-				'href'  => $this->url->link('product/special', $url . '&limit=' . $limit)
-			);
-		}
-			
-		$url = '';
-
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}	
-
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-		
-		if (isset($this->request->get['limit'])) {
-			$url .= '&limit=' . $this->request->get['limit'];
-		}
-						
-		$pagination = new Pagination();
-		$pagination->total = $product_total;
-		$pagination->page = $page;
-		$pagination->limit = $limit;
-		$pagination->text = $this->language->get('text_pagination');
-		$pagination->url = $this->url->link('product/special', $url . '&page={page}');
-			
-		$this->data['pagination'] = $pagination->render();
-			
-		$this->data['sort'] = $sort;
-		$this->data['order'] = $order;
-		$this->data['limit'] = $limit;
-
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/special.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/product/special.tpl';
-		} else {
-			$this->template = 'default/template/product/special.tpl';
-		}
-		
-		$this->children = array(
-			'common/column_left',
-			'common/column_right',
-			'common/content_top',
-			'common/content_bottom',
-			'common/footer',
-			'common/header'
-		);
-	
-		$this->response->setOutput($this->render());			
-  	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/product/search.php
===================================================================
--- trunk/www/catalog/controller/product/search.php	(revision 19)
+++ trunk/www/catalog/controller/product/search.php	(revision 20)
@@ -1,532 +0,0 @@
-<?php 
-class ControllerProductSearch extends Controller { 	
-	public function index() { 
-    	$this->language->load('product/search');
-		
-		$this->load->model('catalog/category');
-		
-		$this->load->model('catalog/product');
-		
-		$this->load->model('tool/image'); 
-		
-		if (isset($this->request->get['search'])) {
-			$search = $this->request->get['search'];
-		} else {
-			$search = '';
-		} 
-		
-		if (isset($this->request->get['tag'])) {
-			$tag = $this->request->get['tag'];
-		} elseif (isset($this->request->get['search'])) {
-			$tag = $this->request->get['search'];
-		} else {
-			$tag = '';
-		} 
-				
-		if (isset($this->request->get['description'])) {
-			$description = $this->request->get['description'];
-		} else {
-			$description = '';
-		} 
-				
-		if (isset($this->request->get['category_id'])) {
-			$category_id = $this->request->get['category_id'];
-		} else {
-			$category_id = 0;
-		} 
-		
-		if (isset($this->request->get['sub_category'])) {
-			$sub_category = $this->request->get['sub_category'];
-		} else {
-			$sub_category = '';
-		} 
-								
-		if (isset($this->request->get['sort'])) {
-			$sort = $this->request->get['sort'];
-		} else {
-			$sort = 'p.sort_order';
-		} 
-
-		if (isset($this->request->get['order'])) {
-			$order = $this->request->get['order'];
-		} else {
-			$order = 'ASC';
-		}
-  		
-		if (isset($this->request->get['page'])) {
-			$page = $this->request->get['page'];
-		} else {
-			$page = 1;
-		}
-				
-		if (isset($this->request->get['limit'])) {
-			$limit = $this->request->get['limit'];
-		} else {
-			$limit = $this->config->get('config_catalog_limit');
-		}
-		
-		if (isset($this->request->get['search'])) {
-			$this->document->setTitle($this->language->get('heading_title') .  ' - ' . $this->request->get['search']);
-		} else {
-			$this->document->setTitle($this->language->get('heading_title'));
-		}
-		
-		$this->document->addScript('catalog/view/javascript/jquery/jquery.total-storage.min.js');
-
-		$this->data['breadcrumbs'] = array();
-
-   		$this->data['breadcrumbs'][] = array( 
-       		'text'      => $this->language->get('text_home'),
-			'href'      => $this->url->link('common/home'),
-      		'separator' => false
-   		);
-		
-		$url = '';
-		
-		if (isset($this->request->get['search'])) {
-			$url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
-		}
-		
-		if (isset($this->request->get['tag'])) {
-			$url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
-		}
-				
-		if (isset($this->request->get['description'])) {
-			$url .= '&description=' . $this->request->get['description'];
-		}
-				
-		if (isset($this->request->get['category_id'])) {
-			$url .= '&category_id=' . $this->request->get['category_id'];
-		}
-		
-		if (isset($this->request->get['sub_category'])) {
-			$url .= '&sub_category=' . $this->request->get['sub_category'];
-		}
-		
-		if (isset($this->request->get['sort'])) {
-			$url .= '&sort=' . $this->request->get['sort'];
-		}	
-
-		if (isset($this->request->get['order'])) {
-			$url .= '&order=' . $this->request->get['order'];
-		}
-				
-		if (isset($this->request->get['page'])) {
-			$url .= '&page=' . $this->request->get['page'];
-		}	
-		
-		if (isset($this->request->get['limit'])) {
-			$url .= '&limit=' . $this->request->get['limit'];
-		}
-						
-   		$this->data['breadcrumbs'][] = array(
-       		'text'      => $this->language->get('heading_title'),
-			'href'      => $this->url->link('product/search', $url),
-      		'separator' => $this->language->get('text_separator')
-   		);
-		
-		if (isset($this->request->get['search'])) {
-    		$this->data['heading_title'] = $this->language->get('heading_title') .  ' - ' . $this->request->get['search'];
-		} else {
-			$this->data['heading_title'] = $this->language->get('heading_title');
-		}
-		
-		$this->data['text_empty'] = $this->language->get('text_empty');
-    	$this->data['text_critea'] = $this->language->get('text_critea');
-    	$this->data['text_search'] = $this->language->get('text_search');
-		$this->data['text_keyword'] = $this->language->get('text_keyword');
-		$this->data['text_category'] = $this->language->get('text_category');
-		$this->data['text_sub_category'] = $this->language->get('text_sub_category');
-		$this->data['text_quantity'] = $this->language->get('text_quantity');
-		$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-		$this->data['text_model'] = $this->language->get('text_model');
-		$this->data['text_price'] = $this->language->get('text_price');
-		$this->data['text_tax'] = $this->language->get('text_tax');
-		$this->data['text_points'] = $this->language->get('text_points');
-		$this->data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
-		$this->data['text_display'] = $this->language->get('text_display');
-		$this->data['text_list'] = $this->language->get('text_list');
-		$this->data['text_grid'] = $this->language->get('text_grid');		
-		$this->data['text_sort'] = $this->language->get('text_sort');
-		$this->data['text_limit'] = $this->language->get('text_limit');
-		
-		$this->data['entry_search'] = $this->language->get('entry_search');
-    	$this->data['entry_description'] = $this->language->get('entry_description');
-		  
-    	$this->data['button_search'] = $this->language->get('button_search');
-		$this->data['button_cart'] = $this->language->get('button_cart');
-		$this->data['button_wishlist'] = $this->language->get('button_wishlist');
-		$this->data['button_compare'] = $this->language->get('button_compare');
-
-		$this->data['compare'] = $this->url->link('product/compare');
-		
-		$this->load->model('catalog/category');
-		
-		// 3 Level Category Search
-		$this->data['categories'] = array();
-					
-		$categories_1 = $this->model_catalog_category->getCategories(0);
-		
-		foreach ($categories_1 as $category_1) {
-			$level_2_data = array();
-			
-			$categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);
-			
-			foreach ($categories_2 as $category_2) {
-				$level_3_data = array();
-				
-				$categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);
-				
-				foreach ($categories_3 as $category_3) {
-					$level_3_data[] = array(
-						'category_id' => $category_3['category_id'],
-						'name'        => $category_3['name'],
-					);
-				}
-				
-				$level_2_data[] = array(
-					'category_id' => $category_2['category_id'],	
-					'name'        => $category_2['name'],
-					'children'    => $level_3_data
-				);					
-			}
-			
-			$this->data['categories'][] = array(
-				'category_id' => $category_1['category_id'],
-				'name'        => $category_1['name'],
-				'children'    => $level_2_data
-			);
-		}
-		
-		$this->data['products'] = array();
-		
-		if (isset($this->request->get['search']) || isset($this->request->get['filter_tag'])) {
-			$data = array(
-				'filter_name'         => $search, 
-				'filter_tag'          => $tag, 
-				'filter_description'  => $description,
-				'filter_category_id'  => $category_id, 
-				'filter_sub_category' => $sub_category, 
-				'sort'                => $sort,
-				'order'               => $order,
-				'start'               => ($page - 1) * $limit,
-				'limit'               => $limit
-			);
-					
-			$product_total = $this->model_catalog_product->getTotalProducts($data);
-								
-			$results = $this->model_catalog_product->getProducts($data);
-					
-			foreach ($results as $result) {
-				if ($result['image']) {
-					$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-				} else {
-					$image = false;
-				}
-
-                //addit image
-                $results_images = $this->model_catalog_product->getProductImages($result['product_id']);
-                if ($results_images) {
-                    $first = true;
-                    foreach ($results_images as $results_image) {
-                        if ( $first ) {
-                            $popup = $this->model_tool_image->resize($results_image['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
-                            $first = false;
-                        }
-                    }
-                } else {
-                    $popup = false;
-                }
-
-                //addit image
-
-
-
-
-
-                if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
-					$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$price = false;
-				}
-				
-				if ((float)$result['special']) {
-					$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')));
-				} else {
-					$special = false;
-				}	
-				
-				if ($this->config->get('config_tax')) {
-					$tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']);
-				} else {
-					$tax = false;
-				}				
-				
-				if ($this->config->get('config_review_status')) {
-					$rating = (int)$result['rating'];
-				} else {
-					$rating = false;
-				}
-
-                //youtube
-                $this->data['youtubes'] = array();
-                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$result['product_id']."'");
-                $youtubes = explode(',',$query->row['video']);
-                $this->data['youtubes'] = $youtubes;
-                //youtube
-
-                /* vars from admin panel labels settings */
-                $this->config->get('bs_general');
-                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
-                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
-                } else {
-                    $this->data['ajaxcart'] = '';
-                }
-
-                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
-
-                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
-                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
-                } else {
-                    $this->data['sale'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
-                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
-                } else {
-                    $this->data['video'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
-                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
-                } else {
-                    $this->data['saleposition'] = '';
-                }
-                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
-                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
-                } else {
-                    $this->data['videoposition'] = '';
-                }
-
-
-                $this->data['products'][] = array(
-					'product_id'  => $result['product_id'],
-					'thumb'       => $image,
-
-                    //addit image
-                    'popup'   	 => $popup,
-                    //addit image
-                    //youtube video
-                    'youtube_video' => $youtubes,
-
-                    'name-main'        => strlen($result['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($result['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $result['name'],
-                    'name'        => $result['name'],
-                    'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
-					'price'       => $price,
-					'special'     => $special,
-					'tax'         => $tax,
-					'rating'      => $result['rating'],
-					'reviews'     => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
-					'href'        => $this->url->link('product/product', $url . '&product_id=' . $result['product_id'])
-				);
-			}
-					
-			$url = '';
-			
-			if (isset($this->request->get['search'])) {
-				$url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['tag'])) {
-				$url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
-			}
-					
-			if (isset($this->request->get['description'])) {
-				$url .= '&description=' . $this->request->get['description'];
-			}
-			
-			if (isset($this->request->get['category_id'])) {
-				$url .= '&category_id=' . $this->request->get['category_id'];
-			}
-			
-			if (isset($this->request->get['sub_category'])) {
-				$url .= '&sub_category=' . $this->request->get['sub_category'];
-			}
-					
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-						
-			$this->data['sorts'] = array();
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_default'),
-				'value' => 'p.sort_order-ASC',
-				'href'  => $this->url->link('product/search', 'sort=p.sort_order&order=ASC' . $url)
-			);
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_name_asc'),
-				'value' => 'pd.name-ASC',
-				'href'  => $this->url->link('product/search', 'sort=pd.name&order=ASC' . $url)
-			); 
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_name_desc'),
-				'value' => 'pd.name-DESC',
-				'href'  => $this->url->link('product/search', 'sort=pd.name&order=DESC' . $url)
-			);
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_price_asc'),
-				'value' => 'p.price-ASC',
-				'href'  => $this->url->link('product/search', 'sort=p.price&order=ASC' . $url)
-			); 
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_price_desc'),
-				'value' => 'p.price-DESC',
-				'href'  => $this->url->link('product/search', 'sort=p.price&order=DESC' . $url)
-			); 
-			
-			if ($this->config->get('config_review_status')) {
-				$this->data['sorts'][] = array(
-					'text'  => $this->language->get('text_rating_desc'),
-					'value' => 'rating-DESC',
-					'href'  => $this->url->link('product/search', 'sort=rating&order=DESC' . $url)
-				); 
-				
-				$this->data['sorts'][] = array(
-					'text'  => $this->language->get('text_rating_asc'),
-					'value' => 'rating-ASC',
-					'href'  => $this->url->link('product/search', 'sort=rating&order=ASC' . $url)
-				);
-			}
-			
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_asc'),
-				'value' => 'p.model-ASC',
-				'href'  => $this->url->link('product/search', 'sort=p.model&order=ASC' . $url)
-			); 
-	
-			$this->data['sorts'][] = array(
-				'text'  => $this->language->get('text_model_desc'),
-				'value' => 'p.model-DESC',
-				'href'  => $this->url->link('product/search', 'sort=p.model&order=DESC' . $url)
-			);
-	
-			$url = '';
-			
-			if (isset($this->request->get['search'])) {
-				$url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['tag'])) {
-				$url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
-			}
-					
-			if (isset($this->request->get['description'])) {
-				$url .= '&description=' . $this->request->get['description'];
-			}
-			
-			if (isset($this->request->get['category_id'])) {
-				$url .= '&category_id=' . $this->request->get['category_id'];
-			}
-			
-			if (isset($this->request->get['sub_category'])) {
-				$url .= '&sub_category=' . $this->request->get['sub_category'];
-			}
-						
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-	
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-			
-			$this->data['limits'] = array();
-	
-			$limits = array_unique(array($this->config->get('config_catalog_limit'), 25, 50, 75, 100));
-			
-			sort($limits);
-	
-			foreach($limits as $limits){
-				$this->data['limits'][] = array(
-					'text'  => $limits,
-					'value' => $limits,
-					'href'  => $this->url->link('product/search', $url . '&limit=' . $limits)
-				);
-			}
-					
-			$url = '';
-	
-			if (isset($this->request->get['search'])) {
-				$url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
-			}
-			
-			if (isset($this->request->get['tag'])) {
-				$url .= '&tag=' . urlencode(html_entity_decode($this->request->get['filter_tag'], ENT_QUOTES, 'UTF-8'));
-			}
-					
-			if (isset($this->request->get['description'])) {
-				$url .= '&description=' . $this->request->get['description'];
-			}
-			
-			if (isset($this->request->get['category_id'])) {
-				$url .= '&category_id=' . $this->request->get['category_id'];
-			}
-			
-			if (isset($this->request->get['sub_category'])) {
-				$url .= '&sub_category=' . $this->request->get['sub_category'];
-			}
-										
-			if (isset($this->request->get['sort'])) {
-				$url .= '&sort=' . $this->request->get['sort'];
-			}	
-	
-			if (isset($this->request->get['order'])) {
-				$url .= '&order=' . $this->request->get['order'];
-			}
-			
-			if (isset($this->request->get['limit'])) {
-				$url .= '&limit=' . $this->request->get['limit'];
-			}
-					
-			$pagination = new Pagination();
-			$pagination->total = $product_total;
-			$pagination->page = $page;
-			$pagination->limit = $limit;
-			$pagination->text = $this->language->get('text_pagination');
-			$pagination->url = $this->url->link('product/search', $url . '&page={page}');
-			
-			$this->data['pagination'] = $pagination->render();
-		}	
-		
-		$this->data['search'] = $search;
-		$this->data['description'] = $description;
-		$this->data['category_id'] = $category_id;
-		$this->data['sub_category'] = $sub_category;
-				
-		$this->data['sort'] = $sort;
-		$this->data['order'] = $order;
-		$this->data['limit'] = $limit;
-		
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/search.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/product/search.tpl';
-		} else {
-			$this->template = 'default/template/product/search.tpl';
-		}
-		
-		$this->children = array(
-			'common/column_left',
-			'common/column_right',
-			'common/content_top',
-			'common/content_bottom',
-			'common/footer',
-			'common/header'
-		);
-				
-		$this->response->setOutput($this->render());
-  	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/module/dresscode_featured_multi.php
===================================================================
--- trunk/www/catalog/controller/module/dresscode_featured_multi.php	(revision 0)
+++ trunk/www/catalog/controller/module/dresscode_featured_multi.php	(revision 20)
@@ -0,0 +1,132 @@
+<?php
+class ControllerModuleDresscodeFeaturedMulti extends Controller {
+	protected function index($setting) {
+		$this->language->load('module/dresscode_featured_multi');
+
+      	$this->data['heading_title'] = $this->language->get('heading_title');
+		
+		$this->data['button_cart'] = $this->language->get('button_cart');
+		
+		$this->load->model('catalog/product'); 
+		
+		$this->load->model('tool/image');
+
+		$this->data['products'] = array();
+
+		$products = explode(',', $this->config->get('dresscode_featured_multi_product'));
+
+		if (empty($setting['limit'])) {
+			$setting['limit'] = 1;
+		}
+		
+		$products = array_slice($products, 0, (int)$setting['limit']);
+		
+		foreach ($products as $product_id) {
+			$product_info = $this->model_catalog_product->getProduct($product_id);
+			
+			if ($product_info) {
+				if ($product_info['image']) {
+					$image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']);
+				} else {
+					$image = false;
+				}
+            //addit image
+            $results_images = $this->model_catalog_product->getProductImages($product_info['product_id']);
+            if ($results_images) {
+                $first = true;
+                foreach ($results_images as $results_image) {
+                    if ( $first ) {
+                        $popup = $this->model_tool_image->resize($results_image['image'], $setting['image_width'], $setting['image_height']);
+                        $first = false;
+                    }
+                }
+            } else {
+                $popup = false;
+            }
+            //addit image
+
+				if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
+					$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')));
+				} else {
+					$price = false;
+				}
+						
+				if ((float)$product_info['special']) {
+					$special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')));
+				} else {
+					$special = false;
+				}
+				
+				if ($this->config->get('config_review_status')) {
+					$rating = $product_info['rating'];
+				} else {
+					$rating = false;
+				}
+
+                //youtube
+                $this->data['youtubes'] = array();
+                $query = $this->db->query("SELECT youtube as video FROM ".DB_PREFIX."product WHERE product_id='".(int)$product_info['product_id']."'");
+                $youtubes = explode(',',$query->row['video']);
+                $this->data['youtubes'] = $youtubes;
+                //youtube
+
+                /* vars from admin panel labels settings */
+                $this->config->get('bs_general');
+                $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
+                if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
+                    $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
+                }
+                $this->data['buyshop_productlabels_settings'] = $this->config->get('bs_productlabels');
+                if (isset($this->data['buyshop_productlabels_settings']['sale'])) {
+                    $this->data['sale'] = $this->data['buyshop_productlabels_settings']['sale'];
+                } else {
+                    $this->data['sale'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['video'])) {
+                    $this->data['video'] = $this->data['buyshop_productlabels_settings']['video'];
+                } else {
+                    $this->data['video'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['saleposition'])) {
+                    $this->data['saleposition'] = $this->data['buyshop_productlabels_settings']['saleposition'];
+                } else {
+                    $this->data['saleposition'] = '';
+                }
+                if (isset($this->data['buyshop_productlabels_settings']['videoposition'])) {
+                    $this->data['videoposition'] = $this->data['buyshop_productlabels_settings']['videoposition'];
+                } else {
+                    $this->data['videoposition'] = '';
+                }
+
+                $this->data['products'][] = array(
+					'product_id' => $product_info['product_id'],
+					'thumb'   	 => $image,
+
+                //addit image
+                'popup'   	 => $popup,
+                //addit image
+                    //youtube video
+                    'youtube_video' => $youtubes,
+
+
+                    'name-main'        => strlen($product_info['name']) > 43 ? utf8_substr(strip_tags(html_entity_decode($product_info['name'], ENT_QUOTES, 'UTF-8')), 0, 43) . '..' : $product_info['name'],
+                    'name'        => $product_info['name'],
+                    'price'   	 => $price,
+					'special' 	 => $special,
+					'rating'     => $rating,
+					'reviews'    => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']),
+					'href'    	 => $this->url->link('product/product', 'product_id=' . $product_info['product_id'])
+				);
+			}
+		}
+
+		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/dresscode_featured_multi.tpl')) {
+			$this->template = $this->config->get('config_template') . '/template/module/dresscode_featured_multi.tpl';
+		} else {
+			$this->template = 'default/template/module/dresscode_featured_multi.tpl';
+		}
+
+		$this->render();
+	}
+}
+?>
\ No newline at end of file
Index: trunk/www/catalog/controller/common/footer.php
===================================================================
--- trunk/www/catalog/controller/common/footer.php	(revision 19)
+++ trunk/www/catalog/controller/common/footer.php	(revision 20)
@@ -1,156 +0,0 @@
-<?php  
-class ControllerCommonFooter extends Controller {
-	protected function index() {
-		$this->language->load('common/footer');
-		
-		$this->data['text_information'] = $this->language->get('text_information');
-		$this->data['text_service'] = $this->language->get('text_service');
-		$this->data['text_extra'] = $this->language->get('text_extra');
-		$this->data['text_contact'] = $this->language->get('text_contact');
-		$this->data['text_return'] = $this->language->get('text_return');
-    	$this->data['text_sitemap'] = $this->language->get('text_sitemap');
-		$this->data['text_manufacturer'] = $this->language->get('text_manufacturer');
-		$this->data['text_voucher'] = $this->language->get('text_voucher');
-		$this->data['text_affiliate'] = $this->language->get('text_affiliate');
-		$this->data['text_special'] = $this->language->get('text_special');
-		$this->data['text_account'] = $this->language->get('text_account');
-		$this->data['text_order'] = $this->language->get('text_order');
-		$this->data['text_wishlist'] = $this->language->get('text_wishlist');
-		$this->data['text_newsletter'] = $this->language->get('text_newsletter');
-		
-		//template
-		$this->data['text_shopping_cart'] = $this->language->get('text_shopping_cart');
-		$this->data['shopping_cart'] = $this->url->link('checkout/cart');
-		$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');
-		$this->data['logged'] = $this->customer->isLogged();
-		$this->data['account'] = $this->url->link('account/account', '', 'SSL');
-		$this->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
-		$this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/logout', '', 'SSL'));
-
-        $this->data['text_twitter_feeds'] = $this->language->get('text_twitter_feeds');
-
-        /* theme options output */
-        $this->config->get('bs_general');
-        $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-        $this->data['themecolor'] = $this->data['buyshop_general_settings']['themecolor'];
-
-        $this->data['text_facebook'] = $this->language->get('text_facebook');
-
-        //contact info in footer
-        $this->data['contact_info'] = $this->language->get('contact_info');
-        $this->data['contact_phone'] = $this->language->get('contact_phone');
-        $this->data['phone_numbers'] = $this->language->get('phone_numbers');
-        $this->data['cell_phone'] = $this->language->get('cell_phone');
-        $this->data['mail_addresses'] = $this->language->get('mail_addresses');
-        $this->data['mail_sails'] = $this->language->get('mail_sails');
-        $this->data['mail_info'] = $this->language->get('mail_info');
-        $this->data['skype_title'] = $this->language->get('skype_title');
-        $this->data['skype_accounts'] = $this->language->get('skype_accounts');
-
-        //socials icons in footer
-        $this->data['socials_title_1'] = $this->language->get('socials_title_1');
-        $this->data['socials_title_2'] = $this->language->get('socials_title_2');
-        $this->data['socials_title_3'] = $this->language->get('socials_title_3');
-        $this->data['socials_title_4'] = $this->language->get('socials_title_4');
-        $this->data['socials_title_5'] = $this->language->get('socials_title_5');
-        $this->data['socials_title_6'] = $this->language->get('socials_title_6');
-
-        $this->data['socials_link_1'] = $this->language->get('socials_link_1');
-        $this->data['socials_link_2'] = $this->language->get('socials_link_2');
-        $this->data['socials_link_3'] = $this->language->get('socials_link_3');
-        $this->data['socials_link_4'] = $this->language->get('socials_link_4');
-        $this->data['socials_link_5'] = $this->language->get('socials_link_5');
-        $this->data['socials_link_6'] = $this->language->get('socials_link_6');
-//template
-
-        $this->load->model('catalog/information');
-		
-		$this->data['informations'] = array();
-
-		foreach ($this->model_catalog_information->getInformations() as $result) {
-			if ($result['bottom']) {
-				$this->data['informations'][] = array(
-					'title' => $result['title'],
-					'href'  => $this->url->link('information/information', 'information_id=' . $result['information_id'])
-				);
-			}
-    	}
-
-        /* theme options output */
-        //$this->config->get('bs_social');
-        $this->data['buyshop_social_settings'] = $this->config->get('bs_social');
-
-
-        if (!empty($this->data['buyshop_social_settings']['twitter'])) {
-            $this->data['twitter_account_name'] = $this->data['buyshop_social_settings']['twitter'];
-        } else {
-            $this->data['twitter_account_name'] = $this->language->get('account_twitter');
-        }
-        if (!empty($this->data['buyshop_social_settings']['facebook'])) {
-                $this->data['facebook'] = $this->data['buyshop_social_settings']['facebook'];
-        } else {
-            $this->data['facebook'] = $this->language->get('account_facebook');
-        }
-        /* theme options output */
-
-
-        $this->data['contact'] = $this->url->link('information/contact');
-		$this->data['return'] = $this->url->link('account/return/insert', '', 'SSL');
-    	$this->data['sitemap'] = $this->url->link('information/sitemap');
-		$this->data['manufacturer'] = $this->url->link('product/manufacturer');
-		$this->data['voucher'] = $this->url->link('account/voucher', '', 'SSL');
-		$this->data['affiliate'] = $this->url->link('affiliate/account', '', 'SSL');
-		$this->data['special'] = $this->url->link('product/special');
-		$this->data['account'] = $this->url->link('account/account', '', 'SSL');
-		$this->data['order'] = $this->url->link('account/order', '', 'SSL');
-		$this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');
-		$this->data['newsletter'] = $this->url->link('account/newsletter', '', 'SSL');		
-
-
-        $this->data['powered'] = sprintf($this->language->get('text_powered'), $this->config->get('config_name'), date('Y', time()));
-
-        $this->data['powered_dresscode'] = sprintf($this->language->get('powered_dresscode'), date('Y', time()));
-
-
-// Whos Online
-		if ($this->config->get('config_customer_online')) {
-			$this->load->model('tool/online');
-	
-			if (isset($this->request->server['REMOTE_ADDR'])) {
-				$ip = $this->request->server['REMOTE_ADDR'];	
-			} else {
-				$ip = ''; 
-			}
-			
-			if (isset($this->request->server['HTTP_HOST']) && isset($this->request->server['REQUEST_URI'])) {
-				$url = 'http://' . $this->request->server['HTTP_HOST'] . $this->request->server['REQUEST_URI'];	
-			} else {
-				$url = '';
-			}
-			
-			if (isset($this->request->server['HTTP_REFERER'])) {
-				$referer = $this->request->server['HTTP_REFERER'];	
-			} else {
-				$referer = '';
-			}
-						
-			$this->model_tool_online->whosonline($ip, $this->customer->getId(), $url, $referer);
-		}
-
-
-
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/footer.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/common/footer.tpl';
-		} else {
-			$this->template = 'default/template/common/footer.tpl';
-		}
-
-        $this->children = array(
-            'common/content_slider',
-            'common/content_footer'
-        );
-
-		$this->render();
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/common/column_left.php
===================================================================
--- trunk/www/catalog/controller/common/column_left.php	(revision 19)
+++ trunk/www/catalog/controller/common/column_left.php	(revision 20)
@@ -1,93 +0,0 @@
-<?php  
-class ControllerCommonColumnLeft extends Controller {
-	protected function index() {
-		$this->load->model('design/layout');
-		$this->load->model('catalog/category');
-		$this->load->model('catalog/product');
-		$this->load->model('catalog/information');
-
-
-        $this->data['flash_title'] = $this->language->get('flash_title');
-
-        $this->data['link_1'] = $this->url->link('information/information&information_id=7');
-
-        if (isset($this->request->get['route'])) {
-			$route = (string)$this->request->get['route'];
-		} else {
-			$route = 'common/home';
-		}
-		
-		$layout_id = 0;
-		
-		if ($route == 'product/category' && isset($this->request->get['path'])) {
-			$path = explode('_', (string)$this->request->get['path']);
-				
-			$layout_id = $this->model_catalog_category->getCategoryLayoutId(end($path));			
-		}
-		
-		if ($route == 'product/product' && isset($this->request->get['product_id'])) {
-			$layout_id = $this->model_catalog_product->getProductLayoutId($this->request->get['product_id']);
-		}
-		
-		if ($route == 'information/information' && isset($this->request->get['information_id'])) {
-			$layout_id = $this->model_catalog_information->getInformationLayoutId($this->request->get['information_id']);
-		}
-		
-		if (!$layout_id) {
-			$layout_id = $this->model_design_layout->getLayout($route);
-		}
-						
-		if (!$layout_id) {
-			$layout_id = $this->config->get('config_layout_id');
-		}
-
-		$module_data = array();
-		
-		$this->load->model('setting/extension');
-		
-		$extensions = $this->model_setting_extension->getExtensions('module');		
-		
-		foreach ($extensions as $extension) {
-			$modules = $this->config->get($extension['code'] . '_module');
-		
-			if ($modules) {
-				foreach ($modules as $module) {
-					if ($module['layout_id'] == $layout_id && $module['position'] == 'column_left' && $module['status']) {
-						$module_data[] = array(
-							'code'       => $extension['code'],
-							'setting'    => $module,
-							'sort_order' => $module['sort_order']
-						);				
-					}
-				}
-			}
-		}
-		
-		$sort_order = array(); 
-	  
-		foreach ($module_data as $key => $value) {
-      		$sort_order[$key] = $value['sort_order'];
-    	}
-		
-		array_multisort($sort_order, SORT_ASC, $module_data);
-		
-		$this->data['modules'] = array();
-		
-		foreach ($module_data as $module) {
-			$module = $this->getChild('module/' . $module['code'], $module['setting']);
-			
-			if ($module) {
-				$this->data['modules'][] = $module;
-			}
-		}
-		
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/column_left.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/common/column_left.tpl';
-		} else {
-			$this->template = 'default/template/common/column_left.tpl';
-		}
-								
-		$this->render();
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/common/header.php
===================================================================
--- trunk/www/catalog/controller/common/header.php	(revision 19)
+++ trunk/www/catalog/controller/common/header.php	(revision 20)
@@ -1,206 +0,0 @@
-<?php   
-class ControllerCommonHeader extends Controller {
-	protected function index() {
-		$this->data['title'] = $this->document->getTitle();
-		
-		if (isset($this->request->server['HTTPS']) && (($this->request->server['HTTPS'] == 'on') || ($this->request->server['HTTPS'] == '1'))) {
-			$server = $this->config->get('config_ssl');
-		} else {
-			$server = $this->config->get('config_url');
-		}
-
-		$this->data['base'] = $server;
-		$this->data['description'] = $this->document->getDescription();
-		$this->data['keywords'] = $this->document->getKeywords();
-		$this->data['links'] = $this->document->getLinks();	 
-		$this->data['styles'] = $this->document->getStyles();
-		$this->data['scripts'] = $this->document->getScripts();
-		$this->data['lang'] = $this->language->get('code');
-		$this->data['direction'] = $this->language->get('direction');
-		$this->data['google_analytics'] = html_entity_decode($this->config->get('config_google_analytics'), ENT_QUOTES, 'UTF-8');
-		$this->data['name'] = $this->config->get('config_name');
-		
-		if ($this->config->get('config_icon') && file_exists(DIR_IMAGE . $this->config->get('config_icon'))) {
-			$this->data['icon'] = $server . 'image/' . $this->config->get('config_icon');
-		} else {
-			$this->data['icon'] = '';
-		}
-		
-		if ($this->config->get('config_logo') && file_exists(DIR_IMAGE . $this->config->get('config_logo'))) {
-			$this->data['logo'] = $server . 'image/' . $this->config->get('config_logo');
-		} else {
-			$this->data['logo'] = '';
-		}
-		
-		$this->language->load('common/header');
-		
-		$this->data['text_home'] = $this->language->get('text_home');
-        $this->data['text_wishlist'] = sprintf($this->language->get('text_wishlist'), (isset($this->session->data['wishlist']) ? count($this->session->data['wishlist']) : 0));
-        $this->data['text_shopping_cart'] = $this->language->get('text_shopping_cart');
-    	$this->data['text_search'] = $this->language->get('text_search');
-
-        $this->data['text_welcome'] = sprintf($this->language->get('text_welcome'), $this->url->link('account/login', '', 'SSL'), $this->url->link('account/register', '', 'SSL'));
-        $this->data['text_logged'] = sprintf($this->language->get('text_logged'), $this->url->link('account/account', '', 'SSL'), $this->customer->getFirstName(), $this->url->link('account/logout', '', 'SSL'));
-
-        $this->data['text_account'] = $this->language->get('text_account');
-    	$this->data['text_checkout'] = $this->language->get('text_checkout');
-				
-		$this->data['home'] = $this->url->link('common/home');
-		$this->data['wishlist'] = $this->url->link('account/wishlist', '', 'SSL');
-		$this->data['logged'] = $this->customer->isLogged();
-		$this->data['account'] = $this->url->link('account/account', '', 'SSL');
-		$this->data['shopping_cart'] = $this->url->link('checkout/cart');
-		$this->data['checkout'] = $this->url->link('checkout/checkout', '', 'SSL');
-
-        // addit vars
-        $this->data['text_search_dresscode'] = $this->language->get('text_search_dresscode');
-        $this->data['text_phone_number'] = $this->language->get('text_phone_number');
-        $this->data['text_service_tools'] = $this->language->get('text_service_tools');
-        $this->data['text_choose'] = $this->language->get('text_choose');
-        $this->data['text_option_1'] = $this->language->get('text_option_1');
-        $this->data['text_option_2'] = $this->language->get('text_option_2');
-        $this->data['text_choose_category'] = $this->language->get('text_choose_category');
-
-
-        $this->data['link_welcome_dresscode'] = $this->url->link('account/login', '', 'SSL');
-        $this->data['link_logged_dresscode'] = $this->url->link('account/logout', '', 'SSL');
-
-
-        $this->data['text_welcome_dresscode'] = $this->language->get('text_welcome_dresscode');
-        $this->data['text_logged_dresscode'] = $this->language->get('text_logged_dresscode');
-
-
-        /* theme options output */
-        $this->config->get('bs_general');
-        $this->data['buyshop_general_settings'] = $this->config->get('bs_general');
-
-        /* vars from admin panel general settings */
-        $this->data['font'] = $this->data['buyshop_general_settings']['font'];
-        $this->data['bgpattern'] = $this->data['buyshop_general_settings']['bgpattern'];
-        $this->data['themecolor'] = $this->data['buyshop_general_settings']['themecolor'];
-        $this->data['contentbgcolor'] = $this->data['buyshop_general_settings']['contentbgcolor'];
-        $this->data['fontcolor'] = $this->data['buyshop_general_settings']['fontcolor'];
-
-        if (isset($this->data['buyshop_general_settings']['tagstack'])) {
-            $this->data['tagstack'] = $this->data['buyshop_general_settings']['tagstack'];
-        }   else {
-            $this->data['tagstack'] = '';
-        }
-        if (isset($this->data['buyshop_general_settings']['productrollover'])) {
-            $this->data['productrollover'] = $this->data['buyshop_general_settings']['productrollover'];
-        }   else {
-            $this->data['productrollover'] = '';
-        }
-
-        if (isset($this->data['buyshop_general_settings']['ajaxcart'])) {
-            $this->data['ajaxcart'] = $this->data['buyshop_general_settings']['ajaxcart'];
-        }   else {
-             $this->data['ajaxcart'] = '';
-        }
-        if (isset($this->data['buyshop_general_settings']['response'])) {
-            $this->data['response'] = $this->data['buyshop_general_settings']['response'];
-        }   else {
-            $this->data['response'] = '';
-        }
-        /* theme options output */
-
-// Daniel's robot detector
-		$status = true;
-		
-		if (isset($this->request->server['HTTP_USER_AGENT'])) {
-			$robots = explode("\n", trim($this->config->get('config_robots')));
-
-			foreach ($robots as $robot) {
-				if ($robot && strpos($this->request->server['HTTP_USER_AGENT'], trim($robot)) !== false) {
-					$status = false;
-
-					break;
-				}
-			}
-		}
-		
-		// A dirty hack to try to set a cookie for the multi-store feature
-		$this->load->model('setting/store');
-		
-		$this->data['stores'] = array();
-		
-		if ($this->config->get('config_shared') && $status) {
-			$this->data['stores'][] = $server . 'catalog/view/javascript/crossdomain.php?session_id=' . $this->session->getId();
-			
-			$stores = $this->model_setting_store->getStores();
-					
-			foreach ($stores as $store) {
-				$this->data['stores'][] = $store['url'] . 'catalog/view/javascript/crossdomain.php?session_id=' . $this->session->getId();
-			}
-		}
-
-
-// Search		
-		if (isset($this->request->get['search'])) {
-			$this->data['search'] = $this->request->get['search'];
-		} else {
-			$this->data['search'] = '';
-		}
-		
-		// Menu
-		$this->load->model('catalog/category');
-		
-		$this->load->model('catalog/product');
-		
-		$this->data['categories'] = array();
-					
-		$categories = $this->model_catalog_category->getCategories(0);
-
-		foreach ($categories as $category) {
-			if ($category['top']) {
-				// Level 2
-				$children_data = array();
-				
-				$children = $this->model_catalog_category->getCategories($category['category_id']);
-				
-				foreach ($children as $child) {
-					$data = array(
-						'filter_category_id'  => $child['category_id'],
-						'filter_sub_category' => true
-					);
-					
-					$product_total = $this->model_catalog_product->getTotalProducts($data);
-									
-					$children_data[] = array(
-						'name'  => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $product_total . ')' : ''),
-						'href'  => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
-
-                    );
-				}
-				
-				// Level 1
-				$this->data['categories'][] = array(
-					'name'     => $category['name'],
-					'children' => $children_data,
-					'column'   => $category['column'] ? $category['column'] : 1,
-                    /* description */
-                    'description' => html_entity_decode($category['description'], ENT_QUOTES, 'UTF-8'),
-                    /* description */
-
-					'href'     => $this->url->link('product/category', 'path=' . $category['category_id'])
-				);
-			}
-		}
-		
-		$this->children = array(
-            'common/custom_menu',
-            'module/language',
-			'module/currency',
-            'module/cart'
-        );
-				
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/header.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/common/header.tpl';
-		} else {
-			$this->template = 'default/template/common/header.tpl';
-		}
-		
-    	$this->render();
-	} 	
-}
-?>
\ No newline at end of file
Index: trunk/www/catalog/controller/common/home.php
===================================================================
--- trunk/www/catalog/controller/common/home.php	(revision 19)
+++ trunk/www/catalog/controller/common/home.php	(revision 20)
@@ -1,51 +0,0 @@
-<?php  
-class ControllerCommonHome extends Controller {
-	public function index() {
-		$this->document->setTitle($this->config->get('config_title'));
-		$this->document->setDescription($this->config->get('config_meta_description'));
-
-		$this->data['heading_title'] = $this->config->get('config_title');
-
-		if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/common/home.tpl')) {
-			$this->template = $this->config->get('config_template') . '/template/common/home.tpl';
-		} else {
-			$this->template = 'default/template/common/home.tpl';
-		}
-
-
-        // addit vars
-        $this->data['text_original_products'] = $this->language->get('text_original_products');
-        $this->data['text_free_shipping'] = $this->language->get('text_free_shipping');
-        $this->data['text_cash_delivery'] = $this->language->get('text_cash_delivery');
-        $this->data['text_day_returns'] = $this->language->get('text_day_returns');
-
-        $this->data['original_products'] = $this->url->link('information/information&amp;information_id=7');
-        $this->data['free_shipping'] = $this->url->link('information/information&amp;information_id=8');
-        $this->data['cash_delivery'] = $this->url->link('information/information&amp;information_id=9');
-        $this->data['day_returns'] = $this->url->link('information/information&amp;information_id=10');
-
-        $this->data['flash_title'] = $this->language->get('flash_title');
-
-        $this->data['text_new_products'] = $this->language->get('text_new_products');
-        $this->data['text_sale'] = $this->language->get('text_sale');
-        $this->data['text_bestsellers'] = $this->language->get('text_bestsellers');
-
-
-
-
-        // addit vars
-
-
-        $this->children = array(
-			'common/column_left',
-			'common/column_right',
-			'common/content_top',
-			'common/content_bottom',
-			'common/footer',
-			'common/header'
-		);
-										
-		$this->response->setOutput($this->render());
-	}
-}
-?>
\ No newline at end of file
Index: trunk/www/version.txt
===================================================================
--- trunk/www/version.txt	(revision 19)
+++ trunk/www/version.txt	(revision 20)
@@ -1 +1 @@
-version 1.6.5
+version 1.6.6
