浏览代码

Merge pull request #1566 from caponica/docs-20130811

Docs 20130811
Thomas 12 年之前
父节点
当前提交
2b11d40921

+ 1 - 0
Form/Type/TranslatableChoiceType.php

@@ -8,6 +8,7 @@
  * For the full copyright and license information, please view the LICENSE
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
  * file that was distributed with this source code.
  *
  *
+ * @deprecated - use ChoiceType with the translation_domain option instead
  */
  */
 
 
 namespace Sonata\AdminBundle\Form\Type;
 namespace Sonata\AdminBundle\Form\Type;

+ 2 - 0
Resources/doc/index.rst

@@ -43,6 +43,8 @@ Reference Guide
    reference/console
    reference/console
    reference/preview_mode
    reference/preview_mode
    reference/troubleshooting
    reference/troubleshooting
+   reference/recipe_file_uploads
+   reference/recipe_image_previews
 
 
 Overview
 Overview
 --------
 --------

+ 3 - 1
Resources/doc/reference/dashboard.rst

@@ -3,7 +3,7 @@ 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
 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>`_.
+follow the instruction in the `BlockBundle documentation`_.
 
 
 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:
@@ -128,3 +128,5 @@ Display two blocks with different dashboard groups
                 sonata_page3:
                 sonata_page3:
                     items:
                     items:
                         - sonata.page.admin.myitem4
                         - sonata.page.admin.myitem4
+
+.. _`BlockBundle documentation`:  http://sonata-project.org/bundles/block/master/doc/index.html

+ 14 - 13
Resources/doc/reference/extensions.rst

@@ -55,23 +55,24 @@ Using the config.yml file has some advantages, it allows you to keep your config
 extra options you can use to wire your extensions in a more dynamic way. This means you can change the behaviour of all
 extra options you can use to wire your extensions in a more dynamic way. This means you can change the behaviour of all
 admins that manage a class of a specific type.
 admins that manage a class of a specific type.
 
 
-| **admins**
-| specify one or more admin service id's to which the Extension should be added
+admins:
+    specify one or more admin service id's to which the Extension should be added
 
 
-| **excludes**
-| specify one or more admin service id's to which the Extension should not be added
+excludes:
+    specify one or more admin service id's to which the Extension should not be added (this will prevent it matching 
+    any of the other settings)
 
 
-| **implements**
-| specify one or more interfaces. If the managed class of an admin implements one of the specified interfaces the
-| extension will be added to that admin.
+extends:
+    specify one or more classes. If the managed class of an admin extends one of the specified classes the extension
+    will be added to that admin.
 
 
-| **extends**
-| specify one or more classes. If the managed class of an admin extends one of the specified classes the extension
-| will be added to that admin.
+implements:
+    specify one or more interfaces. If the managed class of an admin implements one of the specified interfaces the
+    extension will be added to that admin.
 
 
-| **instanceof**
-| specify one or more classes. If the managed class of an admin extends one of the specified classes or is an instance
-| of that class the extension will be added to that admin.
+instanceof:
+    specify one or more classes. If the managed class of an admin extends one of the specified classes or is an instance
+    of that class the extension will be added to that admin.
 
 
 .. code-block:: yaml
 .. code-block:: yaml
 
 

+ 10 - 0
Resources/doc/reference/form_help_message.rst

@@ -46,6 +46,15 @@ Alternative Way To Define Help Messages
         }
         }
     }
     }
 
 
+
+Advanced usage
+^^^^^^^^^^^^^^
+
+Since help messages can contain HTML they can be used for more advanced solutions.
+See the cookbook entry :doc:`Showing image previews <recipe_image_previews>` for a detailed example of how to 
+use help messages to display an image tag.
+
+
 Form Group Descriptions
 Form Group Descriptions
 -----------------------
 -----------------------
 
 
@@ -68,3 +77,4 @@ Example
                 ->end();
                 ->end();
         }
         }
     }
     }
+

+ 1 - 1
Resources/doc/reference/recipe_file_uploads.rst

@@ -303,4 +303,4 @@ as SonataAdmin.
 To learn how to add an image preview to your ImageAdmin take a look at the related cookbook entry.
 To learn how to add an image preview to your ImageAdmin take a look at the related cookbook entry.
 
 
 
 
-_`uploading files with Doctrine and Symfony`: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html
+.. _`uploading files with Doctrine and Symfony`: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html

+ 10 - 8
Resources/doc/reference/security.rst

@@ -25,9 +25,8 @@ There is a little magic in the ``SonataAdminBundle``: if the bundle detects the
 ``SonataUserBundle`` class, then the default ``user_block`` template will be
 ``SonataUserBundle`` class, then the default ``user_block`` template will be
 changed to use the one provided by the ``SonataUserBundle``.
 changed to use the one provided by the ``SonataUserBundle``.
 
 
-The install process is available on the dedicated `SonataUserBundle's
-documentation area
-<http://sonata-project.org/bundles/user/master/doc/reference/installation.html>`_
+The install process is available on the dedicated 
+`SonataUserBundle's documentation area`_.
 
 
 
 
 Security handlers
 Security handlers
@@ -138,8 +137,8 @@ So our ``security.yml`` file may look to something like this:
 
 
 Note that we also set ``access_strategy`` to unanimous.
 Note that we also set ``access_strategy`` to unanimous.
 It means that if one voter (for example Sonata) refuses access, access will be denied.
 It means that if one voter (for example Sonata) refuses access, access will be denied.
-For more information on this subject, please see `here
-<http://symfony.com/doc/2.2/cookbook/security/voters.html#changing-the-access-decision-strategy>`_
+For more information on this subject, please see `changing the access decision strategy`_ 
+in the Symfony documentation.
 
 
 Usage
 Usage
 ~~~~~
 ~~~~~
@@ -178,8 +177,7 @@ Going further
 ~~~~~~~~~~~~~
 ~~~~~~~~~~~~~
 
 
 Because Sonata role handler supplements Symfony2 security, but does not override it, you are free to do more advanced operations.
 Because Sonata role handler supplements Symfony2 security, but does not override it, you are free to do more advanced operations.
-For example, you can `create your own voter
-<http://symfony.com/doc/2.2/cookbook/security/voters.html>`_
+For example, you can `create your own voter`_
 
 
 Customizing the handler behavior
 Customizing the handler behavior
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -672,4 +670,8 @@ service to use when retrieving your users.
 
 
     sonata_admin:
     sonata_admin:
         security:
         security:
-            acl_user_manager: my_user_manager # The name of your service
+            acl_user_manager: my_user_manager # The name of your service
+
+.. _`SonataUserBundle's documentation area`: http://sonata-project.org/bundles/user/master/doc/reference/installation.html
+.. _`changing the access decision strategy`: http://symfony.com/doc/2.2/cookbook/security/voters.html#changing-the-access-decision-strategy
+.. _`create your own voter`: http://symfony.com/doc/2.2/cookbook/security/voters.html

+ 1 - 1
Resources/doc/reference/translation.rst

@@ -74,7 +74,7 @@ If a translation domain is set at the group level it will cascade down to all
 fields within the group.
 fields within the group.
 
 
 Overriding the translation domain is of particular use when using
 Overriding the translation domain is of particular use when using
-:doc:`extensions <extensions>`, where the extension and the translations would
+:doc:`extensions`, where the extension and the translations would
 be defined in one bundle, but implemented in many different Admin instances.
 be defined in one bundle, but implemented in many different Admin instances.
 
 
 Setting the translation domain on an individual field:
 Setting the translation domain on an individual field: