ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 ilSelectInputGUI(
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  $options = [];
275  foreach ($chars as $k => $char) {
276  if (strpos($k, ":") > 0) {
277  $t = explode(":", $k);
278  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both;" class="small">' . $char . "</div>";
279  } else {
280  $html = '<table class="ilc_table_' . $k . '"><tr><td class="small">' .
281  $char . '</td></tr></table>';
282  }
283  //$char_prop->addOption($k, $char, $html);
284  $options[$k] = $char;
285  }
286  $char_prop->setOptions($options);
287  $char_prop->setValue("StandardTable");
288  $this->form->addItem($char_prop);
289 
290  $nr = array();
291  for ($i = 0; $i <= 3; $i++) {
292  $nr[$i] = $i;
293  }
294 
295  // row header
296  $rh = new ilSelectInputGUI($this->lng->txt("cont_nr_row_header"), "row_header");
297  $rh->setOptions($nr);
298  $rh->setValue(1);
299  $this->form->addItem($rh);
300 
301  // row footer
302  $rf = new ilSelectInputGUI($this->lng->txt("cont_nr_row_footer"), "row_footer");
303  $rf->setOptions($nr);
304  $rf->setValue(0);
305  $this->form->addItem($rf);
306 
307  // col header
308  $ch = new ilSelectInputGUI($this->lng->txt("cont_nr_col_header"), "col_header");
309  $ch->setOptions($nr);
310  $ch->setValue(0);
311  $this->form->addItem($ch);
312 
313  // col footer
314  $cf = new ilSelectInputGUI($this->lng->txt("cont_nr_col_footer"), "col_footer");
315  $cf->setOptions($nr);
316  $cf->setValue(0);
317  $this->form->addItem($cf);
318 
319  if ($a_mode == "create") {
320  // first row style
321  $fr_style = new ilSelectInputGUI(
322  $this->lng->txt("cont_first_row_style"),
323  "first_row_style"
324  );
325  $this->setBasicTableCellStyles();
326  $this->getCharacteristicsOfCurrentStyle(["table_cell"]);
327  $chars = $this->getCharacteristics();
328  $options = array_merge(array("" => $this->lng->txt("none")), $chars);
329  $fr_style->setOptions($options);
330 
331  $fr_style->setValue("");
332  $this->form->addItem($fr_style);
333  }
334 
335  // alignment
336  $align_opts = array("Left" => $lng->txt("cont_left"),
337  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
338  "LeftFloat" => $lng->txt("cont_left_float"),
339  "RightFloat" => $lng->txt("cont_right_float"));
340  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
341  $align->setOptions($align_opts);
342  $align->setValue("Center");
343  $this->form->addItem($align);
344 
345  // caption
346  $caption = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
347  $caption->setSize(60);
348  $this->form->addItem($caption);
349 
350  // caption align
351  $ca_opts = array("top" => $lng->txt("cont_top"),
352  "bottom" => $lng->txt("cont_bottom"));
353  $ca = new ilSelectInputGUI(
354  $this->lng->txt("cont_align"),
355  "cap_align"
356  );
357  $ca->setOptions($ca_opts);
358  $caption->addSubItem($ca);
359 
360  // import
361  if ($a_mode == "create") {
362  // import table
363  $import = new ilRadioGroupInputGUI($this->lng->txt("cont_paste_table"), "import_type");
364  $op = new ilRadioOption($this->lng->txt("cont_html_table"), "html");
365  $import->addOption($op);
366  $op2 = new ilRadioOption($this->lng->txt("cont_spreadsheet_table"), "spreadsheet");
367 
368  $import_data = new ilTextAreaInputGUI("", "import_table");
369  $import_data->setRows(8);
370  $import_data->setCols(50);
371  $op2->addSubItem($import_data);
372 
373  $import->addOption($op2);
374  $import->setValue("html");
375  $this->form->addItem($import);
376  }
377 
378  // language
379  if ($this->getCurrentTextLang() != "") {
380  $s_lang = $this->getCurrentTextLang();
381  } else {
382  $s_lang = $ilUser->getLanguage();
383  }
384  $languages = [];
385  foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
386  $languages[$language->value()] = $language->presentableLabel();
387  }
388  $language = new ilSelectInputGUI($this->lng->txt("language"), "language");
389  $language->setOptions($languages);
390  $language->setValue($s_lang);
391  $this->form->addItem($language);
392 
393  if ($a_mode == "create") {
394  $this->form->addCommandButton("create", $lng->txt("save"));
395  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
396  } else {
397  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
398  $this->form->addCommandButton("editData", $lng->txt("close"));
399  }
400  }
401 
402  public function getPropertiesFormValues(): void
403  {
404  $values = array();
405  $values["width"] = $this->content_obj->getWidth();
406  //$values["border"] = $this->content_obj->getBorder();
407  //$values["padding"] = $this->content_obj->getCellPadding();
408  //$values["spacing"] = $this->content_obj->getCellSpacing();
409  $values["row_header"] = $this->content_obj->getHeaderRows();
410  $values["row_footer"] = $this->content_obj->getFooterRows();
411  $values["col_header"] = $this->content_obj->getHeaderCols();
412  $values["col_footer"] = $this->content_obj->getFooterCols();
413  if ($this->content_obj->getTemplate() != "") {
414  $values["characteristic"] = "t:" .
415  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
416  $this->content_obj->getTemplate();
417  } else {
418  $values["characteristic"] = $this->content_obj->getClass();
419  }
420  $values["align"] = $this->content_obj->getHorizontalAlign();
421  $values["caption"] = $this->content_obj->getCaption();
422  $values["cap_align"] = $this->content_obj->getCaptionAlign();
423  $values["language"] = $this->content_obj->getLanguage();
424 
425  $this->form->setValuesByArray($values);
426 
427  $ca = $this->form->getItemByPostVar("cap_align");
428  $ca->setValue($this->content_obj->getCaptionAlign());
429  }
430 
431  public function renderTable(
432  string $a_mode = "table_edit",
433  string $a_submode = ""
434  ): string {
435  $template_xml = "";
436  $tab_node = $this->content_obj->getDomNode();
437  $tab_node->setAttribute("Enabled", "True");
438  $content = $this->dom_util->dump($tab_node);
439 
440  $trans = $this->pg_obj->getLanguageVariablesXML();
441  $mobs = $this->pg_obj->getMultimediaXML();
442  if ($this->getStyleId() > 0) {
443  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
444  $style = new ilObjStyleSheet($this->getStyleId());
445  $template_xml = $style->getTemplateXML();
446  }
447  }
448 
449  $content = $content . $mobs . $trans . $template_xml;
450 
452  $tab = $this->content_obj;
454  $content,
455  $a_mode,
456  $a_submode,
457  $tab,
458  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
459  $this->getPage()
460  );
461  }
462 
463  public static function _renderTable(
464  string $content,
465  string $a_mode = "table_edit",
466  string $a_submode = "",
467  ilPCTable $a_table_obj = null,
468  bool $unmask = true,
469  ilPageObject $page_object = null
470  ): string {
471  global $DIC;
472 
473  $ilUser = $DIC->user();
474  $xsl = $DIC->copage()->internal()->domain()->xsl();
475  $pc_definition = $DIC->copage()->internal()->domain()->pc()->definition();
476 
477  $content = "<dummy>" . $content . "</dummy>";
478 
479  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
480  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg");
481  $params = array('mode' => $a_mode,
482  'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
483  $output = $xsl->process($content, $params);
484 
485  // unmask user html
486  if ($unmask) {
487  $output = str_replace("&lt;", "<", $output);
488  $output = str_replace("&gt;", ">", $output);
489  $output = str_replace("&amp;", "&", $output);
490  }
491 
492  if ($a_mode == "table_edit" && !is_null($a_table_obj)) {
493  switch ($a_submode) {
494  case "style":
495  $output = ilPCTableGUI::_addStyleCheckboxes($output, $a_table_obj);
496  break;
497 
498  case "alignment":
499  $output = ilPCTableGUI::_addAlignmentCheckboxes($output, $a_table_obj);
500  break;
501 
502  case "width":
503  $output = ilPCTableGUI::_addWidthInputs($output, $a_table_obj);
504  break;
505 
506  case "span":
507  $output = ilPCTableGUI::_addSpanInputs($output, $a_table_obj);
508  break;
509  }
510  }
511 
512  // for all page components...
513  if (isset($page_object)) {
514  $defs = $pc_definition->getPCDefinitions();
515  foreach ($defs as $def) {
516  $pc_class = $def["pc_class"];
517  $pc_obj = new $pc_class($page_object);
518 
519  // post xsl page content modification by pc elements
520  $output = $pc_obj->modifyPageContentPostXsl($output, "presentation", false);
521  }
522  }
523 
524  return $output;
525  }
526 
530  public static function _addStyleCheckboxes(
531  string $a_output,
532  ilPCTable $a_table
533  ): string {
534  global $DIC;
535 
536  $lng = $DIC->language();
537 
538  $classes = $a_table->getAllCellClasses();
539 
540  foreach ($classes as $k => $v) {
541  if ($v == "") {
542  $v = $lng->txt("none");
543  }
544  if (substr($v, 0, 4) == "ilc_") {
545  $v = substr($v, 4);
546  }
547  $check = $lng->txt("cont_style") . ": " .
548  '<input type="checkbox" value="1"' .
549  ' name="target[' . $k . ']">' . '</input> ' . $v;
550 
551  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
552  }
553  return $a_output;
554  }
555 
559  public static function _addAlignmentCheckboxes(
560  string $a_output,
561  ilPCTable $a_table
562  ): string {
563  global $DIC;
564 
565  $lng = $DIC->language();
566 
567  $classes = $a_table->getAllCellAlignments();
568 
569  foreach ($classes as $k => $v) {
570  if ($v == "") {
571  $v = $lng->txt("default");
572  }
573  $check = $lng->txt("cont_alignment") . ": " .
574  '<input type="checkbox" value="1"' .
575  ' name="target[' . $k . ']">' . '</input> ' . $v;
576 
577  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
578  }
579  return $a_output;
580  }
581 
585  public static function _addWidthInputs(
586  string $a_output,
587  ilPCTable $a_table
588  ): string {
589  global $DIC;
590 
591  $lng = $DIC->language();
592 
593  $widths = $a_table->getAllCellWidths();
594 
595  foreach ($widths as $k => $v) {
596  $check = $lng->txt("cont_width") . ": " .
597  '<input class="small" type="text" size="5" maxlength="10"' .
598  ' name="width[' . $k . ']" value="' . $v . '">' . '</input>';
599 
600  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
601  }
602  return $a_output;
603  }
604 
608  public static function _addSpanInputs(
609  string $a_output,
610  ilPCTable $a_table
611  ): string {
612  global $DIC;
613 
614  $lng = $DIC->language();
615 
616  $spans = $a_table->getAllCellSpans();
617 
618  foreach ($spans as $k => $v) {
619  // colspans
620  $selects = '<div style="white-space:nowrap;">' . $lng->txt("cont_colspan") . ": " .
621  '<select class="small" name="colspan[' . $k . ']">';
622  for ($i = 1; $i <= $v["max_x"] - $v["x"] + 1; $i++) {
623  $sel_str = ($i == $v["colspan"])
624  ? 'selected="selected"'
625  : '';
626  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
627  }
628  $selects .= "</select></div>";
629 
630  // rowspans
631  $selects .= '<div style="margin-top:3px; white-space:nowrap;">' . $lng->txt("cont_rowspan") . ": " .
632  '<select class="small" name="rowspan[' . $k . ']">';
633  for ($i = 1; $i <= $v["max_y"] - $v["y"] + 1; $i++) {
634  $sel_str = ($i == $v["rowspan"])
635  ? 'selected="selected"'
636  : '';
637  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
638  }
639  $selects .= "</select></div>";
640 
641  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $selects, $a_output);
642  }
643  return $a_output;
644  }
645 
646  public function editCellStyle(): void
647  {
648  $ilCtrl = $this->ctrl;
649  $tpl = $this->tpl;
650  $lng = $this->lng;
651  $ilTabs = $this->tabs;
652 
653  $this->displayValidationError();
654  $this->setTabs();
655  $this->setCellPropertiesSubTabs();
656  $ilTabs->setSubTabActive("cont_style");
657 
658  // edit form
659  $form = new ilPropertyFormGUI();
660  $form->setFormAction($ilCtrl->getFormAction($this));
661  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
662 
663  // first row style
664  $style = new ilSelectInputGUI(
665  $this->lng->txt("cont_style"),
666  "style"
667  );
668  $this->setBasicTableCellStyles();
669  $this->getCharacteristicsOfCurrentStyle(["table_cell"]); // scorm-2004
670  $chars = $this->getCharacteristics(); // scorm-2004
671  $options = array_merge(array("" => $this->lng->txt("none")), $chars); // scorm-2004
672  $style->setOptions($options);
673 
674  $style->setValue("");
675  $style->setInfo($lng->txt("cont_set_tab_style_info"));
676  $form->addItem($style);
677  $form->setKeepOpen(true);
678 
679  $form->addCommandButton("setStyles", $lng->txt("cont_set_styles"));
680 
681  $html = $form->getHTML();
682  $html .= "<br />" . $this->renderTable("table_edit", "style") . "</form>";
683  $tpl->setContent($html);
684  }
685 
686  public function editCellWidth(): void
687  {
688  $ilCtrl = $this->ctrl;
689  $tpl = $this->tpl;
690  $lng = $this->lng;
691  $ilTabs = $this->tabs;
692 
693  $this->displayValidationError();
694  $this->setTabs();
695  $this->setCellPropertiesSubTabs();
696  $ilTabs->setSubTabActive("cont_width");
697  $ilTabs->setTabActive("cont_table_cell_properties");
698 
699  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "components/ILIAS/COPage");
700  $ctpl->setVariable("BTN_NAME", "setWidths");
701  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_widths"));
702  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
703 
704  $html = $ctpl->get();
705  $html .= "<br />" . $this->renderTable("table_edit", "width") . "</form>";
706  $tpl->setContent($html);
707  }
708 
709  public function editCellSpan(): void
710  {
711  $ilCtrl = $this->ctrl;
712  $tpl = $this->tpl;
713  $lng = $this->lng;
714  $ilTabs = $this->tabs;
715 
716  $this->displayValidationError();
717  $this->setTabs();
718  $this->setCellPropertiesSubTabs();
719  $ilTabs->setSubTabActive("cont_span");
720  $ilTabs->setTabActive("cont_table_cell_properties");
721 
722  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "components/ILIAS/COPage");
723  $ctpl->setVariable("BTN_NAME", "setSpans");
724  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_spans"));
725  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
726 
727  $html = $ctpl->get();
728  $html .= "<br />" . $this->renderTable("table_edit", "span") . "</form>";
729  $tpl->setContent($html);
730  }
731 
735  public function setStyles(): void
736  {
737  $lng = $this->lng;
738 
739  $target = $this->request->getStringArray("target");
740  if (count($target)) {
741  foreach ($target as $k => $value) {
742  if ($value > 0) {
743  $cid = explode(":", $k);
744  $this->content_obj->setTDClass(
745  ilUtil::stripSlashes($cid[0]),
746  $this->request->getString("style"),
747  ilUtil::stripSlashes($cid[1])
748  );
749  }
750  }
751  }
752  $this->updated = $this->pg_obj->update();
753  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
754  $this->ctrl->redirect($this, "editCellStyle");
755  }
756 
760  public function setWidths(): void
761  {
762  $lng = $this->lng;
763 
764  $widths = $this->request->getStringArray("width");
765  if (count($widths) > 0) {
766  foreach ($widths as $k => $width) {
767  $cid = explode(":", $k);
768  $this->content_obj->setTDWidth(
769  ilUtil::stripSlashes($cid[0]),
770  ilUtil::stripSlashes($width),
771  ilUtil::stripSlashes($cid[1])
772  );
773  }
774  }
775  $this->updated = $this->pg_obj->update();
776  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
777  $this->ctrl->redirect($this, "editCellWidth");
778  }
779 
783  public function setSpans(): void
784  {
785  $lng = $this->lng;
786 
787  $colspans = $this->request->getStringArray("colspan");
788  $rowspans = $this->request->getStringArray("rowspan");
789  $cs = [];
790  $rs = [];
791  if (count($colspans) > 0) {
792  foreach ($colspans as $k => $span) {
793  $cs[$k] = $span;
794  $rs[$k] = $rowspans[$k];
795  }
796  $this->content_obj->setTDSpans($cs, $rs);
797  }
798  $this->updated = $this->pg_obj->update();
799  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
800  $this->ctrl->redirect($this, "editCellSpan");
801  }
802 
806  public function setProperties(): void
807  {
808  $this->initPropertiesForm();
809  $this->form->checkInput();
810 
811  // mask html
812  $caption = $this->form->getInput("caption");
813  $caption = str_replace("&", "&amp;", $caption);
814  $caption = str_replace("<", "&lt;", $caption);
815  $caption = str_replace(">", "&gt;", $caption);
816 
817  $this->content_obj->setLanguage($this->form->getInput("language"));
818  $this->content_obj->setWidth($this->form->getInput("width"));
819  //$this->content_obj->setBorder($this->form->getInput("border"));
820  //$this->content_obj->setCellSpacing($this->form->getInput("spacing"));
821  //$this->content_obj->setCellPadding($this->form->getInput("padding"));
822  $this->content_obj->setHorizontalAlign($this->form->getInput("align"));
823  $this->content_obj->setHeaderRows($this->form->getInput("row_header"));
824  $this->content_obj->setHeaderCols($this->form->getInput("col_header"));
825  $this->content_obj->setFooterRows($this->form->getInput("row_footer"));
826  $this->content_obj->setFooterCols($this->form->getInput("col_footer"));
827  if (strpos($this->form->getInput("characteristic"), ":") > 0) {
828  $t = explode(":", $this->form->getInput("characteristic"));
829  $this->content_obj->setTemplate($t[2]);
830  $this->content_obj->setClass("");
831  } else {
832  $this->content_obj->setClass($this->form->getInput("characteristic"));
833  $this->content_obj->setTemplate("");
834  }
835  $this->content_obj->setCaption(
836  $caption,
837  $this->form->getInput("cap_align")
838  );
839  }
840 
844  public function saveProperties(): void
845  {
846  $this->setProperties();
847  $this->updated = $this->pg_obj->update();
848  if ($this->updated === true) {
849  $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
850  $this->ctrl->redirect($this, "editProperties");
851  } else {
852  $this->pg_obj->addHierIDs();
853  $this->edit();
854  }
855  }
856 
857  public function rightAlign(): void
858  {
859  $this->content_obj->setHorizontalAlign("Right");
860  $this->updateAndReturn();
861  }
862 
863  public function leftAlign(): void
864  {
865  $this->content_obj->setHorizontalAlign("Left");
866  $this->updateAndReturn();
867  }
868 
869  public function centerAlign(): void
870  {
871  $this->content_obj->setHorizontalAlign("Center");
872  $this->updateAndReturn();
873  }
874 
875  public function leftFloatAlign(): void
876  {
877  $this->content_obj->setHorizontalAlign("LeftFloat");
878  $this->updateAndReturn();
879  }
880 
881  public function rightFloatAlign(): void
882  {
883  $this->content_obj->setHorizontalAlign("RightFloat");
884  $this->updateAndReturn();
885  }
886 
887  public function insert(): void
888  {
889  $tpl = $this->tpl;
890 
891  $this->displayValidationError();
892  $this->initPropertiesForm("create");
893  $html = $this->form->getHTML();
894  $tpl->setContent($html);
895  }
896 
897  public function getNewTableObject(): ilPCTable
898  {
899  return new ilPCTable($this->getPage());
900  }
901 
905  public function create(): void
906  {
907  $this->content_obj = $this->getNewTableObject();
908  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
909 
910  $this->initPropertiesForm("create");
911  $this->form->checkInput();
912 
913  $import_table = trim($this->form->getInput("import_table"));
914 
915  // import xhtml or spreadsheet table
916  if (!empty($import_table)) {
917  switch ($this->form->getInput("import_type")) {
918  // xhtml import
919 
920  // spreadsheet
921  case "spreadsheet":
922  $this->content_obj->importSpreadsheet($this->form->getInput("language"), $import_table);
923  break;
924  }
925  } else {
926  $this->content_obj->addRows(
927  $this->form->getInput("nr_rows"),
928  $this->form->getInput("nr_cols")
929  );
930  }
931 
932  $this->setProperties();
933 
934  $frtype = $this->form->getInput("first_row_style");
935  if ($frtype != "") {
936  $this->content_obj->setFirstRowStyle($frtype);
937  }
938 
939  $this->updated = $this->pg_obj->update();
940 
941  if ($this->updated === true) {
942  $this->afterCreation();
943  } else {
944  $this->insert();
945  }
946  }
947 
948  public function afterCreation(): void
949  {
950  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
951  }
952 
953 
954  //
955  // Edit cell alignments
956  //
957 
958  public function editCellAlignment(): void
959  {
960  $ilCtrl = $this->ctrl;
961  $tpl = $this->tpl;
962  $lng = $this->lng;
963  $ilTabs = $this->tabs;
964 
965  $this->displayValidationError();
966  $this->setTabs();
967  $this->setCellPropertiesSubTabs();
968  $ilTabs->setSubTabActive("cont_alignment");
969  $ilTabs->setTabActive("cont_table_cell_properties");
970 
971  // edit form
972  $form = new ilPropertyFormGUI();
973  $form->setFormAction($ilCtrl->getFormAction($this));
974  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
975 
976  // alignment
977  $options = array(
978  "" => $lng->txt("default"),
979  "Left" => $lng->txt("cont_left"),
980  "Center" => $lng->txt("cont_center"),
981  "Right" => $lng->txt("cont_right")
982  );
983  $si = new ilSelectInputGUI($lng->txt("cont_alignment"), "alignment");
984  $si->setOptions($options);
985  $si->setInfo($lng->txt(""));
986  $form->addItem($si);
987 
988  $form->setKeepOpen(true);
989 
990  $form->addCommandButton("setAlignment", $lng->txt("cont_set_alignment"));
991 
992  $html = $form->getHTML();
993  $html .= "<br />" . $this->renderTable("table_edit", "alignment") . "</form>";
994  $tpl->setContent($html);
995  }
996 
1000  public function setAlignment(): void
1001  {
1002  $lng = $this->lng;
1003 
1004  $targets = $this->request->getStringArray("target");
1005  if (count($targets) > 0) {
1006  foreach ($targets as $k => $value) {
1007  if ($value > 0) {
1008  $cid = explode(":", $k);
1009  $this->content_obj->setTDAlignment(
1010  ilUtil::stripSlashes($cid[0]),
1011  $this->request->getString("alignment"),
1012  ilUtil::stripSlashes($cid[1])
1013  );
1014  }
1015  }
1016  }
1017  $this->updated = $this->pg_obj->update();
1018  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1019 
1020  $this->ctrl->redirect($this, "editCellAlignment");
1021  }
1022 
1023 
1027  public function editData(): void
1028  {
1029  $this->setTabs();
1030 
1031  $this->displayValidationError();
1032  $this->initEditor();
1033  $this->tpl->addJavaScript("assets/js/AdvancedSelectionList.js");
1034  $this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
1035  $this->tpl->setContent($this->getEditDataTable(true));
1036  }
1037 
1038  public function getEditDataTable(bool $initial = false): string
1039  {
1040  $ilCtrl = $this->ctrl;
1041 
1043  $pc_tab = $this->content_obj;
1044 
1045  $dtpl = new ilTemplate("tpl.tabledata2.html", true, true, "components/ILIAS/COPage");
1046  $dtpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "tableAction"));
1047  $dtpl->setVariable("HIERID", $this->hier_id);
1048  $dtpl->setVariable("PCID", $this->pc_id);
1049  $class = $pc_tab->getClass();
1050  if ($class === "") {
1051  $class = "StandardTable";
1052  }
1053  $template_classes = [];
1054  if ($this->getStyleId() > 0 && $pc_tab->getTemplate() != "") {
1055  $id = ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $pc_tab->getTemplate());
1056  $style = new ilObjStyleSheet($this->getStyleId());
1057  $template_classes = $style->getTemplateClasses($id);
1058  if ($template_classes["table"] !== "") {
1059  $class = $template_classes["table"];
1060  }
1061  }
1062  $dtpl->setVariable("TABLE_CLASS", "ilc_table" . $class);
1063 
1064  $dtpl->setVariable(
1065  "WYSIWYG_ACTION",
1066  $ilCtrl->getFormAction($this, "updateJS")
1067  );
1068 
1069  // get all rows
1070  $path = "//PageContent[@HierId='" . $this->getHierId() . "']" .
1071  "/Table/TableRow";
1072  $nodes = $this->dom_util->path($this->dom, $path);
1073  $i = 0;
1074  $total_rows = count($nodes);
1075  foreach ($nodes as $node) {
1076  $path2 = "//PageContent[@HierId='" . $this->getHierId() . "']" .
1077  "/Table/TableRow[$i+1]/TableData";
1078  $nodes2 = $this->dom_util->path($this->dom, $path2);
1079  // if this is the first row -> col icons
1080  if ($i == 0) {
1081  $total_cols = count($nodes2);
1082  $j = 0;
1083  foreach ($nodes2 as $node2) {
1084  if ($j == 0) {
1085  $dtpl->touchBlock("empty_td");
1086  }
1087 
1088  $move_forward = false;
1089  $move_backward = false;
1090  if ($j == 0) {
1091  if (count($nodes2) == 1) {
1092  //
1093  } else {
1094  $move_forward = true;
1095  }
1096  } elseif ($j == (count($nodes2) - 1)) {
1097  $move_backward = true;
1098  } else {
1099  $move_forward = true;
1100  $move_backward = true;
1101  }
1102  $dtpl->setCurrentBlock("col_icon");
1103  $dtpl->setVariable("NR_COLUMN", $j + 1);
1104  $dtpl->setVariable("PCID_COLUMN", $node2->getAttribute("PCID"));
1105  $dtpl->setVariable("COLUMN_CAPTION", $this->getColumnCaption($j + 1));
1106  $dtpl->parseCurrentBlock();
1107  $j++;
1108  }
1109  $dtpl->setCurrentBlock("row");
1110  $dtpl->parseCurrentBlock();
1111  }
1112 
1113  $j = 0;
1114  foreach ($nodes2 as $node2) {
1115  // first col: row icons
1116  if ($j == 0) {
1117  if ($i == 0) {
1118  if (count($nodes) == 1) {
1119  $move_type = "none";
1120  } else {
1121  $move_type = "forward";
1122  }
1123  } elseif ($i == (count($nodes) - 1)) {
1124  $move_type = "backward";
1125  } else {
1126  $move_type = "both";
1127  }
1128  $dtpl->setCurrentBlock("row_icon");
1129  $dtpl->setVariable("NR_ROW", $i + 1);
1130  $dtpl->setVariable("PCID_ROW", $node2->getAttribute("PCID"));
1131  $dtpl->setVariable("ROW_CAPTION", $i + 1);
1132  $dtpl->parseCurrentBlock();
1133  }
1134 
1135  // cell
1136  if ($node2->getAttribute("Hidden") != "Y") {
1137  //if ($this->content_obj->getType() == "dtab") {
1138  $dtpl->touchBlock("cell_type");
1139  //$dtpl->setCurrentBlock("cell_type");
1140  //$dtpl->parseCurrentBlock();
1141  //}
1142 
1143  $dtpl->setCurrentBlock("cell");
1144 
1145  $dtpl->setVariable("PAR_TA_NAME", "cell[" . $i . "][" . $j . "]");
1146  $dtpl->setVariable("PAR_TA_ID", "cell_" . $i . "_" . $j);
1147  $dtpl->setVariable("PAR_ROW", (string) $i);
1148  $dtpl->setVariable("PAR_COLUMN", (string) $j);
1149 
1150  // which tag to use?
1151  $tag = "td";
1152  // only from template
1153  if (false) {
1154  $tag = "th";
1155  }
1156  $dtpl->setVariable("CELL_TAG", "td");
1157 
1158  // which class to use?
1159  $node_class = $node2->getAttribute("Class");
1160  $class = $this->getCellClass(
1161  $i,
1162  $j,
1163  $node_class,
1164  $template_classes,
1165  $total_rows,
1166  $total_cols
1167  );
1168  if ($class !== "") {
1169  $dtpl->setVariable("CELL_CLASS", "ilc_table_cell_" . $class);
1170  }
1171 
1172  $dtpl->setVariable(
1173  "PAR_TA_CONTENT",
1174  $this->getCellContent($i, $j)
1175  );
1176 
1177  $cs = $node2->getAttribute("ColSpan");
1178  $width = (int) $node2->getAttribute("Width");
1179  $rs = $node2->getAttribute("RowSpan");
1180  if ($width > 0) {
1181  $dtpl->setVariable("WIDTH", $width);
1182  }
1183  $align = (string) $node2->getAttribute("HorizontalAlign");
1184  if ($align !== "") {
1185  $dtpl->setVariable("ALIGN", $align);
1186  }
1187  $dtpl->setVariable("HEIGHT", "80");
1188  if ($cs > 1) {
1189  $dtpl->setVariable("COLSPAN", 'colspan="' . $cs . '"');
1190  //$dtpl->setVariable("WIDTH", (140 + ($cs - 1) * 146));
1191  }
1192  if ($rs > 1) {
1193  $dtpl->setVariable("ROWSPAN", 'rowspan="' . $rs . '"');
1194  //$dtpl->setVariable("HEIGHT", (80 + ($rs - 1) * 86));
1195  }
1196  $dtpl->parseCurrentBlock();
1197  }
1198  $j++;
1199  }
1200  $dtpl->setCurrentBlock("row");
1201  $dtpl->parseCurrentBlock();
1202  $i++;
1203  }
1204  $dtpl->setVariable("TXT_ACTION", $this->lng->txt("cont_table"));
1205 
1206  // add int link parts
1207  $dtpl->setCurrentBlock("int_link_prep");
1208  $dtpl->setVariable(
1209  "INT_LINK_PREP",
1211  $ilCtrl->getLinkTargetByClass(
1212  array("ilpageeditorgui", "ilinternallinkgui"),
1213  "",
1214  false,
1215  true,
1216  false
1217  )
1218  )
1219  );
1220  $dtpl->parseCurrentBlock();
1221 
1222  $html = $dtpl->get();
1223  if ($initial) {
1224  $html .= $this->getEditorScriptTag();
1225  }
1226 
1227  return $html;
1228  }
1229 
1230  protected function getCellClass(
1231  int $i,
1232  int $j,
1233  string $node_class,
1234  array $template_classes,
1235  int $total_rows,
1236  int $total_cols
1237  ) {
1238  $class = "";
1240  $pc_tab = $this->content_obj;
1241 
1242  // ["col_foot"] ["row_foot"]
1243 
1244  if (($template_classes["even_row"] ?? "") !== "") {
1245  if ($i % 2 == 1) {
1246  $class = $template_classes["even_row"];
1247  }
1248  }
1249 
1250  if (($template_classes["odd_row"] ?? "") !== "") {
1251  if ($i % 2 == 0) {
1252  $class = $template_classes["odd_row"];
1253  }
1254  }
1255 
1256  if (($template_classes["even_col"] ?? "") !== "") {
1257  if ($j % 2 == 1) {
1258  $class = $template_classes["even_col"];
1259  }
1260  }
1261 
1262  if (($template_classes["odd_col"] ?? "") !== "") {
1263  if ($j % 2 == 0) {
1264  $class = $template_classes["odd_col"];
1265  }
1266  }
1267 
1268  if (($template_classes["row_foot"] ?? "") !== "") {
1269  if ($i + $pc_tab->getFooterRows() >= $total_rows) {
1270  $class = $template_classes["row_foot"];
1271  }
1272  }
1273 
1274  if (($template_classes["col_foot"] ?? "") !== "") {
1275  if ($j + $pc_tab->getFooterCols() >= $total_cols) {
1276  $class = $template_classes["col_foot"];
1277  }
1278  }
1279 
1280  if (($template_classes["row_head"] ?? "") !== "") {
1281  if ($i < $pc_tab->getHeaderRows()) {
1282  $class = $template_classes["row_head"];
1283  }
1284  }
1285 
1286  if (($template_classes["col_head"] ?? "") !== "") {
1287  if ($j < $pc_tab->getHeaderCols()) {
1288  $class = $template_classes["col_head"];
1289  }
1290  }
1291 
1292  if ($class === "") {
1293  if ($i < $pc_tab->getHeaderRows()) {
1294  $class = "StandardHeader";
1295  }
1296  }
1297 
1298  if ($class === "") {
1299  $class = "StandardCell1";
1300  }
1301 
1302 
1303  if ($node_class !== "") {
1304  $class = $node_class;
1305  }
1306  return $class;
1307  }
1308 
1309  protected function getColumnCaption(int $nr): string
1310  {
1311  $cap = "";
1312  $base = 26;
1313  while ($nr > 0) {
1314  $chr = ($nr - 1) % $base;
1315  $cap = chr($chr + 65) . $cap;
1316  $nr = ($nr - 1 - $chr) / $base;
1317  }
1318  return $cap;
1319  }
1320 
1321  protected function getCellContent(int $i, int $j): string
1322  {
1323  $tab_node = $this->content_obj->getDomNode();
1324  $cnt_i = 0;
1325  $content = "";
1326  $template_xml = "";
1327  // get correct cell and dump content of all its childrem
1328  foreach ($tab_node->firstChild->childNodes as $child) {
1329  if ($i == $cnt_i) {
1330  $cnt_j = 0;
1331  foreach ($child->childNodes as $child2) {
1332  if ($j == $cnt_j) {
1333  foreach ($child2->childNodes as $cell_content_node) {
1334  $content .= $this->dom_util->dump($cell_content_node);
1335  }
1336  }
1337  $cnt_j++;
1338  }
1339  }
1340  $cnt_i++;
1341  }
1342  $trans = $this->pg_obj->getLanguageVariablesXML();
1343  $mobs = $this->pg_obj->getMultimediaXML();
1344  if ($this->getStyleId() > 0) {
1345  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
1346  $style = new ilObjStyleSheet($this->getStyleId());
1347  $template_xml = $style->getTemplateXML();
1348  }
1349  }
1350 
1351  $content = $content . $mobs . $trans . $template_xml;
1352 
1353  return $this->renderCell(
1354  $content,
1355  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
1356  $this->getPage()
1357  );
1358  }
1359 
1363  protected function renderCell(
1364  $content,
1365  $unmask = true,
1366  $page_object = null
1367  ): string {
1368  global $DIC;
1369 
1370  $ilUser = $DIC->user();
1371  $content = "<dummy>" . $content . "</dummy>";
1372 
1373  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
1374  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg");
1375  $params = array('webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
1376  $output = $this->xsl->process($content, $params);
1377 
1378  // unmask user html
1379  if ($unmask) {
1380  $output = str_replace("&lt;", "<", $output);
1381  $output = str_replace("&gt;", ">", $output);
1382  $output = str_replace("&amp;", "&", $output);
1383  }
1384 
1385  // for all page components...
1386  if (isset($page_object)) {
1387  $defs = $this->pc_definition->getPCDefinitions();
1388  foreach ($defs as $def) {
1389  $pc_class = $def["pc_class"];
1390  $pc_obj = new $pc_class($page_object);
1391 
1392  // post xsl page content modification by pc elements
1393  $output = $pc_obj->modifyPageContentPostXsl((string) $output, "presentation", false);
1394  }
1395  }
1396 
1397 
1398  return $output;
1399  }
1400 }
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:31
ILIAS COPage PC PCDefinition $pc_definition
ilPropertyFormGUI $form
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
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:30
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.
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")
global $DIC
Definition: shib_login.php:25
ilGlobalTemplateInterface $tpl
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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
form( $class_path, string $cmd, string $submit_caption="")
getAllCellSpans()
Get all cell spans.
setKeepOpen(bool $a_keepopen)
setTabs(string $data_tab_txt_key="")
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
__construct(Container $dic, ilPlugin $plugin)
getTemplateOptions(string $a_type="")
This class represents a text area property in a property form.
$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)
getAllCellClasses()
Get all cell classes.
setWidths()
Set cell widths.
setSpans()
Set cell spans.
getCellContent(int $i, int $j)