Skip to content

Commit f3c27b8

Browse files
committed
cleanup sonata admin
1 parent badf1d8 commit f3c27b8

File tree

4 files changed

+53
-25
lines changed

4 files changed

+53
-25
lines changed

Admin/RouteAdmin.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ protected function configureFormFields(FormMapper $formMapper)
7171
if (null === $this->getParentFieldDescription()) {
7272
$formMapper
7373
->with('form.group_general')
74-
->add('variablePattern', 'text', array('required' => false))
75-
->add('content', 'doctrine_phpcr_odm_tree', array('choice_list' => array(), 'required' => false, 'root_node' => $this->contentRoot))
76-
->add('defaults', 'sonata_type_immutable_array', array('keys' => $this->configureFieldsForDefaults()))
77-
->add('options', 'sonata_type_immutable_array', array('keys' => $this->configureFieldsForOptions()))
74+
->add('content', 'doctrine_phpcr_odm_tree', array('choice_list' => array(), 'required' => false, 'root_node' => $this->contentRoot))
75+
->end()
76+
->with('form.group_advanced')
77+
->add('variablePattern', 'text', array('required' => false), array('help' => 'form.help_variable_pattern'))
78+
->add('defaults', 'sonata_type_immutable_array', array('keys' => $this->configureFieldsForDefaults()))
79+
->add('options', 'sonata_type_immutable_array', array('keys' => $this->configureFieldsForOptions()), array('help' => 'form.help_options'))
80+
->end()
7881
->end();
7982
}
8083
}
@@ -144,8 +147,8 @@ protected function configureFieldsForDefaults()
144147
protected function configureFieldsForOptions()
145148
{
146149
$options = array(
147-
'addFormatPattern' => array('addFormatPattern', 'text', array('required' => false), array('help' => 'form.help_add_format_pattern')),
148-
'addTrailingSlash' => array('addTrailingSlash', 'text', array('required' => false), array('help' => 'form.help_add_trailing_slash')),
150+
'addFormatPattern' => array('addFormatPattern', 'checkbox', array('required' => false, 'label' => 'form.label_add_format_pattern', 'translation_domain' => $this->translationDomain)),
151+
'addTrailingSlash' => array('addTrailingSlash', 'checkbox', array('required' => false, 'label' => 'form.label_add_trailing_slash', 'translation_domain' => $this->translationDomain)),
149152
);
150153

151154
$dynamicOptions = $this->getSubject()->getOptions();

Resources/translations/CmfRoutingBundle.de.xliff

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<source>form.group_general</source>
5959
<target>Allgemein</target>
6060
</trans-unit>
61+
<trans-unit id="form.group_advanced">
62+
<source>form.group_advanced</source>
63+
<target>Details</target>
64+
</trans-unit>
6165
<trans-unit id="form.label_parent">
6266
<source>form.label_parent</source>
6367
<target>Übergeordnet</target>
@@ -70,6 +74,10 @@
7074
<source>form.label_variable_pattern</source>
7175
<target>Variablenmuster</target>
7276
</trans-unit>
77+
<trans-unit id="form.help_variable_pattern">
78+
<source>form.help_variable_pattern</source>
79+
<target>Ein Muster im Format {variable}/{mehr}... Die Felder werden dem Controller übergeben falls er sie deklariert.</target>
80+
</trans-unit>
7381
<trans-unit id="form.label_content">
7482
<source>form.label_content</source>
7583
<target>Inhalt</target>
@@ -111,12 +119,13 @@
111119
<target>Abschließenden Schrägstrich hinzufügen</target>
112120
</trans-unit>
113121
<trans-unit id="form.help_add_format_pattern">
114-
<source>form.help_add_format_pattern</source>
115-
<target>Format zu URL hinzufügen: /eine/url.{format}. Wenn nichts angegeben wird ist das Format html.</target>
116-
</trans-unit>
117-
<trans-unit id="form.help_add_trailing_slash">
118-
<source>form.help_add_trailing_slash</source>
119-
<target>Die URL hört in diesem Fall mit einem Schrägstrich auf, zum Beispiel /eine/url/.</target>
122+
<source>form.help_options</source>
123+
<target>
124+
<![CDATA[
125+
Format: Format zu URL hinzufügen: /eine/url.{format}. Wenn nichts angegeben wird, ist das Format 'html'<br/>
126+
Schrägstrich: Die URL hört in diesem Fall mit einem Schrägstrich auf, zum Beispiel /eine/url/
127+
]]>
128+
</target>
120129
</trans-unit>
121130
</body>
122131
</file>

Resources/translations/CmfRoutingBundle.en.xliff

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<source>form.group_general</source>
5959
<target>General</target>
6060
</trans-unit>
61+
<trans-unit id="form.group_advanced">
62+
<source>form.group_advanced</source>
63+
<target>Advanced</target>
64+
</trans-unit>
6165
<trans-unit id="form.label_parent">
6266
<source>form.label_parent</source>
6367
<target>Parent</target>
@@ -70,6 +74,10 @@
7074
<source>form.label_variable_pattern</source>
7175
<target>Variable pattern</target>
7276
</trans-unit>
77+
<trans-unit id="form.help_variable_pattern">
78+
<source>form.help_variable_pattern</source>
79+
<target>A pattern in the format {variable}/{more}... The fields are passed to the controller if it declares them as arguments.</target>
80+
</trans-unit>
7381
<trans-unit id="form.label_content">
7482
<source>form.label_content</source>
7583
<target>Content</target>
@@ -111,12 +119,12 @@
111119
<target>Add trailing slash</target>
112120
</trans-unit>
113121
<trans-unit id="form.help_add_format_pattern">
114-
<source>form.help_add_format_pattern</source>
115-
<target>Append format to route like /your/route.{format}. Default format is html.</target>
116-
</trans-unit>
117-
<trans-unit id="form.help_add_trailing_slash">
118-
<source>form.help_add_trailing_slash</source>
119-
<target>Append a trailing slash to route like /your/route/.</target>
122+
<source>form.help_options</source>
123+
<target>
124+
<![CDATA[Format: Append format to route like /your/route.{format}. Default format is 'html'<br/>
125+
Slash: Append a trailing slash to route like /your/route/
126+
]]>
127+
</target>
120128
</trans-unit>
121129
</body>
122130
</file>

Resources/translations/CmfRoutingBundle.fr.xliff

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
<source>form.group_general</source>
5959
<target>Général</target>
6060
</trans-unit>
61+
<trans-unit id="form.group_advanced">
62+
<source>form.group_advanced</source>
63+
<target>Avancé</target>
64+
</trans-unit>
6165
<trans-unit id="form.label_parent">
6266
<source>form.label_parent</source>
6367
<target>Parent</target>
@@ -70,6 +74,10 @@
7074
<source>form.label_variable_pattern</source>
7175
<target>Motif variable</target>
7276
</trans-unit>
77+
<trans-unit id="form.help_variable_pattern">
78+
<source>form.help_variable_pattern</source>
79+
<target>Un motif en format {variable}/{plus}... Les variables sont passé au controlleur s'il les déclare comme arguments.</target>
80+
</trans-unit>
7381
<trans-unit id="form.label_content">
7482
<source>form.label_content</source>
7583
<target>Contenu</target>
@@ -110,13 +118,13 @@
110118
<source>form.label_add_trailing_slash</source>
111119
<target>Ajouter une barre oblique en fin</target>
112120
</trans-unit>
113-
<trans-unit id="form.help_add_format_pattern">
114-
<source>form.help_add_format_pattern</source>
115-
<target>Ajoute le format à la route tel que /your/route.{format}. Le format par défaut est html.</target>
116-
</trans-unit>
117-
<trans-unit id="form.help_add_trailing_slash">
118-
<source>form.help_add_trailing_slash</source>
119-
<target>Ajoute un slash à la fin de la route tel que /your/route/.</target>
121+
<trans-unit id="form.help_options">
122+
<source>form.help_options</source>
123+
<target><![CDATA[
124+
Format: Ajoute le format à la route tel que /your/route.{format}. Le format par défaut est 'html'<br/>
125+
Barre Oblique: Ajoute un slash à la fin de la route tel que /your/route/
126+
]]>
127+
</target>
120128
</trans-unit>
121129
</body>
122130
</file>

0 commit comments

Comments
 (0)