]> Raphaƫl G. Git Repositories - userbundle/blobdiff - DependencyInjection/Configuration.php
Rename contact.name to contact.title
[userbundle] / DependencyInjection / Configuration.php
index 6bf675b5780600a64bde94cb8a4a736aa24b821c..efc8a686f5638f5645aa0addad429f1a42498425 100644 (file)
@@ -20,14 +20,18 @@ class Configuration implements ConfigurationInterface {
 
                //The bundle default values
                $defaults = [
 
                //The bundle default values
                $defaults = [
-                       'class' => [
+                       'class' => [
                                'group' => 'Rapsys\\UserBundle\\Entity\\Group',
                                'group' => 'Rapsys\\UserBundle\\Entity\\Group',
-                               'title' => 'Rapsys\\UserBundle\\Entity\\Title',
+                               'civility' => 'Rapsys\\UserBundle\\Entity\\Civility',
                                'user' => 'Rapsys\\UserBundle\\Entity\\User'
                        ],
                                'user' => 'Rapsys\\UserBundle\\Entity\\User'
                        ],
+                       'default' => [
+                               'civility' => 'Mister',
+                               'group' => [ 'User' ]
+                       ],
                        'route' => [
                        'route' => [
-                               'homepage' => [
-                                       'name' => 'rapsys_user_homepage',
+                               'index' => [
+                                       'name' => 'rapsys_user_index',
                                        'context' => []
                                ],
                                'login' => [
                                        'context' => []
                                ],
                                'login' => [
@@ -47,11 +51,17 @@ class Configuration implements ConfigurationInterface {
                                        'context' => []
                                ]
                        ],
                                        'context' => []
                                ]
                        ],
+                       'translate' => [],
+                       'locales' => '%kernel.translator.fallbacks%',
+                       'languages' => [
+                               'en-gb' => 'English'
+                       ],
                        'contact' => [
                        'contact' => [
-                               'name' => 'John Doe',
+                               'title' => 'John Doe',
                                'mail' => 'contact@example.com'
                        ],
                        'login' => [
                                'mail' => 'contact@example.com'
                        ],
                        'login' => [
+                               'route' => ['index' => 'index_url'],
                                'view' => [
                                        'name' => '@RapsysUser/form/login.html.twig',
                                        'form' => 'Rapsys\UserBundle\Form\LoginType',
                                'view' => [
                                        'name' => '@RapsysUser/form/login.html.twig',
                                        'form' => 'Rapsys\UserBundle\Form\LoginType',
@@ -59,6 +69,7 @@ class Configuration implements ConfigurationInterface {
                                ]
                        ],
                        'recover' => [
                                ]
                        ],
                        'recover' => [
+                               'route' => ['index' => 'index_url', 'recover_mail' => 'recover_url'],
                                'view' => [
                                        'name' => '@RapsysUser/form/recover.html.twig',
                                        'form' => 'Rapsys\UserBundle\Form\RecoverType',
                                'view' => [
                                        'name' => '@RapsysUser/form/recover.html.twig',
                                        'form' => 'Rapsys\UserBundle\Form\RecoverType',
@@ -68,11 +79,11 @@ class Configuration implements ConfigurationInterface {
                                        'subject' => 'Welcome back!',
                                        'html' => '@RapsysUser/mail/recover.html.twig',
                                        'text' => '@RapsysUser/mail/recover.text.twig',
                                        'subject' => 'Welcome back!',
                                        'html' => '@RapsysUser/mail/recover.html.twig',
                                        'text' => '@RapsysUser/mail/recover.text.twig',
-                                       'route' => ['homepage' => 'homepage_url', 'recover_mail' => 'recover_url'],
                                        'context' => []
                                ]
                        ],
                        'recover_mail' => [
                                        'context' => []
                                ]
                        ],
                        'recover_mail' => [
+                               'route' => ['index' => 'index_url', 'recover_mail' => 'recover_url'],
                                'view' => [
                                        'name' => '@RapsysUser/form/recover_mail.html.twig',
                                        'form' => 'Rapsys\UserBundle\Form\RecoverMailType',
                                'view' => [
                                        'name' => '@RapsysUser/form/recover_mail.html.twig',
                                        'form' => 'Rapsys\UserBundle\Form\RecoverMailType',
@@ -82,11 +93,11 @@ class Configuration implements ConfigurationInterface {
                                        'subject' => 'Welcome back!',
                                        'html' => '@RapsysUser/mail/recover_mail.html.twig',
                                        'text' => '@RapsysUser/mail/recover_mail.text.twig',
                                        'subject' => 'Welcome back!',
                                        'html' => '@RapsysUser/mail/recover_mail.html.twig',
                                        'text' => '@RapsysUser/mail/recover_mail.text.twig',
-                                       'route' => ['homepage' => 'homepage_url'],
                                        'context' => []
                                ]
                        ],
                        'register' => [
                                        'context' => []
                                ]
                        ],
                        'register' => [
+                               'route' => ['index' => 'index_url'],
                                'view' => [
                                        'form' => 'Rapsys\UserBundle\Form\RegisterType',
                                        'name' => '@RapsysUser/form/register.html.twig',
                                'view' => [
                                        'form' => 'Rapsys\UserBundle\Form\RegisterType',
                                        'name' => '@RapsysUser/form/register.html.twig',
@@ -96,7 +107,6 @@ class Configuration implements ConfigurationInterface {
                                        'subject' => 'Welcome!',
                                        'html' => '@RapsysUser/mail/register.html.twig',
                                        'text' => '@RapsysUser/mail/register.text.twig',
                                        'subject' => 'Welcome!',
                                        'html' => '@RapsysUser/mail/register.html.twig',
                                        'text' => '@RapsysUser/mail/register.text.twig',
-                                       'route' => ['homepage' => 'homepage_url'],
                                        'context' => []
                                ]
                        ]
                                        'context' => []
                                ]
                        ]
@@ -118,20 +128,31 @@ class Configuration implements ConfigurationInterface {
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                                        ->scalarNode('group')->cannotBeEmpty()->defaultValue($defaults['class']['group'])->end()
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                                        ->scalarNode('group')->cannotBeEmpty()->defaultValue($defaults['class']['group'])->end()
-                                                       ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['class']['title'])->end()
+                                                       ->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['class']['civility'])->end()
                                                        ->scalarNode('user')->cannotBeEmpty()->defaultValue($defaults['class']['user'])->end()
                                                ->end()
                                        ->end()
                                                        ->scalarNode('user')->cannotBeEmpty()->defaultValue($defaults['class']['user'])->end()
                                                ->end()
                                        ->end()
+                                       ->arrayNode('default')
+                                               ->addDefaultsIfNotSet()
+                                               ->children()
+                                                       ->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['default']['civility'])->end()
+                                                       ->arrayNode('group')
+                                                               ->treatNullLike(array())
+                                                               ->defaultValue($defaults['default']['group'])
+                                                               ->scalarPrototype()->end()
+                                                       ->end()
+                                               ->end()
+                                       ->end()
                                        ->arrayNode('route')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('route')
                                                ->addDefaultsIfNotSet()
                                                ->children()
-                                                       ->arrayNode('homepage')
+                                                       ->arrayNode('index')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
-                                                                       ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['route']['homepage']['name'])->end()
+                                                                       ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['route']['index']['name'])->end()
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
-                                                                               ->defaultValue($defaults['route']['homepage']['context'])
+                                                                               ->defaultValue($defaults['route']['index']['context'])
                                                                                ->scalarPrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                                                ->scalarPrototype()->end()
                                                                        ->end()
                                                                ->end()
@@ -182,16 +203,32 @@ class Configuration implements ConfigurationInterface {
                                                        ->end()
                                                ->end()
                                        ->end()
                                                        ->end()
                                                ->end()
                                        ->end()
+                                       ->arrayNode('translate')
+                                               ->treatNullLike(array())
+                                               ->defaultValue($defaults['translate'])
+                                               ->scalarPrototype()->end()
+                                       ->end()
+                                       ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->end()
+                                       ->arrayNode('languages')
+                                               ->treatNullLike([])
+                                               ->defaultValue($defaults['languages'])
+                                               ->scalarPrototype()->end()
+                                       ->end()
                                        ->arrayNode('contact')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('contact')
                                                ->addDefaultsIfNotSet()
                                                ->children()
-                                                       ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['contact']['name'])->end()
+                                                       ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['contact']['title'])->end()
                                                        ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()
                                                ->end()
                                        ->end()
                                        ->arrayNode('login')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                                        ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()
                                                ->end()
                                        ->end()
                                        ->arrayNode('login')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('route')
+                                                               ->treatNullLike(array())
+                                                               ->defaultValue($defaults['login']['route'])
+                                                               ->scalarPrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
@@ -200,7 +237,7 @@ class Configuration implements ConfigurationInterface {
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['login']['view']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['login']['view']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
@@ -209,6 +246,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('recover')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('recover')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('route')
+                                                               ->treatNullLike(array())
+                                                               ->defaultValue($defaults['recover']['route'])
+                                                               ->scalarPrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
@@ -217,7 +259,7 @@ class Configuration implements ConfigurationInterface {
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover']['view']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover']['view']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
@@ -227,15 +269,10 @@ class Configuration implements ConfigurationInterface {
                                                                        ->scalarNode('subject')->cannotBeEmpty()->defaultValue($defaults['recover']['mail']['subject'])->end()
                                                                        ->scalarNode('html')->cannotBeEmpty()->defaultValue($defaults['recover']['mail']['html'])->end()
                                                                        ->scalarNode('text')->cannotBeEmpty()->defaultValue($defaults['recover']['mail']['text'])->end()
                                                                        ->scalarNode('subject')->cannotBeEmpty()->defaultValue($defaults['recover']['mail']['subject'])->end()
                                                                        ->scalarNode('html')->cannotBeEmpty()->defaultValue($defaults['recover']['mail']['html'])->end()
                                                                        ->scalarNode('text')->cannotBeEmpty()->defaultValue($defaults['recover']['mail']['text'])->end()
-                                                                       ->arrayNode('route')
-                                                                               ->treatNullLike(array())
-                                                                               ->defaultValue($defaults['recover']['mail']['route'])
-                                                                               ->scalarPrototype()->end()
-                                                                       ->end()
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover']['mail']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover']['mail']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
@@ -244,6 +281,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('recover_mail')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('recover_mail')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('route')
+                                                               ->treatNullLike(array())
+                                                               ->defaultValue($defaults['recover_mail']['route'])
+                                                               ->scalarPrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
@@ -252,7 +294,7 @@ class Configuration implements ConfigurationInterface {
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover_mail']['view']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover_mail']['view']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
@@ -262,15 +304,10 @@ class Configuration implements ConfigurationInterface {
                                                                        ->scalarNode('subject')->cannotBeEmpty()->defaultValue($defaults['recover_mail']['mail']['subject'])->end()
                                                                        ->scalarNode('html')->cannotBeEmpty()->defaultValue($defaults['recover_mail']['mail']['html'])->end()
                                                                        ->scalarNode('text')->cannotBeEmpty()->defaultValue($defaults['recover_mail']['mail']['text'])->end()
                                                                        ->scalarNode('subject')->cannotBeEmpty()->defaultValue($defaults['recover_mail']['mail']['subject'])->end()
                                                                        ->scalarNode('html')->cannotBeEmpty()->defaultValue($defaults['recover_mail']['mail']['html'])->end()
                                                                        ->scalarNode('text')->cannotBeEmpty()->defaultValue($defaults['recover_mail']['mail']['text'])->end()
-                                                                       ->arrayNode('route')
-                                                                               ->treatNullLike(array())
-                                                                               ->defaultValue($defaults['recover_mail']['mail']['route'])
-                                                                               ->scalarPrototype()->end()
-                                                                       ->end()
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover_mail']['mail']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['recover_mail']['mail']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
@@ -279,6 +316,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('register')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('register')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('route')
+                                                               ->treatNullLike(array())
+                                                               ->defaultValue($defaults['register']['route'])
+                                                               ->scalarPrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
@@ -287,7 +329,7 @@ class Configuration implements ConfigurationInterface {
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['register']['view']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['register']['view']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
@@ -297,15 +339,10 @@ class Configuration implements ConfigurationInterface {
                                                                        ->scalarNode('subject')->cannotBeEmpty()->defaultValue($defaults['register']['mail']['subject'])->end()
                                                                        ->scalarNode('html')->cannotBeEmpty()->defaultValue($defaults['register']['mail']['html'])->end()
                                                                        ->scalarNode('text')->cannotBeEmpty()->defaultValue($defaults['register']['mail']['text'])->end()
                                                                        ->scalarNode('subject')->cannotBeEmpty()->defaultValue($defaults['register']['mail']['subject'])->end()
                                                                        ->scalarNode('html')->cannotBeEmpty()->defaultValue($defaults['register']['mail']['html'])->end()
                                                                        ->scalarNode('text')->cannotBeEmpty()->defaultValue($defaults['register']['mail']['text'])->end()
-                                                                       ->arrayNode('route')
-                                                                               ->treatNullLike(array())
-                                                                               ->defaultValue($defaults['register']['mail']['route'])
-                                                                               ->scalarPrototype()->end()
-                                                                       ->end()
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['register']['mail']['context'])
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike(array())
                                                                                ->defaultValue($defaults['register']['mail']['context'])
-                                                                               ->scalarPrototype()->end()
+                                                                               ->variablePrototype()->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()
                                                                        ->end()
                                                                ->end()
                                                        ->end()