implement new breadcrumb on image and document edition in the catalog
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user