3 declare(strict_types=1);
    47     public function __construct(
object $a_slm_object, 
string $a_xml_file)
    51         $this->current_element = array();
    52         $this->slm_object = $a_slm_object;
    53         $this->tree_created = 
false;
    54         $this->parent_stack = array();
    55         $this->item_stack = array();
    67         xml_set_object($a_xml_parser, $this);
    68         xml_set_element_handler($a_xml_parser, 
'handlerBeginTag', 
'handlerEndTag');
    69         xml_set_character_data_handler($a_xml_parser, 
'handlerCharacterData');
    77         parent::startParsing();
    95         $this->current_element[count($this->current_element)] = $a_name;
   104         unset($this->current_element[count($this->current_element) - 1]);
   112         return ($this->current_element[count($this->current_element) - 1]);
   117         return ($this->current_element[count($this->current_element) - 1 - $nr]);
   135     public function buildTag(
string $type, 
string $name, ?array $attr = null): string
   139         if ($type === 
"end") {
   145         if (is_array($attr)) {
   146             foreach ($attr as $k => $v) {
   147                 $tag .= 
" " . $k . 
"=\"$v\"";
   158         return $this->parent_stack[count($this->parent_stack) - 1];
   168     public function handlerBeginTag(XMLParser $a_xml_parser, 
string $a_name, array $a_attribs): void
   174                 if (isset($a_attribs[
"version"])) {
   175                     $mVersion = $a_attribs[
"version"];
   178                 $manifest->setSLMId($this->slm_object->getId());
   179                 $manifest->setImportId($a_attribs[
"identifier"]);
   180                 $manifest->setVersion($mVersion);
   181                 if (isset($a_attribs[
"xml:base"])) {
   182                     $manifest->setXmlBase($a_attribs[
"xml:base"]);
   185                 if (!$this->tree_created) {
   186                     $this->sc_tree = 
new ilSCORMTree($this->slm_object->getId());
   187                     $this->sc_tree->
addTree($this->slm_object->getId(), $manifest->getId());
   191                 $this->parent_stack[] = $manifest->getId();
   194             case "organizations":
   196                 $organizations->setSLMId($this->slm_object->getId());
   197                 if (isset($a_attribs[
"default"])) {
   198                     $organizations->setDefaultOrganization($a_attribs[
"default"]);
   200                     $organizations->setDefaultOrganization(
"");
   202                 $organizations->create();
   203                 $this->sc_tree->insertNode($organizations->getId(), $this->
getCurrentParent());
   204                 $this->parent_stack[] = $organizations->getId();
   209                 $organization->setSLMId($this->slm_object->getId());
   210                 $organization->setImportId($a_attribs[
"identifier"]);
   211                 if (isset($a_attribs[
"structure"])) {
   212                     $organization->setStructure($a_attribs[
"structure"]);
   214                 $organization->create();
   215                 $this->current_organization = &$organization;
   216                 $this->sc_tree->insertNode($organization->getId(), $this->
getCurrentParent());
   217                 $this->parent_stack[] = $organization->getId();
   222                 $item->setSLMId($this->slm_object->getId());
   223                 $item->setImportId($a_attribs[
"identifier"]);
   224                 $item->setIdentifierRef((
string) $a_attribs[
"identifierref"]);
   225                 if (isset($a_attribs[
"isvisible"])) {
   226                     if (strtolower((
string) $a_attribs[
"isvisible"]) !== 
"false") {
   227                         $item->setVisible(
true);
   229                         $item->setVisible(
false);
   232                 if (isset($a_attribs[
"parameters"])) {
   233                     $item->setParameters($a_attribs[
"parameters"]);
   237                 $this->parent_stack[] = $item->getId();
   238                 $this->item_stack[count($this->item_stack)] = &$item;
   241             case "adlcp:prerequisites":
   242                 $this->item_stack[count($this->item_stack) - 1]->setPrereqType($a_attribs[
"type"]);
   247                 $resources->setSLMId($this->slm_object->getId());
   248                 if (isset($a_attribs[
"xml:base"])) {
   249                     $resources->setXmlBase($a_attribs[
"xml:base"]);
   258                 $resource->setSLMId($this->slm_object->getId());
   259                 $resource->setImportId($a_attribs[
"identifier"]);
   260                 $resource->setResourceType($a_attribs[
"type"]);
   261                 if (isset($a_attribs[
"adlcp:scormtype"])) {
   262                     $resource->setScormType($a_attribs[
"adlcp:scormtype"]);
   264                 if (isset($a_attribs[
"xml:base"])) {
   265                     $resource->setXmlBase($a_attribs[
"xml:base"]);
   267                 if (isset($a_attribs[
"href"])) {
   268                     $resource->setHRef($a_attribs[
"href"]);
   271                 $this->current_resource = &$resource;
   273                 $this->parent_stack[] = $resource->getId();
   278                 $file->setHRef($a_attribs[
"href"]);
   279                 $this->current_resource->addFile($file);
   284                 $dependency->setIdentifierRef($a_attribs[
"identifierref"]);
   285                 $this->current_resource->addDependency($dependency);
   298     public function handlerEndTag(XMLParser $a_xml_parser, 
string $a_name): void
   304             case "organizations":
   306                 array_pop($this->parent_stack);
   310                 $this->current_organization->update();
   311                 array_pop($this->parent_stack);
   315                 $this->item_stack[count($this->item_stack) - 1]->update();
   316                 unset($this->item_stack[count($this->item_stack) - 1]);
   317                 array_pop($this->parent_stack);
   321                 $this->current_resource->update();
   322                 array_pop($this->parent_stack);
   339         $a_data = preg_replace(
"/\n/", 
"", $a_data);
   340         $a_data = preg_replace(
"/\t+/", 
"", $a_data);
   341         if (!empty($a_data)) {
   346                             $this->current_organization->setTitle(
   353                             $this->item_stack[count($this->item_stack) - 1]->setTitle(
   360                 case "adlcp:prerequisites":
   361                     $this->item_stack[count($this->item_stack) - 1]->setPrerequisites($a_data);
   364                 case "adlcp:maxtimeallowed":
   365                     $this->item_stack[count($this->item_stack) - 1]->setMaxTimeAllowed($a_data);
   368                 case "adlcp:timelimitaction":
   369                     $this->item_stack[count($this->item_stack) - 1]->setTimeLimitAction($a_data);
   372                 case "adlcp:datafromlms":
   373                     $this->item_stack[count($this->item_stack) - 1]->setDataFromLms($a_data);
   376                 case "adlcp:masteryscore":
   377                     $this->item_stack[count($this->item_stack) - 1]->setMasteryScore($a_data);
 setHandlers($a_xml_parser)
set event handler should be overwritten by inherited class 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(object $a_slm_object, string $a_xml_file)
Constructor. 
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
getAncestorElement(int $nr=1)
 
addTree(int $a_tree_id, int $a_node_id=-1)
create a new tree to do: ??? 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
handlerCharacterData(XMLParser $a_xml_parser, ?string $a_data)
handler for character data 
 
getCurrentElement()
returns current element 
 
handlerEndTag(XMLParser $a_xml_parser, string $a_name)
handler for end of element 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
handlerBeginTag(XMLParser $a_xml_parser, string $a_name, array $a_attribs)
handler for begin of element 
 
endElement(string $a_name)
update parsing status for an element ending 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
buildTag(string $type, string $name, ?array $attr=null)
generate a tag with given name and attributes 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
beginElement(string $a_name)
update parsing status for a element begin 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
__construct(Container $dic, ilPlugin $plugin)
 
object $current_organization