diff --git a/core/lib/Thelia/Config/Resources/form.xml b/core/lib/Thelia/Config/Resources/form.xml index ebb1a03e8..39dc27f55 100644 --- a/core/lib/Thelia/Config/Resources/form.xml +++ b/core/lib/Thelia/Config/Resources/form.xml @@ -134,6 +134,7 @@
+ diff --git a/core/lib/Thelia/Form/ImportForm.php b/core/lib/Thelia/Form/ImportForm.php new file mode 100644 index 000000000..040f5feb0 --- /dev/null +++ b/core/lib/Thelia/Form/ImportForm.php @@ -0,0 +1,60 @@ + + */ +class ImportForm extends BaseForm +{ + /** + * + * in this function you add all the fields you need for your Form. + * Form this you have to call add method on $this->formBuilder attribute : + * + * $this->formBuilder->add("name", "text") + * ->add("email", "email", array( + * "attr" => array( + * "class" => "field" + * ), + * "label" => "email", + * "constraints" => array( + * new \Symfony\Component\Validator\Constraints\NotBlank() + * ) + * ) + * ) + * ->add('age', 'integer'); + * + * @return null + */ + protected function buildForm() + { + $this->formBuilder->add("file_upload", "file", array( + "label" => Translator::getInstance()->trans("File to upload"), + "label_attr" => ["for" => "file_to_upload"], + "required" => true, + )); + } + + /** + * @return string the name of you form. This name must be unique + */ + public function getName() + { + return "thelia_import"; + } + +} \ No newline at end of file diff --git a/templates/backOffice/default/ajax/import-modal.html b/templates/backOffice/default/ajax/import-modal.html new file mode 100644 index 000000000..2cc37c93a --- /dev/null +++ b/templates/backOffice/default/ajax/import-modal.html @@ -0,0 +1,22 @@ +{form name="thelia.import"} + +{/form} \ No newline at end of file diff --git a/templates/backOffice/default/import-page.html b/templates/backOffice/default/import-page.html index e69de29bb..37a155bd9 100644 --- a/templates/backOffice/default/import-page.html +++ b/templates/backOffice/default/import-page.html @@ -0,0 +1,57 @@ +{extends file="admin-layout.tpl"} + +{block name="no-return-functions"} + {$admin_current_location = 'tools'} +{/block} + +{block name="page-title"}{intl l='Import'}: {$TITLE}{/block} + +{block name="check-resource"}admin.import{/block} +{block name="check-access"}view{/block} + +{block name="main-content"} +