ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilPCTableGUI.php
Go to the documentation of this file.
1 <?php
2 
27 {
28  protected \ILIAS\COPage\Dom\DomUtil $dom_util;
29  protected \ILIAS\COPage\PC\PCDefinition $pc_definition;
30  protected \ILIAS\COPage\Xsl\XslManager $xsl;
32  protected ilTabsGUI $tabs;
33  protected ilObjUser $user;
34 
35  public function __construct(
36  ilPageObject $a_pg_obj,
37  ?ilPageContent $a_content_obj,
38  string $a_hier_id,
39  string $a_pc_id = ""
40  ) {
41  global $DIC;
42 
43  $this->tabs = $DIC->tabs();
44  $this->ctrl = $DIC->ctrl();
45  $this->lng = $DIC->language();
46  $this->tpl = $DIC["tpl"];
47  $this->user = $DIC->user();
48  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
49  $this->setCharacteristics(array("StandardTable" => $this->lng->txt("cont_StandardTable")));
50  $this->tool_context = $DIC->globalScreen()->tool()->context();
51  $this->xsl = $DIC->copage()->internal()->domain()->xsl();
52  $this->pc_definition = $DIC
53  ->copage()
54  ->internal()
55  ->domain()
56  ->pc()
57  ->definition();
58  $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
59  }
60 
61  public function setBasicTableCellStyles(): void
62  {
63  $this->setCharacteristics(array("Cell1" => "Cell1", "Cell2" => "Cell2",
64  "Cell3" => "Cell3", "Cell4" => "Cell4"));
65  }
66 
70  public function executeCommand()
71  {
72  $this->getCharacteristicsOfCurrentStyle(["table"]); // scorm-2004
73 
74  // get next class that processes or forwards current command
75  $next_class = $this->ctrl->getNextClass($this);
76 
77  // get current command
78  $cmd = $this->ctrl->getCmd();
79 
80  switch ($next_class) {
81  default:
82  $this->$cmd();
83  break;
84  }
85  return "";
86  }
87 
88  public function setTabs(
89  string $data_tab_txt_key = ""
90  ): void {
91  $ilTabs = $this->tabs;
92  $ilCtrl = $this->ctrl;
93  $lng = $this->lng;
94 
95  $ilTabs->setBackTarget(
96  "",
97  ""
98  );
99 
100  return;
101 
102  $ilTabs->setBackTarget(
103  $lng->txt("pg"),
104  (string) $this->ctrl->getParentReturn($this)
105  );
106 
107  if ($data_tab_txt_key == "") {
108  $data_tab_txt_key = "cont_table_edit_cells";
109  }
110 
111  $ilTabs->addTarget(
112  $data_tab_txt_key,
113  $ilCtrl->getLinkTarget($this, "editData"),
114  "editData",
115  get_class($this)
116  );
117 
118  $ilTabs->addTarget(
119  "cont_table_properties",
120  $ilCtrl->getLinkTarget($this, "editProperties"),
121  "editProperties",
122  get_class($this)
123  );
124 
125  $ilTabs->addTarget(
126  "cont_table_cell_properties",
127  $ilCtrl->getLinkTarget($this, "editCellStyle"),
128  "editCellStyle",
129  get_class($this)
130  );
131  }
132 
133  public function setCellPropertiesSubTabs(): void
134  {
135  $ilTabs = $this->tabs;
136  $ilCtrl = $this->ctrl;
137 
138  $ilTabs->addSubTabTarget(
139  "cont_style",
140  $ilCtrl->getLinkTarget($this, "editCellStyle"),
141  "editCellStyle",
142  get_class($this)
143  );
144 
145  $ilTabs->addSubTabTarget(
146  "cont_width",
147  $ilCtrl->getLinkTarget($this, "editCellWidth"),
148  "editCellWidth",
149  get_class($this)
150  );
151 
152  $ilTabs->addSubTabTarget(
153  "cont_alignment",
154  $ilCtrl->getLinkTarget($this, "editCellAlignment"),
155  "editCellAlignment",
156  get_class($this)
157  );
158 
159  $ilTabs->addSubTabTarget(
160  "cont_span",
161  $ilCtrl->getLinkTarget($this, "editCellSpan"),
162  "editCellSpan",
163  get_class($this)
164  );
165  }
166 
167  public function getTemplateOptions(string $a_type = ""): array
168  {
169  return parent::getTemplateOptions("table");
170  }
171 
172  public function edit(): void
173  {
174  $this->ctrl->redirect($this, "editData");
175  }
176 
177  public function editProperties(): void
178  {
179  $tpl = $this->tpl;
180 
181  $this->displayValidationError();
182  $this->setTabs();
183 
184  $this->initPropertiesForm();
185  $this->getPropertiesFormValues();
186  $html = $this->form->getHTML();
187  $html .= "<br />" . $this->renderTable("");
188  $tpl->setContent($html);
189  }
190 
191  protected function getFormTitle(string $a_mode = "edit"): string
192  {
193  if ($a_mode === "create") {
194  return $this->lng->txt("cont_insert_table");
195  }
196  return $this->lng->txt("cont_table_properties");
197  }
198 
199  public function initPropertiesForm(
200  string $a_mode = "edit"
201  ): void {
202  $a_seleted_value = "";
203  $ilCtrl = $this->ctrl;
204  $lng = $this->lng;
205  $ilUser = $this->user;
206 
207  $this->form = new ilPropertyFormGUI();
208  $this->form->setFormAction($ilCtrl->getFormAction($this));
209  $this->form->setTitle($this->getFormTitle($a_mode));
210 
211  if ($a_mode == "create") {
212  $nr = array();
213  for ($i = 1; $i <= 20; $i++) {
214  $nr[$i] = $i;
215  }
216 
217  // cols
218  $cols = new ilSelectInputGUI($this->lng->txt("cont_nr_cols"), "nr_cols");
219  $cols->setOptions($nr);
220  $cols->setValue(2);
221  $this->form->addItem($cols);
222 
223  // rows
224  $rows = new ilSelectInputGUI($this->lng->txt("cont_nr_rows"), "nr_rows");
225  $rows->setOptions($nr);
226  $rows->setValue(2);
227  $this->form->addItem($rows);
228  }
229 
230  // width
231  $width = new ilTextInputGUI($this->lng->txt("cont_table_width"), "width");
232  $width->setSize(6);
233  $width->setMaxLength(6);
234  $this->form->addItem($width);
235 
236  /*
237  // border
238  $border = new ilTextInputGUI($this->lng->txt("cont_table_border"), "border");
239  $border->setInfo($this->lng->txt("cont_table_border_info"));
240  $border->setValue("1px");
241  $border->setSize(6);
242  $border->setMaxLength(6);
243  $this->form->addItem($border);
244 
245  // padding
246  $padding = new ilTextInputGUI($this->lng->txt("cont_table_cellpadding"), "padding");
247  $padding->setInfo($this->lng->txt("cont_table_cellpadding_info"));
248  $padding->setValue("2px");
249  $padding->setSize(6);
250  $padding->setMaxLength(6);
251  $this->form->addItem($padding);
252 
253  // spacing (deprecated, only hidden)
254  $spacing = new ilHiddenInputGUI("spacing");
255  $spacing->setValue("0px");
256  $this->form->addItem($spacing);*/
257 
258  // table templates and table classes
259  $char_prop = new ilAdvSelectInputGUI(
260  $this->lng->txt("cont_characteristic_table"),
261  "characteristic"
262  );
263  $chars = $this->getCharacteristics();
264  $templates = $this->getTemplateOptions();
265  $chars = array_merge($templates, $chars);
266  if (is_object($this->content_obj)) {
267  if (($chars[$a_seleted_value] ?? "") == "" && ($this->content_obj->getClass() != "")) {
268  $chars = array_merge(
269  array($this->content_obj->getClass() => $this->content_obj->getClass()),
270  $chars
271  );
272  }
273  }
274  foreach ($chars as $k => $char) {
275  if (strpos($k, ":") > 0) {
276  $t = explode(":", $k);
277  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both;" class="small">' . $char . "</div>";
278  } else {
279  $html = '<table class="ilc_table_' . $k . '"><tr><td class="small">' .
280  $char . '</td></tr></table>';
281  }
282  $char_prop->addOption($k, $char, $html);
283  }
284  $char_prop->setValue("StandardTable");
285  $this->form->addItem($char_prop);
286 
287  $nr = array();
288  for ($i = 0; $i <= 3; $i++) {
289  $nr[$i] = $i;
290  }
291 
292  // row header
293  $rh = new ilSelectInputGUI($this->lng->txt("cont_nr_row_header"), "row_header");
294  $rh->setOptions($nr);
295  $rh->setValue(1);
296  $this->form->addItem($rh);
297 
298  // row footer
299  $rf = new ilSelectInputGUI($this->lng->txt("cont_nr_row_footer"), "row_footer");
300  $rf->setOptions($nr);
301  $rf->setValue(0);
302  $this->form->addItem($rf);
303 
304  // col header
305  $ch = new ilSelectInputGUI($this->lng->txt("cont_nr_col_header"), "col_header");
306  $ch->setOptions($nr);
307  $ch->setValue(0);
308  $this->form->addItem($ch);
309 
310  // col footer
311  $cf = new ilSelectInputGUI($this->lng->txt("cont_nr_col_footer"), "col_footer");
312  $cf->setOptions($nr);
313  $cf->setValue(0);
314  $this->form->addItem($cf);
315 
316  if ($a_mode == "create") {
317  // first row style
318  $fr_style = new ilAdvSelectInputGUI(
319  $this->lng->txt("cont_first_row_style"),
320  "first_row_style"
321  );
322  $this->setBasicTableCellStyles();
323  $this->getCharacteristicsOfCurrentStyle(["table_cell"]);
324  $chars = $this->getCharacteristics();
325  $options = array_merge(array("" => $this->lng->txt("none")), $chars);
326  foreach ($options as $k => $option) {
327  $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' .
328  $option . '</td></tr></table>';
329  $fr_style->addOption($k, $option, $html);
330  }
331 
332  $fr_style->setValue("");
333  $this->form->addItem($fr_style);
334  }
335 
336  // alignment
337  $align_opts = array("Left" => $lng->txt("cont_left"),
338  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
339  "LeftFloat" => $lng->txt("cont_left_float"),
340  "RightFloat" => $lng->txt("cont_right_float"));
341  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
342  $align->setOptions($align_opts);
343  $align->setValue("Center");
344  $this->form->addItem($align);
345 
346  // caption
347  $caption = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
348  $caption->setSize(60);
349  $this->form->addItem($caption);
350 
351  // caption align
352  $ca_opts = array("top" => $lng->txt("cont_top"),
353  "bottom" => $lng->txt("cont_bottom"));
354  $ca = new ilSelectInputGUI(
355  $this->lng->txt("cont_align"),
356  "cap_align"
357  );
358  $ca->setOptions($ca_opts);
359  $caption->addSubItem($ca);
360 
361  // import
362  if ($a_mode == "create") {
363  // import table
364  $import = new ilRadioGroupInputGUI($this->lng->txt("cont_paste_table"), "import_type");
365  $op = new ilRadioOption($this->lng->txt("cont_html_table"), "html");
366  $import->addOption($op);
367  $op2 = new ilRadioOption($this->lng->txt("cont_spreadsheet_table"), "spreadsheet");
368 
369  $import_data = new ilTextAreaInputGUI("", "import_table");
370  $import_data->setRows(8);
371  $import_data->setCols(50);
372  $op2->addSubItem($import_data);
373 
374  $import->addOption($op2);
375  $import->setValue("html");
376  $this->form->addItem($import);
377  }
378 
379  // language
380  if ($this->getCurrentTextLang() != "") {
381  $s_lang = $this->getCurrentTextLang();
382  } else {
383  $s_lang = $ilUser->getLanguage();
384  }
386  $language = new ilSelectInputGUI($this->lng->txt("language"), "language");
387  $language->setOptions($lang);
388  $language->setValue($s_lang);
389  $this->form->addItem($language);
390 
391  if ($a_mode == "create") {
392  $this->form->addCommandButton("create_tab", $lng->txt("save"));
393  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
394  } else {
395  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
396  $this->form->addCommandButton("editData", $lng->txt("close"));
397  }
398  }
399 
400  public function getPropertiesFormValues(): void
401  {
402  $values = array();
403  $values["width"] = $this->content_obj->getWidth();
404  //$values["border"] = $this->content_obj->getBorder();
405  //$values["padding"] = $this->content_obj->getCellPadding();
406  //$values["spacing"] = $this->content_obj->getCellSpacing();
407  $values["row_header"] = $this->content_obj->getHeaderRows();
408  $values["row_footer"] = $this->content_obj->getFooterRows();
409  $values["col_header"] = $this->content_obj->getHeaderCols();
410  $values["col_footer"] = $this->content_obj->getFooterCols();
411  if ($this->content_obj->getTemplate() != "") {
412  $values["characteristic"] = "t:" .
413  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
414  $this->content_obj->getTemplate();
415  } else {
416  $values["characteristic"] = $this->content_obj->getClass();
417  }
418  $values["align"] = $this->content_obj->getHorizontalAlign();
419  $values["caption"] = $this->content_obj->getCaption();
420  $values["cap_align"] = $this->content_obj->getCaptionAlign();
421  $values["language"] = $this->content_obj->getLanguage();
422 
423  $this->form->setValuesByArray($values);
424 
425  $ca = $this->form->getItemByPostVar("cap_align");
426  $ca->setValue($this->content_obj->getCaptionAlign());
427  }
428 
429  public function renderTable(
430  string $a_mode = "table_edit",
431  string $a_submode = ""
432  ): string {
433  $template_xml = "";
434  $tab_node = $this->content_obj->getDomNode();
435  $tab_node->setAttribute("Enabled", "True");
436  $content = $this->dom_util->dump($tab_node);
437 
438  $trans = $this->pg_obj->getLanguageVariablesXML();
439  $mobs = $this->pg_obj->getMultimediaXML();
440  if ($this->getStyleId() > 0) {
441  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
442  $style = new ilObjStyleSheet($this->getStyleId());
443  $template_xml = $style->getTemplateXML();
444  }
445  }
446 
447  $content = $content . $mobs . $trans . $template_xml;
448 
450  $tab = $this->content_obj;
452  $content,
453  $a_mode,
454  $a_submode,
455  $tab,
456  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
457  $this->getPage()
458  );
459  }
460 
461  public static function _renderTable(
462  string $content,
463  string $a_mode = "table_edit",
464  string $a_submode = "",
465  ilPCTable $a_table_obj = null,
466  bool $unmask = true,
467  ilPageObject $page_object = null
468  ): string {
469  global $DIC;
470 
471  $ilUser = $DIC->user();
472  $xsl = $DIC->copage()->internal()->domain()->xsl();
473  $pc_definition = $DIC->copage()->internal()->domain()->pc()->definition();
474 
475  $content = "<dummy>" . $content . "</dummy>";
476 
477  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
478  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg");
479  $params = array('mode' => $a_mode,
480  'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
481  $output = $xsl->process($content, $params);
482 
483  // unmask user html
484  if ($unmask) {
485  $output = str_replace("&lt;", "<", $output);
486  $output = str_replace("&gt;", ">", $output);
487  $output = str_replace("&amp;", "&", $output);
488  }
489 
490  if ($a_mode == "table_edit" && !is_null($a_table_obj)) {
491  switch ($a_submode) {
492  case "style":
493  $output = ilPCTableGUI::_addStyleCheckboxes($output, $a_table_obj);
494  break;
495 
496  case "alignment":
497  $output = ilPCTableGUI::_addAlignmentCheckboxes($output, $a_table_obj);
498  break;
499 
500  case "width":
501  $output = ilPCTableGUI::_addWidthInputs($output, $a_table_obj);
502  break;
503 
504  case "span":
505  $output = ilPCTableGUI::_addSpanInputs($output, $a_table_obj);
506  break;
507  }
508  }
509 
510  // for all page components...
511  if (isset($page_object)) {
512  $defs = $pc_definition->getPCDefinitions();
513  foreach ($defs as $def) {
514  $pc_class = $def["pc_class"];
515  $pc_obj = new $pc_class($page_object);
516 
517  // post xsl page content modification by pc elements
518  $output = $pc_obj->modifyPageContentPostXsl($output, "presentation", false);
519  }
520  }
521 
522  return $output;
523  }
524 
528  public static function _addStyleCheckboxes(
529  string $a_output,
530  ilPCTable $a_table
531  ): string {
532  global $DIC;
533 
534  $lng = $DIC->language();
535 
536  $classes = $a_table->getAllCellClasses();
537 
538  foreach ($classes as $k => $v) {
539  if ($v == "") {
540  $v = $lng->txt("none");
541  }
542  if (substr($v, 0, 4) == "ilc_") {
543  $v = substr($v, 4);
544  }
545  $check = $lng->txt("cont_style") . ": " .
546  '<input type="checkbox" value="1"' .
547  ' name="target[' . $k . ']">' . '</input> ' . $v;
548 
549  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
550  }
551  return $a_output;
552  }
553 
557  public static function _addAlignmentCheckboxes(
558  string $a_output,
559  ilPCTable $a_table
560  ): string {
561  global $DIC;
562 
563  $lng = $DIC->language();
564 
565  $classes = $a_table->getAllCellAlignments();
566 
567  foreach ($classes as $k => $v) {
568  if ($v == "") {
569  $v = $lng->txt("default");
570  }
571  $check = $lng->txt("cont_alignment") . ": " .
572  '<input type="checkbox" value="1"' .
573  ' name="target[' . $k . ']">' . '</input> ' . $v;
574 
575  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
576  }
577  return $a_output;
578  }
579 
583  public static function _addWidthInputs(
584  string $a_output,
585  ilPCTable $a_table
586  ): string {
587  global $DIC;
588 
589  $lng = $DIC->language();
590 
591  $widths = $a_table->getAllCellWidths();
592 
593  foreach ($widths as $k => $v) {
594  $check = $lng->txt("cont_width") . ": " .
595  '<input class="small" type="text" size="5" maxlength="10"' .
596  ' name="width[' . $k . ']" value="' . $v . '">' . '</input>';
597 
598  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
599  }
600  return $a_output;
601  }
602 
606  public static function _addSpanInputs(
607  string $a_output,
608  ilPCTable $a_table
609  ): string {
610  global $DIC;
611 
612  $lng = $DIC->language();
613 
614  $spans = $a_table->getAllCellSpans();
615 
616  foreach ($spans as $k => $v) {
617  // colspans
618  $selects = '<div style="white-space:nowrap;">' . $lng->txt("cont_colspan") . ": " .
619  '<select class="small" name="colspan[' . $k . ']">';
620  for ($i = 1; $i <= $v["max_x"] - $v["x"] + 1; $i++) {
621  $sel_str = ($i == $v["colspan"])
622  ? 'selected="selected"'
623  : '';
624  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
625  }
626  $selects .= "</select></div>";
627 
628  // rowspans
629  $selects .= '<div style="margin-top:3px; white-space:nowrap;">' . $lng->txt("cont_rowspan") . ": " .
630  '<select class="small" name="rowspan[' . $k . ']">';
631  for ($i = 1; $i <= $v["max_y"] - $v["y"] + 1; $i++) {
632  $sel_str = ($i == $v["rowspan"])
633  ? 'selected="selected"'
634  : '';
635  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
636  }
637  $selects .= "</select></div>";
638 
639  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $selects, $a_output);
640  }
641  return $a_output;
642  }
643 
644  public function editCellStyle(): void
645  {
646  $ilCtrl = $this->ctrl;
647  $tpl = $this->tpl;
648  $lng = $this->lng;
649  $ilTabs = $this->tabs;
650 
651  $this->displayValidationError();
652  $this->setTabs();
653  $this->setCellPropertiesSubTabs();
654  $ilTabs->setSubTabActive("cont_style");
655 
656  // edit form
657  $form = new ilPropertyFormGUI();
658  $form->setFormAction($ilCtrl->getFormAction($this));
659  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
660 
661  // first row style
663  $this->lng->txt("cont_style"),
664  "style"
665  );
666  $this->setBasicTableCellStyles();
667  $this->getCharacteristicsOfCurrentStyle(["table_cell"]); // scorm-2004
668  $chars = $this->getCharacteristics(); // scorm-2004
669  $options = array_merge(array("" => $this->lng->txt("none")), $chars); // scorm-2004
670  foreach ($options as $k => $option) {
671  $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' .
672  $option . '</td></tr></table>';
673  $style->addOption($k, $option, $html);
674  }
675 
676  $style->setValue("");
677  $style->setInfo($lng->txt("cont_set_tab_style_info"));
678  $form->addItem($style);
679  $form->setKeepOpen(true);
680 
681  $form->addCommandButton("setStyles", $lng->txt("cont_set_styles"));
682 
683  $html = $form->getHTML();
684  $html .= "<br />" . $this->renderTable("table_edit", "style") . "</form>";
685  $tpl->setContent($html);
686  }
687 
688  public function editCellWidth(): void
689  {
690  $ilCtrl = $this->ctrl;
691  $tpl = $this->tpl;
692  $lng = $this->lng;
693  $ilTabs = $this->tabs;
694 
695  $this->displayValidationError();
696  $this->setTabs();
697  $this->setCellPropertiesSubTabs();
698  $ilTabs->setSubTabActive("cont_width");
699  $ilTabs->setTabActive("cont_table_cell_properties");
700 
701  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "Services/COPage");
702  $ctpl->setVariable("BTN_NAME", "setWidths");
703  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_widths"));
704  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
705 
706  $html = $ctpl->get();
707  $html .= "<br />" . $this->renderTable("table_edit", "width") . "</form>";
708  $tpl->setContent($html);
709  }
710 
711  public function editCellSpan(): void
712  {
713  $ilCtrl = $this->ctrl;
714  $tpl = $this->tpl;
715  $lng = $this->lng;
716  $ilTabs = $this->tabs;
717 
718  $this->displayValidationError();
719  $this->setTabs();
720  $this->setCellPropertiesSubTabs();
721  $ilTabs->setSubTabActive("cont_span");
722  $ilTabs->setTabActive("cont_table_cell_properties");
723 
724  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "Services/COPage");
725  $ctpl->setVariable("BTN_NAME", "setSpans");
726  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_spans"));
727  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
728 
729  $html = $ctpl->get();
730  $html .= "<br />" . $this->renderTable("table_edit", "span") . "</form>";
731  $tpl->setContent($html);
732  }
733 
737  public function setStyles(): void
738  {
739  $lng = $this->lng;
740 
741  $target = $this->request->getStringArray("target");
742  if (count($target)) {
743  foreach ($target as $k => $value) {
744  if ($value > 0) {
745  $cid = explode(":", $k);
746  $this->content_obj->setTDClass(
747  ilUtil::stripSlashes($cid[0]),
748  $this->request->getString("style"),
749  ilUtil::stripSlashes($cid[1])
750  );
751  }
752  }
753  }
754  $this->updated = $this->pg_obj->update();
755  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
756  $this->ctrl->redirect($this, "editCellStyle");
757  }
758 
762  public function setWidths(): void
763  {
764  $lng = $this->lng;
765 
766  $widths = $this->request->getStringArray("width");
767  if (count($widths) > 0) {
768  foreach ($widths as $k => $width) {
769  $cid = explode(":", $k);
770  $this->content_obj->setTDWidth(
771  ilUtil::stripSlashes($cid[0]),
772  ilUtil::stripSlashes($width),
773  ilUtil::stripSlashes($cid[1])
774  );
775  }
776  }
777  $this->updated = $this->pg_obj->update();
778  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
779  $this->ctrl->redirect($this, "editCellWidth");
780  }
781 
785  public function setSpans(): void
786  {
787  $lng = $this->lng;
788 
789  $colspans = $this->request->getStringArray("colspan");
790  $rowspans = $this->request->getStringArray("rowspan");
791  $cs = [];
792  $rs = [];
793  if (count($colspans) > 0) {
794  foreach ($colspans as $k => $span) {
795  $cs[$k] = $span;
796  $rs[$k] = $rowspans[$k];
797  }
798  $this->content_obj->setTDSpans($cs, $rs);
799  }
800  $this->updated = $this->pg_obj->update();
801  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
802  $this->ctrl->redirect($this, "editCellSpan");
803  }
804 
808  public function setProperties(): void
809  {
810  $this->initPropertiesForm();
811  $this->form->checkInput();
812 
813  // mask html
814  $caption = $this->form->getInput("caption");
815  $caption = str_replace("&", "&amp;", $caption);
816  $caption = str_replace("<", "&lt;", $caption);
817  $caption = str_replace(">", "&gt;", $caption);
818 
819  $this->content_obj->setLanguage($this->form->getInput("language"));
820  $this->content_obj->setWidth($this->form->getInput("width"));
821  //$this->content_obj->setBorder($this->form->getInput("border"));
822  //$this->content_obj->setCellSpacing($this->form->getInput("spacing"));
823  //$this->content_obj->setCellPadding($this->form->getInput("padding"));
824  $this->content_obj->setHorizontalAlign($this->form->getInput("align"));
825  $this->content_obj->setHeaderRows($this->form->getInput("row_header"));
826  $this->content_obj->setHeaderCols($this->form->getInput("col_header"));
827  $this->content_obj->setFooterRows($this->form->getInput("row_footer"));
828  $this->content_obj->setFooterCols($this->form->getInput("col_footer"));
829  if (strpos($this->form->getInput("characteristic"), ":") > 0) {
830  $t = explode(":", $this->form->getInput("characteristic"));
831  $this->content_obj->setTemplate($t[2]);
832  $this->content_obj->setClass("");
833  } else {
834  $this->content_obj->setClass($this->form->getInput("characteristic"));
835  $this->content_obj->setTemplate("");
836  }
837  $this->content_obj->setCaption(
838  $caption,
839  $this->form->getInput("cap_align")
840  );
841  }
842 
846  public function saveProperties(): void
847  {
848  $this->setProperties();
849  $this->updated = $this->pg_obj->update();
850  if ($this->updated === true) {
851  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
852  $this->ctrl->redirect($this, "editProperties");
853  } else {
854  $this->pg_obj->addHierIDs();
855  $this->edit();
856  }
857  }
858 
859  public function rightAlign(): void
860  {
861  $this->content_obj->setHorizontalAlign("Right");
862  $this->updateAndReturn();
863  }
864 
865  public function leftAlign(): void
866  {
867  $this->content_obj->setHorizontalAlign("Left");
868  $this->updateAndReturn();
869  }
870 
871  public function centerAlign(): void
872  {
873  $this->content_obj->setHorizontalAlign("Center");
874  $this->updateAndReturn();
875  }
876 
877  public function leftFloatAlign(): void
878  {
879  $this->content_obj->setHorizontalAlign("LeftFloat");
880  $this->updateAndReturn();
881  }
882 
883  public function rightFloatAlign(): void
884  {
885  $this->content_obj->setHorizontalAlign("RightFloat");
886  $this->updateAndReturn();
887  }
888 
889  public function insert(): void
890  {
891  $tpl = $this->tpl;
892 
893  $this->displayValidationError();
894  $this->initPropertiesForm("create");
895  $html = $this->form->getHTML();
896  $tpl->setContent($html);
897  }
898 
899  public function getNewTableObject(): ilPCTable
900  {
901  return new ilPCTable($this->getPage());
902  }
903 
907  public function create(): void
908  {
909  $this->content_obj = $this->getNewTableObject();
910  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
911 
912  $this->initPropertiesForm("create");
913  $this->form->checkInput();
914 
915  $import_table = trim($this->form->getInput("import_table"));
916 
917  // import xhtml or spreadsheet table
918  if (!empty($import_table)) {
919  switch ($this->form->getInput("import_type")) {
920  // xhtml import
921 
922  // spreadsheet
923  case "spreadsheet":
924  $this->content_obj->importSpreadsheet($this->form->getInput("language"), $import_table);
925  break;
926  }
927  } else {
928  $this->content_obj->addRows(
929  $this->form->getInput("nr_rows"),
930  $this->form->getInput("nr_cols")
931  );
932  }
933 
934  $this->setProperties();
935 
936  $frtype = $this->form->getInput("first_row_style");
937  if ($frtype != "") {
938  $this->content_obj->setFirstRowStyle($frtype);
939  }
940 
941  $this->updated = $this->pg_obj->update();
942 
943  if ($this->updated === true) {
944  $this->afterCreation();
945  } else {
946  $this->insert();
947  }
948  }
949 
950  public function afterCreation(): void
951  {
952  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
953  }
954 
955 
956  //
957  // Edit cell alignments
958  //
959 
960  public function editCellAlignment(): void
961  {
962  $ilCtrl = $this->ctrl;
963  $tpl = $this->tpl;
964  $lng = $this->lng;
965  $ilTabs = $this->tabs;
966 
967  $this->displayValidationError();
968  $this->setTabs();
969  $this->setCellPropertiesSubTabs();
970  $ilTabs->setSubTabActive("cont_alignment");
971  $ilTabs->setTabActive("cont_table_cell_properties");
972 
973  // edit form
974  $form = new ilPropertyFormGUI();
975  $form->setFormAction($ilCtrl->getFormAction($this));
976  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
977 
978  // alignment
979  $options = array(
980  "" => $lng->txt("default"),
981  "Left" => $lng->txt("cont_left"),
982  "Center" => $lng->txt("cont_center"),
983  "Right" => $lng->txt("cont_right")
984  );
985  $si = new ilSelectInputGUI($lng->txt("cont_alignment"), "alignment");
986  $si->setOptions($options);
987  $si->setInfo($lng->txt(""));
988  $form->addItem($si);
989 
990  $form->setKeepOpen(true);
991 
992  $form->addCommandButton("setAlignment", $lng->txt("cont_set_alignment"));
993 
994  $html = $form->getHTML();
995  $html .= "<br />" . $this->renderTable("table_edit", "alignment") . "</form>";
996  $tpl->setContent($html);
997  }
998 
1002  public function setAlignment(): void
1003  {
1004  $lng = $this->lng;
1005 
1006  $targets = $this->request->getStringArray("target");
1007  if (count($targets) > 0) {
1008  foreach ($targets as $k => $value) {
1009  if ($value > 0) {
1010  $cid = explode(":", $k);
1011  $this->content_obj->setTDAlignment(
1012  ilUtil::stripSlashes($cid[0]),
1013  $this->request->getString("alignment"),
1014  ilUtil::stripSlashes($cid[1])
1015  );
1016  }
1017  }
1018  }
1019  $this->updated = $this->pg_obj->update();
1020  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1021 
1022  $this->ctrl->redirect($this, "editCellAlignment");
1023  }
1024 
1025 
1029  public function editData(): void
1030  {
1031  $this->setTabs();
1032 
1033  $this->displayValidationError();
1034  $this->initEditor();
1035  $this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
1036  $this->tpl->addJavaScript("./Services/UIComponent/AdvancedSelectionList/js/AdvancedSelectionList.js");
1037  $this->tpl->setContent($this->getEditDataTable(true));
1038  }
1039 
1040  public function getEditDataTable(bool $initial = false): string
1041  {
1042  $ilCtrl = $this->ctrl;
1043 
1045  $pc_tab = $this->content_obj;
1046 
1047  $dtpl = new ilTemplate("tpl.tabledata2.html", true, true, "Services/COPage");
1048  $dtpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "tableAction"));
1049  $dtpl->setVariable("HIERID", $this->hier_id);
1050  $dtpl->setVariable("PCID", $this->pc_id);
1051  $class = $pc_tab->getClass();
1052  if ($class === "") {
1053  $class = "StandardTable";
1054  }
1055  $template_classes = [];
1056  if ($this->getStyleId() > 0 && $pc_tab->getTemplate() != "") {
1057  $id = ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $pc_tab->getTemplate());
1058  $style = new ilObjStyleSheet($this->getStyleId());
1059  $template_classes = $style->getTemplateClasses($id);
1060  if ($template_classes["table"] !== "") {
1061  $class = $template_classes["table"];
1062  }
1063  }
1064  $dtpl->setVariable("TABLE_CLASS", "ilc_table" . $class);
1065 
1066  $dtpl->setVariable(
1067  "WYSIWYG_ACTION",
1068  $ilCtrl->getFormAction($this, "updateJS")
1069  );
1070 
1071  // get all rows
1072  $path = "//PageContent[@HierId='" . $this->getHierId() . "']" .
1073  "/Table/TableRow";
1074  $nodes = $this->dom_util->path($this->dom, $path);
1075  $i = 0;
1076  $total_rows = count($nodes);
1077  foreach ($nodes as $node) {
1078  $path2 = "//PageContent[@HierId='" . $this->getHierId() . "']" .
1079  "/Table/TableRow[$i+1]/TableData";
1080  $nodes2 = $this->dom_util->path($this->dom, $path2);
1081  // if this is the first row -> col icons
1082  if ($i == 0) {
1083  $total_cols = count($nodes2);
1084  $j = 0;
1085  foreach ($nodes2 as $node2) {
1086  if ($j == 0) {
1087  $dtpl->touchBlock("empty_td");
1088  }
1089 
1090  $move_forward = false;
1091  $move_backward = false;
1092  if ($j == 0) {
1093  if (count($nodes2) == 1) {
1094  //
1095  } else {
1096  $move_forward = true;
1097  }
1098  } elseif ($j == (count($nodes2) - 1)) {
1099  $move_backward = true;
1100  } else {
1101  $move_forward = true;
1102  $move_backward = true;
1103  }
1104  $dtpl->setCurrentBlock("col_icon");
1105  $dtpl->setVariable("NR_COLUMN", $j + 1);
1106  $dtpl->setVariable("PCID_COLUMN", $node2->getAttribute("PCID"));
1107  $dtpl->setVariable("COLUMN_CAPTION", $this->getColumnCaption($j + 1));
1108  $dtpl->parseCurrentBlock();
1109  $j++;
1110  }
1111  $dtpl->setCurrentBlock("row");
1112  $dtpl->parseCurrentBlock();
1113  }
1114 
1115  $j = 0;
1116  foreach ($nodes2 as $node2) {
1117  // first col: row icons
1118  if ($j == 0) {
1119  if ($i == 0) {
1120  if (count($nodes) == 1) {
1121  $move_type = "none";
1122  } else {
1123  $move_type = "forward";
1124  }
1125  } elseif ($i == (count($nodes) - 1)) {
1126  $move_type = "backward";
1127  } else {
1128  $move_type = "both";
1129  }
1130  $dtpl->setCurrentBlock("row_icon");
1131  $dtpl->setVariable("NR_ROW", $i + 1);
1132  $dtpl->setVariable("PCID_ROW", $node2->getAttribute("PCID"));
1133  $dtpl->setVariable("ROW_CAPTION", $i + 1);
1134  $dtpl->parseCurrentBlock();
1135  }
1136 
1137  // cell
1138  if ($node2->getAttribute("Hidden") != "Y") {
1139  //if ($this->content_obj->getType() == "dtab") {
1140  $dtpl->touchBlock("cell_type");
1141  //$dtpl->setCurrentBlock("cell_type");
1142  //$dtpl->parseCurrentBlock();
1143  //}
1144 
1145  $dtpl->setCurrentBlock("cell");
1146 
1147  $dtpl->setVariable("PAR_TA_NAME", "cell[" . $i . "][" . $j . "]");
1148  $dtpl->setVariable("PAR_TA_ID", "cell_" . $i . "_" . $j);
1149  $dtpl->setVariable("PAR_ROW", (string) $i);
1150  $dtpl->setVariable("PAR_COLUMN", (string) $j);
1151 
1152  // which tag to use?
1153  $tag = "td";
1154  // only from template
1155  if (false) {
1156  $tag = "th";
1157  }
1158  $dtpl->setVariable("CELL_TAG", "td");
1159 
1160  // which class to use?
1161  $node_class = $node2->getAttribute("Class");
1162  $class = $this->getCellClass(
1163  $i,
1164  $j,
1165  $node_class,
1166  $template_classes,
1167  $total_rows,
1168  $total_cols
1169  );
1170  if ($class !== "") {
1171  $dtpl->setVariable("CELL_CLASS", "ilc_table_cell_" . $class);
1172  }
1173 
1174  $dtpl->setVariable(
1175  "PAR_TA_CONTENT",
1176  $this->getCellContent($i, $j)
1177  );
1178 
1179  $cs = $node2->getAttribute("ColSpan");
1180  $width = (int) $node2->getAttribute("Width");
1181  $rs = $node2->getAttribute("RowSpan");
1182  if ($width > 0) {
1183  $dtpl->setVariable("WIDTH", $width);
1184  }
1185  $align = (string) $node2->getAttribute("HorizontalAlign");
1186  if ($align !== "") {
1187  $dtpl->setVariable("ALIGN", $align);
1188  }
1189  $dtpl->setVariable("HEIGHT", "80");
1190  if ($cs > 1) {
1191  $dtpl->setVariable("COLSPAN", 'colspan="' . $cs . '"');
1192  //$dtpl->setVariable("WIDTH", (140 + ($cs - 1) * 146));
1193  }
1194  if ($rs > 1) {
1195  $dtpl->setVariable("ROWSPAN", 'rowspan="' . $rs . '"');
1196  //$dtpl->setVariable("HEIGHT", (80 + ($rs - 1) * 86));
1197  }
1198  $dtpl->parseCurrentBlock();
1199  }
1200  $j++;
1201  }
1202  $dtpl->setCurrentBlock("row");
1203  $dtpl->parseCurrentBlock();
1204  $i++;
1205  }
1206  $dtpl->setVariable("TXT_ACTION", $this->lng->txt("cont_table"));
1207 
1208  // add int link parts
1209  $dtpl->setCurrentBlock("int_link_prep");
1210  $dtpl->setVariable(
1211  "INT_LINK_PREP",
1213  $ilCtrl->getLinkTargetByClass(
1214  array("ilpageeditorgui", "ilinternallinkgui"),
1215  "",
1216  false,
1217  true,
1218  false
1219  )
1220  )
1221  );
1222  $dtpl->parseCurrentBlock();
1223 
1224  $html = $dtpl->get();
1225  if ($initial) {
1226  $html .= $this->getEditorScriptTag();
1227  }
1228 
1229  return $html;
1230  }
1231 
1232  protected function getCellClass(
1233  int $i,
1234  int $j,
1235  string $node_class,
1236  array $template_classes,
1237  int $total_rows,
1238  int $total_cols
1239  ) {
1240  $class = "";
1242  $pc_tab = $this->content_obj;
1243 
1244  // ["col_foot"] ["row_foot"]
1245 
1246  if (($template_classes["even_row"] ?? "") !== "") {
1247  if ($i % 2 == 1) {
1248  $class = $template_classes["even_row"];
1249  }
1250  }
1251 
1252  if (($template_classes["odd_row"] ?? "") !== "") {
1253  if ($i % 2 == 0) {
1254  $class = $template_classes["odd_row"];
1255  }
1256  }
1257 
1258  if (($template_classes["even_col"] ?? "") !== "") {
1259  if ($j % 2 == 1) {
1260  $class = $template_classes["even_col"];
1261  }
1262  }
1263 
1264  if (($template_classes["odd_col"] ?? "") !== "") {
1265  if ($j % 2 == 0) {
1266  $class = $template_classes["odd_col"];
1267  }
1268  }
1269 
1270  if (($template_classes["row_foot"] ?? "") !== "") {
1271  if ($i + $pc_tab->getFooterRows() >= $total_rows) {
1272  $class = $template_classes["row_foot"];
1273  }
1274  }
1275 
1276  if (($template_classes["col_foot"] ?? "") !== "") {
1277  if ($j + $pc_tab->getFooterCols() >= $total_cols) {
1278  $class = $template_classes["col_foot"];
1279  }
1280  }
1281 
1282  if (($template_classes["row_head"] ?? "") !== "") {
1283  if ($i < $pc_tab->getHeaderRows()) {
1284  $class = $template_classes["row_head"];
1285  }
1286  }
1287 
1288  if (($template_classes["col_head"] ?? "") !== "") {
1289  if ($j < $pc_tab->getHeaderCols()) {
1290  $class = $template_classes["col_head"];
1291  }
1292  }
1293 
1294  if ($class === "") {
1295  if ($i < $pc_tab->getHeaderRows()) {
1296  $class = "StandardHeader";
1297  }
1298  }
1299 
1300  if ($class === "") {
1301  $class = "StandardCell1";
1302  }
1303 
1304 
1305  if ($node_class !== "") {
1306  $class = $node_class;
1307  }
1308  return $class;
1309  }
1310 
1311  protected function getColumnCaption(int $nr): string
1312  {
1313  $cap = "";
1314  $base = 26;
1315  while ($nr > 0) {
1316  $chr = ($nr - 1) % $base;
1317  $cap = chr($chr + 65) . $cap;
1318  $nr = ($nr - 1 - $chr) / $base;
1319  }
1320  return $cap;
1321  }
1322 
1323  protected function getCellContent(int $i, int $j): string
1324  {
1325  $tab_node = $this->content_obj->getDomNode();
1326  $cnt_i = 0;
1327  $content = "";
1328  $template_xml = "";
1329  // get correct cell and dump content of all its childrem
1330  foreach ($tab_node->firstChild->childNodes as $child) {
1331  if ($i == $cnt_i) {
1332  $cnt_j = 0;
1333  foreach ($child->childNodes as $child2) {
1334  if ($j == $cnt_j) {
1335  foreach ($child2->childNodes as $cell_content_node) {
1336  $content .= $this->dom_util->dump($cell_content_node);
1337  }
1338  }
1339  $cnt_j++;
1340  }
1341  }
1342  $cnt_i++;
1343  }
1344  $trans = $this->pg_obj->getLanguageVariablesXML();
1345  $mobs = $this->pg_obj->getMultimediaXML();
1346  if ($this->getStyleId() > 0) {
1347  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
1348  $style = new ilObjStyleSheet($this->getStyleId());
1349  $template_xml = $style->getTemplateXML();
1350  }
1351  }
1352 
1353  $content = $content . $mobs . $trans . $template_xml;
1354 
1355  return $this->renderCell(
1356  $content,
1357  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
1358  $this->getPage()
1359  );
1360  }
1361 
1365  protected function renderCell(
1366  $content,
1367  $unmask = true,
1368  $page_object = null
1369  ): string {
1370  global $DIC;
1371 
1372  $ilUser = $DIC->user();
1373  $content = "<dummy>" . $content . "</dummy>";
1374 
1375  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
1376  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg");
1377  $params = array('webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
1378  $output = $this->xsl->process($content, $params);
1379 
1380  // unmask user html
1381  if ($unmask) {
1382  $output = str_replace("&lt;", "<", $output);
1383  $output = str_replace("&gt;", ">", $output);
1384  $output = str_replace("&amp;", "&", $output);
1385  }
1386 
1387  // for all page components...
1388  if (isset($page_object)) {
1389  $defs = $this->pc_definition->getPCDefinitions();
1390  foreach ($defs as $def) {
1391  $pc_class = $def["pc_class"];
1392  $pc_obj = new $pc_class($page_object);
1393 
1394  // post xsl page content modification by pc elements
1395  $output = $pc_obj->modifyPageContentPostXsl((string) $output, "presentation", false);
1396  }
1397  }
1398 
1399 
1400  return $output;
1401  }
1402 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
editData()
Edit data of table.
renderCell( $content, $unmask=true, $page_object=null)
Static render table function.
static getInitHTML(string $a_url)
Get initialisation HTML to use internal link editing.
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
static _renderTable(string $content, string $a_mode="table_edit", string $a_submode="", ilPCTable $a_table_obj=null, bool $unmask=true, ilPageObject $page_object=null)
setAlignment()
Set cell alignments.
initPropertiesForm(string $a_mode="edit")
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
static _lookupTemplateIdByName(int $a_style_id, string $a_name)
Lookup table template preview.
This class represents a selection list property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
ILIAS COPage PC PCDefinition $pc_definition
ilPropertyFormGUI $form
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setStyles()
Set cell styles.
static _addStyleCheckboxes(string $a_output, ilPCTable $a_table)
Add style checkboxes in edit mode.
setOptions(array $a_options)
setCharacteristics(array $a_chars)
create()
create new table in dom and update page in db
Content object of ilPageObject (see ILIAS DTD).
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
static _addSpanInputs(string $a_output, ilPCTable $a_table)
Add span inputs.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
This class represents a property in a property form.
__construct(VocabulariesInterface $vocabularies)
setContent(string $a_html)
Sets content for standard template.
setFormAction(string $a_formaction)
getTemplateXML()
Get table template xml.
static _addAlignmentCheckboxes(string $a_output, ilPCTable $a_table)
Add alignment checkboxes in edit mode.
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getFormTitle(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS COPage Dom DomUtil $dom_util
getEditorScriptTag(string $form_pc_id="", string $form_cname="")
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
getAllCellWidths()
Get all cell widths.
saveProperties()
save table properties in db and return to page edit screen
$lang
Definition: xapiexit.php:26
form( $class_path, string $cmd, string $submit_caption="")
getAllCellSpans()
Get all cell spans.
setKeepOpen(bool $a_keepopen)
setTabs(string $data_tab_txt_key="")
getTemplateOptions(string $a_type="")
This class represents a text area property in a property form.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$check
Definition: buildRTE.php:81
ILIAS COPage Xsl XslManager $xsl
setProperties()
Set properties from input form.
static _addWidthInputs(string $a_output, ilPCTable $a_table)
Add width inputs.
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAllCellClasses()
Get all cell classes.
setWidths()
Set cell widths.
setSpans()
Set cell spans.
getCellContent(int $i, int $j)