From c21f1100c393c41c4b07445e2e61bc090f56f3c9 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Wed, 2 Nov 2011 10:40:57 +0000 Subject: [PATCH] [*] BO : #PSFV-94 - forms now correctly use admin.js::displayFlags function. attributeLang attribute is deprecated in forms --- .../themes/template/helper/form/form.tpl | 80 ++++++------------- controllers/admin/AdminContactsController.php | 2 - js/admin.js | 9 ++- 3 files changed, 30 insertions(+), 61 deletions(-) diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl index f1ad5e14c..f2aae2ae2 100644 --- a/admin-dev/themes/template/helper/form/form.tpl +++ b/admin-dev/themes/template/helper/form/form.tpl @@ -105,38 +105,22 @@
{/block} {if $input.type == 'text'} - {if isset($input.lang) && isset($input.attributeLang)} - {foreach $languages as $language} -
- - {if isset($input.hint)}{$input.hint} {/if} -
- {/foreach} - {if count($languages) > 1} -
- -
-
- {l s='Choose language:'}

- {foreach $languages as $language} - {$language.name} - {/foreach} -
- {/if} + {if isset($input.lang)} +
+ {foreach $languages as $language} +
+ + {if isset($input.hint)}{$input.hint} {/if} +
+ {/foreach} +
{else} {/if} {/foreach} {elseif $input.type == 'textarea'} - {if isset($input.lang) && isset($input.attributeLang)} - {foreach $languages as $language} -
- -
- {/foreach} - {if count($languages) > 1} -
- -
-
- {l s='Choose language:'}

- {foreach $languages as $language} - {$language.name} - {/foreach} -
- {/if} + {if isset($input.lang)} +
+ {foreach $languages as $language} +
+ +
+ {/foreach} +
{else} {/if} diff --git a/controllers/admin/AdminContactsController.php b/controllers/admin/AdminContactsController.php index 867bc7074..490914a0c 100644 --- a/controllers/admin/AdminContactsController.php +++ b/controllers/admin/AdminContactsController.php @@ -61,7 +61,6 @@ class AdminContactsControllerCore extends AdminController 'size' => 33, 'required' => true, 'lang' => true, - 'attributeLang' => 'name', 'p' => $this->l('Contact name, e.g., Technical Support'), ), array( @@ -99,7 +98,6 @@ class AdminContactsControllerCore extends AdminController 'name' => 'description', 'required' => false, 'lang' => true, - 'attributeLang' => 'description', 'cols' => 36, 'rows' => 5, 'p' => $this->l('Additional information about this contact'), diff --git a/js/admin.js b/js/admin.js index d92c30cd5..c27c2b27e 100644 --- a/js/admin.js +++ b/js/admin.js @@ -1,5 +1,4 @@ /* -* 2007-2011 PrestaShop * * NOTICE OF LICENSE * @@ -120,8 +119,12 @@ function updateFriendlyURLByName() } function updateFriendlyURL() { - $('#link_rewrite_' + id_language).val(str2url($('#link_rewrite_' + id_language).val(), 'UTF-8')); - $('#seo #friendly-url').text($('#link_rewrite_' + id_language).val()); + var link = $('#link_rewrite_' + id_language); + if (link[0]) + { + link.val(str2url($('#link_rewrite_' + id_language).val(), 'UTF-8')); + $('#seo #friendly-url').text(link.val()); + } } function toggleLanguageFlags(elt)