ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilPCTableGUI 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 ilPCTableGUI:
+ Collaboration diagram for ilPCTableGUI:

Public Member Functions

 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
 setBasicTableCellStyles ()
 
 executeCommand ()
 
 setTabs (string $data_tab_txt_key="")
 
 setCellPropertiesSubTabs ()
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 
 edit ()
 
 editProperties ()
 
 initPropertiesForm (string $a_mode="edit")
 
 getPropertiesFormValues ()
 
 editCellStyle ()
 
 editCellWidth ()
 
 editCellSpan ()
 
 setStyles ()
 Set cell styles. More...
 
 setWidths ()
 Set cell widths. More...
 
 setSpans ()
 Set cell spans. More...
 
 setProperties ()
 Set properties from input form. More...
 
 saveProperties ()
 save table properties in db and return to page edit screen More...
 
 rightAlign ()
 
 leftAlign ()
 
 centerAlign ()
 
 leftFloatAlign ()
 
 rightFloatAlign ()
 
 insert ()
 
 getNewTableObject ()
 
 create ()
 create new table in dom and update page in db More...
 
 afterCreation ()
 
 editCellAlignment ()
 
 setAlignment ()
 Set cell alignments. More...
 
 editData ()
 Edit data of table. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct (ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id="", string $a_pc_id="0")
 
 setContentObject (ilPageContent $a_val)
 
 getContentObject ()
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 setPageConfig (ilPageConfig $a_val)
 
 getPageConfig ()
 
 setStyleId (int $a_styleid)
 
 getStyleId ()
 
 getStyle ()
 
 getCharacteristicsOfCurrentStyle (array $a_type)
 Get characteristics of current style and call setCharacteristics, if style is given. More...
 
 setCharacteristics (array $a_chars)
 
 getCharacteristics ()
 
 getHierId ()
 
 setHierId (string $a_hier_id)
 set hierarchical id in dom object More...
 
 delete ()
 
 displayValidationError ()
 
 cancelCreate ()
 cancel creating page content More...
 
 cancelUpdate ()
 cancel update More...
 
 cancel ()
 Cancel. More...
 
 deactivate ()
 gui function set enabled if is not enabled and vice versa More...
 
 cut ()
 Cut single element. More...
 
 copy ()
 Copy single element. More...
 
 getTemplateOptions (string $a_type="")
 Get table templates. More...
 

Static Public Member Functions

static _renderTable (string $content, string $a_mode="table_edit", string $a_submode="", ?ilPCTable $a_table_obj=null, bool $unmask=true, ?ilPageObject $page_object=null)
 
static _addStyleCheckboxes (string $a_output, ilPCTable $a_table)
 Add style checkboxes in edit mode. More...
 
static _addAlignmentCheckboxes (string $a_output, ilPCTable $a_table)
 Add alignment checkboxes in edit mode. More...
 
static _addWidthInputs (string $a_output, ilPCTable $a_table)
 Add width inputs. More...
 
static _addSpanInputs (string $a_output, ilPCTable $a_table)
 Add span inputs. More...
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 

Protected Member Functions

 getFormTitle (string $a_mode="edit")
 
 getColumnCaption (int $nr)
 
 getCellContent (int $i, int $j)
 
 renderCell (string $content, bool $unmask=true, ?ilPageObject $page_object=null)
 Static render table function. More...
 
- Protected Member Functions inherited from ilPageContentGUI
 redirectToParent (string $hier_id="")
 
 getParentReturn (string $hier_id="")
 
 updateAndReturn ()
 
 setCurrentTextLang (string $lang_key)
 
 getCurrentTextLang ()
 
 setEditorToolContext ()
 
 initEditor ()
 
 getEditorScriptTag (string $form_pc_id="", string $form_cname="")
 

Protected Attributes

ILIAS COPage Dom DomUtil $dom_util
 
ILIAS COPage PC PCDefinition $pc_definition
 
ILIAS COPage Xsl XslManager $xsl
 
ilPropertyFormGUI $form
 
ilTabsGUI $tabs
 
ilObjUser $user
 
- Protected Attributes inherited from ilPageContentGUI
ILIAS COPage Editor GUIService $editor_gui
 
ILIAS COPage InternalGUIService $gui
 
EditSessionRepository $edit_repo
 
string $pc_id = ""
 
array $chars
 
ilObjStyleSheet $style = null
 
LOMServices $lom_services
 
ilLogger $log
 
int $styleid = 0
 
EditGUIRequest $request
 
string $sub_command = ""
 
int $requested_ref_id = 0
 
ILIAS GlobalScreen ScreenContext ContextServices $tool_context
 
Style Content CharacteristicManager $char_manager
 

Additional Inherited Members

- Data Fields inherited from ilPageContentGUI
ilPageContent $content_obj
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilPageObject $pg_obj
 
string $hier_id = ""
 
DOMDocument $dom
 
array bool null $updated = null
 
string $target_script = ""
 
string $return_location = ""
 
ilPageConfig $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static string $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Static Protected Attributes inherited from ilPageContentGUI
static array $common_bb_buttons
 

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 User Interface for Table Editing

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de See https://mantis.ilias.de/view.php?id=32856 @ilCtrl_Calls ilPCTableGUI: ilAssGenFeedbackPageGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilPCTableGUI::__construct ( ilPageObject  $a_pg_obj,
?ilPageContent  $a_content_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Reimplemented from ilPageContentGUI.

Reimplemented in ilPCDataTableGUI.

Definition at line 34 of file class.ilPCTableGUI.php.

39 {
40 global $DIC;
41
42 $this->tabs = $DIC->tabs();
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->tpl = $DIC["tpl"];
46 $this->user = $DIC->user();
47 parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
48 $this->setCharacteristics(array("StandardTable" => $this->lng->txt("cont_StandardTable")));
49 $this->tool_context = $DIC->globalScreen()->tool()->context();
50 $this->xsl = $DIC->copage()->internal()->domain()->xsl();
51 $this->pc_definition = $DIC
52 ->copage()
53 ->internal()
54 ->domain()
55 ->pc()
56 ->definition();
57 $this->dom_util = $DIC->copage()->internal()->domain()->domUtil();
58 }
setCharacteristics(array $a_chars)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilPageContentGUI\setCharacteristics(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ _addAlignmentCheckboxes()

static ilPCTableGUI::_addAlignmentCheckboxes ( string  $a_output,
ilPCTable  $a_table 
)
static

Add alignment checkboxes in edit mode.

Definition at line 559 of file class.ilPCTableGUI.php.

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 }
$check
Definition: buildRTE.php:81
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...

References $check, and $lng.

◆ _addSpanInputs()

static ilPCTableGUI::_addSpanInputs ( string  $a_output,
ilPCTable  $a_table 
)
static

Add span inputs.

Definition at line 608 of file class.ilPCTableGUI.php.

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 }
getAllCellSpans()
Get all cell spans.

References $lng.

◆ _addStyleCheckboxes()

static ilPCTableGUI::_addStyleCheckboxes ( string  $a_output,
ilPCTable  $a_table 
)
static

Add style checkboxes in edit mode.

Definition at line 530 of file class.ilPCTableGUI.php.

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 }
getAllCellClasses()
Get all cell classes.

References $check, and $lng.

◆ _addWidthInputs()

static ilPCTableGUI::_addWidthInputs ( string  $a_output,
ilPCTable  $a_table 
)
static

Add width inputs.

Definition at line 585 of file class.ilPCTableGUI.php.

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 }
getAllCellWidths()
Get all cell widths.

References $check, and $lng.

◆ _renderTable()

static ilPCTableGUI::_renderTable ( string  $content,
string  $a_mode = "table_edit",
string  $a_submode = "",
?ilPCTable  $a_table_obj = null,
bool  $unmask = true,
?ilPageObject  $page_object = null 
)
static

Definition at line 463 of file class.ilPCTableGUI.php.

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 }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
static _addSpanInputs(string $a_output, ilPCTable $a_table)
Add span inputs.
ILIAS COPage PC PCDefinition $pc_definition
ILIAS COPage Xsl XslManager $xsl
static _addStyleCheckboxes(string $a_output, ilPCTable $a_table)
Add style checkboxes in edit mode.
static _addAlignmentCheckboxes(string $a_output, ilPCTable $a_table)
Add alignment checkboxes in edit mode.
static _addWidthInputs(string $a_output, ilPCTable $a_table)
Add width inputs.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

◆ afterCreation()

ilPCTableGUI::afterCreation ( )

Reimplemented in ilPCDataTableGUI.

Definition at line 948 of file class.ilPCTableGUI.php.

948 : void
949 {
950 $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
951 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ centerAlign()

ilPCTableGUI::centerAlign ( )

Definition at line 869 of file class.ilPCTableGUI.php.

869 : void
870 {
871 $this->content_obj->setHorizontalAlign("Center");
872 $this->updateAndReturn();
873 }

◆ create()

ilPCTableGUI::create ( )

create new table in dom and update page in db

Definition at line 905 of file class.ilPCTableGUI.php.

905 : 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 }
initPropertiesForm(string $a_mode="edit")
setProperties()
Set properties from input form.
form(?array $class_path, string $cmd, string $submit_caption="")

References ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ edit()

ilPCTableGUI::edit ( )

Definition at line 171 of file class.ilPCTableGUI.php.

171 : void
172 {
173 $this->ctrl->redirect($this, "editData");
174 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editCellAlignment()

ilPCTableGUI::editCellAlignment ( )

Definition at line 958 of file class.ilPCTableGUI.php.

958 : void
959 {
960 $ilCtrl = $this->ctrl;
963 $ilTabs = $this->tabs;
964
965 $this->displayValidationError();
966 $this->setTabs();
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 }
setFormAction(string $a_formaction)
setKeepOpen(bool $a_keepopen)
ilPropertyFormGUI $form
setTabs(string $data_tab_txt_key="")
ilGlobalTemplateInterface $tpl
This class represents a property form user interface.
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a selection list property in a property form.
setContent(string $a_html)
Sets content for standard template.

References $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\News\Common\Table\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ilFormGUI\setFormAction(), ilFormGUI\setKeepOpen(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ editCellSpan()

ilPCTableGUI::editCellSpan ( )

Definition at line 709 of file class.ilPCTableGUI.php.

709 : void
710 {
711 $ilCtrl = $this->ctrl;
714 $ilTabs = $this->tabs;
715
716 $this->displayValidationError();
717 $this->setTabs();
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 }
special template class to simplify handling of ITX/PEAR

References $lng, ILIAS\News\Common\Table\$tpl, and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ editCellStyle()

ilPCTableGUI::editCellStyle ( )

Definition at line 646 of file class.ilPCTableGUI.php.

646 : void
647 {
648 $ilCtrl = $this->ctrl;
651 $ilTabs = $this->tabs;
652
653 $this->displayValidationError();
654 $this->setTabs();
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
665 $this->lng->txt("cont_style"),
666 "style"
667 );
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"));
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 }
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.

References $lng, ILIAS\UI\Implementation\Component\Input\Field\$options, ILIAS\News\Common\Table\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), ILIAS\UICore\GlobalTemplate\setContent(), ilFormGUI\setFormAction(), ilFormGUI\setKeepOpen(), and ilPropertyFormGUI\setTitle().

+ Here is the call graph for this function:

◆ editCellWidth()

ilPCTableGUI::editCellWidth ( )

Definition at line 686 of file class.ilPCTableGUI.php.

686 : void
687 {
688 $ilCtrl = $this->ctrl;
691 $ilTabs = $this->tabs;
692
693 $this->displayValidationError();
694 $this->setTabs();
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 }

References $lng, ILIAS\News\Common\Table\$tpl, and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ editData()

ilPCTableGUI::editData ( )

Edit data of table.

Definition at line 1027 of file class.ilPCTableGUI.php.

1027 : void
1028 {
1029 $this->setTabs();
1030
1031 $this->displayValidationError();
1032 $this->initEditor();
1033 $this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
1034 $this->tpl->setContent($this->getEditDataTable(true));
1035 }

References ilObjStyleSheet\getBaseContentStylePath().

Referenced by ilPCDataTableGUI\update(), and ilPCDataTableGUI\updateJS().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editProperties()

ilPCTableGUI::editProperties ( )

Definition at line 176 of file class.ilPCTableGUI.php.

176 : void
177 {
179
180 $this->displayValidationError();
181 $this->setTabs();
182
183 $this->initPropertiesForm();
185 $html = $this->form->getHTML();
186 $html .= "<br />" . $this->renderTable("");
187 $tpl->setContent($html);
188 }

References ILIAS\News\Common\Table\$tpl, ILIAS\Repository\form(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ executeCommand()

ilPCTableGUI::executeCommand ( )
Returns
mixed

Reimplemented in ilPCDataTableGUI.

Definition at line 69 of file class.ilPCTableGUI.php.

69 : mixed
70 {
71 $this->getCharacteristicsOfCurrentStyle(["table"]); // scorm-2004
72
73 // get next class that processes or forwards current command
74 $next_class = $this->ctrl->getNextClass($this);
75
76 // get current command
77 $cmd = $this->ctrl->getCmd();
78
79 switch ($next_class) {
80 default:
81 $this->$cmd();
82 break;
83 }
84 return "";
85 }

References ILIAS\Repository\ctrl(), and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

+ Here is the call graph for this function:

◆ getCellContent()

ilPCTableGUI::getCellContent ( int  $i,
int  $j 
)
protected

Reimplemented in ilPCDataTableGUI.

Definition at line 1328 of file class.ilPCTableGUI.php.

1328 : string
1329 {
1330 $tab_node = $this->content_obj->getDomNode();
1331 $cnt_i = 0;
1332 $content = "";
1333 $template_xml = "";
1334 // get correct cell and dump content of all its childrem
1335 foreach ($tab_node->firstChild->childNodes as $child) {
1336 if ($i == $cnt_i) {
1337 $cnt_j = 0;
1338 foreach ($child->childNodes as $child2) {
1339 if ($j == $cnt_j) {
1340 foreach ($child2->childNodes as $cell_content_node) {
1341 $content .= $this->dom_util->dump($cell_content_node);
1342 }
1343 }
1344 $cnt_j++;
1345 }
1346 }
1347 $cnt_i++;
1348 }
1349 $trans = $this->pg_obj->getLanguageVariablesXML();
1350 $mobs = $this->pg_obj->getMultimediaXML();
1351 if ($this->getStyleId() > 0) {
1352 if (ilObject::_lookupType($this->getStyleId()) == "sty") {
1353 $style = new ilObjStyleSheet($this->getStyleId());
1354 $template_xml = $style->getTemplateXML();
1355 }
1356 }
1357
1358 $content = $content . $mobs . $trans . $template_xml;
1359
1360 return $this->renderCell(
1361 $content,
1362 !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
1363 $this->getPage()
1364 );
1365 }
Class ilObjStyleSheet.
getTemplateXML()
Get table template xml.
static _lookupType(int $id, bool $reference=false)
renderCell(string $content, bool $unmask=true, ?ilPageObject $page_object=null)
Static render table function.

References ilObject\_lookupType().

+ Here is the call graph for this function:

◆ getColumnCaption()

ilPCTableGUI::getColumnCaption ( int  $nr)
protected

Definition at line 1316 of file class.ilPCTableGUI.php.

1316 : string
1317 {
1318 $cap = "";
1319 $base = 26;
1320 while ($nr > 0) {
1321 $chr = ($nr - 1) % $base;
1322 $cap = chr($chr + 65) . $cap;
1323 $nr = ($nr - 1 - $chr) / $base;
1324 }
1325 return $cap;
1326 }

◆ getFormTitle()

ilPCTableGUI::getFormTitle ( string  $a_mode = "edit")
protected

Reimplemented in ilPCDataTableGUI.

Definition at line 190 of file class.ilPCTableGUI.php.

190 : string
191 {
192 if ($a_mode === "create") {
193 return $this->lng->txt("cont_insert_table");
194 }
195 return $this->lng->txt("cont_table_properties");
196 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getNewTableObject()

ilPCTableGUI::getNewTableObject ( )

Reimplemented in ilPCDataTableGUI.

Definition at line 897 of file class.ilPCTableGUI.php.

897 : ilPCTable
898 {
899 return new ilPCTable($this->getPage());
900 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getPropertiesFormValues()

ilPCTableGUI::getPropertiesFormValues ( )

Definition at line 402 of file class.ilPCTableGUI.php.

402 : 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 }
static _lookupTemplateIdByName(int $a_style_id, string $a_name)
Lookup table template preview.

References ilObjStyleSheet\_lookupTemplateIdByName(), and ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ getTemplateOptions()

ilPCTableGUI::getTemplateOptions ( string  $a_type = "")

Get table templates.

Reimplemented from ilPageContentGUI.

Definition at line 166 of file class.ilPCTableGUI.php.

166 : array
167 {
168 return parent::getTemplateOptions("table");
169 }

◆ initPropertiesForm()

ilPCTableGUI::initPropertiesForm ( string  $a_mode = "edit")

Definition at line 198 of file class.ilPCTableGUI.php.

200 : void {
201 $a_seleted_value = "";
202 $ilCtrl = $this->ctrl;
204 $ilUser = $this->user;
205
206 $this->form = new ilPropertyFormGUI();
207 $this->form->setFormAction($ilCtrl->getFormAction($this));
208 $this->form->setTitle($this->getFormTitle($a_mode));
209
210 if ($a_mode == "create") {
211 $nr = array();
212 for ($i = 1; $i <= 20; $i++) {
213 $nr[$i] = $i;
214 }
215
216 // cols
217 $cols = new ilSelectInputGUI($this->lng->txt("cont_nr_cols"), "nr_cols");
218 $cols->setOptions($nr);
219 $cols->setValue(2);
220 $this->form->addItem($cols);
221
222 // rows
223 $rows = new ilSelectInputGUI($this->lng->txt("cont_nr_rows"), "nr_rows");
224 $rows->setOptions($nr);
225 $rows->setValue(2);
226 $this->form->addItem($rows);
227 }
228
229 // width
230 $width = new ilTextInputGUI($this->lng->txt("cont_table_width"), "width");
231 $width->setSize(6);
232 $width->setInfo($lng->txt("cont_width_px_perc_info"));
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 );
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 }
getTemplateOptions(string $a_type="")
Get table templates.
getFormTitle(string $a_mode="edit")
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a text area property in a property form.
This class represents a text property in a property form.

◆ insert()

ilPCTableGUI::insert ( )

Definition at line 887 of file class.ilPCTableGUI.php.

887 : void
888 {
890
891 $this->displayValidationError();
892 $this->initPropertiesForm("create");
893 $html = $this->form->getHTML();
894 $tpl->setContent($html);
895 }

References ILIAS\News\Common\Table\$tpl, ILIAS\Repository\form(), and ILIAS\UICore\GlobalTemplate\setContent().

+ Here is the call graph for this function:

◆ leftAlign()

ilPCTableGUI::leftAlign ( )

Definition at line 863 of file class.ilPCTableGUI.php.

863 : void
864 {
865 $this->content_obj->setHorizontalAlign("Left");
866 $this->updateAndReturn();
867 }

◆ leftFloatAlign()

ilPCTableGUI::leftFloatAlign ( )

Definition at line 875 of file class.ilPCTableGUI.php.

875 : void
876 {
877 $this->content_obj->setHorizontalAlign("LeftFloat");
878 $this->updateAndReturn();
879 }

◆ renderCell()

ilPCTableGUI::renderCell ( string  $content,
bool  $unmask = true,
?ilPageObject  $page_object = null 
)
protected

Static render table function.

Definition at line 1370 of file class.ilPCTableGUI.php.

1374 : string {
1375 global $DIC;
1376
1377 $ilUser = $DIC->user();
1378 $content = "<dummy>" . $content . "</dummy>";
1379
1380 $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
1381 $enlarge_path = ilUtil::getImagePath("media/enlarge.svg");
1382 $params = array('webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
1383 $output = $this->xsl->process($content, $params);
1384
1385 // unmask user html
1386 if ($unmask) {
1387 $output = str_replace("&lt;", "<", $output);
1388 $output = str_replace("&gt;", ">", $output);
1389 $output = str_replace("&amp;", "&", $output);
1390 }
1391
1392 // for all page components...
1393 if (isset($page_object)) {
1394 $defs = $this->pc_definition->getPCDefinitions();
1395 foreach ($defs as $def) {
1396 $pc_class = $def["pc_class"];
1397 $pc_obj = new $pc_class($page_object);
1398
1399 // post xsl page content modification by pc elements
1400 $output = $pc_obj->modifyPageContentPostXsl((string) $output, "presentation", false);
1401 }
1402 }
1403
1404
1405 return $output;
1406 }

◆ rightAlign()

ilPCTableGUI::rightAlign ( )

Definition at line 857 of file class.ilPCTableGUI.php.

857 : void
858 {
859 $this->content_obj->setHorizontalAlign("Right");
860 $this->updateAndReturn();
861 }

◆ rightFloatAlign()

ilPCTableGUI::rightFloatAlign ( )

Definition at line 881 of file class.ilPCTableGUI.php.

881 : void
882 {
883 $this->content_obj->setHorizontalAlign("RightFloat");
884 $this->updateAndReturn();
885 }

◆ saveProperties()

ilPCTableGUI::saveProperties ( )

save table properties in db and return to page edit screen

Definition at line 844 of file class.ilPCTableGUI.php.

844 : 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 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setAlignment()

ilPCTableGUI::setAlignment ( )

Set cell alignments.

Definition at line 1000 of file class.ilPCTableGUI.php.

1000 : 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 }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References $lng, ILIAS\Repository\ctrl(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setBasicTableCellStyles()

ilPCTableGUI::setBasicTableCellStyles ( )

Definition at line 60 of file class.ilPCTableGUI.php.

60 : void
61 {
62 $this->setCharacteristics(array("Cell1" => "Cell1", "Cell2" => "Cell2",
63 "Cell3" => "Cell3", "Cell4" => "Cell4"));
64 }

References ilPageContentGUI\setCharacteristics().

+ Here is the call graph for this function:

◆ setCellPropertiesSubTabs()

ilPCTableGUI::setCellPropertiesSubTabs ( )

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

132 : void
133 {
134 $ilTabs = $this->tabs;
135 $ilCtrl = $this->ctrl;
136
137 $ilTabs->addSubTabTarget(
138 "cont_style",
139 $ilCtrl->getLinkTarget($this, "editCellStyle"),
140 "editCellStyle",
141 get_class($this)
142 );
143
144 $ilTabs->addSubTabTarget(
145 "cont_width",
146 $ilCtrl->getLinkTarget($this, "editCellWidth"),
147 "editCellWidth",
148 get_class($this)
149 );
150
151 $ilTabs->addSubTabTarget(
152 "cont_alignment",
153 $ilCtrl->getLinkTarget($this, "editCellAlignment"),
154 "editCellAlignment",
155 get_class($this)
156 );
157
158 $ilTabs->addSubTabTarget(
159 "cont_span",
160 $ilCtrl->getLinkTarget($this, "editCellSpan"),
161 "editCellSpan",
162 get_class($this)
163 );
164 }

◆ setProperties()

ilPCTableGUI::setProperties ( )

Set properties from input form.

Definition at line 806 of file class.ilPCTableGUI.php.

806 : 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 }

References ILIAS\Repository\form().

+ Here is the call graph for this function:

◆ setSpans()

ilPCTableGUI::setSpans ( )

Set cell spans.

Definition at line 783 of file class.ilPCTableGUI.php.

783 : void
784 {
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 }

References $lng, and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ setStyles()

ilPCTableGUI::setStyles ( )

Set cell styles.

Definition at line 735 of file class.ilPCTableGUI.php.

735 : void
736 {
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 }

References $lng, ILIAS\Scripts\PHPStan\$target, ILIAS\Repository\ctrl(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ setTabs()

ilPCTableGUI::setTabs ( string  $data_tab_txt_key = "")

Reimplemented in ilPCDataTableGUI.

Definition at line 87 of file class.ilPCTableGUI.php.

89 : void {
90 $ilTabs = $this->tabs;
91 $ilCtrl = $this->ctrl;
93
94 $ilTabs->setBackTarget(
95 "",
96 ""
97 );
98
99 return;
100
101 $ilTabs->setBackTarget(
102 $lng->txt("pg"),
103 (string) $this->ctrl->getParentReturn($this)
104 );
105
106 if ($data_tab_txt_key == "") {
107 $data_tab_txt_key = "cont_table_edit_cells";
108 }
109
110 $ilTabs->addTarget(
111 $data_tab_txt_key,
112 $ilCtrl->getLinkTarget($this, "editData"),
113 "editData",
114 get_class($this)
115 );
116
117 $ilTabs->addTarget(
118 "cont_table_properties",
119 $ilCtrl->getLinkTarget($this, "editProperties"),
120 "editProperties",
121 get_class($this)
122 );
123
124 $ilTabs->addTarget(
125 "cont_table_cell_properties",
126 $ilCtrl->getLinkTarget($this, "editCellStyle"),
127 "editCellStyle",
128 get_class($this)
129 );
130 }

◆ setWidths()

ilPCTableGUI::setWidths ( )

Set cell widths.

Definition at line 760 of file class.ilPCTableGUI.php.

760 : void
761 {
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 }

References $lng, ILIAS\Repository\ctrl(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $dom_util

ILIAS COPage Dom DomUtil ilPCTableGUI::$dom_util
protected

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

◆ $form

ilPropertyFormGUI ilPCTableGUI::$form
protected

Definition at line 30 of file class.ilPCTableGUI.php.

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPCTableGUI::$pc_definition
protected

Definition at line 28 of file class.ilPCTableGUI.php.

◆ $tabs

ilTabsGUI ilPCTableGUI::$tabs
protected

Definition at line 31 of file class.ilPCTableGUI.php.

◆ $user

ilObjUser ilPCTableGUI::$user
protected

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

◆ $xsl

ILIAS COPage Xsl XslManager ilPCTableGUI::$xsl
protected

Definition at line 29 of file class.ilPCTableGUI.php.


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