27 public function init(): void
42 if (!empty($a_type)) {
43 $this->dom_util->deleteAllChilds($this->getChildNode());
44 $list_node = $this->dom_doc->createElement(
"ResourceList");
45 $list_node = $this->getChildNode()->appendChild($list_node);
46 $list_node->setAttribute(
"Type", $a_type);
52 if (!empty($a_ref_id)) {
53 $this->dom_util->deleteAllChilds($this->getChildNode());
54 $list_node = $this->dom_doc->createElement(
"ItemGroup");
55 $list_node = $this->getChildNode()->appendChild($list_node);
56 $list_node->setAttribute(
"RefId", $a_ref_id);
65 if (is_object($this->getChildNode())) {
66 $c = $this->getChildNode()->childNodes->item(0);
67 if (is_object(
$c) &&
$c->nodeName ==
"ResourceList") {
68 return $c->getAttribute(
"Type");
79 if (is_object($this->getChildNode())) {
80 $c = $this->getChildNode()->childNodes->item(0);
81 if (is_object(
$c) &&
$c->nodeName ==
"ItemGroup") {
82 return (
int)
$c->getAttribute(
"RefId");
90 if (is_object($this->getChildNode())) {
91 $c = $this->getChildNode()->childNodes->item(0);
93 return (
string)
$c->nodeName;
103 $dom = $a_page->getDomDoc();
107 $xpath_temp =
new DOMXPath($dom);
108 $igs = $xpath_temp->query(
"//Resources/ItemGroup");
110 foreach ($igs as $ig_node) {
111 $ref_id = $ig_node->getAttribute(
"RefId");
112 $log->debug(
">>> Fix Item Group with import Ref Id:" .
$ref_id);
113 $log->debug(
"Ref Id Mapping:" . print_r($mappings,
true));
114 if (($mappings[
$ref_id] ?? 0) > 0) {
115 $ig_node->setAttribute(
"RefId", $mappings[
$ref_id]);
124 return array(
"pc_res");
131 return self::modifyItemGroupRefIdsByMapping($page, $ref_mappings);
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setResourceListType(string $a_type)
static modifyItemGroupRefIdsByMapping(ilPageObject $a_page, array $mappings)
getResourceListType()
Get Resource List Type.
setItemGroupRefId(int $a_ref_id)
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
getItemGroupRefId()
Get item group ref id.
static getLangVars()
Get lang vars needed for editing.
static resolveResources(ilPageObject $page, array $ref_mappings)
Content object of ilPageObject (see ILIAS DTD).
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])
setType(string $a_type)
Set Type.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...