model/export/OatPicExporter.php
public function copyAssetFiles(&$replacementList){
        $object = $this->object;
        $portableAssetsToExport = [];
        $service = new PortableElementService();
        $service->setServiceLocator(ServiceManager::getServiceManager());
        $files = $object->getModel()->getValidator()->getAssets($object, 'runtime');
        $baseUrl = $this->qtiItemExporter->buildBasePath() . DIRECTORY_SEPARATOR . $object->getTypeIdentifier();
        foreach ($files as $url) {
            // Skip shared libraries into portable element
            if (strpos($url, './') !== 0) {
                \common_Logger::i('Shared libraries skipped : ' . $url);
                $portableAssetsToExport[$url] = $url;
                continue;
            }
            $stream = $service->getFileStream($object, $url);
            $replacement = $this->qtiItemExporter->copyAssetFile($stream, $baseUrl, $url, $replacementList);
            $portableAssetToExport = preg_replace('/^(.\/)(.*)/', $object->getTypeIdentifier() . "/$2", $replacement);
            $portableAssetsToExport[$url] = $portableAssetToExport;
            \common_Logger::i('File copied: "' . $url . '" for portable element ' . $object->getTypeIdentifier());
        }
        return $this->portableAssetsToExport = $portableAssetsToExport;
    }
public function copyAssetFiles(&$replacementList){
        $object = $this->object;
        $portableAssetsToExport = [];
        $service = new PortableElementService();
        $service->setServiceLocator(ServiceManager::getServiceManager());
        $files = $object->getModel()->getValidator()->getAssets($object, 'runtime');
        $baseUrl = $this->qtiItemExporter->buildBasePath() . DIRECTORY_SEPARATOR . $object->getTypeIdentifier();
        foreach ($files as $url) {
            // Skip shared libraries into portable element
            if (strpos($url, './') !== 0) {
                \common_Logger::i('Shared libraries skipped : ' . $url);
                $portableAssetsToExport[$url] = $url;
                continue;
            }
            $stream = $service->getFileStream($object, $url);
            $replacement = $this->qtiItemExporter->copyAssetFile($stream, $baseUrl, $url, $replacementList);
            $portableAssetToExport = preg_replace('/^(.\/)(.*)/', $object->getTypeIdentifier() . "/$2", $replacement);
            $portableAssetsToExport[$url] = $portableAssetToExport;
            \common_Logger::i('File copied: "' . $url . '" for portable element ' . $object->getTypeIdentifier());
        }
        return $this->portableAssetsToExport = $portableAssetsToExport;
    }
public function copyAssetFiles ( & $ replacementList ) { $ object = $ this -> object ; $ portableAssetsToExport = [ ] ; $ service = new PortableElementService ( ) ; $ service -> setServiceLocator ( ServiceManager :: getServiceManager ( ) ) ; $ files = $ object -> getModel ( ) -> getValidator ( ) -> getAssets ( $ object , 'runtime' ) ; $ baseUrl = $ this -> qtiItemExporter -> buildBasePath ( ) . DIRECTORY_SEPARATOR . $ object -> getTypeIdentifier ( ) ; foreach ( $ files as $ url ) { // Skip shared libraries into portable element if ( strpos ( $ url , './' ) !== 0 ) { \ common_Logger :: i ( 'Shared libraries skipped : ' . $ url ) ; $ portableAssetsToExport [ $ url ] = $ url ; continue ; } $ stream = $ service -> getFileStream ( $ object , $ url ) ; $ replacement = $ this -> qtiItemExporter -> copyAssetFile ( $ stream , $ baseUrl , $ url , $ replacementList ) ; $ portableAssetToExport = preg_replace ( '/^(.\/)(.*)/' , $ object -> getTypeIdentifier ( ) . "/$2" , $ replacement ) ; $ portableAssetsToExport [ $ url ] = $ portableAssetToExport ; \ common_Logger :: i ( 'File copied: "' . $ url . '" for portable element ' . $ object -> getTypeIdentifier ( ) ) ; } return $ this -> portableAssetsToExport = $ portableAssetsToExport ; }
Copy the asset files of the PIC to the item exporter and return the list of copied assets
@param $replacementList
@return array
Copy the asset files of the PIC to the item exporter and return the list of copied assets