24 require_once(
"./Services/COPage/classes/class.ilPageContent.php");
25 require_once(
"./Services/COPage/classes/class.ilPCTable.php");
54 $this->tab_node =& $a_node->first_child();
57 function create(&$a_pg_obj, $a_hier_id, $a_pc_id =
"")
61 $this->tab_node =& $this->dom->create_element(
"Table");
62 $this->tab_node =& $this->node->append_child($this->tab_node);
63 $this->tab_node->set_attribute(
"Language",
"");
64 $this->tab_node->set_attribute(
"DataTable",
"y");
73 $path =
"//PageContent[@HierId='".$this->getHierId().
"']".
74 "/Table/TableRow[$i+1]/TableData[$j+1]/PageContent[1]/Paragraph[1]";
77 if (is_object(
$res->nodeset[0]))
79 return $res->nodeset[0];
84 $path2 =
"//PageContent[@HierId='".$this->getHierId().
"']".
85 "/Table/TableRow[".($i+1).
"]/TableData[".($j+1).
"]";
90 $td_node = $res2->nodeset[0];
92 if (is_object($td_node))
95 $children = $td_node->child_nodes();
96 for($i=0; $i<count($children); $i++)
98 $td_node->remove_child($children[$i]);
103 $pc_node = $td_node->append_child($pc_node);
104 $par_node = $this->dom->create_element(
"Paragraph");
105 $par_node = $pc_node->append_child($par_node);
106 $par_node->set_attribute(
"Characteristic",
"TableContent");
107 $par_node->set_attribute(
"Language",
123 $children = $td_node->child_nodes();
124 for($i=0; $i<count($children); $i++)
126 $td_node->remove_child($children[$i]);
131 $pc_node = $td_node->append_child($pc_node);
132 $par_node = $this->dom->create_element(
"Paragraph");
133 $par_node = $pc_node->append_child($par_node);
134 $par_node->set_attribute(
"Characteristic",
"TableContent");
135 $par_node->set_attribute(
"Language",
146 if (is_object($cell_par))
149 $childs = $cell_par->child_nodes();
150 for($i=0; $i<count($childs); $i++)
152 $content.= $this->dom->dump_node($childs[$i]);
169 if (is_array($a_data))
171 foreach ($a_data as $i =>
$row)
175 foreach (
$row as $j => $cell)
177 $temp_dom = @
domxml_open_mem(
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>'.$cell.
'</Paragraph>',
184 if(empty(
$error) && is_object($par_node))
187 $children = $par_node->child_nodes();
188 for($k=0; $k < count($children); $k++)
190 $par_node->remove_child($children[$k]);
195 $path =
"//Paragraph";
198 if (count(
$res->nodeset) == 1)
200 $new_par_node =&
$res->nodeset[0];
201 $new_childs = $new_par_node->child_nodes();
202 for (
$l = 0;
$l < count($new_childs);
$l++)
204 $cloned_child = $new_childs[
$l]->clone_node(
true);
205 $par_node->append_child($cloned_child);