public function viewImageAction($imageId, $parentType)
    {
        if (null !== $response = $this->checkAuth($this->getAdminResources()->getResource($parentType, static::MODULE_RIGHT), array(), AccessManager::UPDATE)) {
            return $response;
        }
        $fileManager = $this->getFileManager();
        $imageModel = $fileManager->getModelInstance('image', $parentType);

        $image = $imageModel->getQueryInstance()->findPk($imageId);

        $redirectUrl = $image->getRedirectionUrl();

        return $this->render('image-edit', array(
            'imageId' => $imageId,
            'imageType' => $parentType,
            'redirectUrl' => $redirectUrl,
            'formId' => $imageModel->getUpdateFormId(),
            'breadcrumb' => $image->getBreadcrumb(
                $this->getRouter($this->getCurrentRouter()),
                $this->container,
                'images',
                $this->getCurrentEditionLocale()
            )
        ));
    }
public function viewImageAction($imageId, $parentType)
    {
        if (null !== $response = $this->checkAuth($this->getAdminResources()->getResource($parentType, static::MODULE_RIGHT), array(), AccessManager::UPDATE)) {
            return $response;
        }
        $fileManager = $this->getFileManager();
        $imageModel = $fileManager->getModelInstance('image', $parentType);

        $image = $imageModel->getQueryInstance()->findPk($imageId);

        $redirectUrl = $image->getRedirectionUrl();

        return $this->render('image-edit', array(
            'imageId' => $imageId,
            'imageType' => $parentType,
            'redirectUrl' => $redirectUrl,
            'formId' => $imageModel->getUpdateFormId(),
            'breadcrumb' => $image->getBreadcrumb(
                $this->getRouter($this->getCurrentRouter()),
                $this->container,
                'images',
                $this->getCurrentEditionLocale()
            )
        ));
    }
public function viewImageAction ( $ imageId , $ parentType ) { if ( null !== $ response = $ this -> checkAuth ( $ this -> getAdminResources ( ) -> getResource ( $ parentType , static :: MODULE_RIGHT ) , array ( ) , AccessManager :: UPDATE ) ) { return $ response ; } $ fileManager = $ this -> getFileManager ( ) ; $ imageModel = $ fileManager -> getModelInstance ( 'image' , $ parentType ) ; $ image = $ imageModel -> getQueryInstance ( ) -> findPk ( $ imageId ) ; $ redirectUrl = $ image -> getRedirectionUrl ( ) ; return $ this -> render ( 'image-edit' , array ( 'imageId' => $ imageId , 'imageType' => $ parentType , 'redirectUrl' => $ redirectUrl , 'formId' => $ imageModel -> getUpdateFormId ( ) , 'breadcrumb' => $ image -> getBreadcrumb ( $ this -> getRouter ( $ this -> getCurrentRouter ( ) ) , $ this -> container , 'images' , $ this -> getCurrentEditionLocale ( ) ) ) ) ; }
Manage how an image is viewed

@param int    $imageId    Parent id owning images being saved
@param string $parentType Parent Type owning images being saved

@return Response
Manage how an image is viewed