public function configureAction($id)
    {
        /** @var \Thelia\Handler\ImportHandler $importHandler */
        $importHandler = $this->container->get('thelia.import.handler');

        $import = $importHandler->getImport($id);
        if ($import === null) {
            return $this->pageNotFound();
        }

        $extensions = [];
        $mimeTypes = [];

        /** @var \Thelia\Core\Serializer\AbstractSerializer $serializer */
        foreach ($this->container->get(RegisterSerializerPass::MANAGER_SERVICE_ID)->getSerializers() as $serializer) {
            $extensions[] = $serializer->getExtension();
            $mimeTypes[] = $serializer->getMimeType();
        }

        /** @var \Thelia\Core\Archiver\AbstractArchiver $archiver */
        foreach ($this->container->get(RegisterArchiverPass::MANAGER_SERVICE_ID)->getArchivers(true) as $archiver) {
            $extensions[] = $archiver->getExtension();
            $mimeTypes[] = $archiver->getMimeType();
        }

        // Render standard view or ajax one
        $templateName = 'import-page';
        if ($this->getRequest()->isXmlHttpRequest()) {
            $templateName = 'ajax/import-modal';
        }

        return $this->render(
            $templateName,
            [
                'importId' => $id,
                'ALLOWED_MIME_TYPES' => implode(', ', $mimeTypes),
                'ALLOWED_EXTENSIONS' => implode(', ', $extensions),
            ]
        );
    }
public function configureAction($id)
    {
        /** @var \Thelia\Handler\ImportHandler $importHandler */
        $importHandler = $this->container->get('thelia.import.handler');

        $import = $importHandler->getImport($id);
        if ($import === null) {
            return $this->pageNotFound();
        }

        $extensions = [];
        $mimeTypes = [];

        /** @var \Thelia\Core\Serializer\AbstractSerializer $serializer */
        foreach ($this->container->get(RegisterSerializerPass::MANAGER_SERVICE_ID)->getSerializers() as $serializer) {
            $extensions[] = $serializer->getExtension();
            $mimeTypes[] = $serializer->getMimeType();
        }

        /** @var \Thelia\Core\Archiver\AbstractArchiver $archiver */
        foreach ($this->container->get(RegisterArchiverPass::MANAGER_SERVICE_ID)->getArchivers(true) as $archiver) {
            $extensions[] = $archiver->getExtension();
            $mimeTypes[] = $archiver->getMimeType();
        }

        // Render standard view or ajax one
        $templateName = 'import-page';
        if ($this->getRequest()->isXmlHttpRequest()) {
            $templateName = 'ajax/import-modal';
        }

        return $this->render(
            $templateName,
            [
                'importId' => $id,
                'ALLOWED_MIME_TYPES' => implode(', ', $mimeTypes),
                'ALLOWED_EXTENSIONS' => implode(', ', $extensions),
            ]
        );
    }
public function configureAction ( $ id ) { /** @var \Thelia\Handler\ImportHandler $importHandler */ $ importHandler = $ this -> container -> get ( 'thelia.import.handler' ) ; $ import = $ importHandler -> getImport ( $ id ) ; if ( $ import === null ) { return $ this -> pageNotFound ( ) ; } $ extensions = [ ] ; $ mimeTypes = [ ] ; /** @var \Thelia\Core\Serializer\AbstractSerializer $serializer */ foreach ( $ this -> container -> get ( RegisterSerializerPass :: MANAGER_SERVICE_ID ) -> getSerializers ( ) as $ serializer ) { $ extensions [ ] = $ serializer -> getExtension ( ) ; $ mimeTypes [ ] = $ serializer -> getMimeType ( ) ; } /** @var \Thelia\Core\Archiver\AbstractArchiver $archiver */ foreach ( $ this -> container -> get ( RegisterArchiverPass :: MANAGER_SERVICE_ID ) -> getArchivers ( true ) as $ archiver ) { $ extensions [ ] = $ archiver -> getExtension ( ) ; $ mimeTypes [ ] = $ archiver -> getMimeType ( ) ; } // Render standard view or ajax one $ templateName = 'import-page' ; if ( $ this -> getRequest ( ) -> isXmlHttpRequest ( ) ) { $ templateName = 'ajax/import-modal' ; } return $ this -> render ( $ templateName , [ 'importId' => $ id , 'ALLOWED_MIME_TYPES' => implode ( ', ' , $ mimeTypes ) , 'ALLOWED_EXTENSIONS' => implode ( ', ' , $ extensions ) , ] ) ; }
Display import configuration view

@param integer $id An import identifier

@return \Thelia\Core\HttpFoundation\Response
Display import configuration view