ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilPCTableData Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 init ()
 
 newRowAfter (int $cnt=1)
 
 newRowBefore (int $cnt=1)
 
 deleteRowContent (DOMNode $a_row_node)
 delete content of cells of a row (not the cells itself) More...
 
 deleteTDContent (DOMNode $a_td_node)
 delete content of a cell (not the cell itself) More...
 
 deleteRow ()
 
 newColAfter (int $cnt=1)
 
 newColBefore (int $cnt=1)
 
 deleteCol ()
 
 moveRowDown ()
 
 moveRowUp ()
 
 moveColRight ()
 
 moveColLeft ()
 
 initTablePCNode ()
 
 fixHideAndSpans ()
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj, ?PageManagerInterface $page_manager=null, ?ObjectAdapterInterface $object_adapter=null)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 getDomNode ()
 
 getDomDoc ()
 
 setDomNode (DOMNode $node)
 
 getChildNode ()
 
 getJavascriptFiles (string $a_mode)
 
 getCssFiles (string $a_mode)
 
 getOnloadCode (string $a_mode)
 
 setHierId (string $a_hier_id)
 
 getHierId ()
 
 lookupHierId ()
 
 readHierId ()
 
 setPcId (string $a_pcid)
 
 getPCId ()
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setProfileBackUrl (string $url)
 
 getProfileBackUrl ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 readPCId ()
 
 writePCId (string $a_pc_id)
 
 setEnabled (string $value)
 Set Enabled value for page content component. More...
 
 enable ()
 
 disable ()
 
 isEnabled ()
 
 createPageContentNode (bool $a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 getNewPageContentNode ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model as needed for the front-end editor. More...
 

Protected Attributes

DOMNode $table_pc_node
 
- Protected Attributes inherited from ilPageContent
DOMDocument $dom_doc
 
ILIAS COPage InternalDomainService $domain
 
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 
ILIAS COPage Dom DomUtil $dom_util
 
PageManagerInterface $page_manager = null
 
ObjectAdapterInterface $object = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContent
static sortHierIds (array $a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId (string $a, string $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, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. More...
 
static afterRepositoryCopy (ilPageObject $page, array $mapping, int $source_ref_id)
 After repository (container) copy action. More...
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 Overwrite in derived classes, if old history entries are being deleted. More...
 
- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = null
 
string $page_lang = ""
 
- Protected Member Functions inherited from ilPageContent
 getPageManager ()
 
 setType (string $a_type)
 Set Type. More...
 
 hasNode ()
 
 createInitialChildNode (string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Table Data content object - a table cell (see ILIAS DTD)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ deleteCol()

ilPCTableData::deleteCol ( )

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

References ilPageContent\$hier_id, $parts, fixHideAndSpans(), ilPageContent\getDomNode(), ilPageContent\getHierId(), and initTablePCNode().

185  : void
186  {
187  $this->initTablePCNode();
188  $td = $this->getDomNode();
189 
190  // determine current column nr
191  $hier_id = $this->getHierId();
192  $parts = explode("_", $hier_id);
193  $col_nr = array_pop($parts);
194  $col_nr--;
195 
196  $parent_tr = $td->parentNode;
197  $parent_table = $parent_tr->parentNode;
198 
199  // iterate all table rows
200  foreach ($parent_table->childNodes as $row) {
201  if ($row->nodeName == "TableRow") {
202  // unlink td at $col_nr
203  $tds = $row->childNodes;
204  $tds->item($col_nr)->parentNode->removeChild($tds->item($col_nr));
205  }
206  }
207  $this->fixHideAndSpans();
208  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
+ Here is the call graph for this function:

◆ deleteRow()

ilPCTableData::deleteRow ( )

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

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

101  : void
102  {
103  $this->initTablePCNode();
104  $td = $this->getDomNode();
105  $parent_tr = $td->parentNode;
106  $parent_tr->parentNode->removeChild($parent_tr);
107  $this->fixHideAndSpans();
108  }
+ Here is the call graph for this function:

◆ deleteRowContent()

ilPCTableData::deleteRowContent ( DOMNode  $a_row_node)

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

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

Referenced by newRowAfter(), and newRowBefore().

82  : void {
83  // remove td content of row
84  foreach ($a_row_node->childNodes as $td) {
85  if ($td->hasAttribute("PCID")) {
86  $td->removeAttribute("PCID");
87  }
88  $this->dom_util->deleteAllChilds($td);
89  }
90  }
+ Here is the caller graph for this function:

◆ deleteTDContent()

ilPCTableData::deleteTDContent ( DOMNode  $a_td_node)

delete content of a cell (not the cell itself)

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

Referenced by newColAfter(), and newColBefore().

97  : void {
98  $this->dom_util->deleteAllChilds($a_td_node);
99  }
+ Here is the caller graph for this function:

◆ fixHideAndSpans()

ilPCTableData::fixHideAndSpans ( )

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

References ilPageContent\getPage().

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

298  : void
299  {
300  $table_obj = new ilPCTable($this->getPage());
301  $table_obj->setDomNode($this->table_pc_node);
302  $table_obj->readHierId();
303  $table_obj->readPCId();
304  $table_obj->fixHideAndSpans();
305  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilPCTableData::init ( )

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

References ilPageContent\setType().

27  : void
28  {
29  $this->setType("td");
30  }
setType(string $a_type)
Set Type.
+ Here is the call graph for this function:

◆ initTablePCNode()

ilPCTableData::initTablePCNode ( )

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

References ilPageContent\getDomNode().

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

290  : void
291  {
292  $td = $this->getDomNode();
293  $tr = $td->parentNode;
294  $table = $tr->parentNode;
295  $this->table_pc_node = $table->parentNode;
296  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ moveColLeft()

ilPCTableData::moveColLeft ( )

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

References ilPageContent\$hier_id, $parts, fixHideAndSpans(), ilPageContent\getDomNode(), ilPageContent\getHierId(), and initTablePCNode().

262  : void
263  {
264  $this->initTablePCNode();
265  $td = $this->getDomNode();
266 
267  // determine current column nr
268  $hier_id = $this->getHierId();
269  $parts = explode("_", $hier_id);
270  $col_nr = array_pop($parts);
271  $col_nr--;
272 
273  $parent_tr = $td->parentNode;
274  $parent_table = $parent_tr->parentNode;
275 
276  // iterate all table rows
277  foreach ($parent_table->childNodes as $row) {
278  if ($row->nodeName == "TableRow") {
279  $tds = $row->childNodes;
280  $td = $tds->item($col_nr);
281  $prev = $td->previousSibling;
282  $td_copy = $td->cloneNode(true);
283  $td_copy = $prev->parentNode->insertBefore($td_copy, $prev);
284  $td->parentNode->removeChild($td);
285  }
286  }
287  $this->fixHideAndSpans();
288  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
+ Here is the call graph for this function:

◆ moveColRight()

ilPCTableData::moveColRight ( )

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

References ilPageContent\$hier_id, $parts, fixHideAndSpans(), ilPageContent\getDomNode(), ilPageContent\getHierId(), and initTablePCNode().

234  : void
235  {
236  $this->initTablePCNode();
237  $td = $this->getDomNode();
238 
239  // determine current column nr
240  $hier_id = $this->getHierId();
241  $parts = explode("_", $hier_id);
242  $col_nr = array_pop($parts);
243  $col_nr--;
244 
245  $parent_tr = $td->parentNode;
246  $parent_table = $parent_tr->parentNode;
247 
248  // iterate all table rows
249  foreach ($parent_table->childNodes as $row) {
250  if ($row->nodeName == "TableRow") {
251  $tds = $row->childNodes;
252  $td = $tds->item($col_nr);
253  $next = $td->nextSibling;
254  $next_copy = $next->cloneNode(true);
255  $next_copy = $td->parentNode->insertBefore($next_copy, $td);
256  $next->parentNode->removeChild($next);
257  }
258  }
259  $this->fixHideAndSpans();
260  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
+ Here is the call graph for this function:

◆ moveRowDown()

ilPCTableData::moveRowDown ( )

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

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

210  : void
211  {
212  $this->initTablePCNode();
213  $td = $this->getDomNode();
214  $tr = $td->parentNode;
215  $next = $tr->nextSibling;
216  $next_copy = $next->cloneNode(true);
217  $next_copy = $tr->parentNode->insertBefore($next_copy, $tr);
218  $next->parentNode->removeChild($next);
219  $this->fixHideAndSpans();
220  }
+ Here is the call graph for this function:

◆ moveRowUp()

ilPCTableData::moveRowUp ( )

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

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

222  : void
223  {
224  $this->initTablePCNode();
225  $td = $this->getDomNode();
226  $tr = $td->parentNode;
227  $prev = $tr->previousSibling;
228  $tr_copy = $tr->cloneNode(true);
229  $tr_copy = $prev->parentNode->insertBefore($tr_copy, $prev);
230  $tr->parentNode->removeChild($tr);
231  $this->fixHideAndSpans();
232  }
+ Here is the call graph for this function:

◆ newColAfter()

ilPCTableData::newColAfter ( int  $cnt = 1)

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

References ilPageContent\$hier_id, $parts, deleteTDContent(), fixHideAndSpans(), ilPageContent\getDomNode(), ilPageContent\getHierId(), and initTablePCNode().

110  : void
111  {
112  $this->initTablePCNode();
113  $td = $this->getDomNode();
114 
115  // determine current column nr
116  $hier_id = $this->getHierId();
117  $parts = explode("_", $hier_id);
118  $col_nr = array_pop($parts);
119  $col_nr--;
120 
121  $parent_tr = $td->parentNode;
122  $parent_table = $parent_tr->parentNode;
123 
124  for ($i = 1; $i <= $cnt; $i++) {
125  // iterate all table rows
126  foreach ($parent_table->childNodes as $row) {
127  if ($row->nodeName == "TableRow") {
128  // clone td at $col_nr
129  $tds = $row->childNodes;
130  $old_td = $tds->item($col_nr);
131  $new_td = $old_td->cloneNode(true);
132 
133  if ($new_td->hasAttribute("PCID")) {
134  $new_td->removeAttribute("PCID");
135  }
136 
137  // insert clone after $col_nr
138  if ($next_td = $old_td->nextSibling) {
139  $new_td = $next_td->parentNode->insertBefore($new_td, $next_td);
140  } else {
141  $new_td = $row->appendChild($new_td);
142  }
143  $this->deleteTDContent($new_td);
144  }
145  }
146  }
147  $this->fixHideAndSpans();
148  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
deleteTDContent(DOMNode $a_td_node)
delete content of a cell (not the cell itself)
+ Here is the call graph for this function:

◆ newColBefore()

ilPCTableData::newColBefore ( int  $cnt = 1)

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

References ilPageContent\$hier_id, $parts, deleteTDContent(), fixHideAndSpans(), ilPageContent\getDomNode(), ilPageContent\getHierId(), and initTablePCNode().

150  : void
151  {
152  $this->initTablePCNode();
153  $td = $this->getDomNode();
154 
155  // determine current column nr
156  $hier_id = $this->getHierId();
157  $parts = explode("_", $hier_id);
158  $col_nr = array_pop($parts);
159  $col_nr--;
160  $parent_tr = $td->parentNode;
161  $parent_table = $parent_tr->parentNode;
162 
163  for ($i = 1; $i <= $cnt; $i++) {
164  // iterate all table rows
165  foreach ($parent_table->childNodes as $row) {
166  if ($row->nodeName == "TableRow") {
167  // clone td at $col_nr
168  $tds = $row->childNodes;
169  $old_td = $tds->item($col_nr);
170  $new_td = $old_td->cloneNode(true);
171 
172  if ($new_td->hasAttribute("PCID")) {
173  $new_td->removeAttribute("PCID");
174  }
175 
176  // insert clone before $col_nr
177  $new_td = $old_td->parentNode->insertBefore($new_td, $old_td);
178  $this->deleteTDContent($new_td);
179  }
180  }
181  }
182  $this->fixHideAndSpans();
183  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
deleteTDContent(DOMNode $a_td_node)
delete content of a cell (not the cell itself)
+ Here is the call graph for this function:

◆ newRowAfter()

ilPCTableData::newRowAfter ( int  $cnt = 1)

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

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

32  : void
33  {
34  $this->initTablePCNode();
35  $td = $this->getDomNode();
36  $parent_tr = $td->parentNode;
37  for ($i = 1; $i <= $cnt; $i++) {
38  $new_tr = $parent_tr->cloneNode(true);
39 
40  // remove pc ids
41  if ($new_tr->hasAttribute("PCID")) {
42  $new_tr->removeAttribute("PCID");
43  }
44  if ($next_tr = $parent_tr->nextSibling) {
45  $new_tr = $next_tr->parentNode->insertBefore($new_tr, $next_tr);
46  } else {
47  $parent_table = $parent_tr->parentNode;
48  $new_tr = $parent_table->appendChild($new_tr);
49  }
50 
51  // remove td content of new row
52  $this->deleteRowContent($new_tr);
53  }
54  $this->fixHideAndSpans();
55  }
deleteRowContent(DOMNode $a_row_node)
delete content of cells of a row (not the cells itself)
+ Here is the call graph for this function:

◆ newRowBefore()

ilPCTableData::newRowBefore ( int  $cnt = 1)

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

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

58  : void
59  {
60  $this->initTablePCNode();
61  $td = $this->getDomNode();
62  $parent_tr = $td->parentNode;
63  for ($i = 1; $i <= $cnt; $i++) {
64  $new_tr = $parent_tr->cloneNode(true);
65  $new_tr = $parent_tr->parentNode->insertBefore($new_tr, $parent_tr);
66  if ($new_tr->hasAttribute("PCID")) {
67  $new_tr->removeAttribute("PCID");
68  }
69 
70  // remove td content of new row
71  $this->deleteRowContent($new_tr);
72  }
73  $this->fixHideAndSpans();
74  }
deleteRowContent(DOMNode $a_row_node)
delete content of cells of a row (not the cells itself)
+ Here is the call graph for this function:

Field Documentation

◆ $table_pc_node

DOMNode ilPCTableData::$table_pc_node
protected

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


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