Преглед на файлове

added batch action label to batch action confirmation form

Benoit Pointet преди 13 години
родител
ревизия
8a8efceaeb
променени са 2 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 3 0
      Controller/CRUDController.php
  2. 1 1
      Resources/views/CRUD/batch_confirmation.html.twig

+ 3 - 0
Controller/CRUDController.php

@@ -440,10 +440,13 @@ class CRUDController extends Controller
         $askConfirmation = isset($batchActions[$action]['ask_confirmation']) ? $batchActions[$action]['ask_confirmation'] : true;
 
         if ($askConfirmation && $confirmation != 'ok') {
+            $label = isset($batchActions[$action]['label']) ? $batchActions[$action]['label'] : $action;
+
             $formView = $datagrid->getForm()->createView();
 
             return $this->render($this->admin->getTemplate('batch_confirmation'), array(
                 'action'     => 'list',
+                'action_label' => $label,
                 'datagrid'   => $datagrid,
                 'form'       => $formView,
                 'data'       => $data,

+ 1 - 1
Resources/views/CRUD/batch_confirmation.html.twig

@@ -22,7 +22,7 @@ file that was distributed with this source code.
 
 {% block content %}
     <div class="sonata-ba-delete">
-        <h1>{{ 'title_batch_confirmation'|trans({}, 'SonataAdminBundle') }}</h1>
+        <h1>{% trans from 'SonataAdminBundle' %}title_batch_confirmation{% endtrans %} '{{ action_label | lower }}'</h1>
 
         {% if data.all_elements %}
             {{ 'message_batch_all_confirmation'|trans({}, 'SonataAdminBundle') }}