plugin/scorm/Manager/ExportManager.php
private function exportResource(AbstractResource $resource, $locale)
    {
        $resources = [];

        $event = $this->dispatchEvent($resource, $locale);
        $embedResources = $event->getEmbedResources();

        // Grab data from event
        $resources[$resource->getResourceNode()->getId()] = [
            'node' => $resource->getResourceNode(),
            'template' => $event->getTemplate(),
            'assets' => $event->getAssets(),
            'files' => $event->getFiles(),
            'translation_domains' => $event->getTranslationDomains(),
            'resources' => array_keys($embedResources), // We only need IDs
        ];

        if (!empty($embedResources)) {
            foreach ($embedResources as $embedResource) {
                if (empty($resources[$embedResource->getResourceNode()->getId()])) {
                    // Current resource has not been exported yet
                    $exported = $this->exportResource($embedResource, $locale);
                    $resources = array_merge($resources, $exported);
                }
            }
        }

        return $resources;
    }
private function exportResource(AbstractResource $resource, $locale)
    {
        $resources = [];

        $event = $this->dispatchEvent($resource, $locale);
        $embedResources = $event->getEmbedResources();

        // Grab data from event
        $resources[$resource->getResourceNode()->getId()] = [
            'node' => $resource->getResourceNode(),
            'template' => $event->getTemplate(),
            'assets' => $event->getAssets(),
            'files' => $event->getFiles(),
            'translation_domains' => $event->getTranslationDomains(),
            'resources' => array_keys($embedResources), // We only need IDs
        ];

        if (!empty($embedResources)) {
            foreach ($embedResources as $embedResource) {
                if (empty($resources[$embedResource->getResourceNode()->getId()])) {
                    // Current resource has not been exported yet
                    $exported = $this->exportResource($embedResource, $locale);
                    $resources = array_merge($resources, $exported);
                }
            }
        }

        return $resources;
    }
private function exportResource ( AbstractResource $ resource , $ locale ) { $ resources = [ ] ; $ event = $ this -> dispatchEvent ( $ resource , $ locale ) ; $ embedResources = $ event -> getEmbedResources ( ) ; // Grab data from event $ resources [ $ resource -> getResourceNode ( ) -> getId ( ) ] = [ 'node' => $ resource -> getResourceNode ( ) , 'template' => $ event -> getTemplate ( ) , 'assets' => $ event -> getAssets ( ) , 'files' => $ event -> getFiles ( ) , 'translation_domains' => $ event -> getTranslationDomains ( ) , 'resources' => array_keys ( $ embedResources ) , // We only need IDs ] ; if ( ! empty ( $ embedResources ) ) { foreach ( $ embedResources as $ embedResource ) { if ( empty ( $ resources [ $ embedResource -> getResourceNode ( ) -> getId ( ) ] ) ) { // Current resource has not been exported yet $ exported = $ this -> exportResource ( $ embedResource , $ locale ) ; $ resources = array_merge ( $ resources , $ exported ) ; } } } return $ resources ; }
Export a Claroline Resource and all it's embed Resources.

@param AbstractResource $resource
@param string           $locale

@return array - The list of exported resource
Export a Claroline Resource and all it s embed Resources .