From 265da6a57ebbeda60c579c81a612ac331f5bb329 Mon Sep 17 00:00:00 2001 From: mespeche Date: Fri, 20 Sep 2013 12:00:39 +0200 Subject: [PATCH] Add default language & editing language default field --- .../Thelia/Form/ProfileModificationForm.php | 28 +++++++++ templates/admin/default/profile-edit.html | 62 ++++++++++++++++--- 2 files changed, 82 insertions(+), 8 deletions(-) diff --git a/core/lib/Thelia/Form/ProfileModificationForm.php b/core/lib/Thelia/Form/ProfileModificationForm.php index 94ce1fba9..e3119cfee 100644 --- a/core/lib/Thelia/Form/ProfileModificationForm.php +++ b/core/lib/Thelia/Form/ProfileModificationForm.php @@ -58,6 +58,34 @@ class ProfileModificationForm extends BaseForm "for" => "lastname" ) )) + ->add("default_language", "text", array( + "constraints" => array( + new Constraints\NotBlank() + ), + "label" => Translator::getInstance()->trans("Default language"), + "label_attr" => array( + "for" => "default_language" + ) + )) + ->add("editing_language_default", "text", array( + "constraints" => array( + new Constraints\NotBlank() + ), + "label" => Translator::getInstance()->trans("Editing language default"), + "label_attr" => array( + "for" => "editing_language_default" + ) + )) + ->add("old_password", "password", array( + "constraints" => array( + new Constraints\NotBlank(), + new Constraints\Length(array("min" => ConfigQuery::read("password.length", 4))) + ), + "label" => Translator::getInstance()->trans("Old password"), + "label_attr" => array( + "for" => "old_password" + ) + )) ->add("password", "password", array( "constraints" => array( new Constraints\NotBlank(), diff --git a/templates/admin/default/profile-edit.html b/templates/admin/default/profile-edit.html index 19b6c4c2d..e882dc40d 100644 --- a/templates/admin/default/profile-edit.html +++ b/templates/admin/default/profile-edit.html @@ -47,20 +47,55 @@ {/form_field} - {form_field form=$form field='password'} + {form_field form=$form field='default_language'}
- -
- {/form_field} - {form_field form=$form field='password_confirm'} -
- - +
{/form_field} + {form_field form=$form field='editing_language_default'} +
+ + + +
+ {/form_field} + +
+
{intl l="Change password"}
+ + {form_field form=$form field='old_password'} +
+ + +
+ {/form_field} + + {form_field form=$form field='password'} +
+ + +
+ {/form_field} + + {form_field form=$form field='password_confirm'} +
+ + +
+ {/form_field} +
+
+{/block} + +{block name="javascript-initialization"} + + {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'} + + {/javascripts} + {javascripts file='assets/js/main.js'} + + {/javascripts} + {/block} \ No newline at end of file