24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
51 $this->list_node =& $a_node->first_child();
54 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
58 $this->list_node =& $this->dom->create_element(
"FileList");
59 $this->list_node =& $this->node->append_child($this->list_node);
75 $new_item =& $this->dom->create_element(
"FileItem");
76 $new_item =& $this->list_node->append_child($new_item);
79 $id_node =& $this->dom->create_element(
"Identifier");
80 $id_node =& $new_item->append_child($id_node);
81 $id_node->set_attribute(
"Catalog",
"ILIAS");
82 $id_node->set_attribute(
"Entry",
"il__file_".$a_id);
85 $loc_node =& $this->dom->create_element(
"Location");
86 $loc_node =& $new_item->append_child($loc_node);
87 $loc_node->set_attribute(
"Type",
"LocalFile");
88 $loc_node->set_content($a_location);
91 $form_node =& $this->dom->create_element(
"Format");
92 $form_node =& $new_item->append_child($form_node);
93 $form_node->set_content($a_format);
99 $this->list_node,
"Title", array(
"FileItem"),
100 $a_title, array(
"Language" => $a_language));
105 $chlds =& $this->list_node->child_nodes();
106 for($i=0; $i<count($chlds); $i++)
108 if ($chlds[$i]->node_name() ==
"Title")
110 return $chlds[$i]->get_content();
118 $chlds =& $this->list_node->child_nodes();
119 for($i=0; $i<count($chlds); $i++)
121 if ($chlds[$i]->node_name() ==
"Title")
123 return $chlds[$i]->get_attribute(
"Language");
137 $childs = $this->list_node->child_nodes();
138 for ($i=0; $i<count($childs); $i++)
140 if ($childs[$i]->node_name() ==
"FileItem")
143 $pc_id = $childs[$i]->get_attribute(
"PCID");
144 $hier_id = $childs[$i]->get_attribute(
"HierId");
145 $class = $childs[$i]->get_attribute(
"Class");
148 $id_node = $childs[$i]->first_child();
149 if ($id_node->node_name() ==
"Identifier")
151 $entry = $id_node->get_attribute(
"Entry");
152 if (substr($entry, 0, 9) ==
"il__file_")
154 $id = substr($entry, 9);
157 $files[] = array(
"entry" => $entry,
"id" => $id,
158 "pc_id" => $pc_id,
"hier_id" =>
$hier_id,
174 $childs = $this->list_node->child_nodes();
176 for ($i=0; $i<count($childs); $i++)
178 if ($childs[$i]->node_name() ==
"FileItem")
181 $pc_id = $childs[$i]->get_attribute(
"PCID");
182 $hier_id = $childs[$i]->get_attribute(
"HierId");
184 if (in_array(
$hier_id.
":".$pc_id, $a_ids))
186 $childs[$i]->unlink($childs[$i]);
200 $childs = $this->list_node->child_nodes();
202 for ($i=0; $i<count($childs); $i++)
204 if ($childs[$i]->node_name() ==
"FileItem")
207 $pc_id = $childs[$i]->get_attribute(
"PCID");
208 $hier_id = $childs[$i]->get_attribute(
"HierId");
209 $nodes[
$hier_id.
":".$pc_id] = $childs[$i];
210 $childs[$i]->unlink($childs[$i]);
214 foreach($a_pos as $k => $v)
216 if (is_object($nodes[$k]))
218 $nodes[$k] = $this->list_node->append_child($nodes[$k]);
231 $childs = $this->list_node->child_nodes();
233 for ($i=0; $i<count($childs); $i++)
235 if ($childs[$i]->node_name() ==
"FileItem")
237 $classes[$childs[$i]->get_attribute(
"HierId").
":".
238 $childs[$i]->get_attribute(
"PCID")] = $childs[$i]->get_attribute(
"Class");
251 $childs = $this->list_node->child_nodes();
252 for ($i=0; $i<count($childs); $i++)
254 if ($childs[$i]->node_name() ==
"FileItem")
256 $childs[$i]->set_attribute(
"Class",
257 $a_class[$childs[$i]->get_attribute(
"HierId").
":".
258 $childs[$i]->get_attribute(
"PCID")]);