4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
36 $this->res_node =& $a_node->first_child();
45 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
49 $this->res_node =& $this->dom->create_element(
"Resources");
50 $this->res_node =& $this->node->append_child($this->res_node);
62 $children = $this->res_node->child_nodes();
63 for ($i=0; $i<count($children); $i++)
65 $this->res_node->remove_child($children[$i]);
67 $list_node =& $this->dom->create_element(
"ResourceList");
68 $list_node =& $this->res_node->append_child($list_node);
69 $list_node->set_attribute(
"Type", $a_type);
80 if (!empty($a_ref_id))
82 $children = $this->res_node->child_nodes();
83 for ($i=0; $i<count($children); $i++)
85 $this->res_node->remove_child($children[$i]);
87 $list_node =& $this->dom->create_element(
"ItemGroup");
88 $list_node =& $this->res_node->append_child($list_node);
89 $list_node->set_attribute(
"RefId", $a_ref_id);
100 if (is_object($this->res_node))
102 $children = $this->res_node->child_nodes();
103 if (is_object($children[0]) && $children[0]->node_name() ==
"ResourceList")
105 return $children[0]->get_attribute(
"Type");
118 if (is_object($this->res_node))
120 $children = $this->res_node->child_nodes();
121 if (is_object($children[0]) && $children[0]->node_name() ==
"ItemGroup")
123 return (
int) $children[0]->get_attribute(
"RefId");
136 if (is_object($this->res_node))
138 $children = $this->res_node->child_nodes();
139 if (is_object($children[0]))
141 return $children[0]->node_name();
155 $dom = $a_page->getDom();
162 $xpath_temp =
new DOMXPath(
$dom);
163 $igs = $xpath_temp->query(
"//Resources/ItemGroup");
165 foreach ($igs as $ig_node)
167 $ref_id = $ig_node->getAttribute(
"RefId");
170 $ig_node->setAttribute(
"RefId", $mappings[
$ref_id]);