ILIAS  release_8 Revision v8.24
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 ()
 Init object. More...
 
 newRowAfter ()
 
 newRowBefore ()
 
 deleteRowContent (php4DOMElement $a_row_node)
 delete content of cells of a row (not the cells itself) More...
 
 deleteTDContent (php4DOMElement $a_td_node)
 delete content of a cell (not the cell itself) More...
 
 deleteRow ()
 
 newColAfter ()
 
 newColBefore ()
 
 deleteCol ()
 
 moveRowDown ()
 
 moveRowUp ()
 
 moveColRight ()
 
 moveColLeft ()
 
 initTablePCNode ()
 
 fixHideAndSpans ()
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 getNode ()
 
 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...
 
 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

php4DOMElement $table_pc_node
 
- Protected Attributes inherited from ilPageContent
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContent
static incEdId (string $ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId (string $ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
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 = ""
 
php4DOMElement $node = null
 
php4DOMDocument $dom = null
 
string $page_lang = ""
 
- Protected Member Functions inherited from ilPageContent
 setType (string $a_type)
 Set Type. More...
 

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 184 of file class.ilPCTableData.php.

184 : void
185 {
186 $this->initTablePCNode();
187 $td = $this->getNode();
188
189 // determine current column nr
190 $hier_id = $this->getHierId();
191 $parts = explode("_", $hier_id);
192 $col_nr = array_pop($parts);
193 $col_nr--;
194
195 $parent_tr = $td->parent_node();
196 $parent_table = $parent_tr->parent_node();
197
198 // iterate all table rows
199 $rows = $parent_table->child_nodes();
200 for ($i = 0; $i < count($rows); $i++) {
201 if ($rows[$i]->node_name() == "TableRow") {
202 // unlink td at $col_nr
203 $tds = $rows[$i]->child_nodes();
204 $tds[$col_nr]->unlink($tds[$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:64
$i
Definition: metadata.php:41
$rows
Definition: xhr_table.php:10

References $i, $parts, and $rows.

◆ deleteRow()

ilPCTableData::deleteRow ( )

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

104 : void
105 {
106 $this->initTablePCNode();
107 $td = $this->getNode();
108 $parent_tr = $td->parent_node();
109 $parent_tr->unlink($parent_tr);
110 $this->fixHideAndSpans();
111 }

◆ deleteRowContent()

ilPCTableData::deleteRowContent ( php4DOMElement  $a_row_node)

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

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

78 : void {
79 // remove td content of row
80 $tds = $a_row_node->child_nodes();
81 for ($i = 0; $i < count($tds); $i++) {
82 if ($tds[$i]->has_attribute("PCID")) {
83 $tds[$i]->remove_attribute("PCID");
84 }
85 $td_childs = $tds[$i]->child_nodes();
86 for ($j = 0; $j < count($td_childs); $j++) {
87 $tds[$i]->remove_child($td_childs[$j]);
88 }
89 }
90 }

Referenced by newRowAfter(), and newRowBefore().

+ Here is the caller graph for this function:

◆ deleteTDContent()

ilPCTableData::deleteTDContent ( php4DOMElement  $a_td_node)

delete content of a cell (not the cell itself)

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

97 : void {
98 $td_childs = $a_td_node->child_nodes();
99 for ($j = 0; $j < count($td_childs); $j++) {
100 $a_td_node->remove_child($td_childs[$j]);
101 }
102 }
remove_child($oldchild)

◆ fixHideAndSpans()

ilPCTableData::fixHideAndSpans ( )

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

301 : void
302 {
303 $table_obj = new ilPCTable($this->getPage());
304 $table_obj->setNode($this->table_pc_node);
305 $table_obj->readHierId();
306 $table_obj->readPCId();
307 $table_obj->fixHideAndSpans();
308 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by newRowAfter(), and newRowBefore().

+ Here is the caller graph for this function:

◆ init()

ilPCTableData::init ( )

Init object.

This function must be overwritten and at least set the content type.

Reimplemented from ilPageContent.

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

27 : void
28 {
29 $this->setType("td");
30 }
setType(string $a_type)
Set Type.

References ilPageContent\setType().

+ Here is the call graph for this function:

◆ initTablePCNode()

ilPCTableData::initTablePCNode ( )

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

293 : void
294 {
295 $td = $this->getNode();
296 $tr = $td->parent_node();
297 $table = $tr->parent_node();
298 $this->table_pc_node = $table->parent_node();
299 }

Referenced by newRowAfter(), and newRowBefore().

+ Here is the caller graph for this function:

◆ moveColLeft()

ilPCTableData::moveColLeft ( )

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

264 : void
265 {
266 $this->initTablePCNode();
267 $td = $this->getNode();
268
269 // determine current column nr
270 $hier_id = $this->getHierId();
271 $parts = explode("_", $hier_id);
272 $col_nr = array_pop($parts);
273 $col_nr--;
274
275 $parent_tr = $td->parent_node();
276 $parent_table = $parent_tr->parent_node();
277
278 // iterate all table rows
279 $rows = $parent_table->child_nodes();
280 for ($i = 0; $i < count($rows); $i++) {
281 if ($rows[$i]->node_name() == "TableRow") {
282 $tds = $rows[$i]->child_nodes();
283 $td = $tds[$col_nr];
284 $prev = $td->previous_sibling();
285 $td_copy = $td->clone_node(true);
286 $td_copy = $prev->insert_before($td_copy, $prev);
287 $td->unlink($td);
288 }
289 }
290 $this->fixHideAndSpans();
291 }

References $i, $parts, and $rows.

◆ moveColRight()

ilPCTableData::moveColRight ( )

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

234 : void
235 {
236 $this->initTablePCNode();
237 $td = $this->getNode();
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->parent_node();
246 $parent_table = $parent_tr->parent_node();
247
248 // iterate all table rows
249 $rows = $parent_table->child_nodes();
250 for ($i = 0; $i < count($rows); $i++) {
251 if ($rows[$i]->node_name() == "TableRow") {
252 $tds = $rows[$i]->child_nodes();
253 $td = $tds[$col_nr];
254 //$td = $this->getNode();
255 $next = $td->next_sibling();
256 $next_copy = $next->clone_node(true);
257 $next_copy = $td->insert_before($next_copy, $td);
258 $next->unlink($next);
259 }
260 }
261 $this->fixHideAndSpans();
262 }

References $i, $parts, and $rows.

◆ moveRowDown()

ilPCTableData::moveRowDown ( )

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

210 : void
211 {
212 $this->initTablePCNode();
213 $td = $this->getNode();
214 $tr = $td->parent_node();
215 $next = $tr->next_sibling();
216 $next_copy = $next->clone_node(true);
217 $next_copy = $tr->insert_before($next_copy, $tr);
218 $next->unlink($next);
219 $this->fixHideAndSpans();
220 }

◆ moveRowUp()

ilPCTableData::moveRowUp ( )

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

222 : void
223 {
224 $this->initTablePCNode();
225 $td = $this->getNode();
226 $tr = $td->parent_node();
227 $prev = $tr->previous_sibling();
228 $tr_copy = $tr->clone_node(true);
229 $tr_copy = $prev->insert_before($tr_copy, $prev);
230 $tr->unlink($tr);
231 $this->fixHideAndSpans();
232 }

◆ newColAfter()

ilPCTableData::newColAfter ( )

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

113 : void
114 {
115 $this->initTablePCNode();
116 $td = $this->getNode();
117
118 // determine current column nr
119 $hier_id = $this->getHierId();
120 $parts = explode("_", $hier_id);
121 $col_nr = array_pop($parts);
122 $col_nr--;
123
124 $parent_tr = $td->parent_node();
125 $parent_table = $parent_tr->parent_node();
126
127 // iterate all table rows
128 $rows = $parent_table->child_nodes();
129 for ($i = 0; $i < count($rows); $i++) {
130 if ($rows[$i]->node_name() == "TableRow") {
131 // clone td at $col_nr
132 $tds = $rows[$i]->child_nodes();
133 $new_td = $tds[$col_nr]->clone_node(true);
134
135 if ($new_td->has_attribute("PCID")) {
136 $new_td->remove_attribute("PCID");
137 }
138
139 // insert clone after $col_nr
140 if ($next_td = $tds[$col_nr]->next_sibling()) {
141 $new_td = $next_td->insert_before($new_td, $next_td);
142 } else {
143 $new_td = $rows[$i]->append_child($new_td);
144 }
145 $this->deleteTDContent($new_td);
146 }
147 }
148 $this->fixHideAndSpans();
149 }
deleteTDContent(php4DOMElement $a_td_node)
delete content of a cell (not the cell itself)

References $i, $parts, and $rows.

◆ newColBefore()

ilPCTableData::newColBefore ( )

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

151 : void
152 {
153 $this->initTablePCNode();
154 $td = $this->getNode();
155
156 // determine current column nr
157 $hier_id = $this->getHierId();
158 $parts = explode("_", $hier_id);
159 $col_nr = array_pop($parts);
160 $col_nr--;
161 $parent_tr = $td->parent_node();
162 $parent_table = $parent_tr->parent_node();
163
164 // iterate all table rows
165 $rows = $parent_table->child_nodes();
166 for ($i = 0; $i < count($rows); $i++) {
167 if ($rows[$i]->node_name() == "TableRow") {
168 // clone td at $col_nr
169 $tds = $rows[$i]->child_nodes();
170 $new_td = $tds[$col_nr]->clone_node(true);
171
172 if ($new_td->has_attribute("PCID")) {
173 $new_td->remove_attribute("PCID");
174 }
175
176 // insert clone before $col_nr
177 $new_td = $tds[$col_nr]->insert_before($new_td, $tds[$col_nr]);
178 $this->deleteTDContent($new_td);
179 }
180 }
181 $this->fixHideAndSpans();
182 }

References $i, $parts, and $rows.

◆ newRowAfter()

ilPCTableData::newRowAfter ( )

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

32 : void
33 {
34 $this->initTablePCNode();
35 $td = $this->getNode();
36 $parent_tr = $td->parent_node();
37 $new_tr = $parent_tr->clone_node(true);
38
39 // remove pc ids
40 if ($new_tr->has_attribute("PCID")) {
41 $new_tr->remove_attribute("PCID");
42 }
43 if ($next_tr = $parent_tr->next_sibling()) {
44 $new_tr = $next_tr->insert_before($new_tr, $next_tr);
45 } else {
46 $parent_table = $parent_tr->parent_node();
47 $new_tr = $parent_table->append_child($new_tr);
48 }
49
50 // remove td content of new row
51 $this->deleteRowContent($new_tr);
52 $this->fixHideAndSpans();
53 }
deleteRowContent(php4DOMElement $a_row_node)
delete content of cells of a row (not the cells itself)

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

+ Here is the call graph for this function:

◆ newRowBefore()

ilPCTableData::newRowBefore ( )

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

56 : void
57 {
58 $this->initTablePCNode();
59 $td = $this->getNode();
60 $parent_tr = $td->parent_node();
61 $new_tr = $parent_tr->clone_node(true);
62 $new_tr = $parent_tr->insert_before($new_tr, $parent_tr);
63 if ($new_tr->has_attribute("PCID")) {
64 $new_tr->remove_attribute("PCID");
65 }
66
67 // remove td content of new row
68 $this->deleteRowContent($new_tr);
69 $this->fixHideAndSpans();
70 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $table_pc_node

php4DOMElement 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: