Browse Source

Update documentation

Thomas Rabaix 13 năm trước cách đây
mục cha
commit
6a541ae401

+ 36 - 25
CHANGES

@@ -1,64 +1,75 @@
-07/03/2012
-----------
+CHANGELOG
+=========
 
 
-* Extension : refactor the AdminExtensionInterface to use the proper AdminInterface, add a new configureQuery method
+### 2012-03-07
+
+* [BC BREAK] Extension : refactor the AdminExtensionInterface to use the proper AdminInterface, add a new configureQuery method
+* Add export to xls format (html file)
+
+### 2012-03-01
+
+* [BC BREAK] Introduce Block Into the Admin Bundle
+  The AdminBundle has now a dependency to BlockBundle : http://github.com/sonata-project/SonataBlockBundle
+  The dashboard list is now a block, so it can be removed from the sonata_admin configuration.
+  More blocks can be created please follow the instruction here : http://sonata-project.org/bundles/block/master/doc/reference/your_first_block.html
+
+* [BC BREAK] New configuration format for the dasboard section.
+
+### 2012-02-28
+
+* Add export feature to csv, xml, json
+  The AdminBundle has now a new dependency to exporter : https://github.com/sonata-project/exporter
+
+### 2011-09-04
 
 
-04/09/2011
-----------
 * Add a delete option on widget with edit = list
 * Add a delete option on widget with edit = list
 * Refactoring the Menu/Breadcrumb management due to a change in the KnpLab Menu lib
 * Refactoring the Menu/Breadcrumb management due to a change in the KnpLab Menu lib
 
 
-03/08/2011
-----------
+### 2011-08-03
+
 * remove property definitions
 * remove property definitions
 * add TypeGuesser for list/show/filter
 * add TypeGuesser for list/show/filter
 * refactor [Form|List|Filter|Show]|Mapper to match the Symfony2 Form API
 * refactor [Form|List|Filter|Show]|Mapper to match the Symfony2 Form API
 * add theme form definition from within the Admin class - default : SonataAdminBundle:Form:admin_fields.html.twig
 * add theme form definition from within the Admin class - default : SonataAdminBundle:Form:admin_fields.html.twig
-* add new twig bloc type names to allows custom widget layouts per admin
+* add new twig block type names to allows custom widget layouts per admin
 * add show
 * add show
 
 
-01/04/2011
-----------
+### 2011-04-01
+
 * migrate to the new form framework
 * migrate to the new form framework
 
 
-03/03/2011
-----------
+### 2011-03-03
+
 * add sortable option
 * add sortable option
 
 
- 08/02/2011
-----------
+### 2011-02-08
+
 * add prototype for nested admin
 * add prototype for nested admin
 
 
-07/02/2011
-----------
+### 2011-02-07
 
 
 * refactor code to use builder (FormBuilder, DatagradBuilder, FilterBuilder)
 * refactor code to use builder (FormBuilder, DatagradBuilder, FilterBuilder)
 
 
-02/02/2011
-----------
+### 2011-02-02
 
 
 * starting to use the form.field_factory service
 * starting to use the form.field_factory service
 * update code to integrate the last symfony changes
 * update code to integrate the last symfony changes
 
 
- 24/01/2011
-----------
+### 2011-01-24
 
 
 * add list mode
 * add list mode
 * add 'add_empty' option to association widget (ie: select)
 * add 'add_empty' option to association widget (ie: select)
 * add country field type
 * add country field type
 * refactor the form creation
 * refactor the form creation
 
 
-18/01/2011
-----------
+### 18/01/2011
 
 
 * respect symfony conventions
 * respect symfony conventions
 * add new base edit template (standard and inline)
 * add new base edit template (standard and inline)
 * admin instances are not singletons anymore
 * admin instances are not singletons anymore
 * add inline edition
 * add inline edition
 
 
-
-15/01/2011
-----------
+### 15/01/2011
 
 
 * respect symfony conventions
 * respect symfony conventions
 * add a FieldDescription
 * add a FieldDescription

+ 46 - 22
Resources/doc/reference/dashboard.rst

@@ -1,8 +1,10 @@
 Dashboard
 Dashboard
 =========
 =========
 
 
-The dashboard is the main landing page. By default the dashboard lists the
-different admin areas available.
+The dashboard is the main landing page. By default the dashboard lists the different admin areas available.
+The admin list is a block defined by the ``sonata.admin.block.admin_list`` service. More block can be added, just
+follow the instruction in the `BlockBundle documentation <http://sonata-project.org/bundles/block/master/doc/index.html>`_.
+
 If you want to customize the dashboard, add the following code to your
 If you want to customize the dashboard, add the following code to your
 application's config file:
 application's config file:
 
 
@@ -10,8 +12,13 @@ application's config file:
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard_groups:
-            ... your config ...
+        blocks:
+            # display a dashboard block
+            - { position: left, type: sonata.admin.block.admin_list }
+
+        dashboard
+            groups:
+                ... your config ...
 
 
 
 
 Examples
 Examples
@@ -24,10 +31,15 @@ Set the label group & add all the default items
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard_groups:
-            sonata_page:
-                label: Page
-                items: ~
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page:
+                    label: Page
+                    items: ~
 
 
 Set items group
 Set items group
 ^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^
@@ -36,10 +48,15 @@ Set items group
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard_groups:
-            sonata_page:
-                items:
-                    - sonata.page.admin.page
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page:
+                    items:
+                        - sonata.page.admin.page
 
 
 Add a group with all the default items
 Add a group with all the default items
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -48,8 +65,13 @@ Add a group with all the default items
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard_groups:
-            sonata_page: ~
+        dashboard
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page: ~
 
 
 Add some items to a group
 Add some items to a group
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -58,14 +80,16 @@ Add some items to a group
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard_groups:
-            sonata_page:
-                item_adds:
-                    - sonata.page.admin.myitem1
-                    - sonata.page.admin.myitem2
-
-
-
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                sonata_page:
+                    item_adds:
+                        - sonata.page.admin.myitem1
+                        - sonata.page.admin.myitem2
 
 
 
 
 .. image:: ../images/dashboard.png
 .. image:: ../images/dashboard.png

+ 26 - 11
Resources/doc/reference/getting_started.rst

@@ -69,15 +69,15 @@ the Sonata\AdminBundle\Admin\Admin class. Here is a simple example from the
 SonataNewsBundle:
 SonataNewsBundle:
 
 
 .. code-block:: php
 .. code-block:: php
-   
+
    namespace Sonata\NewsBundle\Admin;
    namespace Sonata\NewsBundle\Admin;
-   
+
    use Sonata\AdminBundle\Admin\Admin;
    use Sonata\AdminBundle\Admin\Admin;
    use Sonata\AdminBundle\Datagrid\ListMapper;
    use Sonata\AdminBundle\Datagrid\ListMapper;
    use Sonata\AdminBundle\Datagrid\DatagridMapper;
    use Sonata\AdminBundle\Datagrid\DatagridMapper;
    use Sonata\AdminBundle\Validator\ErrorElement;
    use Sonata\AdminBundle\Validator\ErrorElement;
    use Sonata\AdminBundle\Form\FormMapper;
    use Sonata\AdminBundle\Form\FormMapper;
-   
+
    class TagAdmin extends Admin
    class TagAdmin extends Admin
    {
    {
        protected function configureFormFields(FormMapper $formMapper)
        protected function configureFormFields(FormMapper $formMapper)
@@ -163,22 +163,37 @@ and change them according to your requirements:
             list:    SonataAdminBundle:CRUD:list.html.twig
             list:    SonataAdminBundle:CRUD:list.html.twig
             show:    SonataAdminBundle:CRUD:show.html.twig
             show:    SonataAdminBundle:CRUD:show.html.twig
             edit:    SonataAdminBundle:CRUD:edit.html.twig
             edit:    SonataAdminBundle:CRUD:edit.html.twig
-        dashboard_groups:
-            default: ~
+        dashboard:
+            blocks:
+                # display a dashboard block
+                - { position: left, type: sonata.admin.block.admin_list }
+
+            groups:
+                default: ~
 
 
 
 
 Linking the admin class to the dashboard is done automatically because of the
 Linking the admin class to the dashboard is done automatically because of the
 default option you defined above:
 default option you defined above:
 
 
-    dashboard_groups:
-        default: ~
+    dashboard
+        blocks:
+            # display a dashboard block
+            - { position: left, type: sonata.admin.block.admin_list }
+
+        groups:
+            default: ~
 
 
 However you can define only admin groups you want to show in the dashboard by:
 However you can define only admin groups you want to show in the dashboard by:
 
 
-    dashboard_groups:
-        sonata_page:
-            label: Page
-            items: ~
+    dashboard
+        blocks:
+            # display a dashboard block
+            - { position: left, type: sonata.admin.block.admin_list }
+
+        groups:
+            sonata_page:
+                label: Page
+                items: ~
 
 
 More information can be found in the configuration chapter of this documentation.
 More information can be found in the configuration chapter of this documentation.