]> _ Git - cubist_scorm.git/commitdiff
wip #6186 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 22 Sep 2023 15:45:05 +0000 (17:45 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 22 Sep 2023 15:45:05 +0000 (17:45 +0200)
composer.lock
src/Manifest.php

index 75261855eb77d14d50c0441a301703983f70f178..aaf45338dc2703793db752d29f00f55e41da5983 100644 (file)
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "4839e02e1197a2d107ff1dea39bf2cf3",
+    "content-hash": "ac1f71451c93880e9dcc8d96a5d27041",
     "packages": [],
     "packages-dev": [],
     "aliases": [],
@@ -13,7 +13,8 @@
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=7.3"
+        "php": ">=7.3",
+        "ext-mbstring": "*"
     },
     "platform-dev": [],
     "plugin-api-version": "2.1.0"
index 519bd9b7782b8f3c9d72cfee4f6713f03a3f5481..4d6b0051329b1fc5b7a06b13ce3c4eb56d164ca5 100644 (file)
@@ -63,6 +63,10 @@ class Manifest
             $v = '3rd';
         }
 
+        if ($this->getReference() === $this->getOrganization()) {
+            $this->setOrganization($this->getOrganization() . '_ORG');
+        }
+
         return '<?xml version="1.0" standalone="no" ?>
 <manifest identifier="' . $this->_escape($this->getManifestID()) . '" version="1.3"
           xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"
@@ -111,6 +115,10 @@ class Manifest
      */
     protected function _render12()
     {
+        if ($this->getReference() === $this->getOrganization()) {
+            $this->setOrganization($this->getOrganization() . '_ORG');
+        }
+
         $res = '<?xml version="1.0" encoding="UTF-8"?>
 <manifest 
     xmlns="http://www.imsproject.org/xsd/imscp_rootv1p1p2"
@@ -128,13 +136,13 @@ class Manifest
     <organizations default="' . $this->_escapeAttr($this->getOrganization()) . '">
         <organization identifier="' . $this->_escapeAttr($this->getOrganization()) . '" structure="hierarchical">
             <title>' . $this->_escape($this->getTitle()) . '</title>
-            <item identifier="' . $this->_escapeAttr($this->getReference()) . '" identifierref="' . $this->_escapeAttr($this->getReference()) . '" isvisible="true">
+            <item identifier="' . $this->_escapeAttr($this->getReference()) . '" identifierref="' . $this->_escapeAttr($this->getReference()) . '_RES" isvisible="true">
                 <title>' . $this->_escape($this->getTitle()) . '</title>
             </item>
         </organization>
     </organizations>
     <resources>
-        <resource type="webcontent" adlcp:scormtype="sco" identifier="' . $this->_escapeAttr($this->getReference()) . '" href="' . $this->getStart() . '">
+        <resource type="webcontent" adlcp:scormtype="sco" identifier="' . $this->_escapeAttr($this->getReference()) . '_RES" href="' . $this->getStart() . '">
             <file href="' . $this->getStart() . '"/>
         </resource>
     </resources>