implement new breadcrumb on image and document edition in the catalog

This commit is contained in:
Manuel Raynaud
2014-06-11 10:29:52 +02:00
parent afe48b2d33
commit 476bda3d4a
11 changed files with 220 additions and 20 deletions

View File

@@ -312,7 +312,8 @@ class FileController extends BaseAdminController
'imageId' => $imageId,
'imageType' => $parentType,
'redirectUrl' => $redirectUrl,
'formId' => $fileManager->getFormId($parentType, FileManager::FILE_TYPE_IMAGES)
'formId' => $fileManager->getFormId($parentType, FileManager::FILE_TYPE_IMAGES),
'breadcrumb' => $image->getBreadcrumb($this->getRouter($this->getCurrentRouter()), $this->container, 'images')
));
} catch (\Exception $e) {
$this->pageNotFound();
@@ -341,7 +342,8 @@ class FileController extends BaseAdminController
'documentId' => $documentId,
'documentType' => $parentType,
'redirectUrl' => $redirectUrl,
'formId' => $fileManager->getFormId($parentType, FileManager::FILE_TYPE_DOCUMENTS)
'formId' => $fileManager->getFormId($parentType, FileManager::FILE_TYPE_DOCUMENTS),
'breadcrumb' => $document->getBreadcrumb($this->getRouter($this->getCurrentRouter()), $this->container, 'documents')
));
} catch (\Exception $e) {
$this->pageNotFound();

View File

@@ -291,7 +291,7 @@ abstract class BaseController extends ContainerAware
protected function getRouteFromRouter($routerName, $routeId, $parameters = array(), $referenceType = Router::ABSOLUTE_URL)
{
/** @var Router $router */
$router = $this->container->get($routerName);
$router = $this->getRouter($routerName);
if ($router == null) {
throw new \InvalidArgumentException(sprintf("Router '%s' does not exists.", $routerName));
@@ -300,6 +300,15 @@ abstract class BaseController extends ContainerAware
return $router->generate($routeId, $parameters, $referenceType);
}
/**
* @param $routerName
* @return Router
*/
protected function getRouter($routerName)
{
return $this->container->get($routerName);
}
/**
* Return a 404 error
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException