Explorar el Código

Removed the enablePreviewTemplate method from the Admin.
Moved the login to CRUDController and only set the edit template.

Thanos Polymeneas hace 13 años
padre
commit
4b05f7cb11
Se han modificado 2 ficheros con 2 adiciones y 10 borrados
  1. 0 8
      Admin/Admin.php
  2. 2 2
      Controller/CRUDController.php

+ 0 - 8
Admin/Admin.php

@@ -2516,12 +2516,4 @@ abstract class Admin implements AdminInterface, DomainObjectInterface
         return $this->labelTranslatorStrategy;
     }
     
-    /**
-     * Enables the preview template for the create/edit actions
-     */
-    public function enablePreviewTemplate()
-    {
-        $this->setTemplate('edit', $this->getTemplate('preview'));
-        $this->setTemplate('create', $this->getTemplate('preview'));
-    }
 }

+ 2 - 2
Controller/CRUDController.php

@@ -280,7 +280,7 @@ class CRUDController extends Controller
                 $this->get('session')->setFlash('sonata_flash_error', 'flash_edit_error');
             } elseif ($this->isPreviewRequested()) {
                 // enable the preview template if the form was valid and preview was requested
-                $this->admin->enablePreviewTemplate();
+                $this->admin->setTemplate('edit', $this->admin->getTemplate('preview'));
             }
         }
 
@@ -459,7 +459,7 @@ class CRUDController extends Controller
                 $this->get('session')->setFlash('sonata_flash_error', 'flash_create_error');
             } elseif ($this->isPreviewRequested()) {
                 // enable the preview template if the form was valid and preview was requested
-                $this->admin->enablePreviewTemplate();
+                $this->admin->setTemplate('edit', $this->admin->getTemplate('preview'));
             }
         }