ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPCTableGUI Class Reference

Class ilPCTableGUI. More...

+ Inheritance diagram for ilPCTableGUI:
+ Collaboration diagram for ilPCTableGUI:

Public Member Functions

 __construct (&$a_pg_obj, &$a_content_obj, $a_hier_id, $a_pc_id="")
 Constructor public. More...
 
 setBasicTableCellStyles ()
 Set basic table cell styles. More...
 
 executeCommand ()
 execute command More...
 
 setTabs ()
 Set tabs. More...
 
 setCellPropertiesSubTabs ()
 Set tabs. More...
 
 getTemplateOptions ($a_type="")
 Get table templates. More...
 
 edit ()
 edit properties form More...
 
 initPropertiesForm ($a_mode="edit")
 Init properties form. More...
 
 getPropertiesFormValues ()
 Get properties form. More...
 
 renderTable ($a_mode="table_edit", $a_submode="")
 Render the table. More...
 
 editCellStyle ()
 Edit cell styles. More...
 
 editCellWidth ()
 Edit cell widths. More...
 
 editCellSpan ()
 Edit cell spans. More...
 
 setStyles ()
 Set cell styles and. 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 ()
 align table to right More...
 
 leftAlign ()
 align table to left More...
 
 centerAlign ()
 align table to left More...
 
 leftFloatAlign ()
 align table to left float More...
 
 rightFloatAlign ()
 align table to left More...
 
 insert ()
 insert new table form More...
 
 getNewTableObject ()
 Get new table object. More...
 
 create ()
 create new table in dom and update page in db More...
 
 afterCreation ()
 After creation processing. More...
 
 editCellAlignment ()
 Edit cell styles. More...
 
 setAlignment ()
 Set cell alignments. More...
 
- Public Member Functions inherited from ilPageContentGUI
 __construct ($a_pg_obj, $a_content_obj, $a_hier_id=0, $a_pc_id="")
 Constructor public. More...
 
 setContentObject ($a_val)
 Set content object. More...
 
 getContentObject ()
 Get content object. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 setPageConfig ($a_val)
 Set Page Config. More...
 
 getPageConfig ()
 Get Page Config. More...
 
 setStyleId ($a_styleid)
 Set Style Id. More...
 
 getStyleId ()
 Get Style Id. More...
 
 getStyle ()
 Get style object. More...
 
 setCharacteristics ($a_chars)
 Set Characteristics. More...
 
 getCharacteristics ()
 Get characteristics. More...
 
 getHierId ()
 get hierarchical id in dom object More...
 
 setHierId ($a_hier_id)
 get hierarchical id in dom object More...
 
 getBBMenu ($a_ta_name="par_content")
 Get the bb menu incl. More...
 
 delete ()
 delete content element More...
 
 moveAfter ()
 move content element after another element More...
 
 moveBefore ()
 move content element before another element More...
 
 splitPage ()
 split page to new page at specified position More...
 
 splitPageNext ()
 split page to next page at specified position More...
 
 displayValidationError ()
 display validation errors More...
 
 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 ($a_type)
 Get table templates. More...
 

Static Public Member Functions

static _renderTable ( $content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true)
 Static render table function. More...
 
static _addStyleCheckboxes ($a_output, $a_table)
 Add style checkboxes in edit mode. More...
 
static _addAlignmentCheckboxes ($a_output, $a_table)
 Add alignment checkboxes in edit mode. More...
 
static _addWidthInputs ($a_output, $a_table)
 Add width inputs. More...
 
static _addSpanInputs ($a_output, $a_table)
 Add span inputs. More...
 
- Static Public Member Functions inherited from ilPageContentGUI
static _getCommonBBButtons ()
 Get common bb buttons. More...
 

Protected Attributes

 $tabs
 
 $user
 
- Protected Attributes inherited from ilPageContentGUI
 $error
 
 $log
 

Additional Inherited Members

- Data Fields inherited from ilPageContentGUI
 $content_obj
 
 $tpl
 
 $lng
 
 $ctrl
 
 $pg_obj
 
 $hier_id
 
 $dom
 
 $updated
 
 $target_script
 
 $return_location
 
 $page_config = null
 
- Static Public Attributes inherited from ilPageContentGUI
static $style_selector_reset = "margin-top:2px; margin-bottom:2px; text-indent:0px; position:static; float:none; width: auto;"
 
- Protected Member Functions inherited from ilPageContentGUI
 getCharacteristicsOfCurrentStyle ($a_type)
 Get characteristics of current style. More...
 
- Static Protected Attributes inherited from ilPageContentGUI
static $common_bb_buttons
 

Detailed Description

Class ilPCTableGUI.

User Interface for Table Editing

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilPCTableGUI::__construct ( $a_pg_obj,
$a_content_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Constructor public.

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

References $DIC, ilPageContentGUI\setCharacteristics(), and user().

35  {
36  global $DIC;
37 
38  $this->tabs = $DIC->tabs();
39  $this->ctrl = $DIC->ctrl();
40  $this->lng = $DIC->language();
41  $this->tpl = $DIC["tpl"];
42  $this->user = $DIC->user();
43  parent::__construct($a_pg_obj, $a_content_obj, $a_hier_id, $a_pc_id);
44  $this->setCharacteristics(array("StandardTable" => $this->lng->txt("cont_StandardTable")));
45  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
setCharacteristics($a_chars)
Set Characteristics.
+ Here is the call graph for this function:

Member Function Documentation

◆ _addAlignmentCheckboxes()

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

Add alignment checkboxes in edit mode.

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

References $DIC, and ilPageContentGUI\$lng.

Referenced by _renderTable().

542  {
543  global $DIC;
544 
545  $lng = $DIC->language();
546 
547  $classes = $a_table->getAllCellAlignments();
548 
549  foreach ($classes as $k => $v) {
550  if ($v == "") {
551  $v = $lng->txt("default");
552  }
553  $check = $lng->txt("cont_alignment") . ": " .
554  '<input type="checkbox" value="1"' .
555  ' name="target[' . $k . ']">' . '</input> ' . $v;
556 
557  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
558  }
559  return $a_output;
560  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _addSpanInputs()

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

Add span inputs.

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

References $DIC, $i, and ilPageContentGUI\$lng.

Referenced by _renderTable().

587  {
588  global $DIC;
589 
590  $lng = $DIC->language();
591 
592  $spans = $a_table->getAllCellSpans();
593 
594  foreach ($spans as $k => $v) {
595  // colspans
596  $selects = '<div style="white-space:nowrap;">' . $lng->txt("cont_colspan") . ": " .
597  '<select class="small" name="colspan[' . $k . ']">';
598  for ($i = 1; $i <= $v["max_x"] - $v["x"] + 1; $i++) {
599  $sel_str = ($i == $v["colspan"])
600  ? 'selected="selected"'
601  : '';
602  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
603  }
604  $selects .= "</select></div>";
605 
606  // rowspans
607  $selects .= '<div style="margin-top:3px; white-space:nowrap;">' . $lng->txt("cont_rowspan") . ": " .
608  '<select class="small" name="rowspan[' . $k . ']">';
609  for ($i = 1; $i <= $v["max_y"] - $v["y"] + 1; $i++) {
610  $sel_str = ($i == $v["rowspan"])
611  ? 'selected="selected"'
612  : '';
613  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
614  }
615  $selects .= "</select></div>";
616 
617  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $selects, $a_output);
618  }
619  return $a_output;
620  }
global $DIC
Definition: saml.php:7
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ _addStyleCheckboxes()

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

Add style checkboxes in edit mode.

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

References $DIC, and ilPageContentGUI\$lng.

Referenced by _renderTable().

515  {
516  global $DIC;
517 
518  $lng = $DIC->language();
519 
520  $classes = $a_table->getAllCellClasses();
521 
522  foreach ($classes as $k => $v) {
523  if ($v == "") {
524  $v = $lng->txt("none");
525  }
526  if (substr($v, 0, 4) == "ilc_") {
527  $v = substr($v, 4);
528  }
529  $check = $lng->txt("cont_style") . ": " .
530  '<input type="checkbox" value="1"' .
531  ' name="target[' . $k . ']">' . '</input> ' . $v;
532 
533  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
534  }
535  return $a_output;
536  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _addWidthInputs()

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

Add width inputs.

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

References $DIC, and ilPageContentGUI\$lng.

Referenced by _renderTable().

566  {
567  global $DIC;
568 
569  $lng = $DIC->language();
570 
571  $widths = $a_table->getAllCellWidths();
572 
573  foreach ($widths as $k => $v) {
574  $check = $lng->txt("cont_width") . ": " .
575  '<input class="small" type="text" size="5" maxlength="10"' .
576  ' name="width[' . $k . ']" value="' . $v . '">' . '</input>';
577 
578  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
579  }
580  return $a_output;
581  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _renderTable()

static ilPCTableGUI::_renderTable (   $content,
  $a_mode = "table_edit",
  $a_submode = "",
  $a_table_obj = null,
  $unmask = true 
)
static

Static render table function.

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

References $DIC, $ilUser, Sabre\VObject\$output, PHPMailer\PHPMailer\$params, _addAlignmentCheckboxes(), _addSpanInputs(), _addStyleCheckboxes(), _addWidthInputs(), ilUtil\getImagePath(), ilUtil\getWebspaceDir(), xslt_create(), xslt_error(), and xslt_free().

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

458  {
459  global $DIC;
460 
461  $ilUser = $DIC->user();
462 
463  $content = "<dummy>" . $content . "</dummy>";
464 
465  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
466  $args = array( '/_xml' => $content, '/_xsl' => $xsl );
467  $xh = xslt_create();
468  //echo "<b>XML</b>:".htmlentities($content).":<br>";
469  //echo "<b>XSLT</b>:".htmlentities($xsl).":<br>";
470  $wb_path = ilUtil::getWebspaceDir("output");
471  $enlarge_path = ilUtil::getImagePath("enlarge.svg");
472  $params = array('mode' => $a_mode,
473  'media_mode' => $ilUser->getPref("ilPageEditor_MediaMode"),
474  'media_mode' => 'disable',
475  'webspace_path' => $wb_path, 'enlarge_path' => $enlarge_path);
476  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
477  echo xslt_error($xh);
478  xslt_free($xh);
479 
480  // unmask user html
481  if ($unmask) {
482  $output = str_replace("&lt;", "<", $output);
483  $output = str_replace("&gt;", ">", $output);
484  $output = str_replace("&amp;", "&", $output);
485  }
486 
487  if ($a_mode == "table_edit" && !is_null($a_table_obj)) {
488  switch ($a_submode) {
489  case "style":
490  $output = ilPCTableGUI::_addStyleCheckboxes($output, $a_table_obj);
491  break;
492 
493  case "alignment":
494  $output = ilPCTableGUI::_addAlignmentCheckboxes($output, $a_table_obj);
495  break;
496 
497  case "width":
498  $output = ilPCTableGUI::_addWidthInputs($output, $a_table_obj);
499  break;
500 
501  case "span":
502  $output = ilPCTableGUI::_addSpanInputs($output, $a_table_obj);
503  break;
504  }
505  }
506 
507 
508  return '<div class="ilFloatLeft">' . $output . '</div>';
509  }
xslt_create()
global $DIC
Definition: saml.php:7
static _addSpanInputs($a_output, $a_table)
Add span inputs.
xslt_free(&$proc)
static _addWidthInputs($a_output, $a_table)
Add width inputs.
xslt_error(&$proc)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
static _addStyleCheckboxes($a_output, $a_table)
Add style checkboxes in edit mode.
static _addAlignmentCheckboxes($a_output, $a_table)
Add alignment checkboxes in edit mode.
static getWebspaceDir($mode="filesystem")
get webspace directory
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ afterCreation()

ilPCTableGUI::afterCreation ( )

After creation processing.

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

Referenced by create().

968  {
969  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
970  }
+ Here is the caller graph for this function:

◆ centerAlign()

ilPCTableGUI::centerAlign ( )

align table to left

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

References $_SESSION.

863  {
864  $this->content_obj->setHorizontalAlign("Center");
865  $_SESSION["il_pg_error"] = $this->pg_obj->update();
866  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
867  }
$_SESSION["AccountId"]

◆ create()

ilPCTableGUI::create ( )

create new table in dom and update page in db

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

References $_POST, ilPageContentGUI\$lng, afterCreation(), getNewTableObject(), insert(), setProperties(), and ilUtil\stripSlashes().

918  {
919  global $lng;
920 
921  $this->content_obj = $this->getNewTableObject();
922  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
923  $import_table = trim($_POST["import_table"]);
924 
925  // import xhtml or spreadsheet table
926  if (!empty($import_table)) {
927  switch ($_POST["import_type"]) {
928  // xhtml import
929  case "html":
930  if (!$this->content_obj->importHtml($_POST["language"], $import_table)) {
931  $this->insert();
932  return;
933  }
934  break;
935 
936  // spreadsheet
937  case "spreadsheet":
938  $this->content_obj->importSpreadsheet($_POST["language"], $import_table);
939  break;
940  }
941  } else {
942  $this->content_obj->addRows(
943  ilUtil::stripSlashes($_POST["nr_rows"]),
944  ilUtil::stripSlashes($_POST["nr_cols"])
945  );
946  }
947 
948  $this->setProperties();
949 
950  $frtype = ilUtil::stripSlashes($_POST["first_row_style"]);
951  if ($frtype != "") {
952  $this->content_obj->setFirstRowStyle($frtype);
953  }
954 
955  $this->updated = $this->pg_obj->update();
956 
957  if ($this->updated === true) {
958  $this->afterCreation();
959  } else {
960  $this->insert();
961  }
962  }
getNewTableObject()
Get new table object.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
insert()
insert new table form
setProperties()
Set properties from input form.
afterCreation()
After creation processing.
$_POST["username"]
+ Here is the call graph for this function:

◆ edit()

ilPCTableGUI::edit ( )

edit properties form

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

References ilPageContentGUI\$ctrl, $html, $ilCtrl, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), getPropertiesFormValues(), initPropertiesForm(), renderTable(), and setTabs().

Referenced by saveProperties().

158  {
160  $lng = $this->lng;
161  $tpl = $this->tpl;
162 
163  $this->displayValidationError();
164  $this->setTabs();
165 
166  $this->initPropertiesForm();
167  $this->getPropertiesFormValues();
168  $html = $this->form->getHTML();
169  $html .= "<br />" . $this->renderTable("");
170  $tpl->setContent($html);
171  }
initPropertiesForm($a_mode="edit")
Init properties form.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
$html
Definition: example_001.php:87
getPropertiesFormValues()
Get properties form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editCellAlignment()

ilPCTableGUI::editCellAlignment ( )

Edit cell styles.

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

References ilPageContentGUI\$ctrl, $form, $html, $ilCtrl, ilPageContentGUI\$lng, PHPMailer\PHPMailer\$options, $si, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), renderTable(), setCellPropertiesSubTabs(), ilSelectInputGUI\setOptions(), and setTabs().

981  {
983  $tpl = $this->tpl;
984  $lng = $this->lng;
985  $ilTabs = $this->tabs;
986 
987  $this->displayValidationError();
988  $this->setTabs();
989  $this->setCellPropertiesSubTabs();
990  $ilTabs->setSubTabActive("cont_alignment");
991  $ilTabs->setTabActive("cont_table_cell_properties");
992 
993  // edit form
994  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
995  $form = new ilPropertyFormGUI();
996  $form->setFormAction($ilCtrl->getFormAction($this));
997  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
998 
999  // alignment
1000  $options = array(
1001  "" => $lng->txt("default"),
1002  "Left" => $lng->txt("cont_left"),
1003  "Center" => $lng->txt("cont_center"),
1004  "Right" => $lng->txt("cont_right")
1005  );
1006  $si = new ilSelectInputGUI($lng->txt("cont_alignment"), "alignment");
1007  $si->setOptions($options);
1008  $si->setInfo($lng->txt(""));
1009  $form->addItem($si);
1010 
1011  $form->setKeepOpen(true);
1012 
1013  $form->addCommandButton("setAlignment", $lng->txt("cont_set_alignment"));
1014 
1015  $html = $form->getHTML();
1016  $html .= "<br />" . $this->renderTable("table_edit", "alignment") . "</form>";
1017  $tpl->setContent($html);
1018  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
if(isset($_POST['submit'])) $form
displayValidationError()
display validation errors
setOptions($a_options)
Set Options.
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ editCellSpan()

ilPCTableGUI::editCellSpan ( )

Edit cell spans.

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

References ilPageContentGUI\$ctrl, $html, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), renderTable(), setCellPropertiesSubTabs(), and setTabs().

701  {
703  $tpl = $this->tpl;
704  $lng = $this->lng;
705  $ilTabs = $this->tabs;
706 
707  $this->displayValidationError();
708  $this->setTabs();
709  $this->setCellPropertiesSubTabs();
710  $ilTabs->setSubTabActive("cont_span");
711  $ilTabs->setTabActive("cont_table_cell_properties");
712 
713  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "Services/COPage");
714  $ctpl->setVariable("BTN_NAME", "setSpans");
715  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_spans"));
716  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
717 
718  $html = $ctpl->get();
719  $html .= "<br />" . $this->renderTable("table_edit", "span") . "</form>";
720  $tpl->setContent($html);
721  }
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
special template class to simplify handling of ITX/PEAR
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ editCellStyle()

ilPCTableGUI::editCellStyle ( )

Edit cell styles.

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

References ilPageContentGUI\$ctrl, $form, $html, $ilCtrl, ilPageContentGUI\$lng, PHPMailer\PHPMailer\$options, $style, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), renderTable(), setBasicTableCellStyles(), setCellPropertiesSubTabs(), and setTabs().

626  {
628  $tpl = $this->tpl;
629  $lng = $this->lng;
630  $ilTabs = $this->tabs;
631 
632  $this->displayValidationError();
633  $this->setTabs();
634  $this->setCellPropertiesSubTabs();
635  $ilTabs->setSubTabActive("cont_style");
636 
637  // edit form
638  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
639  $form = new ilPropertyFormGUI();
640  $form->setFormAction($ilCtrl->getFormAction($this));
641  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
642 
643  // first row style
644  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
646  $this->lng->txt("cont_style"),
647  "style"
648  );
649  $this->setBasicTableCellStyles();
650  $this->getCharacteristicsOfCurrentStyle("table_cell"); // scorm-2004
651  $chars = $this->getCharacteristics(); // scorm-2004
652  $options = array_merge(array("" => $this->lng->txt("none")), $chars); // scorm-2004
653  foreach ($options as $k => $option) {
654  $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' .
655  $option . '</td></tr></table>';
656  $style->addOption($k, $option, $html);
657  }
658 
659  $style->setValue("");
660  $style->setInfo($lng->txt("cont_set_tab_style_info"));
661  $form->addItem($style);
662  $form->setKeepOpen(true);
663 
664  $form->addCommandButton("setStyles", $lng->txt("cont_set_styles"));
665 
666  $html = $form->getHTML();
667  $html .= "<br />" . $this->renderTable("table_edit", "style") . "</form>";
668  $tpl->setContent($html);
669  }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$style
Definition: example_012.php:70
This class represents a property form user interface.
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
if(isset($_POST['submit'])) $form
setBasicTableCellStyles()
Set basic table cell styles.
displayValidationError()
display validation errors
getCharacteristics()
Get characteristics.
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
This class represents an advanced selection list property in a property form.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ editCellWidth()

ilPCTableGUI::editCellWidth ( )

Edit cell widths.

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

References ilPageContentGUI\$ctrl, $html, $ilCtrl, ilPageContentGUI\$lng, $tabs, ilPageContentGUI\$tpl, ilPageContentGUI\displayValidationError(), renderTable(), setCellPropertiesSubTabs(), and setTabs().

675  {
677  $tpl = $this->tpl;
678  $lng = $this->lng;
679  $ilTabs = $this->tabs;
680 
681  $this->displayValidationError();
682  $this->setTabs();
683  $this->setCellPropertiesSubTabs();
684  $ilTabs->setSubTabActive("cont_width");
685  $ilTabs->setTabActive("cont_table_cell_properties");
686 
687  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "Services/COPage");
688  $ctpl->setVariable("BTN_NAME", "setWidths");
689  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_widths"));
690  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
691 
692  $html = $ctpl->get();
693  $html .= "<br />" . $this->renderTable("table_edit", "width") . "</form>";
694  $tpl->setContent($html);
695  }
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
special template class to simplify handling of ITX/PEAR
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ executeCommand()

ilPCTableGUI::executeCommand ( )

execute command

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

References $ret, and ilPageContentGUI\getCharacteristicsOfCurrentStyle().

60  {
61  $this->getCharacteristicsOfCurrentStyle("table"); // scorm-2004
62 
63  // get next class that processes or forwards current command
64  $next_class = $this->ctrl->getNextClass($this);
65 
66  // get current command
67  $cmd = $this->ctrl->getCmd();
68 
69  switch ($next_class) {
70  default:
71  $ret = $this->$cmd();
72  break;
73  }
74 
75  return $ret;
76  }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$ret
Definition: parser.php:6
+ Here is the call graph for this function:

◆ getNewTableObject()

ilPCTableGUI::getNewTableObject ( )

Get new table object.

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

References ilPageContentGUI\getPage().

Referenced by create().

910  {
911  return new ilPCTable($this->getPage());
912  }
Class ilPCTable.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPropertiesFormValues()

ilPCTableGUI::getPropertiesFormValues ( )

Get properties form.

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

References $values, ilObjStyleSheet\_lookupTemplateIdByName(), and ilPageContentGUI\getStyleId().

Referenced by edit().

391  {
392  $values = array();
393  $values["width"] = $this->content_obj->getWidth();
394  $values["border"] = $this->content_obj->getBorder();
395  $values["padding"] = $this->content_obj->getCellPadding();
396  $values["spacing"] = $this->content_obj->getCellSpacing();
397  $values["row_header"] = $this->content_obj->getHeaderRows();
398  $values["row_footer"] = $this->content_obj->getFooterRows();
399  $values["col_header"] = $this->content_obj->getHeaderCols();
400  $values["col_footer"] = $this->content_obj->getFooterCols();
401  if ($this->content_obj->getTemplate() != "") {
402  $values["characteristic"] = "t:" .
403  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
404  $this->content_obj->getTemplate();
405  } else {
406  $values["characteristic"] = $this->content_obj->getClass();
407  }
408  $values["align"] = $this->content_obj->getHorizontalAlign();
409  $values["caption"] = $this->content_obj->getCaption();
410  $values["cap_align"] = $this->content_obj->getCaptionAlign();
411  $values["language"] = $this->content_obj->getLanguage();
412 
413  $this->form->setValuesByArray($values);
414 
415  $ca = $this->form->getItemByPostVar("cap_align");
416  $ca->setValue($this->content_obj->getCaptionAlign());
417  }
static _lookupTemplateIdByName($a_style_id, $a_name)
Lookup table template preview.
$values
getStyleId()
Get Style Id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplateOptions()

ilPCTableGUI::getTemplateOptions (   $a_type = "")

Get table templates.

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

Referenced by initPropertiesForm().

150  {
151  return parent::getTemplateOptions("table");
152  }
+ Here is the caller graph for this function:

◆ initPropertiesForm()

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

Init properties form.

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

References $_GET, $_SESSION, $border, $cols, ilPageContentGUI\$ctrl, $html, $i, $ilCtrl, $ilUser, $lang, $language, ilPageContentGUI\$lng, PHPMailer\PHPMailer\$options, $rows, $t, ilPageContentGUI\$tpl, $user, ilMDLanguageItem\_getLanguages(), ilRadioOption\addSubItem(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), getTemplateOptions(), setBasicTableCellStyles(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), and ilTextInputGUI\setSize().

Referenced by edit(), and insert().

177  {
179  $lng = $this->lng;
180  $tpl = $this->tpl;
182 
183  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
184  $this->form = new ilPropertyFormGUI();
185  $this->form->setFormAction($ilCtrl->getFormAction($this));
186  if ($a_mode == "create") {
187  $this->form->setTitle($this->lng->txt("cont_insert_table"));
188  } else {
189  $this->form->setTitle($this->lng->txt("cont_table_properties"));
190  }
191 
192  if ($a_mode == "create") {
193  $nr = array();
194  for ($i = 1; $i <= 20; $i++) {
195  $nr[$i] = $i;
196  }
197 
198  // cols
199  $cols = new ilSelectInputGUI($this->lng->txt("cont_nr_cols"), "nr_cols");
200  $cols->setOptions($nr);
201  $cols->setValue(2);
202  $this->form->addItem($cols);
203 
204  // rows
205  $rows = new ilSelectInputGUI($this->lng->txt("cont_nr_rows"), "nr_rows");
206  $rows->setOptions($nr);
207  $rows->setValue(2);
208  $this->form->addItem($rows);
209  }
210 
211  // width
212  $width = new ilTextInputGUI($this->lng->txt("cont_table_width"), "width");
213  $width->setSize(6);
214  $width->setMaxLength(6);
215  $this->form->addItem($width);
216 
217  // border
218  $border = new ilTextInputGUI($this->lng->txt("cont_table_border"), "border");
219  $border->setInfo($this->lng->txt("cont_table_border_info"));
220  $border->setValue("1px");
221  $border->setSize(6);
222  $border->setMaxLength(6);
223  $this->form->addItem($border);
224 
225  // padding
226  $padding = new ilTextInputGUI($this->lng->txt("cont_table_cellpadding"), "padding");
227  $padding->setInfo($this->lng->txt("cont_table_cellpadding_info"));
228  $padding->setValue("2px");
229  $padding->setSize(6);
230  $padding->setMaxLength(6);
231  $this->form->addItem($padding);
232 
233  // spacing (deprecated, only hidden)
234  $spacing = new ilHiddenInputGUI("spacing");
235  $spacing->setValue("0px");
236  $this->form->addItem($spacing);
237  /*$spacing = new ilTextInputGUI($this->lng->txt("cont_table_cellspacing"), "spacing");
238  $spacing->setValue("0px");
239  $spacing->setSize(6);
240  $spacing->setMaxLength(6);
241  $this->form->addItem($spacing);*/
242 
243  // table templates and table classes
244  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
245  $char_prop = new ilAdvSelectInputGUI(
246  $this->lng->txt("cont_characteristic"),
247  "characteristic"
248  );
249  $chars = $this->getCharacteristics();
250  $templates = $this->getTemplateOptions();
251  $chars = array_merge($templates, $chars);
252  if (is_object($this->content_obj)) {
253  if ($chars[$a_seleted_value] == "" && ($this->content_obj->getClass() != "")) {
254  $chars = array_merge(
255  array($this->content_obj->getClass() => $this->content_obj->getClass()),
256  $chars
257  );
258  }
259  }
260  foreach ($chars as $k => $char) {
261  if (strpos($k, ":") > 0) {
262  $t = explode(":", $k);
263  $html = $this->style->lookupTemplatePreview($t[1]) . '<div style="clear:both;" class="small">' . $char . "</div>";
264  } else {
265  $html = '<table class="ilc_table_' . $k . '"><tr><td class="small">' .
266  $char . '</td></tr></table>';
267  }
268  $char_prop->addOption($k, $char, $html);
269  }
270  $char_prop->setValue("StandardTable");
271  $this->form->addItem($char_prop);
272 
273  $nr = array();
274  for ($i = 0; $i <= 3; $i++) {
275  $nr[$i] = $i;
276  }
277 
278  // row header
279  $rh = new ilSelectInputGUI($this->lng->txt("cont_nr_row_header"), "row_header");
280  $rh->setOptions($nr);
281  $rh->setValue(1);
282  $this->form->addItem($rh);
283 
284  // row footer
285  $rf = new ilSelectInputGUI($this->lng->txt("cont_nr_row_footer"), "row_footer");
286  $rf->setOptions($nr);
287  $rf->setValue(0);
288  $this->form->addItem($rf);
289 
290  // col header
291  $ch = new ilSelectInputGUI($this->lng->txt("cont_nr_col_header"), "col_header");
292  $ch->setOptions($nr);
293  $ch->setValue(0);
294  $this->form->addItem($ch);
295 
296  // col footer
297  $cf = new ilSelectInputGUI($this->lng->txt("cont_nr_col_footer"), "col_footer");
298  $cf->setOptions($nr);
299  $cf->setValue(0);
300  $this->form->addItem($cf);
301 
302  if ($a_mode == "create") {
303  // first row style
304  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
305  $fr_style = new ilAdvSelectInputGUI(
306  $this->lng->txt("cont_first_row_style"),
307  "first_row_style"
308  );
309  $this->setBasicTableCellStyles();
310  $this->getCharacteristicsOfCurrentStyle("table_cell");
311  $chars = $this->getCharacteristics();
312  $options = array_merge(array("" => $this->lng->txt("none")), $chars);
313  foreach ($options as $k => $option) {
314  $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' .
315  $option . '</td></tr></table>';
316  $fr_style->addOption($k, $option, $html);
317  }
318 
319  $fr_style->setValue("");
320  $this->form->addItem($fr_style);
321  }
322 
323  // alignment
324  $align_opts = array("Left" => $lng->txt("cont_left"),
325  "Right" => $lng->txt("cont_right"), "Center" => $lng->txt("cont_center"),
326  "LeftFloat" => $lng->txt("cont_left_float"),
327  "RightFloat" => $lng->txt("cont_right_float"));
328  $align = new ilSelectInputGUI($this->lng->txt("cont_align"), "align");
329  $align->setOptions($align_opts);
330  $align->setValue("Center");
331  $this->form->addItem($align);
332 
333  // caption
334  $caption = new ilTextInputGUI($this->lng->txt("cont_caption"), "caption");
335  $caption->setSize(60);
336  $this->form->addItem($caption);
337 
338  // caption align
339  $ca_opts = array("top" => $lng->txt("cont_top"),
340  "bottom" => $lng->txt("cont_bottom"));
341  $ca = new ilSelectInputGUI(
342  $this->lng->txt("cont_align"),
343  "cap_align"
344  );
345  $ca->setOptions($ca_opts);
346  $caption->addSubItem($ca);
347 
348  // import
349  if ($a_mode == "create") {
350  // import table
351  $import = new ilRadioGroupInputGUI($this->lng->txt("cont_paste_table"), "import_type");
352  $op = new ilRadioOption($this->lng->txt("cont_html_table"), "html");
353  $import->addOption($op);
354  $op2 = new ilRadioOption($this->lng->txt("cont_spreadsheet_table"), "spreadsheet");
355 
356  $import_data = new ilTextAreaInputGUI("", "import_table");
357  $import_data->setRows(8);
358  $import_data->setCols(50);
359  $op2->addSubItem($import_data);
360 
361  $import->addOption($op2);
362  $import->setValue("html");
363  $this->form->addItem($import);
364  }
365 
366  // language
367  if ($_SESSION["il_text_lang_" . $_GET["ref_id"]] != "") {
368  $s_lang = $_SESSION["il_text_lang_" . $_GET["ref_id"]];
369  } else {
370  $s_lang = $ilUser->getLanguage();
371  }
372  require_once("Services/MetaData/classes/class.ilMDLanguageItem.php");
374  $language = new ilSelectInputGUI($this->lng->txt("language"), "language");
375  $language->setOptions($lang);
376  $language->setValue($s_lang);
377  $this->form->addItem($language);
378 
379  if ($a_mode == "create") {
380  $this->form->addCommandButton("create_tab", $lng->txt("save"));
381  $this->form->addCommandButton("cancelCreate", $lng->txt("cancel"));
382  } else {
383  $this->form->addCommandButton("saveProperties", $lng->txt("save"));
384  }
385  }
This class represents an option in a radio group.
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
$_SESSION["AccountId"]
This class represents a selection list property in a property form.
This class represents a property form user interface.
$border
$_GET["client_id"]
"color:#CC0000 style
Definition: example_001.php:92
getTemplateOptions($a_type="")
Get table templates.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
addSubItem($a_item)
Add Subitem.
setBasicTableCellStyles()
Set basic table cell styles.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
getCharacteristics()
Get characteristics.
$rows
Definition: xhr_table.php:10
This class represents a text area property in a property form.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
$i
Definition: disco.tpl.php:19
This class represents an advanced selection list property in a property form.
$cols
Definition: xhr_table.php:11
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilPCTableGUI::insert ( )

insert new table form

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

References ilPageContentGUI\$ctrl, $html, $ilCtrl, $ilUser, ilPageContentGUI\$lng, ilPageContentGUI\$tpl, $user, ilPageContentGUI\displayValidationError(), and initPropertiesForm().

Referenced by create().

893  {
896  $tpl = $this->tpl;
897  $lng = $this->lng;
898 
899  $this->displayValidationError();
900 
901  $this->initPropertiesForm("create");
902  $html = $this->form->getHTML();
903  $tpl->setContent($html);
904  }
initPropertiesForm($a_mode="edit")
Init properties form.
global $ilCtrl
Definition: ilias.php:18
displayValidationError()
display validation errors
$ilUser
Definition: imgupload.php:18
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ leftAlign()

ilPCTableGUI::leftAlign ( )

align table to left

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

References $_SESSION.

853  {
854  $this->content_obj->setHorizontalAlign("Left");
855  $_SESSION["il_pg_error"] = $this->pg_obj->update();
856  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
857  }
$_SESSION["AccountId"]

◆ leftFloatAlign()

ilPCTableGUI::leftFloatAlign ( )

align table to left float

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

References $_SESSION.

873  {
874  $this->content_obj->setHorizontalAlign("LeftFloat");
875  $_SESSION["il_pg_error"] = $this->pg_obj->update();
876  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
877  }
$_SESSION["AccountId"]

◆ renderTable()

ilPCTableGUI::renderTable (   $a_mode = "table_edit",
  $a_submode = "" 
)

Render the table.

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

References $mobs, $style, ilObject\_lookupType(), _renderTable(), and ilPageContentGUI\getStyleId().

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

423  {
424  $tab_node = $this->content_obj->getNode();
425  $tab_node->set_attribute("Enabled", "True");
426  $content = $this->dom->dump_node($tab_node);
427 
428  $trans = $this->pg_obj->getLanguageVariablesXML();
429  $mobs = $this->pg_obj->getMultimediaXML();
430  if ($this->getStyleId() > 0) {
431  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
432  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
433  $style = new ilObjStyleSheet($this->getStyleId());
434  $template_xml = $style->getTemplateXML();
435  }
436  }
437 
438  $content = $content . $mobs . $trans . $template_xml;
439 
441  $content,
442  $a_mode,
443  $a_submode,
444  $this->content_obj,
445  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking()
446  );
447  }
$style
Definition: example_012.php:70
$mobs
getStyleId()
Get Style Id.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilObjStyleSheet.
static _renderTable( $content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true)
Static render table function.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rightAlign()

ilPCTableGUI::rightAlign ( )

align table to right

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

References $_SESSION.

843  {
844  $this->content_obj->setHorizontalAlign("Right");
845  $_SESSION["il_pg_error"] = $this->pg_obj->update();
846  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
847  }
$_SESSION["AccountId"]

◆ rightFloatAlign()

ilPCTableGUI::rightFloatAlign ( )

align table to left

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

References $_SESSION.

883  {
884  $this->content_obj->setHorizontalAlign("RightFloat");
885  $_SESSION["il_pg_error"] = $this->pg_obj->update();
886  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
887  }
$_SESSION["AccountId"]

◆ saveProperties()

ilPCTableGUI::saveProperties ( )

save table properties in db and return to page edit screen

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

References edit(), and setProperties().

827  {
828  $this->setProperties();
829  $this->updated = $this->pg_obj->update();
830  if ($this->updated === true) {
831  $this->ctrl->redirect($this, "edit");
832  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
833  } else {
834  $this->pg_obj->addHierIDs();
835  $this->edit();
836  }
837  }
edit()
edit properties form
setProperties()
Set properties from input form.
+ Here is the call graph for this function:

◆ setAlignment()

ilPCTableGUI::setAlignment ( )

Set cell alignments.

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

References $_POST, ilPageContentGUI\$lng, and ilUtil\stripSlashes().

1024  {
1025  $lng = $this->lng;
1026 
1027  if (is_array($_POST["target"])) {
1028  foreach ($_POST["target"] as $k => $value) {
1029  if ($value > 0) {
1030  $cid = explode(":", $k);
1031  $this->content_obj->setTDAlignment(
1032  ilUtil::stripSlashes($cid[0]),
1033  ilUtil::stripSlashes($_POST["alignment"]),
1034  ilUtil::stripSlashes($cid[1])
1035  );
1036  }
1037  }
1038  }
1039  $this->updated = $this->pg_obj->update();
1040  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1041 
1042  $this->ctrl->redirect($this, "editCellAlignment");
1043  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ setBasicTableCellStyles()

ilPCTableGUI::setBasicTableCellStyles ( )

Set basic table cell styles.

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

References ilPageContentGUI\setCharacteristics().

Referenced by editCellStyle(), and initPropertiesForm().

51  {
52  $this->setCharacteristics(array("Cell1" => "Cell1", "Cell2" => "Cell2",
53  "Cell3" => "Cell3", "Cell4" => "Cell4"));
54  }
setCharacteristics($a_chars)
Set Characteristics.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCellPropertiesSubTabs()

ilPCTableGUI::setCellPropertiesSubTabs ( )

Set tabs.

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, and $tabs.

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

112  {
113  $ilTabs = $this->tabs;
115  $lng = $this->lng;
116 
117  $ilTabs->addSubTabTarget(
118  "cont_style",
119  $ilCtrl->getLinkTarget($this, "editCellStyle"),
120  "editCellStyle",
121  get_class($this)
122  );
123 
124  $ilTabs->addSubTabTarget(
125  "cont_width",
126  $ilCtrl->getLinkTarget($this, "editCellWidth"),
127  "editCellWidth",
128  get_class($this)
129  );
130 
131  $ilTabs->addSubTabTarget(
132  "cont_alignment",
133  $ilCtrl->getLinkTarget($this, "editCellAlignment"),
134  "editCellAlignment",
135  get_class($this)
136  );
137 
138  $ilTabs->addSubTabTarget(
139  "cont_span",
140  $ilCtrl->getLinkTarget($this, "editCellSpan"),
141  "editCellSpan",
142  get_class($this)
143  );
144  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setProperties()

ilPCTableGUI::setProperties ( )

Set properties from input form.

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

References $_POST, $t, and ilUtil\stripSlashes().

Referenced by create(), and saveProperties().

792  {
793  // mask html
794  $caption = ilUtil::stripSlashes($_POST["caption"]);
795  $caption = str_replace("&", "&amp;", $caption);
796  $caption = str_replace("<", "&lt;", $caption);
797  $caption = str_replace(">", "&gt;", $caption);
798 
799  $this->content_obj->setLanguage(ilUtil::stripSlashes($_POST["language"]));
800  $this->content_obj->setWidth(ilUtil::stripSlashes($_POST["width"]));
801  $this->content_obj->setBorder(ilUtil::stripSlashes($_POST["border"]));
802  $this->content_obj->setCellSpacing(ilUtil::stripSlashes($_POST["spacing"]));
803  $this->content_obj->setCellPadding(ilUtil::stripSlashes($_POST["padding"]));
804  $this->content_obj->setHorizontalAlign(ilUtil::stripSlashes($_POST["align"]));
805  $this->content_obj->setHeaderRows(ilUtil::stripSlashes($_POST["row_header"]));
806  $this->content_obj->setHeaderCols(ilUtil::stripSlashes($_POST["col_header"]));
807  $this->content_obj->setFooterRows(ilUtil::stripSlashes($_POST["row_footer"]));
808  $this->content_obj->setFooterCols(ilUtil::stripSlashes($_POST["col_footer"]));
809  if (strpos($_POST["characteristic"], ":") > 0) {
810  $t = explode(":", $_POST["characteristic"]);
811  $this->content_obj->setTemplate(ilUtil::stripSlashes($t[2]));
812  $this->content_obj->setClass("");
813  } else {
814  $this->content_obj->setClass(ilUtil::stripSlashes($_POST["characteristic"]));
815  $this->content_obj->setTemplate("");
816  }
817  $this->content_obj->setCaption(
818  $caption,
819  ilUtil::stripSlashes($_POST["cap_align"])
820  );
821  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ 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 772 of file class.ilPCTableGUI.php.

References $_POST, ilPageContentGUI\$lng, and ilUtil\stripSlashes().

773  {
774  $lng = $this->lng;
775 
776  if (is_array($_POST["colspan"])) {
777  foreach ($_POST["colspan"] as $k => $span) {
778  $_POST["colspan"][$k] = ilUtil::stripSlashes($span);
779  $_POST["rowspan"][$k] = ilUtil::stripSlashes($_POST["rowspan"][$k]);
780  }
781  $this->content_obj->setTDSpans($_POST["colspan"], $_POST["rowspan"]);
782  }
783  $this->updated = $this->pg_obj->update();
784  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
785  $this->ctrl->redirect($this, "editCellSpan");
786  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ setStyles()

ilPCTableGUI::setStyles ( )

Set cell styles and.

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

References $_POST, ilPageContentGUI\$lng, and ilUtil\stripSlashes().

727  {
728  $lng = $this->lng;
729 
730  if (is_array($_POST["target"])) {
731  foreach ($_POST["target"] as $k => $value) {
732  if ($value > 0) {
733  $cid = explode(":", $k);
734  $this->content_obj->setTDClass(
735  ilUtil::stripSlashes($cid[0]),
736  ilUtil::stripSlashes($_POST["style"]),
737  ilUtil::stripSlashes($cid[1])
738  );
739  }
740  }
741  }
742  $this->updated = $this->pg_obj->update();
743  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
744  $this->ctrl->redirect($this, "editCellStyle");
745  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ setTabs()

ilPCTableGUI::setTabs ( )

Set tabs.

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

References ilPageContentGUI\$ctrl, $ilCtrl, ilPageContentGUI\$lng, and $tabs.

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

83  {
84  $ilTabs = $this->tabs;
86  $lng = $this->lng;
87 
88  $ilTabs->setBackTarget(
89  $lng->txt("pg"),
90  $this->ctrl->getParentReturn($this)
91  );
92 
93  $ilTabs->addTarget(
94  "cont_table_properties",
95  $ilCtrl->getLinkTarget($this, "edit"),
96  "edit",
97  get_class($this)
98  );
99 
100  $ilTabs->addTarget(
101  "cont_table_cell_properties",
102  $ilCtrl->getLinkTarget($this, "editCellStyle"),
103  "editCellStyle",
104  get_class($this)
105  );
106  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setWidths()

ilPCTableGUI::setWidths ( )

Set cell widths.

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

References $_POST, ilPageContentGUI\$lng, and ilUtil\stripSlashes().

751  {
752  $lng = $this->lng;
753 
754  if (is_array($_POST["width"])) {
755  foreach ($_POST["width"] as $k => $width) {
756  $cid = explode(":", $k);
757  $this->content_obj->setTDWidth(
758  ilUtil::stripSlashes($cid[0]),
759  ilUtil::stripSlashes($width),
760  ilUtil::stripSlashes($cid[1])
761  );
762  }
763  }
764  $this->updated = $this->pg_obj->update();
765  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
766  $this->ctrl->redirect($this, "editCellWidth");
767  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $tabs

ilPCTableGUI::$tabs
protected

◆ $user

ilPCTableGUI::$user
protected

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

Referenced by initPropertiesForm(), and insert().


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