public function __construct(Scorm2004Resource $scormResource, User $user, array $details)
 {
     parent::__construct(self::ACTION, $details, $user, null, $scormResource->getResourceNode(), null, $scormResource->getResourceNode()->getWorkspace());
 }
Exemplo n.º 2
0
 /**
  * @DI\Observe("copy_claroline_scorm_2004")
  *
  * @param CopyResourceEvent $event
  */
 public function onCopy(CopyResourceEvent $event)
 {
     $resource = $event->getResource();
     $copy = new Scorm2004Resource();
     $copy->setHashName($resource->getHashName());
     $copy->setName($resource->getName());
     $this->om->persist($copy);
     $scos = $resource->getScos();
     foreach ($scos as $sco) {
         if (is_null($sco->getScoParent())) {
             $this->copySco($sco, $copy);
         }
     }
     $event->setCopy($copy);
     $event->stopPropagation();
 }
Exemplo n.º 3
0
 private function hasScorm2004Right(Scorm2004Resource $scorm, $right)
 {
     $collection = new ResourceCollection([$scorm->getResourceNode()]);
     return $this->authorization->isGranted($right, $collection);
 }