diff --git a/AdminIncludes/module_configuration.html b/AdminIncludes/module_configuration.html index 160dea6..21942be 100644 --- a/AdminIncludes/module_configuration.html +++ b/AdminIncludes/module_configuration.html @@ -117,52 +117,12 @@ {* Capture the dialog body, to pass it to the generic dialog *} {capture "keyword_group_creation_dialog"} + {form_hidden_fields} - {form_hidden_fields form=$form} - - {form_field form=$form field='success_url'} - - {/form_field} - - {form_field form=$form field='title'} -
- - {loop type="lang" name="default-lang" default_only="1"} -
- - $TITLE -
- -
{intl l='Enter here the keyword group name in the default language (%title)' d='keyword' title="$TITLE"}
- - {* Switch edition to the current locale *} - - - {form_field form=$form field='locale'} - - {/form_field} - {/loop} -
- {/form_field} - - {form_field form=$form field='code'} -
- - -
{intl l='Enter here the unique identifier of the keyword group which must be use into your loops' d='keyword'}
-
- {/form_field} - - {form_field form=$form field='visible'} -
-
- -
-
- {/form_field} - + {render_form_field field='success_url' value="{url path='/admin/module/Keyword'}"} + {render_form_field field='title'} + {render_form_field field='code'} + {render_form_field field='visible'} {/capture} {include @@ -175,7 +135,7 @@ dialog_ok_label = {intl l="Save"} form_action = {url path='/admin/module/Keyword/group/create'} - form_enctype = {form_enctype form=$form} + form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} diff --git a/Config/module.xml b/Config/module.xml index dbb5406..25aabdc 100644 --- a/Config/module.xml +++ b/Config/module.xml @@ -7,7 +7,7 @@ Keyword - 3.0.1 + 3.0.2 Michaël Espeche mespeche@openstudio.fr diff --git a/Form/KeywordCreationForm.php b/Form/KeywordCreationForm.php index e748fea..b462614 100644 --- a/Form/KeywordCreationForm.php +++ b/Form/KeywordCreationForm.php @@ -23,6 +23,8 @@ namespace Keyword\Form; use Keyword\Model\KeywordQuery; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Validator\Constraints\Callback; @@ -63,13 +65,14 @@ protected function buildForm() )) ) )) - ->add('visible', IntegerType::class, array( + ->add('visible', CheckboxType::class, array( 'label' => Translator::getInstance()->trans('Visible ?'), + 'required' => false, 'label_attr' => array( 'for' => 'keyword_visible' ) )) - ->add("locale", TextType::class, array( + ->add("locale", HiddenType::class, array( "constraints" => array( new NotBlank() ) diff --git a/Form/KeywordGroupCreationForm.php b/Form/KeywordGroupCreationForm.php index d295854..85ba48f 100644 --- a/Form/KeywordGroupCreationForm.php +++ b/Form/KeywordGroupCreationForm.php @@ -23,6 +23,8 @@ namespace Keyword\Form; use Keyword\Model\KeywordGroupQuery; +use Symfony\Component\Form\Extension\Core\Type\CheckboxType; +use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\IntegerType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Validator\Constraints\Callback; @@ -55,13 +57,14 @@ protected function buildForm() 'for' => 'keyword_code' ) )) - ->add('visible', IntegerType::class, array( + ->add('visible', CheckboxType::class, array( 'label' => Translator::getInstance()->trans('Visible ?'), + 'required' => false, 'label_attr' => array( 'for' => 'keyword_visible' ) )) - ->add("locale", TextType::class, array( + ->add("locale", HiddenType::class, array( "constraints" => array( new NotBlank() ) diff --git a/I18n/fr_FR.php b/I18n/fr_FR.php index 99c4075..c96c0ea 100755 --- a/I18n/fr_FR.php +++ b/I18n/fr_FR.php @@ -1,40 +1,40 @@ 'Modification du mot clé', - 'Keywords' => 'Mots clé', - 'Edit keyword %title' => 'Modifier le mot clé : %title', - 'Edit previous keyword' => 'Modifier le mot clé précédent', - 'Edit next keyword' => 'Modifier le mot clé suivant', + 'Edit keyword' => 'Modification du mot-clé', + 'Keywords' => 'mots-clés', + 'Edit keyword %title' => 'Modifier le mot-clé %title', + 'Edit previous keyword' => 'Modifier le mot-clé précédent', + 'Edit next keyword' => 'Modifier le mot-clé suivant', 'unique identifier' => 'identifiant unique', 'Unique identifier' => 'Identifiant unique', - 'Enter here the unique identifier of the keyword which must be use into your loops' => 'Entrez ici l\'identifiant unique du mot clé qui doit être utilisé dans vos boucles', - 'Keyword created on %date_create. Last modification: %date_change' => 'Mot clé créé le %date_create. Dernière modification le %date_change', - 'View keyword associations' => 'Voir les associations du mot clé', - 'View keyword "%title" associations' => 'Voir les associations du mot clé : %title', - 'View previous keyword' => 'Voir le mot clé précédent', - 'View next keyword' => 'Voir le mot clé suivant', + 'Enter here the unique identifier of the keyword which must be use into your loops' => 'Entrez ici l\'identifiant unique du mot-clé qui doit être utilisé dans vos boucles', + 'Keyword created on %date_create. Last modification: %date_change' => 'mot-clé créé le %date_create. Dernière modification le %date_change', + 'View keyword associations' => 'Voir les associations du mot-clé', + 'View keyword "%title" associations' => 'Associations des mots-clés du goupe %title', + 'View previous keyword' => 'Voir le mot-clé précédent', + 'View next keyword' => 'Voir le mot-clé suivant', 'Folders association' => 'Dossiers associés', 'Contents association' => 'Contenus associés', 'Categories association' => 'Catégories associés', 'Products association' => 'Produits associés', 'Contents' => 'Contenus', - 'This keyword has no folder assocation.' => 'Ce mot clé n\'a pas de dossier associé', - 'This keyword has no content assocation.' => 'Ce mot clé n\'a pas de contenu associé', - 'This keyword has no category assocation.' => 'Ce mot clé n\'a pas de catégorie associée', - 'This keyword has no product assocation.' => 'Ce mot clé n\'a pas de produit associé', - 'Keywords association' => 'Mots clé associés', - 'Enter new keyword position' => 'Entrez la nouvelle position du mot clé', - 'Add a new keyword' => 'Ajouter un nouveau mot clé', - 'Browse this keyword' => 'Voir ce mot clé', - 'Edit this keyword' => 'Modifier ce mot clé', - 'Delete this keyword' => 'Supprimer ce mot clé', - 'There is no keywords. To create a new one, click the + button above.' => 'Il n\'y a pas de mot clé. Pour en créer un nouveau, cliquez sur le bouton + ci-dessus.', - 'There is no keywords.' => 'Il n\'y a pas de mot clé.', - 'Enter here the keyword name in the default language (%title)' => 'Entrez ici le titre du mot clé dans la langue par defaut (%title)', - 'Create a new keyword' => 'Créer un nouveau mot clé', - 'Delete keyword' => 'Supprimer le mot clé', - 'Do you really want to delete this keyword and all its associations ?' => 'Voulez-vous vraiment supprimer ce mot clé ainsi que toutes ses assocations ?', + 'This keyword has no folder assocation.' => 'Ce mot-clé n\'a pas de dossier associé', + 'This keyword has no content assocation.' => 'Ce mot-clé n\'a pas de contenu associé', + 'This keyword has no category assocation.' => 'Ce mot-clé n\'a pas de catégorie associée', + 'This keyword has no product assocation.' => 'Ce mot-clé n\'a pas de produit associé', + 'Keywords association' => 'mots-clés associés', + 'Enter new keyword position' => 'Entrez la nouvelle position du mot-clé', + 'Add a new keyword' => 'Ajouter un nouveau mot-clé', + 'Browse this keyword' => 'Voir ce mot-clé', + 'Edit this keyword' => 'Modifier ce mot-clé', + 'Delete this keyword' => 'Supprimer ce mot-clé', + 'There is no keywords. To create a new one, click the + button above.' => 'Il n\'y a pas de mot-clé. Pour en créer un nouveau, cliquez sur le bouton + ci-dessus.', + 'There is no keywords.' => 'Il n\'y a pas de mot-clé.', + 'Enter here the keyword name in the default language (%title)' => 'Entrez ici le titre du mot-clé dans la langue par defaut (%title)', + 'Create a new keyword' => 'Créer un nouveau mot-clé', + 'Delete keyword' => 'Supprimer le mot-clé', + 'Do you really want to delete this keyword and all its associations ?' => 'Voulez-vous vraiment supprimer ce mot-clé ainsi que toutes ses assocations ?', 'Edit keyword group' => 'Modification du groupe de mots-clés', 'Keyword Groups' => 'Goupes de mots-clés', @@ -56,12 +56,12 @@ 'Edit next keyword group' => 'Modifier le groupe de mots-clés suivant', 'Keyword group created on %date_create. Last modification: %date_change' => 'Groupe de mots-clés créé le %date_create. Dernière modification le %date_change', 'View keyword group associations' => 'Voir les associations du groupe de mots-clés', - 'View keyword group "%title" associations' => 'Voir les associations du groupe de mots-clés : %title', + 'View keyword group "%title" associations' => 'Mots-clés du groupe %title', 'View previous keyword group' => 'Voir le groupe de mots-clés précédent', 'View next keyword group' => 'Voir le groupe de mots-clés suivant', 'Enter new folder position' => 'Entrez la nouvelle position du dossier', 'Enter new content position' => 'Entrez la nouvelle position du contenu', 'Enter new category position' => 'Entrez la nouvelle position de la catégorie', 'Enter new product position' => 'Entrez la nouvelle position du produit', - 'Change keyword group' => 'Changer le mot clé de groupe' + 'Change keyword group' => 'Changer le mot-clé de groupe' ); diff --git a/templates/backOffice/default/keyword-edit.html b/templates/backOffice/default/keyword-edit.html index 834708c..53e7833 100644 --- a/templates/backOffice/default/keyword-edit.html +++ b/templates/backOffice/default/keyword-edit.html @@ -8,7 +8,7 @@ {block name="main-content"}
- +k={$keyword_id} {loop name="keyword_edit" type="keyword" visible="*" id="{$keyword_id}" backend_context="1" lang="$edit_language_id"}
@@ -147,4 +122,4 @@
-{/block} \ No newline at end of file +{/block} diff --git a/templates/backOffice/default/keyword-group-edit.html b/templates/backOffice/default/keyword-group-edit.html index d8d15db..1a9004f 100644 --- a/templates/backOffice/default/keyword-group-edit.html +++ b/templates/backOffice/default/keyword-group-edit.html @@ -15,7 +15,7 @@
- {loop name="keyword_edit" type="keyword_group" visible="*" id="{$keyword_group_id}" backend_context="1" lang="$edit_language_id"} + {loop name="keyword_edit" type="keyword_group" visible="*" id=$keyword_group_id backend_context="1" lang=$edit_language_id}
@@ -52,50 +52,29 @@
{form name="keyword_group_admin_modification"} - + {include file="includes/inner-form-toolbar.html" close_url="{url path='/admin/module/Keyword' keyword_group_id=$keyword_group_id}"} {* Be sure to get the keyword group ID, even if the form could not be validated *} - + - {form_hidden_fields form=$form} + {form_hidden_fields} - {form_field form=$form field='success_url'} - - {/form_field} + {render_form_field field='id' value=$keyword_group_id} - {form_field form=$form field='locale'} - - {/form_field} + {render_form_field field='success_url' value={url path="/admin/module/Keyword/group/update{$ID}"}} + {render_form_field field='locale' value=$edit_language_locale} {if $form_error}
{$form_error_message}
{/if} - {include file="includes/standard-description-form-fields.html"} + {render_form_field field='title' value=$TITLE} + {render_form_field field="chapo" value=$CHAPO} + {render_form_field field="description" value=$DESCRIPTION extra_class="wysiwyg"} + {render_form_field field="postscriptum" value=$POSTSCRIPTUM} - {form_field form=$form field='code'} -
- - -
{intl l='Enter here the unique identifier of the keyword group which must be use into your loops' d='keyword'}
-
- {/form_field} - -
-
- {form_field form=$form field='visible'} -
- -
- -
-
- {/form_field} -
-
+ {render_form_field field='code' value=$CODE} + {render_form_field field='visible' value=$CODE}
@@ -122,4 +101,4 @@
-{/block} \ No newline at end of file +{/block} diff --git a/templates/backOffice/default/keyword-group-view.html b/templates/backOffice/default/keyword-group-view.html index 9420351..b284630 100644 --- a/templates/backOffice/default/keyword-group-view.html +++ b/templates/backOffice/default/keyword-group-view.html @@ -20,11 +20,16 @@
-
+
{intl l='View keyword group "%title" associations' title=$TITLE d='keyword'}
-
+
+ {loop type="auth" name="can_create" role="ADMIN" resource="admin.keyword" access="CREATE"} + + + + {/loop} {if $HAS_PREVIOUS != 0} @@ -46,16 +51,6 @@
- - {ifloop rel="keyword_list"} @@ -166,55 +161,13 @@ {* Capture the dialog body, to pass it to the generic dialog *} {capture "keyword_creation_dialog"} - {form_hidden_fields form=$form} - - {form_field form=$form field='success_url'} - - {/form_field} - - {form_field form=$form field='keyword_group_id'} - - {/form_field} - - {form_field form=$form field='title'} -
- - {loop type="lang" name="default-lang" default_only="1"} -
- - $TITLE -
- -
{intl l='Enter here the keyword name in the default language (%title)' title="$TITLE" d='keyword'}
- - {* Switch edition to the current locale *} - - - {form_field form=$form field='locale'} - - {/form_field} - {/loop} -
- {/form_field} - - {form_field form=$form field='code'} -
- - -
{intl l='Enter here the unique identifier of the keyword which must be use into your loops' d='keyword'}
-
- {/form_field} - - {form_field form=$form field='visible'} -
-
- -
-
- {/form_field} + {form_hidden_fields} + {render_form_field field='success_url' value="{url path='/admin/module/Keyword/group/view' keyword_group_id=$keyword_group_id}"} + {render_form_field field='keyword_group_id' value=$keyword_group_id} + {render_form_field field='title'} + {render_form_field field='code'} + {render_form_field field='visible'} {/capture} {include @@ -227,7 +180,7 @@ dialog_ok_label = {intl l="Save"} form_action = {url path='/admin/module/Keyword/create'} - form_enctype = {form_enctype form=$form} + form_enctype = {form_enctype} form_error_message = $form_error_message } {/form} @@ -307,4 +260,4 @@ }); -{/block} \ No newline at end of file +{/block} diff --git a/templates/backOffice/default/keyword-view.html b/templates/backOffice/default/keyword-view.html index 18bae27..f108af5 100644 --- a/templates/backOffice/default/keyword-view.html +++ b/templates/backOffice/default/keyword-view.html @@ -410,7 +410,7 @@ -{/block} \ No newline at end of file +{/block}
- {intl l="Keywords" d='keyword'} - - {loop type="auth" name="can_create" role="ADMIN" resource="admin.keyword" access="CREATE"} - - - - {/loop} -