create contentAddFolder process

This commit is contained in:
Manuel Raynaud
2013-10-01 09:51:07 +02:00
parent cc370af113
commit dfda04ddd2
7 changed files with 133 additions and 10 deletions

View File

@@ -22,6 +22,7 @@
/*************************************************************************************/
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Content\ContentAddFolderEvent;
use Thelia\Core\Event\Content\ContentCreateEvent;
use Thelia\Core\Event\Content\ContentDeleteEvent;
use Thelia\Core\Event\Content\ContentToggleVisibilityEvent;
@@ -60,6 +61,28 @@ class ContentController extends AbstractCrudController
);
}
public function addAdditionalFolderAction()
{
// Check current user authorization
if (null !== $response = $this->checkAuth('admin.content.update')) return $response;
$folder_id = intval($this->getRequest()->request->get('additional_folder_id'));
if ($folder_id > 0) {
$event = new ContentAddFolderEvent(
$this->getExistingObject(),
$folder_id
);
try {
} catch (\Exception $e) {
$this->errorPage($e);
}
}
}
/**
* Return the creation form for this object
*/

View File

@@ -24,6 +24,7 @@
namespace Thelia\Controller\Admin;
use Thelia\Core\Event\Product\ProductAddCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteCategoryEvent;
use Thelia\Core\Event\Product\ProductDeleteEvent;
use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\Product\ProductUpdateEvent;
@@ -613,7 +614,7 @@ class ProductController extends AbstractCrudController
// Check current user authorization
if (null !== $response = $this->checkAuth("admin.products.update")) return $response;
$category_id = intval($this->getRequest()->get('additional_category_id'));
$category_id = intval($this->getRequest()->request->get('additional_category_id'));
if ($category_id > 0) {