24require_once(
"./Services/COPage/classes/class.ilPageContent.php");
 
   25require_once(
"./Services/COPage/classes/class.ilPCTable.php");
 
   53        parent::setNode($a_node);               
 
   54        $this->tab_node = $a_node->first_child();               
 
   57    public 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");
 
   74            "/Table/TableRow[$i+1]/TableData[$j+1]/PageContent[1]/Paragraph[1]";
 
   79        if (is_object(
$res->nodeset[0])) {
 
   80            return $res->nodeset[0];
 
   83            $path2 = 
"//PageContent[@HierId='" . $this->
getHierId() . 
"']" .
 
   84                "/Table/TableRow[" . (
$i + 1) . 
"]/TableData[" . ($j + 1) . 
"]";
 
   89            $td_node = $res2->nodeset[0];
 
   91            if (is_object($td_node)) {
 
   93                $children = $td_node->child_nodes();
 
   94                for (
$i = 0; 
$i < count($children); 
$i++) {
 
   95                    $td_node->remove_child($children[
$i]);
 
  100                $pc_node = $td_node->append_child($pc_node);
 
  101                $par_node = $this->dom->create_element(
"Paragraph");
 
  102                $par_node = $pc_node->append_child($par_node);
 
  103                $par_node->set_attribute(
"Characteristic", 
"TableContent");
 
  104                $par_node->set_attribute(
 
  122        $children = $td_node->child_nodes();
 
  123        for (
$i = 0; 
$i < count($children); 
$i++) {
 
  124            $td_node->remove_child($children[
$i]);
 
  129        $pc_node = $td_node->append_child($pc_node);
 
  130        $par_node = $this->dom->create_element(
"Paragraph");
 
  131        $par_node = $pc_node->append_child($par_node);
 
  132        $par_node->set_attribute(
"Characteristic", 
"TableContent");
 
  133        $par_node->set_attribute(
 
  146        if (is_object($cell_par)) {
 
  148            $childs = $cell_par->child_nodes();
 
  149            for (
$i = 0; 
$i < count($childs); 
$i++) {
 
  150                $content .= $this->dom->dump_node($childs[
$i]);
 
  165        if (is_array($a_data)) {
 
  166            foreach ($a_data as 
$i => 
$row) {
 
  167                if (is_array(
$row)) {
 
  168                    foreach (
$row as $j => $cell) {
 
  171                            '<?xml version="1.0" encoding="UTF-8"?><Paragraph>' . $cell . 
'</Paragraph>',
 
  180                        if (empty($error) && is_object($par_node)) {
 
  182                            $children = $par_node->child_nodes();
 
  183                            for ($k = 0; $k < count($children); $k++) {
 
  184                                $par_node->remove_child($children[$k]);
 
  189                            $path = 
"//Paragraph";
 
  192                            if (count(
$res->nodeset) == 1) {
 
  193                                $new_par_node = 
$res->nodeset[0];
 
  194                                $new_childs = $new_par_node->child_nodes();
 
  195                                for (
$l = 0; 
$l < count($new_childs); 
$l++) {
 
  196                                    $cloned_child = $new_childs[
$l]->clone_node(
true);
 
  197                                    $par_node->append_child($cloned_child);
 
  202                            if (!empty($error)) {
 
An exception for terminatinating execution or to throw for unit testing.
makeEmptyCell($td_node)
Make cell empty.
getCellText($i, $j)
Get cell text of row $i and cell $j.
getCellNode($i, $j)
Get cell paragraph node of row $i and cell $j.
init()
Init page content component.
setData($a_data)
Set data of cells.
create(&$a_pg_obj, $a_hier_id, $a_pc_id="")
setNode($a_node)
Set xml node of page content.
getLanguage()
get table language
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)
getHierId()
Get hierarchical id.
setType($a_type)
Set Type.
xpath_eval($xpath_context, $eval_str, $contextnode=null)
domxml_open_mem($str, $mode=0, &$error=null)
xpath_new_context($dom_document)
const DOMXML_LOAD_PARSING
foreach($_POST as $key=> $value) $res