allow possibility to change folder visibility

This commit is contained in:
Manuel Raynaud
2013-09-20 20:23:49 +02:00
parent a8dddc9c26
commit abac607534
5 changed files with 62 additions and 6 deletions

View File

@@ -492,9 +492,6 @@ abstract class AbstractCrudController extends BaseAdminController
$changeEvent = $this->createToggleVisibilityEvent($this->getRequest());
// Create and dispatch the change event
$changeEvent->setIsDefault(true);
try {
$this->dispatch($this->visibilityToggleEventIdentifier, $changeEvent);
} catch (\Exception $ex) {
@@ -502,7 +499,7 @@ abstract class AbstractCrudController extends BaseAdminController
return $this->errorPage($ex);
}
$this->redirectToListTemplate();
return $this->nullResponse();
}
/**

View File

@@ -24,6 +24,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\FolderCreateEvent;
use Thelia\Core\Event\FolderDeleteEvent;
use Thelia\Core\Event\FolderToggleVisibilityEvent;
use Thelia\Core\Event\FolderUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Form\FolderCreationForm;
@@ -147,6 +148,14 @@ class FolderController extends AbstractCrudController
return new FolderDeleteEvent($this->getRequest()->get('folder_id'), 0);
}
/**
*
*/
protected function createToggleVisibilityEvent()
{
return new FolderToggleVisibilityEvent($this->getExistingObject());
}
/**
* Return true if the event contains the object, e.g. the action has updated the object in the event.
*