diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 876814d5d..3857b0a4b 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -103,6 +103,8 @@
+ + diff --git a/core/lib/Thelia/Form/LanguageCreationForm.php b/core/lib/Thelia/Form/LanguageCreationForm.php new file mode 100644 index 000000000..713cafcd9 --- /dev/null +++ b/core/lib/Thelia/Form/LanguageCreationForm.php @@ -0,0 +1,58 @@ +. */ +/* */ +/*************************************************************************************/ +namespace Thelia\Form; + +use Symfony\Component\Validator\Constraints\NotBlank; +use Thelia\Core\Translation\Translator; + +class LanguageCreationForm extends BaseForm +{ + protected function buildForm() + { + $this->formBuilder + ->add("title", "text", array( + "constraints" => array( + new NotBlank() + ), + "label" => Translator::getInstance()->trans("Language title *"), + "label_attr" => array( + "for" => "title" + ) + )) + ->add("isocode", "text", array( + "constraints" => array( + new NotBlank() + ), + "label" => Translator::getInstance()->trans("ISO Code *"), + "label_attr" => array( + "for" => "isocode" + ) + )) + ; + } + + public function getName() + { + return "thelia_language_creation"; + } +} diff --git a/templates/admin/default/languages.html b/templates/admin/default/languages.html index 1a11b9537..499e903d7 100644 --- a/templates/admin/default/languages.html +++ b/templates/admin/default/languages.html @@ -180,10 +180,58 @@ +{form name="thelia.admin.language.creation"} + + {* Capture the dialog body, to pass it to the generic dialog *} + {capture "creation_dialog"} + + {form_hidden_fields form=$form} + + {* Be sure to get the language_id, even if the form could not be validated *} + + + {form_field form=$form field='success_url'} + {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} + + {/form_field} + + {form_field form=$form field='title'} +