瀏覽代碼

fix default dashbord

Charley Maillot 13 年之前
父節點
當前提交
7c054efb69
共有 2 個文件被更改,包括 24 次插入12 次删除
  1. 2 1
      DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php
  2. 22 11
      Resources/doc/reference/dashboard.rst

+ 2 - 1
DependencyInjection/Compiler/AddDependencyCallsCompilerPass.php

@@ -74,7 +74,7 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
             $groupDefaults[$group_name]['items'][] = $id;
         }
 
-        if (isset($settings['dashboard_groups'])) {
+        if (!empty($settings['dashboard_groups'])) {
 
             $groups = $settings['dashboard_groups'];
 
@@ -93,6 +93,7 @@ class AddDependencyCallsCompilerPass implements CompilerPassInterface
             }
         }
         else {
+
             $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
 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:
+
 .. code-block:: yaml
 
     # app/config/config.yml
     sonata_admin:
-        dashboard:
+        dashboard_groups:
     ... 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
 
     # app/config/config.yml
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page:
                 label: Page
                 items: ~
 
-2 - Set items group
+Set items group
+^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 
     # app/config/config.yml
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page:
                 items:
                     - sonata.page.admin.page
 
-3 - Add a group with all the default items
+Add a group with all the default items
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 
     # app/config/config.yml
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page: ~
 
-4 - Add some items in a group
+Add some items in a group
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
 .. code-block:: yaml
 
     # app/config/config.yml
     sonata_admin:
-        dashboard:
+        dashboard_groups:
             sonata_page:
                 item_adds:
                     - sonata.page.admin.myitem1