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"} +
+ + + + {form name="thelia.import"} + {if $form_error} +
+
+
{$form_error_message}
+
+
+ {/if} + +
+
+
+ +
+ {intl l='Import'}: {$TITLE} +
+ +
+ {custom_render_form_field form=$form field="file_upload"} + + {/custom_render_form_field} + + + +
+
+
+
+ {/form} +{/block} + +{block name="javascript-last-call"} + {module_include location='configuration-js'} +{/block} \ No newline at end of file diff --git a/templates/backOffice/default/import.html b/templates/backOffice/default/import.html index 8f44e31af..ae48246ab 100644 --- a/templates/backOffice/default/import.html +++ b/templates/backOffice/default/import.html @@ -17,6 +17,7 @@ {assign url_import "import_order="|cat:$import_order} {/if} +
@@ -33,6 +34,7 @@ {module_include location='tools_top'} {loop name="import-category" type="import-category" order=$category_order} + {assign category_title $TITLE}
@@ -80,7 +82,7 @@ {$ID} - {$TITLE} + {$TITLE} {$DESCRIPTION} @@ -96,7 +98,7 @@ @@ -123,35 +125,27 @@
{/block} - -{block name="javascript-initialization"} - {javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'} - - {/javascripts} -{/block} - {block name="javascript-last-call"} - {module_include location='configuration-js'}