Skip to content

Commit e25d93a

Browse files
committed
Merge pull request #58 from symfony-cmf/admin_cleanups
[WIP] Cleaned up the admin, also made locale support disabled by default
2 parents 5c59ef2 + 59a5e14 commit e25d93a

File tree

6 files changed

+364
-8
lines changed

6 files changed

+364
-8
lines changed

Admin/PageAdmin.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ protected function configureListFields(ListMapper $listMapper)
4545
protected function configureFormFields(FormMapper $formMapper)
4646
{
4747
$formMapper
48+
->with('form.group_general')
4849
->add(
4950
'parent',
5051
'doctrine_phpcr_odm_tree',
@@ -54,6 +55,8 @@ protected function configureFormFields(FormMapper $formMapper)
5455
->add('label', null, array('required' => false))
5556
->add('title')
5657
->add('createDate')
58+
->add('addFormatPattern')
59+
->add('addTrailingSlash')
5760
->add('addLocalePattern')
5861
->add('body', 'textarea')
5962
;

Model/Page.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,12 @@ class Page extends Route implements
8484
*
8585
* @param Boolean $addFormatPattern whether to add ".{_format}" to the route pattern
8686
* also implicitly sets a default/require on "_format" to "html"
87+
* @param Boolean $addTrailingSlash whether to add a trailing slash to the route, defaults to not add one
8788
* @param Boolean $addLocalePattern whether to add "/{_locale}" to the route pattern
8889
*/
89-
public function __construct($addFormatPattern = false, $addLocalePattern = true)
90+
public function __construct($addFormatPattern = false, $addTrailingSlash = false, $addLocalePattern = false)
9091
{
91-
parent::__construct($addFormatPattern);
92+
parent::__construct($addFormatPattern, $addTrailingSlash);
9293
$this->addLocalePattern = $addLocalePattern;
9394
$this->createDate = new \DateTime();
9495
}

Resources/config/admin.xml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
<services>
1010

1111
<service id="cmf_simple_cms.persistence.phpcr.admin.page" class="Symfony\Cmf\Bundle\SimpleCmsBundle\Admin\PageAdmin">
12-
<tag
13-
name="sonata.admin"
14-
manager_type="doctrine_phpcr"
15-
group="simple cms"
16-
label="page"
17-
/>
12+
<tag name="sonata.admin" manager_type="doctrine_phpcr" group="dashboard.cmf" label_catalogue="CmfSimpleCmsBundle" label="dashboard.label_page" label_translator_strategy="sonata.admin.label.strategy.underscore" />
1813

1914
<argument/>
2015
<argument>%cmf_simple_cms.persistence.phpcr.document_class%</argument>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
3+
<file source-language="en" target-language="de" datatype="plaintext" original="CmfSimpleCmsBundle.en.xliff">
4+
<body>
5+
<trans-unit id="dashboard.cmf">
6+
<source>dashboard.cmf</source>
7+
<target>Symfony CMF</target>
8+
</trans-unit>
9+
<trans-unit id="dashboard.label_page">
10+
<source>dashboard.label_page</source>
11+
<target>Pages</target>
12+
</trans-unit>
13+
<trans-unit id="breadcrumb.link_page_list">
14+
<source>breadcrumb.link_page_list</source>
15+
<target>Pages</target>
16+
</trans-unit>
17+
<trans-unit id="breadcrumb.link_page_create">
18+
<source>breadcrumb.link_page_create</source>
19+
<target>Create</target>
20+
</trans-unit>
21+
<trans-unit id="breadcrumb.link_page_edit">
22+
<source>breadcrumb.link_page_edit</source>
23+
<target>Edit</target>
24+
</trans-unit>
25+
<trans-unit id="breadcrumb.link_page_delete">
26+
<source>breadcrumb.link_page_delete</source>
27+
<target>Delete</target>
28+
</trans-unit>
29+
<trans-unit id="list.label_path">
30+
<source>list.label_path</source>
31+
<target>Path</target>
32+
</trans-unit>
33+
<trans-unit id="list.label_title">
34+
<source>list.label_title</source>
35+
<target>Title</target>
36+
</trans-unit>
37+
<trans-unit id="list.label_locales">
38+
<source>list.label_locales</source>
39+
<target>Locales</target>
40+
</trans-unit>
41+
<trans-unit id="list.label_name">
42+
<source>list.label_name</source>
43+
<target>Name</target>
44+
</trans-unit>
45+
<trans-unit id="list.label_label">
46+
<source>list.label_label</source>
47+
<target>Label</target>
48+
</trans-unit>
49+
<trans-unit id="list.label_create_date">
50+
<source>list.label_create_date</source>
51+
<target>Create Date</target>
52+
</trans-unit>
53+
<trans-unit id="list.label_publish_start_date">
54+
<source>list.label_publish_start_date</source>
55+
<target>Publish Start Date</target>
56+
</trans-unit>
57+
<trans-unit id="list.label_publish_end_date">
58+
<source>list.label_publish_end_date</source>
59+
<target>Publish End Date</target>
60+
</trans-unit>
61+
<trans-unit id="filter.label_title">
62+
<source>filter.label_title</source>
63+
<target>Title</target>
64+
</trans-unit>
65+
<trans-unit id="filter.label_name">
66+
<source>filter.label_name</source>
67+
<target>Name</target>
68+
</trans-unit>
69+
<trans-unit id="form.group_general">
70+
<source>form.group_general</source>
71+
<target>General</target>
72+
</trans-unit>
73+
<trans-unit id="form.label_parent">
74+
<source>form.label_parent</source>
75+
<target>Parent</target>
76+
</trans-unit>
77+
<trans-unit id="form.label_name">
78+
<source>form.label_name</source>
79+
<target>Name</target>
80+
</trans-unit>
81+
<trans-unit id="form.label_label">
82+
<source>form.label_label</source>
83+
<target>Label</target>
84+
</trans-unit>
85+
<trans-unit id="form.label_title">
86+
<source>form.label_title</source>
87+
<target>Title</target>
88+
</trans-unit>
89+
<trans-unit id="form.label_create_date">
90+
<source>form.label_create_date</source>
91+
<target>Create date</target>
92+
</trans-unit>
93+
<trans-unit id=" form.label_add_format_pattern">
94+
<source>form.label_add_format_pattern</source>
95+
<target>Add format pattern</target>
96+
</trans-unit>
97+
<trans-unit id=" form.label_add_trailing_slash">
98+
<source>form.label_add_trailing_slash</source>
99+
<target>Add trailing slash</target>
100+
</trans-unit>
101+
<trans-unit id="form.label_add_locale_pattern">
102+
<source>form.label_add_locale_pattern</source>
103+
<target>Add locale pattern</target>
104+
</trans-unit>
105+
<trans-unit id="form.label_locale">
106+
<source>form.label_locale</source>
107+
<target>Locale</target>
108+
</trans-unit>
109+
<trans-unit id="form.label_body">
110+
<source>form.label_body</source>
111+
<target>Content</target>
112+
</trans-unit>
113+
<trans-unit id="help.items_help">
114+
<source>help.items_help</source>
115+
<target>Click on item to edit, right click to create new items.</target>
116+
</trans-unit>
117+
</body>
118+
</file>
119+
</xliff>
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
3+
<file source-language="en" target-language="en" datatype="plaintext" original="CmfSimpleCmsBundle.en.xliff">
4+
<body>
5+
<trans-unit id="dashboard.cmf">
6+
<source>dashboard.cmf</source>
7+
<target>Symfony CMF</target>
8+
</trans-unit>
9+
<trans-unit id="dashboard.label_page">
10+
<source>dashboard.label_page</source>
11+
<target>Pages</target>
12+
</trans-unit>
13+
<trans-unit id="breadcrumb.link_page_list">
14+
<source>breadcrumb.link_page_list</source>
15+
<target>Pages</target>
16+
</trans-unit>
17+
<trans-unit id="breadcrumb.link_page_create">
18+
<source>breadcrumb.link_page_create</source>
19+
<target>Create</target>
20+
</trans-unit>
21+
<trans-unit id="breadcrumb.link_page_edit">
22+
<source>breadcrumb.link_page_edit</source>
23+
<target>Edit</target>
24+
</trans-unit>
25+
<trans-unit id="breadcrumb.link_page_delete">
26+
<source>breadcrumb.link_page_delete</source>
27+
<target>Delete</target>
28+
</trans-unit>
29+
<trans-unit id="list.label_path">
30+
<source>list.label_path</source>
31+
<target>Path</target>
32+
</trans-unit>
33+
<trans-unit id="list.label_title">
34+
<source>list.label_title</source>
35+
<target>Title</target>
36+
</trans-unit>
37+
<trans-unit id="list.label_locales">
38+
<source>list.label_locales</source>
39+
<target>Locales</target>
40+
</trans-unit>
41+
<trans-unit id="list.label_name">
42+
<source>list.label_name</source>
43+
<target>Name</target>
44+
</trans-unit>
45+
<trans-unit id="list.label_label">
46+
<source>list.label_label</source>
47+
<target>Label</target>
48+
</trans-unit>
49+
<trans-unit id="list.label_create_date">
50+
<source>list.label_create_date</source>
51+
<target>Create Date</target>
52+
</trans-unit>
53+
<trans-unit id="list.label_publish_start_date">
54+
<source>list.label_publish_start_date</source>
55+
<target>Publish Start Date</target>
56+
</trans-unit>
57+
<trans-unit id="list.label_publish_end_date">
58+
<source>list.label_publish_end_date</source>
59+
<target>Publish End Date</target>
60+
</trans-unit>
61+
<trans-unit id="filter.label_title">
62+
<source>filter.label_title</source>
63+
<target>Title</target>
64+
</trans-unit>
65+
<trans-unit id="filter.label_name">
66+
<source>filter.label_name</source>
67+
<target>Name</target>
68+
</trans-unit>
69+
<trans-unit id="form.group_general">
70+
<source>form.group_general</source>
71+
<target>General</target>
72+
</trans-unit>
73+
<trans-unit id="form.label_parent">
74+
<source>form.label_parent</source>
75+
<target>Parent</target>
76+
</trans-unit>
77+
<trans-unit id="form.label_name">
78+
<source>form.label_name</source>
79+
<target>Name</target>
80+
</trans-unit>
81+
<trans-unit id="form.label_label">
82+
<source>form.label_label</source>
83+
<target>Label</target>
84+
</trans-unit>
85+
<trans-unit id="form.label_title">
86+
<source>form.label_title</source>
87+
<target>Title</target>
88+
</trans-unit>
89+
<trans-unit id="form.label_create_date">
90+
<source>form.label_create_date</source>
91+
<target>Create date</target>
92+
</trans-unit>
93+
<trans-unit id=" form.label_add_format_pattern">
94+
<source>form.label_add_format_pattern</source>
95+
<target>Add format pattern</target>
96+
</trans-unit>
97+
<trans-unit id=" form.label_add_trailing_slash">
98+
<source>form.label_add_trailing_slash</source>
99+
<target>Add trailing slash</target>
100+
</trans-unit>
101+
<trans-unit id="form.label_add_locale_pattern">
102+
<source>form.label_add_locale_pattern</source>
103+
<target>Add locale pattern</target>
104+
</trans-unit>
105+
<trans-unit id="form.label_locale">
106+
<source>form.label_locale</source>
107+
<target>Locale</target>
108+
</trans-unit>
109+
<trans-unit id="form.label_body">
110+
<source>form.label_body</source>
111+
<target>Content</target>
112+
</trans-unit>
113+
<trans-unit id="help.items_help">
114+
<source>help.items_help</source>
115+
<target>Click on item to edit, right click to create new items.</target>
116+
</trans-unit>
117+
</body>
118+
</file>
119+
</xliff>

0 commit comments

Comments
 (0)