ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ResourcesManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 protected \ILIAS\COPage\Dom\DomUtil $dom_util;
26
27 public function __construct()
28 {
29 global $DIC;
30 $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
31 }
32
33 public function getResourceIds(\DOMDocument $dom): array
34 {
35 $r_ids = [];
36 $path = "//Resources";
37 $nodes = $this->dom_util->path($dom, $path);
38 foreach ($nodes as $node) {
39 $id = "";
40 $c = $node->childNodes->item(0);
41 if (is_object($c) && $c->nodeName === "ResourceList") {
42 $id = $c->getAttribute("Type");
43 }
44 if (is_object($c) && $c->nodeName === "ItemGroup") {
45 $id = $c->getAttribute("RefId");
46 }
47 if ($id !== "" && !in_array($id, $r_ids)) {
48 $r_ids[] = $id;
49 }
50 }
51 return $r_ids;
52 }
53
54}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$c
Definition: deliver.php:25
$path
Definition: ltiservices.php:30
global $DIC
Definition: shib_login.php:26