public function viewDocumentAction($documentId, $parentType)
    {
        if (null !== $response = $this->checkAuth($this->getAdminResources()->getResource($parentType, static::MODULE_RIGHT), array(), AccessManager::UPDATE)) {
            return $response;
        }

        $fileManager = $this->getFileManager();
        $documentModel = $fileManager->getModelInstance('document', $parentType);

        $document = $documentModel->getQueryInstance()->findPk($documentId);

        $redirectUrl = $document->getRedirectionUrl();

        return $this->render('document-edit', array(
            'documentId' => $documentId,
            'documentType' => $parentType,
            'redirectUrl' => $redirectUrl,
            'formId' => $documentModel->getUpdateFormId(),
            'breadcrumb' => $document->getBreadcrumb(
                $this->getRouter($this->getCurrentRouter()),
                $this->container,
                'documents',
                $this->getCurrentEditionLocale()
            )
        ));
    }
public function viewDocumentAction($documentId, $parentType)
    {
        if (null !== $response = $this->checkAuth($this->getAdminResources()->getResource($parentType, static::MODULE_RIGHT), array(), AccessManager::UPDATE)) {
            return $response;
        }

        $fileManager = $this->getFileManager();
        $documentModel = $fileManager->getModelInstance('document', $parentType);

        $document = $documentModel->getQueryInstance()->findPk($documentId);

        $redirectUrl = $document->getRedirectionUrl();

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

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

@return Response
Manage how an document is viewed