ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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
 
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
 
 $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\GlobalScreen\Provider\__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: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ 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.

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

Referenced by _renderTable().

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  }
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: shib_login.php:25
$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 608 of file class.ilPCTableGUI.php.

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

Referenced by _renderTable().

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  }
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: shib_login.php:25
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 530 of file class.ilPCTableGUI.php.

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

Referenced by _renderTable().

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  }
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: shib_login.php:25
$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 585 of file class.ilPCTableGUI.php.

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

Referenced by _renderTable().

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  }
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: shib_login.php:25
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 463 of file class.ilPCTableGUI.php.

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

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

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
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
ILIAS COPage PC PCDefinition $pc_definition
static _addStyleCheckboxes(string $a_output, ilPCTable $a_table)
Add style checkboxes in edit mode.
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.
global $DIC
Definition: shib_login.php:25
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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 948 of file class.ilPCTableGUI.php.

References ILIAS\Repository\ctrl().

Referenced by create().

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

◆ centerAlign()

ilPCTableGUI::centerAlign ( )

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

References ilPageContentGUI\updateAndReturn().

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

◆ create()

ilPCTableGUI::create ( )

create new table in dom and update page in db

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

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

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")
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 958 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().

958  : void
959  {
960  $ilCtrl = $this->ctrl;
961  $tpl = $this->tpl;
962  $lng = $this->lng;
963  $ilTabs = $this->tabs;
964 
965  $this->displayValidationError();
966  $this->setTabs();
967  $this->setCellPropertiesSubTabs();
968  $ilTabs->setSubTabActive("cont_alignment");
969  $ilTabs->setTabActive("cont_table_cell_properties");
970 
971  // edit form
972  $form = new ilPropertyFormGUI();
973  $form->setFormAction($ilCtrl->getFormAction($this));
974  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
975 
976  // alignment
977  $options = array(
978  "" => $lng->txt("default"),
979  "Left" => $lng->txt("cont_left"),
980  "Center" => $lng->txt("cont_center"),
981  "Right" => $lng->txt("cont_right")
982  );
983  $si = new ilSelectInputGUI($lng->txt("cont_alignment"), "alignment");
984  $si->setOptions($options);
985  $si->setInfo($lng->txt(""));
986  $form->addItem($si);
987 
988  $form->setKeepOpen(true);
989 
990  $form->addCommandButton("setAlignment", $lng->txt("cont_set_alignment"));
991 
992  $html = $form->getHTML();
993  $html .= "<br />" . $this->renderTable("table_edit", "alignment") . "</form>";
994  $tpl->setContent($html);
995  }
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 709 of file class.ilPCTableGUI.php.

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

709  : void
710  {
711  $ilCtrl = $this->ctrl;
712  $tpl = $this->tpl;
713  $lng = $this->lng;
714  $ilTabs = $this->tabs;
715 
716  $this->displayValidationError();
717  $this->setTabs();
718  $this->setCellPropertiesSubTabs();
719  $ilTabs->setSubTabActive("cont_span");
720  $ilTabs->setTabActive("cont_table_cell_properties");
721 
722  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "components/ILIAS/COPage");
723  $ctpl->setVariable("BTN_NAME", "setSpans");
724  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_spans"));
725  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
726 
727  $html = $ctpl->get();
728  $html .= "<br />" . $this->renderTable("table_edit", "span") . "</form>";
729  $tpl->setContent($html);
730  }
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 646 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().

646  : void
647  {
648  $ilCtrl = $this->ctrl;
649  $tpl = $this->tpl;
650  $lng = $this->lng;
651  $ilTabs = $this->tabs;
652 
653  $this->displayValidationError();
654  $this->setTabs();
655  $this->setCellPropertiesSubTabs();
656  $ilTabs->setSubTabActive("cont_style");
657 
658  // edit form
659  $form = new ilPropertyFormGUI();
660  $form->setFormAction($ilCtrl->getFormAction($this));
661  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
662 
663  // first row style
664  $style = new ilSelectInputGUI(
665  $this->lng->txt("cont_style"),
666  "style"
667  );
668  $this->setBasicTableCellStyles();
669  $this->getCharacteristicsOfCurrentStyle(["table_cell"]); // scorm-2004
670  $chars = $this->getCharacteristics(); // scorm-2004
671  $options = array_merge(array("" => $this->lng->txt("none")), $chars); // scorm-2004
672  $style->setOptions($options);
673 
674  $style->setValue("");
675  $style->setInfo($lng->txt("cont_set_tab_style_info"));
676  $form->addItem($style);
677  $form->setKeepOpen(true);
678 
679  $form->addCommandButton("setStyles", $lng->txt("cont_set_styles"));
680 
681  $html = $form->getHTML();
682  $html .= "<br />" . $this->renderTable("table_edit", "style") . "</form>";
683  $tpl->setContent($html);
684  }
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...
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="")
+ Here is the call graph for this function:

◆ editCellWidth()

ilPCTableGUI::editCellWidth ( )

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

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

686  : void
687  {
688  $ilCtrl = $this->ctrl;
689  $tpl = $this->tpl;
690  $lng = $this->lng;
691  $ilTabs = $this->tabs;
692 
693  $this->displayValidationError();
694  $this->setTabs();
695  $this->setCellPropertiesSubTabs();
696  $ilTabs->setSubTabActive("cont_width");
697  $ilTabs->setTabActive("cont_table_cell_properties");
698 
699  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "components/ILIAS/COPage");
700  $ctpl->setVariable("BTN_NAME", "setWidths");
701  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_widths"));
702  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
703 
704  $html = $ctpl->get();
705  $html .= "<br />" . $this->renderTable("table_edit", "width") . "</form>";
706  $tpl->setContent($html);
707  }
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 1027 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().

1027  : void
1028  {
1029  $this->setTabs();
1030 
1031  $this->displayValidationError();
1032  $this->initEditor();
1033  $this->tpl->addJavaScript("assets/js/AdvancedSelectionList.js");
1034  $this->tpl->addCss(ilObjStyleSheet::getBaseContentStylePath());
1035  $this->tpl->setContent($this->getEditDataTable(true));
1036  }
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 1321 of file class.ilPCTableGUI.php.

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

Referenced by editData().

1321  : string
1322  {
1323  $tab_node = $this->content_obj->getDomNode();
1324  $cnt_i = 0;
1325  $content = "";
1326  $template_xml = "";
1327  // get correct cell and dump content of all its childrem
1328  foreach ($tab_node->firstChild->childNodes as $child) {
1329  if ($i == $cnt_i) {
1330  $cnt_j = 0;
1331  foreach ($child->childNodes as $child2) {
1332  if ($j == $cnt_j) {
1333  foreach ($child2->childNodes as $cell_content_node) {
1334  $content .= $this->dom_util->dump($cell_content_node);
1335  }
1336  }
1337  $cnt_j++;
1338  }
1339  }
1340  $cnt_i++;
1341  }
1342  $trans = $this->pg_obj->getLanguageVariablesXML();
1343  $mobs = $this->pg_obj->getMultimediaXML();
1344  if ($this->getStyleId() > 0) {
1345  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
1346  $style = new ilObjStyleSheet($this->getStyleId());
1347  $template_xml = $style->getTemplateXML();
1348  }
1349  }
1350 
1351  $content = $content . $mobs . $trans . $template_xml;
1352 
1353  return $this->renderCell(
1354  $content,
1355  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
1356  $this->getPage()
1357  );
1358  }
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 1309 of file class.ilPCTableGUI.php.

Referenced by editData().

1309  : string
1310  {
1311  $cap = "";
1312  $base = 26;
1313  while ($nr > 0) {
1314  $chr = ($nr - 1) % $base;
1315  $cap = chr($chr + 65) . $cap;
1316  $nr = ($nr - 1 - $chr) / $base;
1317  }
1318  return $cap;
1319  }
+ 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 897 of file class.ilPCTableGUI.php.

References ilPageContentGUI\getPage().

Referenced by create().

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

◆ getPropertiesFormValues()

ilPCTableGUI::getPropertiesFormValues ( )

Definition at line 402 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().

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.
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, ilPageContentGUI\$lng, $user, 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 ilSelectInputGUI(
260  $this->lng->txt("cont_characteristic_table"),
261  "characteristic"
262  );
263  $chars = $this->getCharacteristics();
264  $templates = $this->getTemplateOptions();
265  $chars = array_merge($templates, $chars);
266  if (is_object($this->content_obj)) {
267  if (($chars[$a_seleted_value] ?? "") == "" && ($this->content_obj->getClass() != "")) {
268  $chars = array_merge(
269  array($this->content_obj->getClass() => $this->content_obj->getClass()),
270  $chars
271  );
272  }
273  }
274  $options = [];
275  foreach ($chars as $k => $char) {
276  if (strpos($k, ":") > 0) {
277  $t = explode(":", $k);
278  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both;" class="small">' . $char . "</div>";
279  } else {
280  $html = '<table class="ilc_table_' . $k . '"><tr><td class="small">' .
281  $char . '</td></tr></table>';
282  }
283  //$char_prop->addOption($k, $char, $html);
284  $options[$k] = $char;
285  }
286  $char_prop->setOptions($options);
287  $char_prop->setValue("StandardTable");
288  $this->form->addItem($char_prop);
289 
290  $nr = array();
291  for ($i = 0; $i <= 3; $i++) {
292  $nr[$i] = $i;
293  }
294 
295  // row header
296  $rh = new ilSelectInputGUI($this->lng->txt("cont_nr_row_header"), "row_header");
297  $rh->setOptions($nr);
298  $rh->setValue(1);
299  $this->form->addItem($rh);
300 
301  // row footer
302  $rf = new ilSelectInputGUI($this->lng->txt("cont_nr_row_footer"), "row_footer");
303  $rf->setOptions($nr);
304  $rf->setValue(0);
305  $this->form->addItem($rf);
306 
307  // col header
308  $ch = new ilSelectInputGUI($this->lng->txt("cont_nr_col_header"), "col_header");
309  $ch->setOptions($nr);
310  $ch->setValue(0);
311  $this->form->addItem($ch);
312 
313  // col footer
314  $cf = new ilSelectInputGUI($this->lng->txt("cont_nr_col_footer"), "col_footer");
315  $cf->setOptions($nr);
316  $cf->setValue(0);
317  $this->form->addItem($cf);
318 
319  if ($a_mode == "create") {
320  // first row style
321  $fr_style = new ilSelectInputGUI(
322  $this->lng->txt("cont_first_row_style"),
323  "first_row_style"
324  );
325  $this->setBasicTableCellStyles();
326  $this->getCharacteristicsOfCurrentStyle(["table_cell"]);
327  $chars = $this->getCharacteristics();
328  $options = array_merge(array("" => $this->lng->txt("none")), $chars);
329  $fr_style->setOptions($options);
330 
331  $fr_style->setValue("");
332  $this->form->addItem($fr_style);
333  }
334 
335  // alignment
336  $align_opts = array("Left" => $lng->txt("cont_left"),
337  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
338  "LeftFloat" => $lng->txt("cont_left_float"),
339  "RightFloat" => $lng->txt("cont_right_float"));
340  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
341  $align->setOptions($align_opts);
342  $align->setValue("Center");
343  $this->form->addItem($align);
344 
345  // caption
346  $caption = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
347  $caption->setSize(60);
348  $this->form->addItem($caption);
349 
350  // caption align
351  $ca_opts = array("top" => $lng->txt("cont_top"),
352  "bottom" => $lng->txt("cont_bottom"));
353  $ca = new ilSelectInputGUI(
354  $this->lng->txt("cont_align"),
355  "cap_align"
356  );
357  $ca->setOptions($ca_opts);
358  $caption->addSubItem($ca);
359 
360  // import
361  if ($a_mode == "create") {
362  // import table
363  $import = new ilRadioGroupInputGUI($this->lng->txt("cont_paste_table"), "import_type");
364  $op = new ilRadioOption($this->lng->txt("cont_html_table"), "html");
365  $import->addOption($op);
366  $op2 = new ilRadioOption($this->lng->txt("cont_spreadsheet_table"), "spreadsheet");
367 
368  $import_data = new ilTextAreaInputGUI("", "import_table");
369  $import_data->setRows(8);
370  $import_data->setCols(50);
371  $op2->addSubItem($import_data);
372 
373  $import->addOption($op2);
374  $import->setValue("html");
375  $this->form->addItem($import);
376  }
377 
378  // language
379  if ($this->getCurrentTextLang() != "") {
380  $s_lang = $this->getCurrentTextLang();
381  } else {
382  $s_lang = $ilUser->getLanguage();
383  }
384  $languages = [];
385  foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
386  $languages[$language->value()] = $language->presentableLabel();
387  }
388  $language = new ilSelectInputGUI($this->lng->txt("language"), "language");
389  $language->setOptions($languages);
390  $language->setValue($s_lang);
391  $this->form->addItem($language);
392 
393  if ($a_mode == "create") {
394  $this->form->addCommandButton("create", $lng->txt("save"));
395  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
396  } else {
397  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
398  $this->form->addCommandButton("editData", $lng->txt("close"));
399  }
400  }
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")
form( $class_path, string $cmd, string $submit_caption="")
getTemplateOptions(string $a_type="")
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCTableGUI::insert ( )

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

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

Referenced by create().

887  : void
888  {
889  $tpl = $this->tpl;
890 
891  $this->displayValidationError();
892  $this->initPropertiesForm("create");
893  $html = $this->form->getHTML();
894  $tpl->setContent($html);
895  }
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 863 of file class.ilPCTableGUI.php.

References ilPageContentGUI\updateAndReturn().

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

◆ leftFloatAlign()

ilPCTableGUI::leftFloatAlign ( )

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

References ilPageContentGUI\updateAndReturn().

875  : void
876  {
877  $this->content_obj->setHorizontalAlign("LeftFloat");
878  $this->updateAndReturn();
879  }
+ 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 1363 of file class.ilPCTableGUI.php.

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

Referenced by getCellContent().

1367  : string {
1368  global $DIC;
1369 
1370  $ilUser = $DIC->user();
1371  $content = "<dummy>" . $content . "</dummy>";
1372 
1373  $wb_path = ilFileUtils::getWebspaceDir("output") . "/";
1374  $enlarge_path = ilUtil::getImagePath("media/enlarge.svg");
1375  $params = array('webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
1376  $output = $this->xsl->process($content, $params);
1377 
1378  // unmask user html
1379  if ($unmask) {
1380  $output = str_replace("&lt;", "<", $output);
1381  $output = str_replace("&gt;", ">", $output);
1382  $output = str_replace("&amp;", "&", $output);
1383  }
1384 
1385  // for all page components...
1386  if (isset($page_object)) {
1387  $defs = $this->pc_definition->getPCDefinitions();
1388  foreach ($defs as $def) {
1389  $pc_class = $def["pc_class"];
1390  $pc_obj = new $pc_class($page_object);
1391 
1392  // post xsl page content modification by pc elements
1393  $output = $pc_obj->modifyPageContentPostXsl((string) $output, "presentation", false);
1394  }
1395  }
1396 
1397 
1398  return $output;
1399  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
global $DIC
Definition: shib_login.php:25
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rightAlign()

ilPCTableGUI::rightAlign ( )

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

References ilPageContentGUI\updateAndReturn().

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

◆ rightFloatAlign()

ilPCTableGUI::rightFloatAlign ( )

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

References ilPageContentGUI\updateAndReturn().

881  : void
882  {
883  $this->content_obj->setHorizontalAlign("RightFloat");
884  $this->updateAndReturn();
885  }
+ 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 844 of file class.ilPCTableGUI.php.

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

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

◆ setAlignment()

ilPCTableGUI::setAlignment ( )

Set cell alignments.

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

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

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  }
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 806 of file class.ilPCTableGUI.php.

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

Referenced by create(), and saveProperties().

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  }
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 783 of file class.ilPCTableGUI.php.

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

783  : void
784  {
785  $lng = $this->lng;
786 
787  $colspans = $this->request->getStringArray("colspan");
788  $rowspans = $this->request->getStringArray("rowspan");
789  $cs = [];
790  $rs = [];
791  if (count($colspans) > 0) {
792  foreach ($colspans as $k => $span) {
793  $cs[$k] = $span;
794  $rs[$k] = $rowspans[$k];
795  }
796  $this->content_obj->setTDSpans($cs, $rs);
797  }
798  $this->updated = $this->pg_obj->update();
799  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
800  $this->ctrl->redirect($this, "editCellSpan");
801  }
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 735 of file class.ilPCTableGUI.php.

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

735  : void
736  {
737  $lng = $this->lng;
738 
739  $target = $this->request->getStringArray("target");
740  if (count($target)) {
741  foreach ($target as $k => $value) {
742  if ($value > 0) {
743  $cid = explode(":", $k);
744  $this->content_obj->setTDClass(
745  ilUtil::stripSlashes($cid[0]),
746  $this->request->getString("style"),
747  ilUtil::stripSlashes($cid[1])
748  );
749  }
750  }
751  }
752  $this->updated = $this->pg_obj->update();
753  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
754  $this->ctrl->redirect($this, "editCellStyle");
755  }
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 760 of file class.ilPCTableGUI.php.

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

760  : void
761  {
762  $lng = $this->lng;
763 
764  $widths = $this->request->getStringArray("width");
765  if (count($widths) > 0) {
766  foreach ($widths as $k => $width) {
767  $cid = explode(":", $k);
768  $this->content_obj->setTDWidth(
769  ilUtil::stripSlashes($cid[0]),
770  ilUtil::stripSlashes($width),
771  ilUtil::stripSlashes($cid[1])
772  );
773  }
774  }
775  $this->updated = $this->pg_obj->update();
776  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
777  $this->ctrl->redirect($this, "editCellWidth");
778  }
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: