From 1aa8b239bd35dd69a9acb2a448796bc6796c2f4a Mon Sep 17 00:00:00 2001 From: lLefevre Date: Wed, 14 Dec 2011 15:57:29 +0000 Subject: [PATCH] // added tab SEO in AdminProductsController --- admin-dev/themes/default/admin.css | 2 +- .../themes/template/products/informations.tpl | 57 ------------------- controllers/admin/AdminProductsController.php | 23 ++++++-- translations/fr/admin.php | 4 +- 4 files changed, 19 insertions(+), 67 deletions(-) diff --git a/admin-dev/themes/default/admin.css b/admin-dev/themes/default/admin.css index e4413bc5e..46bbb75c3 100644 --- a/admin-dev/themes/default/admin.css +++ b/admin-dev/themes/default/admin.css @@ -199,7 +199,7 @@ div.fix-toolbar {border-bottom: 1px solid #E0E0E0;position:fixed;top:0;opacity:0 #productBox { position:relative; width:100%; float:left;} /*tab-pane*/ -form#product_form, form#access_form, form#cart_rule_form { background-color:#ebedf4; border:1px solid #ccced7; min-height:400px; padding: 5px 10px 10px; margin-left:140px;} +form#product_form, form#access_form, form#cart_rule_form { background-color:#ebedf4; border:1px solid #ccced7; min-height:404px; padding: 5px 10px 10px; margin-left:140px;} form#product_form h4 { font-size:18px; font-weight:normal;} .tab-row {} .tab-row .tab {background:#EFEFEF;width:100px;} diff --git a/admin-dev/themes/template/products/informations.tpl b/admin-dev/themes/template/products/informations.tpl index 99f2af7d2..21c87b478 100644 --- a/admin-dev/themes/template/products/informations.tpl +++ b/admin-dev/themes/template/products/informations.tpl @@ -335,63 +335,6 @@ var textFieldLabel = 0;
- -{************** DESCRIPTION *****************************} - -
- {l s='SEO'}{l s='Click here to improve product\'s rank in search engines (SEO)'}
- -
-
diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9484d208c..cc991737a 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -39,6 +39,7 @@ class AdminProductsControllerCore extends AdminController protected $available_tabs = array( 'Informations', 'Prices', + 'Seo', 'Associations', 'Images', 'Shipping', @@ -57,6 +58,7 @@ class AdminProductsControllerCore extends AdminController protected $tabs_preloaded = array( 'Informations' => true, 'Prices' => true, + 'Seo' => true, 'Associations' => true, 'Images' => false, 'Shipping' => true, @@ -111,11 +113,6 @@ class AdminProductsControllerCore extends AdminController 'align' => 'center', 'width' => 80 ), - /*'name_category' => array( - 'title' => $this->l('Category'), - 'width' => 100, - 'filter_key' => 'cl!name' - ),*/ 'name_category' => array( 'title' => $this->l('Category'), 'width' => 230, @@ -161,6 +158,7 @@ class AdminProductsControllerCore extends AdminController $this->available_tabs_lang = array ( 'Informations' => $this->l('Informations'), 'Prices' => $this->l('Prices'), + 'Seo' => $this->l('SEO'), 'Images' => $this->l('Images'), 'Associations' => $this->l('Associations'), 'Shipping' => $this->l('Shipping'), @@ -2521,6 +2519,20 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['custom_form'] = $this->context->smarty->createTemplate($this->tpl_form, $data)->fetch(); } + public function initFormSeo($product, $languages, $default_language) + { + $data = $this->context->smarty->createData(); + + $data->assign(array( + 'product' => $product, + 'languages' => $languages, + 'default_language' => $default_language, + 'ps_ssl_enabled' => Configuration::get('PS_SSL_ENABLED') + )); + + $this->tpl_form_vars['custom_form'] = $this->context->smarty->createTemplate($this->tpl_form, $data)->fetch(); + } + private function _getFinalPrice($specific_price, $productPrice, $taxRate) { $price = Tools::ps_round((float)($specific_price['price']) ? $specific_price['price'] : $productPrice, 2); @@ -2939,7 +2951,6 @@ class AdminProductsControllerCore extends AdminController foreach ($images as $k => $image) $images[$k]['src'] = $this->context->link->getImageLink($product->link_rewrite[$this->context->language->id], $product->id.'-'.$image['id_image'], 'small'); - $data->assign('ps_ssl_enabled', Configuration::get('PS_SSL_ENABLED')); $data->assign('images', $images); $data->assign('imagesTypes', ImageType::getImagesTypes('products')); diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 1783d6291..80cb1ea6b 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -3091,6 +3091,7 @@ $_LANGADM['AdminProducts86754577897acfb25deb69039d49d9a7'] = 'Statut'; $_LANGADM['AdminProducts52f5e0bc3859bc5f5e25130b6c7e8881'] = 'Position'; $_LANGADM['AdminProductsc4c95c36570d5a8834be5e88e2f0f6b2'] = 'Informations'; $_LANGADM['AdminProductse16dd6e118732c5d1586d6aba0b62f3a'] = 'Prix'; +$_LANGADM['AdminProductsd88946b678e4c2f251d4e292e8142291'] = 'Référencement'; $_LANGADM['AdminProductsfff0d600f8a0b5e19e88bfb821dd1157'] = 'Images'; $_LANGADM['AdminProducts0063394f0497bfd610ebac0aee7cfc34'] = 'Associations'; $_LANGADM['AdminProductsea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Transports'; @@ -3294,7 +3295,6 @@ $_LANGADM['AdminProducts22987d3b86cd0afd549196e94817e20f'] = 'Vous perdrez toute $_LANGADM['AdminProductsd6ae681fcd58f1e1936ca97da36528ff'] = 'Ajouter une nouvelle caractéristique'; $_LANGADM['AdminProducts8321e79c278ec510f63675c040594892'] = 'Maximum'; $_LANGADM['AdminProductsd076bfa965e6f3f48bba804b6faf1527'] = 'caractères'; -$_LANGADM['AdminProductsccb78eb7f6c9e4c522ad95bafbb4c899'] = 'Êtes-vous certain de vouloir rafraîchir l\'onglet ? (Toutes les modifications seront perdues)'; $_LANGADM['AdminProductsbe53a0541a6d36f6ecb879fa2c584b08'] = 'Image'; $_LANGADM['AdminProductsd3d2e617335f08df83599665eef8a418'] = 'Fermer'; $_LANGADM['AdminProducts6b75fa7115dc07a315c0d9eb30f065e1'] = '(ou \"Esc\")'; @@ -3349,7 +3349,6 @@ $_LANGADM['AdminProducts6624493bea28e951b0e89cb12a324bcf'] = 'Est-ce un produit $_LANGADM['AdminProductsf8d71f7aaec730f4f1620506a158728a'] = 'Ce produit a un fichier associé ?'; $_LANGADM['AdminProducts63b28593e2858476903ac94ca8697341'] = 'Votre répertoire de dépôt de fichier n\'a pas les permissions suffisantes en écriture'; $_LANGADM['AdminProducts9c4cae7cfe29fcbd5a5b5d866593f294'] = 'Vous avez utilisé des déclinaisons, pour cette raison vous ne pouvez pas éditer votre fichier ici, mais dans l\'onglet \"Déclinaisons\"'; -$_LANGADM['AdminProductsd88946b678e4c2f251d4e292e8142291'] = 'SEO'; $_LANGADM['AdminProducts2651608f8f1c6f391f919be228a6ee62'] = 'Cliquez ici pour améliorer votre position dans les moteurs de recherche (SEO)'; $_LANGADM['AdminProducts7b250cb374c12c42a75227ba75df7779'] = 'Balise :'; $_LANGADM['AdminProducts18a2ecd7e67529945cf93821d3fc438f'] = 'Titre de la fiche produit, laisser vide pour utiliser le nom du produit'; @@ -3396,7 +3395,6 @@ $_LANGADM['AdminProducts184dba60ea740430441d13a7e8213691'] = 'Affiche \"en solde $_LANGADM['AdminProducts7b988b81a5fe3114360063de23f49016'] = 'Prix de vente final :'; $_LANGADM['AdminProductse2e79605fc9450ec17957cf0e910f5c6'] = 'TTC'; $_LANGADM['AdminProducts887ee91702c962a70b87cbef07bbcaec'] = 'HT'; -$_LANGADM['AdminProducts6aa641a49246a5538f692e9884fbe96e'] = 'Vous pouvez définir plusieurs réductions et des règles de prix spécifiques dans l\'onglet Prix'; $_LANGADM['AdminProducts850611eb409c54ab510153d91572be5b'] = 'Prix spécifique actuel :'; $_LANGADM['AdminProductsc1649abdccba825a27f5820f126c8454'] = 'Ajouter un nouveau prix spécifiques'; $_LANGADM['AdminProductsf98188b975d57e9dfc3137c7c9f9a5da'] = 'Pour :';

({l s='appears in the product lists and on the top of the product page'})