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        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]";
 
   79                if (is_object(
$res->nodeset[0]))
 
   81                        return $res->nodeset[0];
 
   86                        $path2 = 
"//PageContent[@HierId='".$this->getHierId().
"']".
 
   87                                "/Table/TableRow[".($i+1).
"]/TableData[".($j+1).
"]";
 
   92                        $td_node = $res2->nodeset[0];
 
   94                        if (is_object($td_node))
 
   97                                $children = $td_node->child_nodes();
 
   98                                for($i=0; $i<count($children); $i++)
 
  100                                        $td_node->remove_child($children[$i]);
 
  105                                $pc_node = $td_node->append_child($pc_node);
 
  106                                $par_node = $this->dom->create_element(
"Paragraph");
 
  107                                $par_node = $pc_node->append_child($par_node);
 
  108                                $par_node->set_attribute(
"Characteristic", 
"TableContent");
 
  109                                $par_node->set_attribute(
"Language",
 
  125                $children = $td_node->child_nodes();
 
  126                for($i=0; $i<count($children); $i++)
 
  128                        $td_node->remove_child($children[$i]);
 
  133                $pc_node = $td_node->append_child($pc_node);
 
  134                $par_node = $this->dom->create_element(
"Paragraph");
 
  135                $par_node = $pc_node->append_child($par_node);
 
  136                $par_node->set_attribute(
"Characteristic", 
"TableContent");
 
  137                $par_node->set_attribute(
"Language",
 
  148                if (is_object($cell_par))
 
  151                        $childs = $cell_par->child_nodes();
 
  152                        for($i=0; $i<count($childs); $i++)
 
  154                                $content.= $this->dom->dump_node($childs[$i]);
 
  171                if (is_array($a_data))
 
  173                        foreach ($a_data as $i => 
$row)
 
  177                                        foreach (
$row as $j => $cell)
 
  180                                                $temp_dom = @
domxml_open_mem(
'<?xml version="1.0" encoding="UTF-8"?><Paragraph>'.$cell.
'</Paragraph>',
 
  181                                                        DOMXML_LOAD_PARSING, 
$error);
 
  187                                                if(empty(
$error) && is_object($par_node))
 
  190                                                        $children = $par_node->child_nodes();
 
  191                                                        for($k=0; $k < count($children); $k++)
 
  193                                                                $par_node->remove_child($children[$k]);
 
  198                                                        $path = 
"//Paragraph";
 
  201                                                        if (count(
$res->nodeset) == 1)
 
  203                                                                $new_par_node = 
$res->nodeset[0];
 
  204                                                                $new_childs = $new_par_node->child_nodes();
 
  205                                                                for (
$l = 0; 
$l < count($new_childs); 
$l++)
 
  207                                                                        $cloned_child = $new_childs[
$l]->clone_node(
true);
 
  208                                                                        $par_node->append_child($cloned_child);
 
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)
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)