4 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
35 parent::setNode($a_node);
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();
159 $dom = $dom->myDOMDocument;
162 $xpath_temp =
new DOMXPath($dom);
163 $igs = $xpath_temp->query(
"//Resources/ItemGroup");
166 foreach ($igs as $ig_node)
168 $ref_id = $ig_node->getAttribute(
"RefId");
171 $ig_node->setAttribute(
"RefId", $mappings[
$ref_id]);
184 return array(
"pc_res");
194 return self::modifyItemGroupRefIdsByMapping($page, $ref_mappings);
init()
Init page content component.
static modifyItemGroupRefIdsByMapping($a_page, $mappings)
Modify ref ids by mapping.
setType($a_type)
Set Type.
getResourceListType()
Get Resource Lis Type.
getMainType()
Get main type.
static getLangVars()
Get lang vars needed for editing.
setNode($a_node)
Set node.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
Create resources node in xml.
setResourceListType($a_type)
Set Type of Resource List (currently only one)
setItemGroupRefId($a_ref_id)
Set Item Group Ref Id.
Create styles array
The data for the language used.
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
getItemGroupRefId()
Get item group ref id.
static resolveResources(ilPageObject $page, $ref_mappings)
Resolve resources.