Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 7167998

Browse files
committed
Fixes after test-drive in the sandbox
1 parent b12c704 commit 7167998

16 files changed

+330
-55
lines changed

src/Admin/Menu/AbstractMenuNodeAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configureFormFields(FormMapper $formMapper)
5353
{
5454
$formMapper
5555
->tab('form.tab_general')
56-
->with('form.group_location')
56+
->with('form.group_location', ['class' => 'col-md-3'])
5757
->add('name', TextType::class)
5858
->add('label', TextType::class)
5959
->end()

src/Admin/Menu/Extension/MenuOptionsExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public function configureFormFields(FormMapper $formMapper)
6666
: []
6767
)
6868
->with($this->formGroup, 'form.group_menu_options' === $this->formGroup
69-
? ['translation_domain' => 'CmfSonataAdminIntegrationBundle']
70-
: []
69+
? ['class' => 'col-md-3', 'translation_domain' => 'CmfSonataAdminIntegrationBundle']
70+
: ['class' => 'col-md-3']
7171
)
7272
->add('display', CheckboxType::class, ['required' => false], ['help' => 'form.help_display'])
7373
->add('displayChildren', CheckboxType::class, ['required' => false], ['help' => 'form.help_display_children'])

src/Admin/Menu/MenuAdmin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ protected function configureFormFields(FormMapper $formMapper)
3030
if (!$isNew) {
3131
$formMapper
3232
->tab('form.tab_general')
33-
->with('form.group_items')
33+
->with('form.group_items', ['class' => 'col-md-6'])
3434
->add('children', TreeManagerType::class, array(
3535
'root' => $this->menuRoot,
3636
'edit_in_overlay' => false,
3737
'create_in_overlay' => false,
3838
'delete_in_overlay' => false,
3939
), array(
40-
'help' => 'help.items_help',
40+
'help' => 'help.help_items',
4141
))
4242
->end()
4343
->end()

src/Admin/Menu/MenuNodeAdmin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function configureFormFields(FormMapper $formMapper)
5959
// Add the choice for the node links "target"
6060
$formMapper
6161
->tab('form.tab_general')
62-
->with('form.group_target', ['class' => 'col-sm-9'])
62+
->with('form.group_target', ['class' => 'col-sm-6'])
6363
->add('linkType', ChoiceFieldMaskType::class, array(
6464
'choices' => array(
6565
'route' => 'route',

src/Admin/Routing/Extension/RouteReferrersExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ public function __construct($formGroup = 'form.group_routes', $formTab = 'form.t
3434

3535
public function configureFormFields(FormMapper $formMapper)
3636
{
37-
if ($formMapper->hasOpenTabs()) {
37+
if ($formMapper->hasOpenTab()) {
3838
$formMapper->end();
3939
}
4040

4141
$formMapper
4242
->tab($this->formTab)
43-
->with('form.group_routes')
43+
->with('form.group_routes', ['translation_domain' => 'CmfSonataAdminIntegrationBundle'])
4444
->add(
4545
'routes',
4646
CollectionType::class,
47-
[],
47+
['label' => false],
4848
[
4949
'edit' => 'inline',
5050
'inline' => 'table',

src/Admin/Routing/RouteAdmin.php

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ protected function configureFormFields(FormMapper $formMapper)
8585
)
8686
->end() // group path
8787

88-
->with('form.group_data', ['class' => 'col-md-6'])
88+
->with('form.group_defaults', ['class' => 'col-md-6'])
8989
->add(
9090
'defaults',
9191
ImmutableArrayType::class,
92-
['keys' => $this->configureFieldsForDefaults($this->getSubject()->getDefaults())]
92+
['label' => false, 'keys' => $this->configureFieldsForDefaults($this->getSubject()->getDefaults())]
9393
)
9494
->end() // group data
9595
->ifEnd()
@@ -131,17 +131,18 @@ public function getExportFormats()
131131
protected function configureFieldsForDefaults($dynamicDefaults)
132132
{
133133
$defaults = array(
134-
'_controller' => array('_controller', TextType::class, array('required' => false)),
135-
'_template' => array('_template', TextType::class, array('required' => false)),
136-
'type' => array('type', RouteTypeType::class, array(
134+
'_controller' => ['_controller', TextType::class, ['required' => false, 'translation_domain' => 'CmfSonataAdminIntegrationBundle']],
135+
'_template' => ['_template', TextType::class, ['required' => false, 'translation_domain' => 'CmfSonataAdminIntegrationBundle']],
136+
'type' => ['type', RouteTypeType::class, [
137137
'placeholder' => '',
138138
'required' => false,
139-
)),
139+
'translation_domain' => 'CmfSonataAdminIntegrationBundle',
140+
]],
140141
);
141142

142143
foreach ($dynamicDefaults as $name => $value) {
143144
if (!isset($defaults[$name])) {
144-
$defaults[$name] = array($name, TextType::class, array('required' => false));
145+
$defaults[$name] = [$name, TextType::class, ['required' => false]];
145146
}
146147
}
147148

@@ -153,16 +154,16 @@ protected function configureFieldsForDefaults($dynamicDefaults)
153154
foreach ($matches as $match) {
154155
$name = substr($match[0][0], 1, -1);
155156
if (!isset($defaults[$name])) {
156-
$defaults[$name] = array($name, TextType::class, array('required' => true));
157+
$defaults[$name] = [$name, TextType::class, ['required' => true]];
157158
}
158159
}
159160
}
160161

161162
if ($route && $route->getOption('add_format_pattern')) {
162-
$defaults['_format'] = array('_format', TextType::class, array('required' => true));
163+
$defaults['_format'] = ['_format', TextType::class, ['required' => true]];
163164
}
164165
if ($route && $route->getOption('add_locale_pattern')) {
165-
$defaults['_locale'] = array('_locale', TextType::class, array('required' => false));
166+
$defaults['_locale'] = ['_locale', TextType::class, ['required' => false]];
166167
}
167168

168169
return $defaults;
@@ -177,15 +178,15 @@ protected function configureFieldsForDefaults($dynamicDefaults)
177178
*/
178179
protected function configureFieldsForOptions(array $dynamicOptions)
179180
{
180-
$options = array(
181-
'add_locale_pattern' => array('add_locale_pattern', CheckboxType::class, array('required' => false, 'label' => 'form.label_add_locale_pattern', 'translation_domain' => 'CmfRoutingBundle')),
182-
'add_format_pattern' => array('add_format_pattern', CheckboxType::class, array('required' => false, 'label' => 'form.label_add_format_pattern', 'translation_domain' => 'CmfRoutingBundle')),
183-
'add_trailing_slash' => array('add_trailing_slash', CheckboxType::class, array('required' => false, 'label' => 'form.label_add_trailing_slash', 'translation_domain' => 'CmfRoutingBundle')),
184-
);
181+
$options = [
182+
'add_locale_pattern' => ['add_locale_pattern', CheckboxType::class, ['required' => false, 'label' => 'form.label_add_locale_pattern', 'translation_domain' => 'CmfSonataAdminIntegrationBundle']],
183+
'add_format_pattern' => ['add_format_pattern', CheckboxType::class, ['required' => false, 'label' => 'form.label_add_format_pattern', 'translation_domain' => 'CmfSonataAdminIntegrationBundle']],
184+
'add_trailing_slash' => ['add_trailing_slash', CheckboxType::class, ['required' => false, 'label' => 'form.label_add_trailing_slash', 'translation_domain' => 'CmfSonataAdminIntegrationBundle']],
185+
];
185186

186187
foreach ($dynamicOptions as $name => $value) {
187188
if (!isset($options[$name])) {
188-
$options[$name] = array($name, TextType::class, array('required' => false));
189+
$options[$name] = [$name, TextType::class, ['required' => false]];
189190
}
190191
}
191192

src/Resources/translations/CmfSonataAdminIntegrationBundle.cs.xliff

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,11 @@
336336
<!-- TODO: Translate -->
337337
<target>Target link</target>
338338
</trans-unit>
339+
<trans-unit id="form.group_menu_options">
340+
<source>form.group_menu_options</source>
341+
<!-- TODO: Translate -->
342+
<target>Menu Options</target>
343+
</trans-unit>
339344

340345
<trans-unit id="form.label_menu_nodes">
341346
<source>form.label_menu_nodes</source>
@@ -403,6 +408,11 @@
403408
<!-- TODO: Translate -->
404409
<target>Children are only displayed if the menu entry itself is displayed.</target>
405410
</trans-unit>
411+
<trans-unit id="help.help_items">
412+
<source>help.help_items</source>
413+
<!-- TODO: Translate -->
414+
<target>Click on item to edit, right click to create new items.</target>
415+
</trans-unit>
406416

407417
<trans-unit id="breadcrumb.link_menu_list">
408418
<source>breadcrumb.link_menu_list</source>
@@ -477,12 +487,17 @@
477487
<!-- TODO: Translate -->
478488
<target>Data</target>
479489
</trans-unit>
480-
481-
<trans-unit id="form.label_defaults">
482-
<source>form.label_defaults</source>
490+
<trans-unit id="form.group_defaults">
491+
<source>form.group_defaults</source>
483492
<!-- TODO: Translate -->
484493
<target>Default values</target>
485494
</trans-unit>
495+
<trans-unit id="form.group_routes">
496+
<source>form.group_routes</source>
497+
<!-- TODO: Translate -->
498+
<target>Routes</target>
499+
</trans-unit>
500+
486501
<trans-unit id="form.label_variable_pattern">
487502
<source>form.label_variable_pattern</source>
488503
<!-- TODO: Translate -->
@@ -508,6 +523,21 @@
508523
<!-- TODO: Translate -->
509524
<target>Route target</target>
510525
</trans-unit>
526+
<trans-unit id="form.label_add_locale_pattern">
527+
<source>form.label_add_locale_pattern</source>
528+
<!-- TODO: Translate -->
529+
<target>Add locale pattern</target>
530+
</trans-unit>
531+
<trans-unit id="form.label_add_format_pattern">
532+
<source>form.label_add_format_pattern</source>
533+
<!-- TODO: Translate -->
534+
<target>Add format pattern</target>
535+
</trans-unit>
536+
<trans-unit id="form.label_add_trailing_slash">
537+
<source>form.label_add_trailing_slash</source>
538+
<!-- TODO: Translate -->
539+
<target>Add trailing slash</target>
540+
</trans-unit>
511541

512542
<trans-unit id="form.help_variable_pattern">
513543
<source>form.help_variable_pattern</source>

src/Resources/translations/CmfSonataAdminIntegrationBundle.de.xliff

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@
355355
<!-- TODO: Translate -->
356356
<target>Target link</target>
357357
</trans-unit>
358+
<trans-unit id="form.group_menu_options">
359+
<source>form.group_menu_options</source>
360+
<target>Menü-Optionen</target>
361+
</trans-unit>
358362

359363
<trans-unit id="form.label_menu_nodes">
360364
<source>form.label_menu_nodes</source>
@@ -413,6 +417,10 @@
413417
<source>form.help_display_children</source>
414418
<target>Unterelemente werden nur angezeigt, wenn der Menüeintrag selber angezeigt wird.</target>
415419
</trans-unit>
420+
<trans-unit id="help.help_items">
421+
<source>help.help_items</source>
422+
<target>Klicken Sie auf ein Element, um es zu bearbeiten. Rechtsklick um Einträge hinzuzufügen.</target>
423+
</trans-unit>
416424

417425
<trans-unit id="breadcrumb.link_menu_list">
418426
<source>breadcrumb.link_menu_list</source>
@@ -482,11 +490,15 @@
482490
<!-- TODO: Translate -->
483491
<target>Data</target>
484492
</trans-unit>
485-
486-
<trans-unit id="form.label_defaults">
487-
<source>form.label_defaults</source>
493+
<trans-unit id="form.group_defaults">
494+
<source>form.group_defaults</source>
488495
<target>Vorgabewerte</target>
489496
</trans-unit>
497+
<trans-unit id="form.group_routes">
498+
<source>form.group_routes</source>
499+
<target>Routen</target>
500+
</trans-unit>
501+
490502
<trans-unit id="form.label_variable_pattern">
491503
<source>form.label_variable_pattern</source>
492504
<target>Variablenmuster</target>
@@ -507,6 +519,18 @@
507519
<source>form.label_route_target</source>
508520
<target>Routenziel</target>
509521
</trans-unit>
522+
<trans-unit id="form.label_add_locale_pattern">
523+
<source>form.label_add_locale_pattern</source>
524+
<target>Sprache hinzufügen</target>
525+
</trans-unit>
526+
<trans-unit id="form.label_add_format_pattern">
527+
<source>form.label_add_format_pattern</source>
528+
<target>Formatmuster hinzufügen</target>
529+
</trans-unit>
530+
<trans-unit id="form.label_add_trailing_slash">
531+
<source>form.label_add_trailing_slash</source>
532+
<target>Abschließenden Schrägstrich hinzufügen</target>
533+
</trans-unit>
510534

511535
<trans-unit id="form.help_variable_pattern">
512536
<source>form.help_variable_pattern</source>

src/Resources/translations/CmfSonataAdminIntegrationBundle.en.xliff

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
<target>Name</target>
1717
</trans-unit>
1818

19+
<trans-unit id="filter.label_title">
20+
<source>filter.label_title</source>
21+
<target>Title</target>
22+
</trans-unit>
23+
<trans-unit id="filter.label_name">
24+
<source>filter.label_name</source>
25+
<target>Name</target>
26+
</trans-unit>
27+
1928
<trans-unit id="form.tab_general">
2029
<source>form.tab_general</source>
2130
<target>General</target>
@@ -349,6 +358,14 @@
349358
<source>form.group_target</source>
350359
<target>Target link</target>
351360
</trans-unit>
361+
<trans-unit id="form.group_menu_options">
362+
<source>form.group_menu_options</source>
363+
<target>Menu Options</target>
364+
</trans-unit>
365+
<trans-unit id="form.group_routes">
366+
<source>form.group_routes</source>
367+
<target>Routes</target>
368+
</trans-unit>
352369

353370
<trans-unit id="form.label_menu_nodes">
354371
<source>form.label_menu_nodes</source>
@@ -407,6 +424,10 @@
407424
<source>form.help_display_children</source>
408425
<target>Children are only displayed if the menu entry itself is displayed.</target>
409426
</trans-unit>
427+
<trans-unit id="help.help_items">
428+
<source>help.help_items</source>
429+
<target>Click on item to edit, right click to create new items.</target>
430+
</trans-unit>
410431

411432
<trans-unit id="breadcrumb.link_menu_list">
412433
<source>breadcrumb.link_menu_list</source>
@@ -474,11 +495,11 @@
474495
<source>form.group_data</source>
475496
<target>Data</target>
476497
</trans-unit>
477-
478-
<trans-unit id="form.label_defaults">
479-
<source>form.label_defaults</source>
498+
<trans-unit id="form.group_defaults">
499+
<source>form.group_defaults</source>
480500
<target>Default values</target>
481501
</trans-unit>
502+
482503
<trans-unit id="form.label_variable_pattern">
483504
<source>form.label_variable_pattern</source>
484505
<target>Variable pattern</target>
@@ -499,6 +520,18 @@
499520
<source>form.label_route_target</source>
500521
<target>Route target</target>
501522
</trans-unit>
523+
<trans-unit id="form.label_add_locale_pattern">
524+
<source>form.label_add_locale_pattern</source>
525+
<target>Add locale pattern</target>
526+
</trans-unit>
527+
<trans-unit id="form.label_add_format_pattern">
528+
<source>form.label_add_format_pattern</source>
529+
<target>Add format pattern</target>
530+
</trans-unit>
531+
<trans-unit id="form.label_add_trailing_slash">
532+
<source>form.label_add_trailing_slash</source>
533+
<target>Add trailing slash</target>
534+
</trans-unit>
502535

503536
<trans-unit id="form.help_variable_pattern">
504537
<source>form.help_variable_pattern</source>

0 commit comments

Comments
 (0)