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

1.2.0 #594

Merged
merged 56 commits into from
Oct 25, 2014
Merged

1.2.0 #594

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f1858e6
reflect the changes in the directory implied by the switch to PSR-4 c…
xabbuh Jun 6, 2014
034d959
Merge branch 'xabbuh-psr4' into dev
wouterj Jun 14, 2014
22cce61
Merge branch 'master' into dev
wouterj Jul 20, 2014
e768d15
Merge branch 'master' into dev
wouterj Aug 13, 2014
47cf416
document delete workflow
uwej711 Aug 13, 2014
69475c6
remove trailing blanks
uwej711 Aug 13, 2014
c083062
document enable_initalizer
uwej711 Aug 13, 2014
5038f0f
made proposed changes
uwej711 Aug 13, 2014
d2d2743
made proposed changes
uwej711 Aug 13, 2014
bfb8f5d
Merge pull request #540 from uwej711/document_delete_workflow
wouterj Aug 13, 2014
c3792e5
[#540] added versionadded
wouterj Aug 13, 2014
d63ccdc
added version hint
uwej711 Aug 13, 2014
1a2b38b
Merge pull request #541 from uwej711/document_routing_enable_initializer
dbu Aug 14, 2014
7d303c6
Merge branch 'master' into dev
wouterj Aug 15, 2014
fee4726
Merge remote-tracking branch 'origin/master' into dev
dbu Aug 18, 2014
a0de4a3
Document MenuOptionsInterface and sonata admin extension
mkoosej Aug 12, 2014
7ef9ca5
Merge pull request #548 from symfony-cmf/mkoosej-menu-options
dbu Aug 18, 2014
0884127
fix package name
ElectricMaxxx Aug 19, 2014
924f303
Merge pull request #549 from ElectricMaxxx/wrong-package
lsmith77 Aug 19, 2014
bb08a7d
Merge branch 'master' into dev
wouterj Aug 25, 2014
b16c241
Add documentation about the 'namespace' option under 'metadata_cache_…
Tatsh Aug 25, 2014
3fb34e8
Merge branch 'master' into dev
wouterj Aug 30, 2014
887219c
added docs for CreateBundle rest_force_request_locale config option
lsmith77 Aug 28, 2014
3d67ed8
Fixed filename in comments
wjzijderveld Sep 3, 2014
2450126
Merge pull request #563 from wjzijderveld/fix-services-filename
dbu Sep 3, 2014
4176f19
bootstrap changes
cordoval Sep 24, 2014
9a91013
add note on traits and more corrections
cordoval Sep 24, 2014
fc9c46c
final correction for now
cordoval Sep 24, 2014
a35340d
add trait note inside a tip tag
cordoval Sep 24, 2014
8420e5b
Merge pull request #575 from cordoval/seo-corrections
wouterj Sep 24, 2014
7690cc0
Revert "seo corrections"
wouterj Sep 24, 2014
620e74b
Merge pull request #576 from symfony-cmf/revert-575-seo-corrections
wouterj Sep 24, 2014
6fc78cf
Merge branch 'master' into dev
wouterj Oct 5, 2014
f5ce614
Merge branch 'master' into dev
wouterj Oct 5, 2014
e4f2fec
fix xml attribute name
hairmare Oct 8, 2014
beaf11a
Merge pull request #583 from hairmare/patch-1
wouterj Oct 8, 2014
5da23cf
Merge branch 'master' into dev
wouterj Oct 14, 2014
34311c1
Add imagine routing to the configuration
Jul 30, 2014
2e85489
feature #531 Add imagine routing to the configuration (JJK801)
wouterj Oct 21, 2014
3385de9
Merge branch 'master' into dev
wouterj Oct 21, 2014
bc72c24
we instruct users to move the composer.phar to composer
lsmith77 Oct 22, 2014
affa959
Add a note about rest_no_locale.xml
EmmanuelVella Oct 24, 2014
9abb6be
Merge pull request #593 from EmmanuelVella/patch-3
dbu Oct 24, 2014
aa4bdb5
validate we have the right type of object manager in the fixtures
lsmith77 Oct 25, 2014
d6525e8
Merge pull request #596 from symfony-cmf/fixture_om_check
dbu Oct 25, 2014
d3c74f7
as the initializer is only run when sonata is present, ensure users c…
lsmith77 Oct 25, 2014
7ebc27b
Fixed commands
wouterj Oct 25, 2014
90e3987
Merge pull request #590 from symfony-cmf/composer_phar
wouterj Oct 25, 2014
de422c4
Added some info
wouterj Oct 25, 2014
d3b9bb0
Updated versions
wouterj Oct 5, 2014
28db0ec
Fixed some more versions
wouterj Oct 25, 2014
51cd755
Reverted tutorial changes
wouterj Oct 25, 2014
b793ae5
Drop documentation for deprecated tag
wouterj Oct 25, 2014
28bd76b
Merge pull request #580 from symfony-cmf/prepare-1.2
wouterj Oct 25, 2014
94f0b17
Fixes after david's comments
wouterj Oct 25, 2014
5d96f9c
Merge pull request #597 from symfony-cmf/ensure_cms_routes_is_created
wouterj Oct 25, 2014
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
6 changes: 3 additions & 3 deletions book/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ and then get the Symfony CMF code with it (this may take a while):

.. code-block:: bash

$ php composer.phar create-project symfony-cmf/standard-edition <path-to-install> ~1.1
$ composer create-project symfony-cmf/standard-edition <path-to-install> ~1.2
$ cd <path-to-install>

.. note::
Expand All @@ -76,7 +76,7 @@ to configure the permissions and then run the ``install`` command:

.. code-block:: bash

$ php composer.phar install
$ composer install

2) GIT
~~~~~~
Expand All @@ -94,7 +94,7 @@ dependencies, use the ``install`` command:

.. code-block:: bash

$ php composer.phar install
$ composer install


Set up the Database
Expand Down
17 changes: 17 additions & 0 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ follows::
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\Route;
use Symfony\Cmf\Bundle\ContentBundle\Doctrine\Phpcr\StaticContent;
use PHPCR\Util\NodeHelper;

class LoadRoutingData implements FixtureInterface
{
Expand All @@ -461,6 +462,13 @@ follows::
*/
public function load(ObjectManager $dm)
{
if (!$dm instanceof DocumentManager) {
$class = get_class($dm);
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
}

NodeHelper::createPath($session, '/cms/routes');

$route = new Route();
$route->setParentDocument($dm->find(null, '/cms/routes'));
$route->setName('projects');
Expand All @@ -486,6 +494,15 @@ follows::
This will give you a document that matches the URL ``/projects/<number>`` but
also ``/projects`` as there is a default for the id parameter.

.. caution::

As you can see, the code explicitely creates the ``/cms/routes`` path.
The RoutingBundle only creates this path automatically if the Sonata Admin
was enabled in the routing configuration using an :ref:`initializer
<phpcr-odm-repository-initializers>`. Otherwise, it'll assume you do
something yourself to create the path (by configuring an initializer or
doing it in a fixture like this).

Because you defined the ``{id}`` route parameter, your controller can expect an
``$id`` parameter. Additionally, because you called setRouteContent on the
route, your controller can expect the ``$contentDocument`` parameter.
Expand Down
10 changes: 10 additions & 0 deletions book/simplecms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ To create a page, use the
*/
public function load(ObjectManager $dm)
{
if (!$dm instanceof DocumentManager) {
$class = get_class($dm);
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
}

$parent = $dm->find(null, '/cms/simple');
$page = new Page();
$page->setTitle('About Symfony CMF');
Expand Down Expand Up @@ -111,6 +116,11 @@ structure, you would do::
*/
public function load(ObjectManager $dm)
{
if (!$dm instanceof DocumentManager) {
$class = get_class($dm);
throw new \RuntimeException("Fixture requires a PHPCR ODM DocumentManager instance, instance of '$class' given.");
}

$root = $dm->find(null, '/cms/simple');

$about = new Page();
Expand Down
2 changes: 1 addition & 1 deletion bundles/content/exposing_content_via_rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Then use Composer_ to update your projects vendors:

.. code-block:: bash

$ php composer.phar update
$ composer update

Configuring FOSRestBundle
-------------------------
Expand Down
27 changes: 0 additions & 27 deletions bundles/core/dependency_injection_tags.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,6 @@
Dependency Injection Tags
-------------------------

cmf_request_aware
~~~~~~~~~~~~~~~~~

.. caution::

This tag has been deprecated in CoreBundle 1.1 and will be removed
in CoreBundle 1.2. Since Symfony 2.3, you can profit from the fact
that the request is a `synchronized service`_.

When working with the 1.0 version of the CMF in Symfony 2.2 and you have
services that need the request (e.g. for the publishing workflow or current
menu item voters), you can tag services with ``cmf_request_aware`` to have a
kernel listener inject the request. Any class used in such a tagged service
must have the ``setRequest`` method or you will get a fatal error::

use Symfony\Component\HttpFoundation\Request;

class MyClass
{
private $request;

public function setRequest(Request $request)
{
$this->request = $request;
}
}

cmf_published_voter
~~~~~~~~~~~~~~~~~~~

Expand Down
23 changes: 22 additions & 1 deletion bundles/create/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ persistence configuration has the following configuration:
model_class: ~
controller_class: Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController
basepath: /cms/media
delete: false

.. code-block:: xml

Expand All @@ -95,6 +96,7 @@ persistence configuration has the following configuration:
<phpcr
enabled="false"
manager-name="null"
delete="false"
>
<image
enabled="false"
Expand All @@ -120,6 +122,7 @@ persistence configuration has the following configuration:
'controller_class' => 'Symfony\Cmf\Bundle\CreateBundle\Controller\ImageController',
'basepath' => '/cms/media',
),
'delete' => false,
),
),
));
Expand Down Expand Up @@ -152,6 +155,14 @@ provided by the MediaBundle.
If you need different image handling, you can either overwrite
``model_class`` and/or the ``controller_class``.

delete
""""""
**type**: ``boolean`` **default**: ``false``

Set delete to true to enable the simple delete workflow. This allows to directly
delete content from the frontend. Be careful, there are no special checks once you confirm deletion
your content is gone.

Metadata Handling
~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -208,7 +219,17 @@ REST handler
~~~~~~~~~~~~

You can configure the REST handler class with the ``rest_controller_class``
option.
option. Furthermore it is possible to enable ``rest_force_request_locale``.
When this option is enabled, the current request locale is set on the model
instance. This is useful in order to automatically translate a model to
the request locale when using inline editing, instead of editing the model
in the locale in which it is currently stored, which might be different
than the request locale due to language fallback.

.. note::

The ``rest_force_request_locale`` option requires that the
:doc:`CoreBundle <../core/introduction>` is enabled.

Editor configuration
~~~~~~~~~~~~~~~~~~~~
Expand Down
78 changes: 74 additions & 4 deletions bundles/create/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,22 @@ overwrite them) are:

{
"extra": {
"create-directory": "vendor/symfony-cmf/create-bundle/Symfony/Cmf/Bundle/CreateBundle/Resources/public/vendor/create",
"create-directory": "vendor/symfony-cmf/create-bundle/Resources/public/vendor/create",
"create-repository": "https://github.com/bergie/create.git",
"create-commit": "a148ce9633535930d7b4b70cc1088102f5c5eb90"

"ckeditor-directory": "vendor/symfony-cmf/create-bundle/Symfony/Cmf/Bundle/CreateBundle/Resources/public/vendor/ckeditor",
"ckeditor-directory": "vendor/symfony-cmf/create-bundle/Resources/public/vendor/ckeditor",
"ckeditor-repository": "https://github.com/ckeditor/ckeditor-releases.git",
"ckeditor-commit": "bba29309f93a1ace1e2e3a3bd086025975abbad0"
}
}

.. versionadded:: 1.2
The Symfony CMF bundles updated to PSR-4 autoloading with Symfony CMF
1.2. Before, the target directories were located in the
``vendor/symfony-cmf/create-bundle/Symfony/Cmf/Bundle/CreateBundle/Resources/public/vendor``
directory.

Add this bundle (and its dependencies, if they are not already added) to your
application's kernel::

Expand Down Expand Up @@ -250,6 +256,11 @@ routing configuration to enable the REST end point for saving content:
$collection->addCollection($loader->import("@CmfCreateBundle/Resources/config/routing/rest.xml"));

return $collection;

.. tip::

If you don't want these routes to be prefixed by the current locale, you can
use the ``@CmfCreateBundle/Resources/config/routing/rest_no_locale.xml`` file instead.

If you have the :doc:`MediaBundle <../media/index>` present in your project as well, you
additionally need to register the route for the image upload handler:
Expand Down Expand Up @@ -500,7 +511,7 @@ Mapping Requests to Domain Objects
One last piece is the mapping between CreatePHP data and the application
domain objects. Data needs to be stored back into the database.

In version 1.0, the CreateBundle only provides a service to map to Doctrine
Currently, the CreateBundle only provides a service to map to Doctrine
PHPCR-ODM. If you do not enable the phpcr persistence layer, you need to
configure the ``cmf_create.object_mapper_service_id``.

Expand All @@ -513,14 +524,73 @@ configure the ``cmf_create.object_mapper_service_id``.
CreatePHP would support specific mappers per RDFa type. If you need that, dig
into the CreatePHP and CreateBundle and do a pull request to enable this feature.

Workflows
---------

.. versionadded:: 1.1
Support for workflows was introduced in CreateBundle 1.1.

CreateJS uses a REST api for creating, loading and changing content. To delete content
the HTTP method DELETE is used. Since deleting might be a more complex operation
than just removing the content form the storage (e.g. getting approval by another
editor) there is no simple delete button in the user frontend. Instead, CreateJS and
CreatePHP use "workflows" to implement that. This bundle comes with a simple implementation
of a workflow to delete content. To enable the workflow set the config option 'delete' to true.

.. configuration-block::

.. code-block:: yaml

cmf_create:
persistence:
phpcr:
delete: true

.. code-block:: xml

<?xml version="1.0" charset="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services">
<config xmlns="http://cmf.symfony.com/schema/dic/create">
<persistence>
<phpcr
delete="true"
>
</phpcr>
</persistence>
</config>
</container>

.. code-block:: php

$container->loadFromExtension('cmf_create', array(
'persistence' => array(
'phpcr' => array(
'delete' => true,
),
),
));

This results in the delete workflow being registered with CreatePHP and CreateJS so that
you can now delete content from the frontend.

.. note::

The provided workflow supports PHPCR persistence only. It deletes the currently selected
content once you confirmed deletion in the frontend. If the currently selected property is
a property of the page the whole page is deleted.

In a more complex setup you need to create your own workflow instance, register it with CreatePHP
and implement your logic in the workflows run method.

Currently the bundle only supports delete workflows but that will change in the future.

Read On
-------

* :doc:`developing-hallo`
* :doc:`other-editors`
* :doc:`configuration`


.. _`create.js`: http://createjs.org
.. _`hallo.js`: http://hallojs.org
.. _`CKEditor`: http://ckeditor.com/
Expand Down
2 changes: 1 addition & 1 deletion bundles/create/other-editors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Then re-run composer:

.. code-block:: bash

$ php composer.phar run-scripts
$ composer run-scripts

In your template, load the JavaScript files using:

Expand Down
3 changes: 3 additions & 0 deletions bundles/media/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ Installation
cmf_media_image:
resource: "@CmfMediaBundle/Resources/config/routing/image.xml"

_liip_imagine:
resource: "@LiipImagineBundle/Resources/config/routing.xml"

.. code-block:: xml

<!-- app/config/routing.xml -->
Expand Down
62 changes: 62 additions & 0 deletions bundles/menu/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,68 @@ admin_recursive_breadcrumbs
When editing a node, this setting will cause the Sonata admin breadcrumb to
include ancestors of the node being edited.

Admin Extensions
----------------

The ``admin_extensions`` section contains the configurations of the admin extensions that comes with the menu bundle.

menu_options
~~~~~~~~~~~~

You can configure the menu options extension in this sections.

.. configuration-block::

.. code-block:: yaml

cmf_menu:
# ...
cmf_menu:
admin_extensions:
menu_options:
enabled: auto
advanced: false

.. code-block:: xml

<?xml version="1.0" charset="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services">
<config xmlns="http://cmf.symfony.com/schema/dic/menu">
<admin_extensions>
<menu_options
enabled="auto"
advanced="false"
/>
</admin_extensions>
</config>
</container>

.. code-block:: php

$container->loadFromExtension('cmf_menu', array(
'admin_extensions' => array(
'menu_options' => array(
'enabled' => 'auto',
'advanced' => false,
),
),
),
));

enabled
"""""""
**type**: ``enum`` **valid values**: ``true|false|auto`` **default**: ``auto``

If ``true``, the admin extension is activated. If set to ``auto``, it will be
activated only if the SonataAdminBundle is present.

advanced
""""""""
**type**: ``boolean`` **default**: ``false``

if set to ``true`` it will expose the advanced options in the admin.
To enable this options you need ``BurgovKeyValueFormBundle``

Voter
-----

Expand Down
Loading