Sfoglia il codice sorgente

Added new configuration parameter in "templates" for batch_confirmation

Sebastiaan Stok 12 anni fa
parent
commit
0e2efa99fa

+ 1 - 1
Controller/CRUDController.php

@@ -411,7 +411,7 @@ class CRUDController extends Controller
         if ($askConfirmation && $confirmation != 'ok') {
             $formView = $datagrid->getForm()->createView();
 
-            return $this->render('SonataAdminBundle:CRUD:batch_confirmation.html.twig', array(
+            return $this->render($this->admin->getTemplate('batch_confirmation'), array(
                 'action'   => 'list',
                 'datagrid' => $datagrid,
                 'form'     => $formView,

+ 1 - 0
DependencyInjection/Configuration.php

@@ -139,6 +139,7 @@ class Configuration implements ConfigurationInterface
                         ->scalarNode('short_object_description')->defaultValue('SonataAdminBundle:Helper:short-object-description.html.twig')->cannotBeEmpty()->end()
                         ->scalarNode('delete')->defaultValue('SonataAdminBundle:CRUD:delete.html.twig')->cannotBeEmpty()->end()
                         ->scalarNode('batch')->defaultValue('SonataAdminBundle:CRUD:list__batch.html.twig')->cannotBeEmpty()->end()
+                        ->scalarNode('batch_confirmation')->defaultValue('SonataAdminBundle:CRUD:batch_confirmation.html.twig')->cannotBeEmpty()->end()
                     ->end()
                 ->end()
 

+ 3 - 2
Resources/doc/reference/templates.rst

@@ -19,7 +19,8 @@ By default, an Admin class uses a set of templates, it is possible to tweak the
             preview: SonataAdminBundle:CRUD:preview.html.twig
             delete:  SonataAdminBundle:CRUD:delete.html.twig
             batch:   SonataAdminBundle:CRUD:list__batch.html.twig
-
+            batch_confirmation: SonataAdminBundle:CRUD:batch_confirmation.html.twig
+            
             # default values of helper templates
             short_object_description: SonataAdminBundle:Helper:short-object-description.html.twig
 
@@ -79,4 +80,4 @@ You can easily extend the provided templates in your own and customize only the
                 return parent::getTemplate($name);
                 break;
         }
-    }
+    }