From b441c1cf26ab6693c294e8ef7d0daa8904abc3f0 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Sun, 6 Nov 2011 12:54:50 +0000 Subject: [PATCH] // fix update form.tpl in AdminLanguagesController --- admin-dev/themes/template/languages/form.tpl | 351 +++--------------- .../admin/AdminLanguagesController.php | 2 + 2 files changed, 53 insertions(+), 300 deletions(-) diff --git a/admin-dev/themes/template/languages/form.tpl b/admin-dev/themes/template/languages/form.tpl index 33a430691..86c979051 100644 --- a/admin-dev/themes/template/languages/form.tpl +++ b/admin-dev/themes/template/languages/form.tpl @@ -23,309 +23,60 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} +{extends file="helper/form/form.tpl"} -{if $firstCall} - - - -{/if} -{if isset($fields.title)}

{$fields.title}

{/if} -
- {if $form_id} - +{block name="start_field_block"} +
+ {if $input.type == 'special'} +

{$input.text}

{/if} -
- {foreach $fields as $key => $field} - {if $key == 'legend'} - - {if isset($field.image)}{$field.title}{/if} - {$field.title} - - {elseif $key == 'input'} - {foreach $field as $input} - {if $input.name == 'id_state'} -
- {/if} - {if isset($input.label)} - - {/if} - {if $input.type == 'hidden'} - - {else} -
- {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} -
+{/block} + +{block name=script} + + $(document).ready(function() { + $('#iso_code').keyup(function() { + checkLangPack(); + }); + }); + +{/block} + +{block name="other_fieldsets"} + + {if isset($fields['new'])} +

+
+ {foreach $fields['new'] as $key => $field} + {if $key == 'legend'} + + {if isset($field.image)}{$field.title}{/if} + {$field.title} + +

{l s='This language is NOT complete and cannot be used in the Front or Back Office because some files are missing.'}

+
+ {elseif $key == 'list_files'} + {foreach $field as $list} + +
+ {foreach $list.files as $key => $file} + {if !file_exists($key)} + {/if} - {else} - - {if isset($input.hint)}{$input.hint} {/if} - {/if} - {elseif $input.type == 'select'} - {if isset($input.options.query) && !$input.options.query && isset($input.empty_message)} - {$input.empty_message} - {$input.required = false} - {$input.p = null} - {else} - - {if isset($input.hint)}{$input.hint} {/if} - {/if} - {elseif $input.type == 'radio'} - {foreach $input.values as $value} - - - {if isset($input.br) && $input.br}
{/if} + {$key} + {if !file_exists($key)} +
+ {/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} - {else} - - {/if} - {elseif $input.type == 'checkbox'} - {foreach $input.values.query as $value} - {assign var=id_checkbox value=$input.name|cat:'_'|cat:$value[$input.values.id]} - -
- {/foreach} - {elseif $input.type == 'file'} - - - {elseif $input.type == 'password'} - - {elseif $input.type == 'special'} -

{$input.text}

- {elseif $input.type == 'group'} - {assign var=groups value=$input.values} - {include file='helper/form/form_group.tpl'} - {elseif $input.type == 'shop' OR $input.type == 'group_shop'} - {include file='helper/form/form_shop.tpl'} - {elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop} - -
- {$asso_shop} -
- {/if} - {if isset($input.required) && $input.required} *{/if} - {if isset($input.p)} -

- {if is_array($input.p)} - {foreach $input.p as $p} - {if is_array($p)} - {$p.text}
- {else} - {$p}
- {/if} - {/foreach} - {else} - {$input.p} - {/if} -

- {/if} - {if isset($languages)}
{/if} -
- {/if} - {if $input.name == 'id_state'}
- {/if} - {/foreach} - {elseif $key == 'submit'} -
- -
- {/if} - {/foreach} - {if $required_fields} -
* {l s ='Required field'}
- {/if} -
- - -{if isset($fields['new'])} -

-
- {foreach $fields['new'] as $key => $field} - {if $key == 'legend'} - - {if isset($field.image)}{$field.title}{/if} - {$field.title} - -

{l s='This language is NOT complete and cannot be used in the Front or Back Office because some files are missing.'}

-
- {elseif $key == 'list_files'} - {foreach $field as $list} - -
- {foreach $list.files as $key => $file} - {if !file_exists($key)} - - {/if} - {$key} - {if !file_exists($key)} - - {/if} -
- {/foreach} -
-
- {/foreach} - {/if} - {/foreach} -
-
{l s='Missing files are marked in red'}
-
-{/if} -

-{if $firstCall && !$no_back} - {if $back} - {l s='Back'} - {else} - {l s='Back to list'} +
+ {/foreach} + {/if} + {/foreach} +
+
{l s='Missing files are marked in red'}
+ {/if} -
-{/if} + +{/block} diff --git a/controllers/admin/AdminLanguagesController.php b/controllers/admin/AdminLanguagesController.php index 1a4f040be..f12c3f572 100644 --- a/controllers/admin/AdminLanguagesController.php +++ b/controllers/admin/AdminLanguagesController.php @@ -299,6 +299,8 @@ class AdminLanguagesControllerCore extends AdminController $this->fields_value['shop'][$row['id_shop']][] = $row[$this->identifier]; } + $this->addJS(_PS_JS_DIR_.'checkLangPack.js'); + return parent::initForm(); }