24require_once(
"./Services/COPage/classes/class.ilPageContent.php");
55 $parent_tr = $td->parent_node();
56 $new_tr = $parent_tr->clone_node(
true);
59 if ($new_tr->has_attribute(
"PCID")) {
60 $new_tr->remove_attribute(
"PCID");
62 if ($next_tr = $parent_tr->next_sibling()) {
63 $new_tr = $next_tr->insert_before($new_tr, $next_tr);
65 $parent_table = $parent_tr->parent_node();
66 $new_tr = $parent_table->append_child($new_tr);
82 $parent_tr = $td->parent_node();
83 $new_tr = $parent_tr->clone_node(
true);
84 $new_tr = $parent_tr->insert_before($new_tr, $parent_tr);
85 if ($new_tr->has_attribute(
"PCID")) {
86 $new_tr->remove_attribute(
"PCID");
103 $tds = $a_row_node->child_nodes();
104 for (
$i = 0;
$i < count($tds);
$i++) {
105 if ($tds[
$i]->has_attribute(
"PCID")) {
106 $tds[
$i]->remove_attribute(
"PCID");
108 $td_childs = $tds[
$i]->child_nodes();
109 for ($j = 0; $j < count($td_childs); $j++) {
110 $tds[
$i]->remove_child($td_childs[$j]);
122 $td_childs = $a_td_node->child_nodes();
123 for ($j = 0; $j < count($td_childs); $j++) {
124 $a_td_node->remove_child($td_childs[$j]);
136 $parent_tr = $td->parent_node();
137 $parent_tr->unlink($parent_tr);
153 $col_nr = array_pop($parts);
156 $parent_tr = $td->parent_node();
157 $parent_table = $parent_tr->parent_node();
160 $rows = $parent_table->child_nodes();
162 if (
$rows[
$i]->node_name() ==
"TableRow") {
164 $tds =
$rows[
$i]->child_nodes();
165 $new_td = $tds[$col_nr]->clone_node(
true);
167 if ($new_td->has_attribute(
"PCID")) {
168 $new_td->remove_attribute(
"PCID");
172 if ($next_td = $tds[$col_nr]->next_sibling()) {
173 $new_td = $next_td->insert_before($new_td, $next_td);
175 $new_td =
$rows[
$i]->append_child($new_td);
194 $col_nr = array_pop($parts);
197 $parent_tr = $td->parent_node();
198 $parent_table = $parent_tr->parent_node();
201 $rows = $parent_table->child_nodes();
203 if (
$rows[
$i]->node_name() ==
"TableRow") {
205 $tds =
$rows[
$i]->child_nodes();
206 $new_td = $tds[$col_nr]->clone_node(
true);
208 if ($new_td->has_attribute(
"PCID")) {
209 $new_td->remove_attribute(
"PCID");
213 $new_td = $tds[$col_nr]->insert_before($new_td, $tds[$col_nr]);
231 $col_nr = array_pop($parts);
234 $parent_tr = $td->parent_node();
235 $parent_table = $parent_tr->parent_node();
238 $rows = $parent_table->child_nodes();
240 if (
$rows[
$i]->node_name() ==
"TableRow") {
242 $tds =
$rows[
$i]->child_nodes();
243 $tds[$col_nr]->unlink($tds[$col_nr]);
256 $tr = $td->parent_node();
257 $next = $tr->next_sibling();
258 $next_copy = $next->clone_node(
true);
259 $next_copy = $tr->insert_before($next_copy, $tr);
260 $next->unlink($next);
271 $tr = $td->parent_node();
272 $prev = $tr->previous_sibling();
273 $tr_copy = $tr->clone_node(
true);
274 $tr_copy = $prev->insert_before($tr_copy, $prev);
290 $col_nr = array_pop($parts);
293 $parent_tr = $td->parent_node();
294 $parent_table = $parent_tr->parent_node();
297 $rows = $parent_table->child_nodes();
299 if (
$rows[
$i]->node_name() ==
"TableRow") {
300 $tds =
$rows[
$i]->child_nodes();
303 $next = $td->next_sibling();
304 $next_copy = $next->clone_node(
true);
305 $next_copy = $td->insert_before($next_copy, $td);
306 $next->unlink($next);
323 $col_nr = array_pop($parts);
326 $parent_tr = $td->parent_node();
327 $parent_table = $parent_tr->parent_node();
330 $rows = $parent_table->child_nodes();
332 if (
$rows[
$i]->node_name() ==
"TableRow") {
333 $tds =
$rows[
$i]->child_nodes();
335 $prev = $td->previous_sibling();
336 $td_copy = $td->clone_node(
true);
337 $td_copy = $prev->insert_before($td_copy, $prev);
350 $tr = $td->parent_node();
351 $table = $tr->parent_node();
352 $this->table_pc_node = $table->parent_node();
360 include_once(
"./Services/COPage/classes/class.ilPCTable.php");
362 $table_obj->setNode($this->table_pc_node);
363 $table_obj->readHierId();
364 $table_obj->readPCId();
365 $table_obj->fixHideAndSpans();
An exception for terminatinating execution or to throw for unit testing.
deleteRowContent(&$a_row_node)
delete content of cells of a row (not the cells itself)
newRowBefore()
insert new row after cell
moveColLeft()
move column left
fixHideAndSpans()
Fix hide attribute and spans.
init()
Init page content component.
newRowAfter()
insert new row after cell
deleteTDContent(&$a_td_node)
delete content of a cell (not the cell itself)
deleteCol()
delete column of cell
deleteRow()
delete row of cell
moveRowDown()
move row down
moveColRight()
move column right
initTablePCNode()
Table PC Node.
newColBefore()
insert new column before cell
newColAfter()
insert new column after cell
getHierId()
Get hierarchical id.
& getNode()
Get xml node of page content.
setType($a_type)
Set Type.