Quellcode durchsuchen

fix default dashbord

Charley Maillot vor 13 Jahren
Ursprung
Commit
7c054efb69

+ 2 - 1
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -74,7 +74,7 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
             $groupDefaults[$group_name]['items'][] = $id;
             $groupDefaults[$group_name]['items'][] = $id;
         }
         }
 
 
-        if (isset($settings['dashboard_groups'])) {
+        if (!empty($settings['dashboard_groups'])) {
 
 
             $groups = $settings['dashboard_groups'];
             $groups = $settings['dashboard_groups'];
 
 
@@ -93,6 +93,7 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
             }
             }
         }
         }
         else {
         else {
+
             $groups = $groupDefaults;
             $groups = $groupDefaults;
         }
         }
 
 

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

@@ -3,51 +3,62 @@ Dashboard
 
 
 The dashboard is the main landing page. By default the dashboard lists the
 The dashboard is the main landing page. By default the dashboard lists the
 different admin areas available.
 different admin areas available.
-If you want to custom the dashbord, add the following code to your
+If you want to custom the dashboard, add the following code to your
 application's config file:
 application's config file:
+
 .. code-block:: yaml
 .. code-block:: yaml
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard:
+        dashboard_groups:
     ... your config ...
     ... your config ...
 
 
 
 
-Some examples of config file:
-1 - Set the label group & add all the default items
+Examples
+--------
+
+Set the label group & add all the default items
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 .. code-block:: yaml
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page:
             sonata_page:
                 label: Page
                 label: Page
                 items: ~
                 items: ~
 
 
-2 - Set items group
+Set items group
+^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 .. code-block:: yaml
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page:
             sonata_page:
                 items:
                 items:
                     - sonata.page.admin.page
                     - sonata.page.admin.page
 
 
-3 - Add a group with all the default items
+Add a group with all the default items
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 .. code-block:: yaml
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page: ~
             sonata_page: ~
 
 
-4 - Add some items in a group
+Add some items in a group
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 .. code-block:: yaml
 
 
     # app/config/config.yml
     # app/config/config.yml
     sonata_admin:
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page:
             sonata_page:
                 item_adds:
                 item_adds:
                     - sonata.page.admin.myitem1
                     - sonata.page.admin.myitem1