ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPCTableData Class Reference

Class ilPCTableData. More...

+ Inheritance diagram for ilPCTableData:
+ Collaboration diagram for ilPCTableData:

Public Member Functions

 init ()
 Init page content component. More...
 
 newRowAfter ()
 insert new row after cell More...
 
 newRowBefore ()
 insert new row after cell More...
 
 deleteRowContent (&$a_row_node)
 delete content of cells of a row (not the cells itself) More...
 
 deleteTDContent (&$a_td_node)
 delete content of a cell (not the cell itself) More...
 
 deleteRow ()
 delete row of cell More...
 
 newColAfter ()
 insert new column after cell More...
 
 newColBefore ()
 insert new column before cell More...
 
 deleteCol ()
 delete column of cell More...
 
 moveRowDown ()
 move row down More...
 
 moveRowUp ()
 move row up More...
 
 moveColRight ()
 move column right More...
 
 moveColLeft ()
 move column left More...
 
 initTablePCNode ()
 Table PC Node. More...
 
 fixHideAndSpans ()
 Fix hide attribute and spans. More...
 
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 init ()
 Init object. More...
 
 getType ()
 Get type of page content. More...
 
 setNode ($a_node)
 Set xml node of page content. More...
 
getNode ()
 Get xml node of page content. More...
 
 getJavascriptFiles ($a_mode)
 Get Javascript files. More...
 
 getCssFiles ($a_mode)
 Get css files. More...
 
 getOnloadCode ($a_mode)
 Get on load code. More...
 
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure. More...
 
 getHierId ()
 Get hierarchical id. More...
 
 lookupHierId ()
 Get hierarchical id from dom. More...
 
 readHierId ()
 Read PC Id. More...
 
 setPcId ($a_pcid)
 Set PC Id. More...
 
 getPCId ()
 Get PC Id. More...
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. More...
 
 setEnabled ($value)
 Set Enabled value for page content component. More...
 
 enable ()
 Enable page content. More...
 
 disable ()
 Disable page content. More...
 
 isEnabled ()
 Check whether page content is enabled. More...
 
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl ($a_output, $a_mode)
 Modify page content after xsl. More...
 

Data Fields

 $dom
 
- Data Fields inherited from ilPageContent
 $hier_id
 
 $node
 
 $dom
 
 $page_lang
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContent
static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container. More...
 
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 
- Protected Attributes inherited from ilPageContent
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

Detailed Description

Class ilPCTableData.

Table Data content object - a table cell (see ILIAS DTD)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 36 of file class.ilPCTableData.php.

Member Function Documentation

◆ deleteCol()

ilPCTableData::deleteCol ( )

delete column of cell

Definition at line 223 of file class.ilPCTableData.php.

References ilPageContent\$hier_id, $i, $rows, fixHideAndSpans(), ilPageContent\getHierId(), ilPageContent\getNode(), and initTablePCNode().

224  {
225  $this->initTablePCNode();
226  $td = $this->getNode();
227 
228  // determine current column nr
229  $hier_id = $this->getHierId();
230  $parts = explode("_", $hier_id);
231  $col_nr = array_pop($parts);
232  $col_nr--;
233 
234  $parent_tr = $td->parent_node();
235  $parent_table = $parent_tr->parent_node();
236 
237  // iterate all table rows
238  $rows = $parent_table->child_nodes();
239  for ($i=0; $i<count($rows); $i++) {
240  if ($rows[$i]->node_name() == "TableRow") {
241  // unlink td at $col_nr
242  $tds = $rows[$i]->child_nodes();
243  $tds[$col_nr]->unlink($tds[$col_nr]);
244  }
245  }
246  $this->fixHideAndSpans();
247  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
getHierId()
Get hierarchical id.
$rows
Definition: xhr_table.php:10
initTablePCNode()
Table PC Node.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ deleteRow()

ilPCTableData::deleteRow ( )

delete row of cell

Definition at line 132 of file class.ilPCTableData.php.

References fixHideAndSpans(), ilPageContent\getNode(), and initTablePCNode().

133  {
134  $this->initTablePCNode();
135  $td = $this->getNode();
136  $parent_tr = $td->parent_node();
137  $parent_tr->unlink($parent_tr);
138  $this->fixHideAndSpans();
139  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
initTablePCNode()
Table PC Node.
+ Here is the call graph for this function:

◆ deleteRowContent()

ilPCTableData::deleteRowContent ( $a_row_node)

delete content of cells of a row (not the cells itself)

private

Definition at line 100 of file class.ilPCTableData.php.

References $i.

Referenced by newRowAfter(), and newRowBefore().

101  {
102  // remove td content of row
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");
107  }
108  $td_childs = $tds[$i]->child_nodes();
109  for ($j=0; $j<count($td_childs); $j++) {
110  $tds[$i]->remove_child($td_childs[$j]);
111  }
112  }
113  }
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ deleteTDContent()

ilPCTableData::deleteTDContent ( $a_td_node)

delete content of a cell (not the cell itself)

private

Definition at line 120 of file class.ilPCTableData.php.

Referenced by newColAfter(), and newColBefore().

121  {
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]);
125  }
126  }
+ Here is the caller graph for this function:

◆ fixHideAndSpans()

ilPCTableData::fixHideAndSpans ( )

Fix hide attribute and spans.

Definition at line 358 of file class.ilPCTableData.php.

References ilPageContent\getPage().

Referenced by deleteCol(), deleteRow(), moveColLeft(), moveColRight(), moveRowDown(), moveRowUp(), newColAfter(), newColBefore(), newRowAfter(), and newRowBefore().

359  {
360  include_once("./Services/COPage/classes/class.ilPCTable.php");
361  $table_obj = new ilPCTable($this->getPage());
362  $table_obj->setNode($this->table_pc_node);
363  $table_obj->readHierId();
364  $table_obj->readPCId();
365  $table_obj->fixHideAndSpans();
366  }
Class ilPCTable.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilPCTableData::init ( )

Init page content component.

Definition at line 43 of file class.ilPCTableData.php.

References ilPageContent\setType().

44  {
45  $this->setType("td");
46  }
setType($a_type)
Set Type.
+ Here is the call graph for this function:

◆ initTablePCNode()

ilPCTableData::initTablePCNode ( )

Table PC Node.

Definition at line 347 of file class.ilPCTableData.php.

References $table, and ilPageContent\getNode().

Referenced by deleteCol(), deleteRow(), moveColLeft(), moveColRight(), moveRowDown(), moveRowUp(), newColAfter(), newColBefore(), newRowAfter(), and newRowBefore().

348  {
349  $td = $this->getNode();
350  $tr = $td->parent_node();
351  $table = $tr->parent_node();
352  $this->table_pc_node = $table->parent_node();
353  }
& getNode()
Get xml node of page content.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveColLeft()

ilPCTableData::moveColLeft ( )

move column left

Definition at line 315 of file class.ilPCTableData.php.

References ilPageContent\$hier_id, $i, $rows, fixHideAndSpans(), ilPageContent\getHierId(), ilPageContent\getNode(), and initTablePCNode().

316  {
317  $this->initTablePCNode();
318  $td = $this->getNode();
319 
320  // determine current column nr
321  $hier_id = $this->getHierId();
322  $parts = explode("_", $hier_id);
323  $col_nr = array_pop($parts);
324  $col_nr--;
325 
326  $parent_tr = $td->parent_node();
327  $parent_table = $parent_tr->parent_node();
328 
329  // iterate all table rows
330  $rows = $parent_table->child_nodes();
331  for ($i=0; $i<count($rows); $i++) {
332  if ($rows[$i]->node_name() == "TableRow") {
333  $tds = $rows[$i]->child_nodes();
334  $td = $tds[$col_nr];
335  $prev = $td->previous_sibling();
336  $td_copy = $td->clone_node(true);
337  $td_copy = $prev->insert_before($td_copy, $prev);
338  $td->unlink($td);
339  }
340  }
341  $this->fixHideAndSpans();
342  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
getHierId()
Get hierarchical id.
$rows
Definition: xhr_table.php:10
initTablePCNode()
Table PC Node.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ moveColRight()

ilPCTableData::moveColRight ( )

move column right

Definition at line 282 of file class.ilPCTableData.php.

References ilPageContent\$hier_id, $i, $rows, fixHideAndSpans(), ilPageContent\getHierId(), ilPageContent\getNode(), and initTablePCNode().

283  {
284  $this->initTablePCNode();
285  $td = $this->getNode();
286 
287  // determine current column nr
288  $hier_id = $this->getHierId();
289  $parts = explode("_", $hier_id);
290  $col_nr = array_pop($parts);
291  $col_nr--;
292 
293  $parent_tr = $td->parent_node();
294  $parent_table = $parent_tr->parent_node();
295 
296  // iterate all table rows
297  $rows = $parent_table->child_nodes();
298  for ($i=0; $i<count($rows); $i++) {
299  if ($rows[$i]->node_name() == "TableRow") {
300  $tds = $rows[$i]->child_nodes();
301  $td = $tds[$col_nr];
302  //$td = $this->getNode();
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);
307  }
308  }
309  $this->fixHideAndSpans();
310  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
getHierId()
Get hierarchical id.
$rows
Definition: xhr_table.php:10
initTablePCNode()
Table PC Node.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

◆ moveRowDown()

ilPCTableData::moveRowDown ( )

move row down

Definition at line 252 of file class.ilPCTableData.php.

References fixHideAndSpans(), ilPageContent\getNode(), and initTablePCNode().

253  {
254  $this->initTablePCNode();
255  $td = $this->getNode();
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);
261  $this->fixHideAndSpans();
262  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
initTablePCNode()
Table PC Node.
+ Here is the call graph for this function:

◆ moveRowUp()

ilPCTableData::moveRowUp ( )

move row up

Definition at line 267 of file class.ilPCTableData.php.

References fixHideAndSpans(), ilPageContent\getNode(), and initTablePCNode().

268  {
269  $this->initTablePCNode();
270  $td = $this->getNode();
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);
275  $tr->unlink($tr);
276  $this->fixHideAndSpans();
277  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
initTablePCNode()
Table PC Node.
+ Here is the call graph for this function:

◆ newColAfter()

ilPCTableData::newColAfter ( )

insert new column after cell

Definition at line 145 of file class.ilPCTableData.php.

References ilPageContent\$hier_id, $i, $rows, deleteTDContent(), fixHideAndSpans(), ilPageContent\getHierId(), ilPageContent\getNode(), and initTablePCNode().

146  {
147  $this->initTablePCNode();
148  $td = $this->getNode();
149 
150  // determine current column nr
151  $hier_id = $this->getHierId();
152  $parts = explode("_", $hier_id);
153  $col_nr = array_pop($parts);
154  $col_nr--;
155 
156  $parent_tr = $td->parent_node();
157  $parent_table = $parent_tr->parent_node();
158 
159  // iterate all table rows
160  $rows = $parent_table->child_nodes();
161  for ($i=0; $i<count($rows); $i++) {
162  if ($rows[$i]->node_name() == "TableRow") {
163  // clone td at $col_nr
164  $tds = $rows[$i]->child_nodes();
165  $new_td = $tds[$col_nr]->clone_node(true);
166 
167  if ($new_td->has_attribute("PCID")) {
168  $new_td->remove_attribute("PCID");
169  }
170 
171  // insert clone after $col_nr
172  if ($next_td = $tds[$col_nr]->next_sibling()) {
173  $new_td = $next_td->insert_before($new_td, $next_td);
174  } else {
175  $new_td = $rows[$i]->append_child($new_td);
176  }
177  $this->deleteTDContent($new_td);
178  }
179  }
180  $this->fixHideAndSpans();
181  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
getHierId()
Get hierarchical id.
$rows
Definition: xhr_table.php:10
initTablePCNode()
Table PC Node.
$i
Definition: disco.tpl.php:19
deleteTDContent(&$a_td_node)
delete content of a cell (not the cell itself)
+ Here is the call graph for this function:

◆ newColBefore()

ilPCTableData::newColBefore ( )

insert new column before cell

Definition at line 186 of file class.ilPCTableData.php.

References ilPageContent\$hier_id, $i, $rows, deleteTDContent(), fixHideAndSpans(), ilPageContent\getHierId(), ilPageContent\getNode(), and initTablePCNode().

187  {
188  $this->initTablePCNode();
189  $td = $this->getNode();
190 
191  // determine current column nr
192  $hier_id = $this->getHierId();
193  $parts = explode("_", $hier_id);
194  $col_nr = array_pop($parts);
195  $col_nr--;
196 
197  $parent_tr = $td->parent_node();
198  $parent_table = $parent_tr->parent_node();
199 
200  // iterate all table rows
201  $rows = $parent_table->child_nodes();
202  for ($i=0; $i<count($rows); $i++) {
203  if ($rows[$i]->node_name() == "TableRow") {
204  // clone td at $col_nr
205  $tds = $rows[$i]->child_nodes();
206  $new_td = $tds[$col_nr]->clone_node(true);
207 
208  if ($new_td->has_attribute("PCID")) {
209  $new_td->remove_attribute("PCID");
210  }
211 
212  // insert clone before $col_nr
213  $new_td = $tds[$col_nr]->insert_before($new_td, $tds[$col_nr]);
214  $this->deleteTDContent($new_td);
215  }
216  }
217  $this->fixHideAndSpans();
218  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
getHierId()
Get hierarchical id.
$rows
Definition: xhr_table.php:10
initTablePCNode()
Table PC Node.
$i
Definition: disco.tpl.php:19
deleteTDContent(&$a_td_node)
delete content of a cell (not the cell itself)
+ Here is the call graph for this function:

◆ newRowAfter()

ilPCTableData::newRowAfter ( )

insert new row after cell

Definition at line 51 of file class.ilPCTableData.php.

References deleteRowContent(), fixHideAndSpans(), ilPageContent\getNode(), and initTablePCNode().

52  {
53  $this->initTablePCNode();
54  $td = $this->getNode();
55  $parent_tr = $td->parent_node();
56  $new_tr = $parent_tr->clone_node(true);
57 
58  // remove pc ids
59  if ($new_tr->has_attribute("PCID")) {
60  $new_tr->remove_attribute("PCID");
61  }
62  if ($next_tr = $parent_tr->next_sibling()) {
63  $new_tr = $next_tr->insert_before($new_tr, $next_tr);
64  } else {
65  $parent_table = $parent_tr->parent_node();
66  $new_tr = $parent_table->append_child($new_tr);
67  }
68 
69  // remove td content of new row
70  $this->deleteRowContent($new_tr);
71  $this->fixHideAndSpans();
72  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
deleteRowContent(&$a_row_node)
delete content of cells of a row (not the cells itself)
initTablePCNode()
Table PC Node.
+ Here is the call graph for this function:

◆ newRowBefore()

ilPCTableData::newRowBefore ( )

insert new row after cell

Definition at line 78 of file class.ilPCTableData.php.

References deleteRowContent(), fixHideAndSpans(), ilPageContent\getNode(), and initTablePCNode().

79  {
80  $this->initTablePCNode();
81  $td = $this->getNode();
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");
87  }
88 
89  // remove td content of new row
90  $this->deleteRowContent($new_tr);
91  $this->fixHideAndSpans();
92  }
& getNode()
Get xml node of page content.
fixHideAndSpans()
Fix hide attribute and spans.
deleteRowContent(&$a_row_node)
delete content of cells of a row (not the cells itself)
initTablePCNode()
Table PC Node.
+ Here is the call graph for this function:

Field Documentation

◆ $dom

ilPCTableData::$dom

Definition at line 38 of file class.ilPCTableData.php.


The documentation for this class was generated from the following file: