27 public function init(): void
42 if (!empty($a_type)) {
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)) {
54 $list_node = $this->dom_doc->createElement(
"ItemGroup");
55 $list_node = $this->
getChildNode()->appendChild($list_node);
56 $list_node->setAttribute(
"RefId", $a_ref_id);
67 if (is_object(
$c) &&
$c->nodeName ==
"ResourceList") {
68 return $c->getAttribute(
"Type");
81 if (is_object(
$c) &&
$c->nodeName ==
"ItemGroup") {
82 return (
int)
$c->getAttribute(
"RefId");
93 return (
string)
$c->nodeName;
108 $igs = $xpath_temp->query(
"//Resources/ItemGroup");
110 foreach ($igs as $ig_node) {
111 $ref_id = $ig_node->getAttribute(
"RefId");
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 resolveResources(ilPageObject $page, array $ref_mappings)
setType(string $a_type)
Set Type.
static getLogger(string $a_component_id)
Get component logger.
getResourceListType()
Get Resource List Type.
getDomDoc()
Get dom doc (DOMDocument)
Content object of ilPageObject (see ILIAS DTD).
static modifyItemGroupRefIdsByMapping(ilPageObject $a_page, array $mappings)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
setResourceListType(string $a_type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
getItemGroupRefId()
Get item group ref id.
setItemGroupRefId(int $a_ref_id)
debug(string $message, array $context=[])
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])