allow update content position number

This commit is contained in:
Manuel Raynaud
2013-09-23 11:39:53 +02:00
parent ac435b8f87
commit 49f79071a6
5 changed files with 54 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Content\ContentCreateEvent;
use Thelia\Core\Event\Content\ContentUpdateEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdatePositionEvent;
use Thelia\Form\ContentCreationForm;
use Thelia\Form\ContentModificationForm;
use Thelia\Model\ContentQuery;
@@ -286,4 +287,31 @@ class ContentController extends AbstractCrudController
);
}
}
/**
* @param $event \Thelia\Core\Event\UpdatePositionEvent
* @return null|Response
*/
protected function performAdditionalUpdatePositionAction($event)
{
if (null !== $content = ContentQuery::create()->findPk($event->getObjectId())) {
// Redirect to parent category list
$this->redirectToRoute(
'admin.folders.default',
array('parent' => $content->getDefaultFolderId())
);
}
return null;
}
protected function createUpdatePositionEvent($positionChangeMode, $positionValue)
{
return new UpdatePositionEvent(
$this->getRequest()->get('content_id', null),
$positionChangeMode,
$positionValue
);
}
}