Skip to content

[WIP] Cleaned up the admin, also made locale support disabled by default #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Admin/PageAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ protected function configureListFields(ListMapper $listMapper)
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->with('form.group_general')
->add(
'parent',
'doctrine_phpcr_odm_tree',
Expand All @@ -54,6 +55,8 @@ protected function configureFormFields(FormMapper $formMapper)
->add('label', null, array('required' => false))
->add('title')
->add('createDate')
->add('addFormatPattern')
->add('addTrailingSlash')
->add('addLocalePattern')
->add('body', 'textarea')
;
Expand Down
5 changes: 3 additions & 2 deletions Model/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ class Page extends Route implements
*
* @param Boolean $addFormatPattern whether to add ".{_format}" to the route pattern
* also implicitly sets a default/require on "_format" to "html"
* @param Boolean $addTrailingSlash whether to add a trailing slash to the route, defaults to not add one
* @param Boolean $addLocalePattern whether to add "/{_locale}" to the route pattern
*/
public function __construct($addFormatPattern = false, $addLocalePattern = true)
public function __construct($addFormatPattern = false, $addTrailingSlash = false, $addLocalePattern = false)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locale support is now off by default

{
parent::__construct($addFormatPattern);
parent::__construct($addFormatPattern, $addTrailingSlash);
$this->addLocalePattern = $addLocalePattern;
$this->createDate = new \DateTime();
}
Expand Down
7 changes: 1 addition & 6 deletions Resources/config/admin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
<services>

<service id="cmf_simple_cms.persistence.phpcr.admin.page" class="Symfony\Cmf\Bundle\SimpleCmsBundle\Admin\PageAdmin">
<tag
name="sonata.admin"
manager_type="doctrine_phpcr"
group="simple cms"
label="page"
/>
<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" />

<argument/>
<argument>%cmf_simple_cms.persistence.phpcr.document_class%</argument>
Expand Down
119 changes: 119 additions & 0 deletions Resources/translations/CmfSimpleCmsBundle.de.xliff
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be translated

<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="de" datatype="plaintext" original="CmfSimpleCmsBundle.en.xliff">
<body>
<trans-unit id="dashboard.cmf">
<source>dashboard.cmf</source>
<target>Symfony CMF</target>
</trans-unit>
<trans-unit id="dashboard.label_page">
<source>dashboard.label_page</source>
<target>Pages</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_list">
<source>breadcrumb.link_page_list</source>
<target>Pages</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_create">
<source>breadcrumb.link_page_create</source>
<target>Create</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_edit">
<source>breadcrumb.link_page_edit</source>
<target>Edit</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_delete">
<source>breadcrumb.link_page_delete</source>
<target>Delete</target>
</trans-unit>
<trans-unit id="list.label_path">
<source>list.label_path</source>
<target>Path</target>
</trans-unit>
<trans-unit id="list.label_title">
<source>list.label_title</source>
<target>Title</target>
</trans-unit>
<trans-unit id="list.label_locales">
<source>list.label_locales</source>
<target>Locales</target>
</trans-unit>
<trans-unit id="list.label_name">
<source>list.label_name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="list.label_label">
<source>list.label_label</source>
<target>Label</target>
</trans-unit>
<trans-unit id="list.label_create_date">
<source>list.label_create_date</source>
<target>Create Date</target>
</trans-unit>
<trans-unit id="list.label_publish_start_date">
<source>list.label_publish_start_date</source>
<target>Publish Start Date</target>
</trans-unit>
<trans-unit id="list.label_publish_end_date">
<source>list.label_publish_end_date</source>
<target>Publish End Date</target>
</trans-unit>
<trans-unit id="filter.label_title">
<source>filter.label_title</source>
<target>Title</target>
</trans-unit>
<trans-unit id="filter.label_name">
<source>filter.label_name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="form.group_general">
<source>form.group_general</source>
<target>General</target>
</trans-unit>
<trans-unit id="form.label_parent">
<source>form.label_parent</source>
<target>Parent</target>
</trans-unit>
<trans-unit id="form.label_name">
<source>form.label_name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="form.label_label">
<source>form.label_label</source>
<target>Label</target>
</trans-unit>
<trans-unit id="form.label_title">
<source>form.label_title</source>
<target>Title</target>
</trans-unit>
<trans-unit id="form.label_create_date">
<source>form.label_create_date</source>
<target>Create date</target>
</trans-unit>
<trans-unit id=" form.label_add_format_pattern">
<source>form.label_add_format_pattern</source>
<target>Add format pattern</target>
</trans-unit>
<trans-unit id=" form.label_add_trailing_slash">
<source>form.label_add_trailing_slash</source>
<target>Add trailing slash</target>
</trans-unit>
<trans-unit id="form.label_add_locale_pattern">
<source>form.label_add_locale_pattern</source>
<target>Add locale pattern</target>
</trans-unit>
<trans-unit id="form.label_locale">
<source>form.label_locale</source>
<target>Locale</target>
</trans-unit>
<trans-unit id="form.label_body">
<source>form.label_body</source>
<target>Content</target>
</trans-unit>
<trans-unit id="help.items_help">
<source>help.items_help</source>
<target>Click on item to edit, right click to create new items.</target>
</trans-unit>
</body>
</file>
</xliff>
119 changes: 119 additions & 0 deletions Resources/translations/CmfSimpleCmsBundle.en.xliff
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file source-language="en" target-language="en" datatype="plaintext" original="CmfSimpleCmsBundle.en.xliff">
<body>
<trans-unit id="dashboard.cmf">
<source>dashboard.cmf</source>
<target>Symfony CMF</target>
</trans-unit>
<trans-unit id="dashboard.label_page">
<source>dashboard.label_page</source>
<target>Pages</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_list">
<source>breadcrumb.link_page_list</source>
<target>Pages</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_create">
<source>breadcrumb.link_page_create</source>
<target>Create</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_edit">
<source>breadcrumb.link_page_edit</source>
<target>Edit</target>
</trans-unit>
<trans-unit id="breadcrumb.link_page_delete">
<source>breadcrumb.link_page_delete</source>
<target>Delete</target>
</trans-unit>
<trans-unit id="list.label_path">
<source>list.label_path</source>
<target>Path</target>
</trans-unit>
<trans-unit id="list.label_title">
<source>list.label_title</source>
<target>Title</target>
</trans-unit>
<trans-unit id="list.label_locales">
<source>list.label_locales</source>
<target>Locales</target>
</trans-unit>
<trans-unit id="list.label_name">
<source>list.label_name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="list.label_label">
<source>list.label_label</source>
<target>Label</target>
</trans-unit>
<trans-unit id="list.label_create_date">
<source>list.label_create_date</source>
<target>Create Date</target>
</trans-unit>
<trans-unit id="list.label_publish_start_date">
<source>list.label_publish_start_date</source>
<target>Publish Start Date</target>
</trans-unit>
<trans-unit id="list.label_publish_end_date">
<source>list.label_publish_end_date</source>
<target>Publish End Date</target>
</trans-unit>
<trans-unit id="filter.label_title">
<source>filter.label_title</source>
<target>Title</target>
</trans-unit>
<trans-unit id="filter.label_name">
<source>filter.label_name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="form.group_general">
<source>form.group_general</source>
<target>General</target>
</trans-unit>
<trans-unit id="form.label_parent">
<source>form.label_parent</source>
<target>Parent</target>
</trans-unit>
<trans-unit id="form.label_name">
<source>form.label_name</source>
<target>Name</target>
</trans-unit>
<trans-unit id="form.label_label">
<source>form.label_label</source>
<target>Label</target>
</trans-unit>
<trans-unit id="form.label_title">
<source>form.label_title</source>
<target>Title</target>
</trans-unit>
<trans-unit id="form.label_create_date">
<source>form.label_create_date</source>
<target>Create date</target>
</trans-unit>
<trans-unit id=" form.label_add_format_pattern">
<source>form.label_add_format_pattern</source>
<target>Add format pattern</target>
</trans-unit>
<trans-unit id=" form.label_add_trailing_slash">
<source>form.label_add_trailing_slash</source>
<target>Add trailing slash</target>
</trans-unit>
<trans-unit id="form.label_add_locale_pattern">
<source>form.label_add_locale_pattern</source>
<target>Add locale pattern</target>
</trans-unit>
<trans-unit id="form.label_locale">
<source>form.label_locale</source>
<target>Locale</target>
</trans-unit>
<trans-unit id="form.label_body">
<source>form.label_body</source>
<target>Content</target>
</trans-unit>
<trans-unit id="help.items_help">
<source>help.items_help</source>
<target>Click on item to edit, right click to create new items.</target>
</trans-unit>
</body>
</file>
</xliff>
Loading