Browse Source

Passage des services dans le TrackController

Mael ETIENNE 3 years ago
parent
commit
2a4137f049
1 changed files with 7 additions and 19 deletions
  1. 7
    19
      Controller/Track2004Controller.php

+ 7
- 19
Controller/Track2004Controller.php View File

@@ -19,9 +19,11 @@ use Logipro\Bundle\SCORMBundle\Player\SCORM2004\Scorm2004PlayerView;
19 19
 use Logipro\Bundle\SCORMBundle\Tools\TimeTools;
20 20
 use Logipro\Bundle\SCORMBundle\Tools\UnicodeTools;
21 21
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
22
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
22 23
 use Symfony\Component\HttpFoundation\Request;
23 24
 use Symfony\Component\HttpFoundation\Response;
24 25
 use Symfony\Component\HttpFoundation\JsonResponse;
26
+use Symfony\Component\Routing\RouterInterface;
25 27
 
26 28
 class Track2004Controller extends AbstractController
27 29
 {
@@ -370,7 +372,9 @@ class Track2004Controller extends AbstractController
370 372
         // Récupération des modifications du lecteur pour la réponse ajax
371 373
         $packageFolder = $this->container->getParameter('logipro_scorm.package_folder');
372 374
         $dom = $registrationAttempt->getDOM($packageFolder);
373
-        $playerView = new Scorm2004PlayerView($dom, $track, $registrationKey, $organization, $item);
375
+        $router = $this->container->get('router.default');
376
+        $parameters = $this->container->get('parameter_bag');
377
+        $playerView = new Scorm2004PlayerView($router, $parameters, $em, $dom, $track, $registrationKey, $organization, $item);
374 378
         $response = $playerView->getNavResponse();
375 379
 
376 380
         return $this->json($response);
@@ -827,29 +831,13 @@ class Track2004Controller extends AbstractController
827 831
         $em->flush();
828 832
     }
829 833
 
830
-    /**
831
-     * Récupère le code html des éléments de navigation du lecteur
832
-     *
833
-     * @param AGOReaderSCORM2004View $reader
834
-     * @return string
835
-     */
836
-    protected function getReaderChanges(AGOReaderSCORM2004View $reader)
837
-    {
838
-        $navHTML = array();
839
-        $navHTML['prev'] = $reader->getPrevLink();
840
-        $navHTML['next'] = $reader->getNextLink();
841
-        $navHTML['toc']  = $reader->getNodesTree();
842
-        $json = json_encode($navHTML);
843
-
844
-        return ($json);
845
-    }
846 834
 
847 835
     /**
848 836
      * Cette fonction permet de faire la redirection si on a une requête de redirection demandée par le SCO
849 837
      */
850 838
     public function redirection()
851 839
     {
852
-        // Si on trouve pas la requete de redirection, on ne fait rien !!
840
+        /* // Si on trouve pas la requete de redirection, on ne fait rien !!
853 841
         if (! isset($_REQUEST ['request'])) {
854 842
             return ;
855 843
         }
@@ -952,7 +940,7 @@ class Track2004Controller extends AbstractController
952 940
         $myURL = $tp->getURLTurbolead();
953 941
         $myURL.= 'mod/agora/'.$this->url;
954 942
 
955
-        $url = $myURL.do__ago_scorm2004_nav_request.'&idNode='.$urlParams;
943
+        $url = $myURL.do__ago_scorm2004_nav_request.'&idNode='.$urlParams; */
956 944
 
957 945
         echo $url;
958 946
     }

Loading…
Cancel
Save