ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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="")
 
 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 ( $content, $unmask=true, $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
 
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
 
 $updated
 
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 ilPCTableGUI: ilAssGenFeedbackPageGUI

Definition at line 26 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 = "" 
)

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilPageContentGUI\setCharacteristics(), ILIAS\Repository\tabs(), and ILIAS\Repository\user().

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  }
setCharacteristics(array $a_chars)
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ 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 557 of file class.ilPCTableGUI.php.

References $check, $DIC, ilPageContentGUI\$lng, ilPCTable\getAllCellAlignments(), and ilLanguage\txt().

Referenced by _renderTable().

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  }
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...
global $DIC
Definition: feed.php:28
$check
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _addSpanInputs()

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

Add span inputs.

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

References $DIC, ilPageContentGUI\$lng, ilPCTable\getAllCellSpans(), and ilLanguage\txt().

Referenced by _renderTable().

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  }
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...
global $DIC
Definition: feed.php:28
getAllCellSpans()
Get all cell spans.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _addStyleCheckboxes()

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

Add style checkboxes in edit mode.

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

References $check, $DIC, ilPageContentGUI\$lng, ilPCTable\getAllCellClasses(), and ilLanguage\txt().

Referenced by _renderTable().

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  }
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...
global $DIC
Definition: feed.php:28
$check
Definition: buildRTE.php:81
getAllCellClasses()
Get all cell classes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _addWidthInputs()

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

Add width inputs.

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

References $check, $DIC, ilPageContentGUI\$lng, ilPCTable\getAllCellWidths(), and ilLanguage\txt().

Referenced by _renderTable().

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  }
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...
global $DIC
Definition: feed.php:28
getAllCellWidths()
Get all cell widths.
$check
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _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 461 of file class.ilPCTableGUI.php.

References $DIC, $params, _addAlignmentCheckboxes(), _addSpanInputs(), _addStyleCheckboxes(), _addWidthInputs(), ilUtil\getImagePath(), and ilFileUtils\getWebspaceDir().

Referenced by ilObjStyleSheetGUI\_getTemplatePreview(), and getPropertiesFormValues().

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  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
ILIAS COPage PC PCDefinition $pc_definition
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _addStyleCheckboxes(string $a_output, ilPCTable $a_table)
Add style checkboxes in edit mode.
global $DIC
Definition: feed.php:28
static _addSpanInputs(string $a_output, ilPCTable $a_table)
Add span inputs.
static _addAlignmentCheckboxes(string $a_output, ilPCTable $a_table)
Add alignment checkboxes in edit mode.
ILIAS COPage Xsl XslManager $xsl
static _addWidthInputs(string $a_output, ilPCTable $a_table)
Add width inputs.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterCreation()

ilPCTableGUI::afterCreation ( )

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

References ILIAS\Repository\ctrl().

Referenced by create().

950  : void
951  {
952  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
953  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ centerAlign()

ilPCTableGUI::centerAlign ( )

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

References ilPageContentGUI\updateAndReturn().

871  : void
872  {
873  $this->content_obj->setHorizontalAlign("Center");
874  $this->updateAndReturn();
875  }
+ Here is the call graph for this function:

◆ create()

ilPCTableGUI::create ( )

create new table in dom and update page in db

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

References afterCreation(), ILIAS\Repository\form(), getNewTableObject(), initPropertiesForm(), insert(), and setProperties().

907  : 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  }
initPropertiesForm(string $a_mode="edit")
form( $class_path, string $cmd, string $submit_caption="")
setProperties()
Set properties from input form.
+ Here is the call graph for this function:

◆ edit()

ilPCTableGUI::edit ( )

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

References ILIAS\Repository\ctrl().

Referenced by saveProperties().

172  : void
173  {
174  $this->ctrl->redirect($this, "editData");
175  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editCellAlignment()

ilPCTableGUI::editCellAlignment ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPageContentGUI\displayValidationError(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), setCellPropertiesSubTabs(), ilGlobalTemplateInterface\setContent(), ilFormGUI\setFormAction(), ilFormGUI\setKeepOpen(), ilSelectInputGUI\setOptions(), setTabs(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

960  : 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  }
This class represents a selection list property in a property form.
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...
ilPropertyFormGUI $form
setOptions(array $a_options)
setContent(string $a_html)
Sets content for standard template.
setFormAction(string $a_formaction)
ilGlobalTemplateInterface $tpl
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
setKeepOpen(bool $a_keepopen)
setTabs(string $data_tab_txt_key="")
+ Here is the call graph for this function:

◆ editCellSpan()

ilPCTableGUI::editCellSpan ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), setCellPropertiesSubTabs(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

711  : 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  }
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
setTabs(string $data_tab_txt_key="")
+ Here is the call graph for this function:

◆ editCellStyle()

ilPCTableGUI::editCellStyle ( )

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

References ilPageContentGUI\$chars, ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, ilPageContentGUI\$style, $tabs, ilPageContentGUI\$tpl, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilPageContentGUI\displayValidationError(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), ilPropertyFormGUI\getHTML(), ILIAS\Repository\lng(), setBasicTableCellStyles(), setCellPropertiesSubTabs(), ilGlobalTemplateInterface\setContent(), ilFormGUI\setFormAction(), ilFormGUI\setKeepOpen(), setTabs(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

644  : 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  }
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
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...
ilPropertyFormGUI $form
setContent(string $a_html)
Sets content for standard template.
setFormAction(string $a_formaction)
ilGlobalTemplateInterface $tpl
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
setKeepOpen(bool $a_keepopen)
setTabs(string $data_tab_txt_key="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ editCellWidth()

ilPCTableGUI::editCellWidth ( )

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), setCellPropertiesSubTabs(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

688  : 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  }
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...
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
setTabs(string $data_tab_txt_key="")
+ Here is the call graph for this function:

◆ editData()

ilPCTableGUI::editData ( )

Edit data of table.

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

References ilPageContentGUI\$content_obj, ilPageContentGUI\$ctrl, $id, $path, ilPageContentGUI\$style, ilObjStyleSheet\_lookupTemplateIdByName(), ILIAS\Repository\ctrl(), ilPageContentGUI\displayValidationError(), ilObjStyleSheet\getBaseContentStylePath(), getCellContent(), getColumnCaption(), ilPageContentGUI\getEditorScriptTag(), ilPageContentGUI\getHierId(), ilInternalLinkGUI\getInitHTML(), ilPageContentGUI\getStyleId(), ilPageContentGUI\initEditor(), ILIAS\Repository\int(), ILIAS\Repository\lng(), and setTabs().

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

1029  : 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  }
setTabs(string $data_tab_txt_key="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editProperties()

ilPCTableGUI::editProperties ( )

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), getPropertiesFormValues(), initPropertiesForm(), ilGlobalTemplateInterface\setContent(), and setTabs().

177  : 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  }
initPropertiesForm(string $a_mode="edit")
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
setTabs(string $data_tab_txt_key="")
+ Here is the call graph for this function:

◆ executeCommand()

ilPCTableGUI::executeCommand ( )
Returns
mixed

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

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

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  }
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
+ Here is the call graph for this function:

◆ getCellContent()

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

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

References ilPageContentGUI\$style, ilObject\_lookupType(), ilPageContentGUI\getPage(), ilPageContentGUI\getStyleId(), ilObjStyleSheet\getTemplateXML(), and renderCell().

Referenced by editData().

1323  : 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  }
renderCell( $content, $unmask=true, $page_object=null)
Static render table function.
getTemplateXML()
Get table template xml.
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getColumnCaption()

ilPCTableGUI::getColumnCaption ( int  $nr)
protected

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

Referenced by editData().

1311  : 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  }
+ Here is the caller graph for this function:

◆ getFormTitle()

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

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

References ILIAS\Repository\lng().

Referenced by initPropertiesForm().

191  : 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  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewTableObject()

ilPCTableGUI::getNewTableObject ( )

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

References ilPageContentGUI\getPage().

Referenced by create().

899  : ilPCTable
900  {
901  return new ilPCTable($this->getPage());
902  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPropertiesFormValues()

ilPCTableGUI::getPropertiesFormValues ( )

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

References ilPageContentGUI\$content_obj, ilPageContentGUI\$style, ilObjStyleSheet\_lookupTemplateIdByName(), ilObject\_lookupType(), _renderTable(), ILIAS\Repository\form(), ilPageContentGUI\getPage(), ilPageContentGUI\getStyleId(), and ilObjStyleSheet\getTemplateXML().

Referenced by editProperties().

400  : 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  }
static _lookupTemplateIdByName(int $a_style_id, string $a_name)
Lookup table template preview.
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplateOptions()

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

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

Referenced by ilPCDataTableGUI\initCreationForm(), ilPCDataTableGUI\initEditingForm(), ilPCDataTableGUI\initImportForm(), and initPropertiesForm().

167  : array
168  {
169  return parent::getTemplateOptions("table");
170  }
+ Here is the caller graph for this function:

◆ initPropertiesForm()

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

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

References ilPageContentGUI\$chars, ilPageContentGUI\$ctrl, $lang, ilPageContentGUI\$lng, $user, ilMDLanguageItem\_getLanguages(), ilRadioOption\addSubItem(), ILIAS\Repository\form(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), ilPageContentGUI\getCurrentTextLang(), getFormTitle(), getTemplateOptions(), ILIAS\Repository\lng(), setBasicTableCellStyles(), ilSelectInputGUI\setOptions(), and ilLanguage\txt().

Referenced by create(), editProperties(), insert(), and setProperties().

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  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given.
This class represents a selection list property in a property form.
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...
setOptions(array $a_options)
This class represents a property in a property form.
getFormTitle(string $a_mode="edit")
$lang
Definition: xapiexit.php:26
form( $class_path, string $cmd, string $submit_caption="")
getTemplateOptions(string $a_type="")
This class represents a text area property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCTableGUI::insert ( )

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

References ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ILIAS\Repository\form(), initPropertiesForm(), and ilGlobalTemplateInterface\setContent().

Referenced by create().

889  : void
890  {
891  $tpl = $this->tpl;
892 
893  $this->displayValidationError();
894  $this->initPropertiesForm("create");
895  $html = $this->form->getHTML();
896  $tpl->setContent($html);
897  }
initPropertiesForm(string $a_mode="edit")
setContent(string $a_html)
Sets content for standard template.
ilGlobalTemplateInterface $tpl
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leftAlign()

ilPCTableGUI::leftAlign ( )

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

References ilPageContentGUI\updateAndReturn().

865  : void
866  {
867  $this->content_obj->setHorizontalAlign("Left");
868  $this->updateAndReturn();
869  }
+ Here is the call graph for this function:

◆ leftFloatAlign()

ilPCTableGUI::leftFloatAlign ( )

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

References ilPageContentGUI\updateAndReturn().

877  : void
878  {
879  $this->content_obj->setHorizontalAlign("LeftFloat");
880  $this->updateAndReturn();
881  }
+ Here is the call graph for this function:

◆ renderCell()

ilPCTableGUI::renderCell (   $content,
  $unmask = true,
  $page_object = null 
)
protected

Static render table function.

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

References $DIC, $params, ilUtil\getImagePath(), and ilFileUtils\getWebspaceDir().

Referenced by getCellContent().

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  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rightAlign()

ilPCTableGUI::rightAlign ( )

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

References ilPageContentGUI\updateAndReturn().

859  : void
860  {
861  $this->content_obj->setHorizontalAlign("Right");
862  $this->updateAndReturn();
863  }
+ Here is the call graph for this function:

◆ rightFloatAlign()

ilPCTableGUI::rightFloatAlign ( )

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

References ilPageContentGUI\updateAndReturn().

883  : void
884  {
885  $this->content_obj->setHorizontalAlign("RightFloat");
886  $this->updateAndReturn();
887  }
+ Here is the call graph for this function:

◆ saveProperties()

ilPCTableGUI::saveProperties ( )

save table properties in db and return to page edit screen

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

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

846  : 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  }
setProperties()
Set properties from input form.
+ Here is the call graph for this function:

◆ setAlignment()

ilPCTableGUI::setAlignment ( )

Set cell alignments.

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

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

1002  : 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  }
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...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

◆ setBasicTableCellStyles()

ilPCTableGUI::setBasicTableCellStyles ( )

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

References ilPageContentGUI\setCharacteristics().

Referenced by editCellStyle(), ilPCDataTableGUI\initCellPropertiesForm(), and initPropertiesForm().

61  : void
62  {
63  $this->setCharacteristics(array("Cell1" => "Cell1", "Cell2" => "Cell2",
64  "Cell3" => "Cell3", "Cell4" => "Cell4"));
65  }
setCharacteristics(array $a_chars)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCellPropertiesSubTabs()

ilPCTableGUI::setCellPropertiesSubTabs ( )

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

References ilPageContentGUI\$ctrl, and $tabs.

Referenced by editCellAlignment(), editCellSpan(), editCellStyle(), and editCellWidth().

133  : 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  }
+ Here is the caller graph for this function:

◆ setProperties()

ilPCTableGUI::setProperties ( )

Set properties from input form.

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

References ILIAS\Repository\form(), and initPropertiesForm().

Referenced by create(), and saveProperties().

808  : 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  }
initPropertiesForm(string $a_mode="edit")
form( $class_path, string $cmd, string $submit_caption="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSpans()

ilPCTableGUI::setSpans ( )

Set cell spans.

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

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

785  : 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  }
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...
+ Here is the call graph for this function:

◆ setStyles()

ilPCTableGUI::setStyles ( )

Set cell styles.

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

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

737  : 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  }
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...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

◆ setTabs()

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

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

References ilPageContentGUI\$ctrl, ilPageContentGUI\$lng, $tabs, ILIAS\Repository\ctrl(), and ilLanguage\txt().

Referenced by editCellAlignment(), editCellSpan(), editCellStyle(), editCellWidth(), editData(), and editProperties().

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  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setWidths()

ilPCTableGUI::setWidths ( )

Set cell widths.

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

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

762  : 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  }
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...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

Field Documentation

◆ $dom_util

ILIAS COPage Dom DomUtil ilPCTableGUI::$dom_util
protected

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

◆ $form

◆ $pc_definition

ILIAS COPage PC PCDefinition ilPCTableGUI::$pc_definition
protected

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

◆ $tabs

ilTabsGUI ilPCTableGUI::$tabs
protected

◆ $user

◆ $xsl

ILIAS COPage Xsl XslManager ilPCTableGUI::$xsl
protected

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


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