ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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, $page_object=null)
 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, ILIAS\GlobalScreen\Provider\__construct(), 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  }
user()
Definition: user.php:4
setCharacteristics($a_chars)
Set Characteristics.
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ 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 554 of file class.ilPCTableGUI.php.

References $DIC, and ilPageContentGUI\$lng.

Referenced by _renderTable().

555  {
556  global $DIC;
557 
558  $lng = $DIC->language();
559 
560  $classes = $a_table->getAllCellAlignments();
561 
562  foreach ($classes as $k => $v) {
563  if ($v == "") {
564  $v = $lng->txt("default");
565  }
566  $check = $lng->txt("cont_alignment") . ": " .
567  '<input type="checkbox" value="1"' .
568  ' name="target[' . $k . ']">' . '</input> ' . $v;
569 
570  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
571  }
572  return $a_output;
573  }
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _addSpanInputs()

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

Add span inputs.

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

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

Referenced by _renderTable().

600  {
601  global $DIC;
602 
603  $lng = $DIC->language();
604 
605  $spans = $a_table->getAllCellSpans();
606 
607  foreach ($spans as $k => $v) {
608  // colspans
609  $selects = '<div style="white-space:nowrap;">' . $lng->txt("cont_colspan") . ": " .
610  '<select class="small" name="colspan[' . $k . ']">';
611  for ($i = 1; $i <= $v["max_x"] - $v["x"] + 1; $i++) {
612  $sel_str = ($i == $v["colspan"])
613  ? 'selected="selected"'
614  : '';
615  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
616  }
617  $selects .= "</select></div>";
618 
619  // rowspans
620  $selects .= '<div style="margin-top:3px; white-space:nowrap;">' . $lng->txt("cont_rowspan") . ": " .
621  '<select class="small" name="rowspan[' . $k . ']">';
622  for ($i = 1; $i <= $v["max_y"] - $v["y"] + 1; $i++) {
623  $sel_str = ($i == $v["rowspan"])
624  ? 'selected="selected"'
625  : '';
626  $selects .= '<option value="' . $i . '" ' . $sel_str . '>' . $i . '</option>';
627  }
628  $selects .= "</select></div>";
629 
630  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $selects, $a_output);
631  }
632  return $a_output;
633  }
$DIC
Definition: xapitoken.php:46
$i
Definition: metadata.php:24
+ 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 527 of file class.ilPCTableGUI.php.

References $DIC, and ilPageContentGUI\$lng.

Referenced by _renderTable().

528  {
529  global $DIC;
530 
531  $lng = $DIC->language();
532 
533  $classes = $a_table->getAllCellClasses();
534 
535  foreach ($classes as $k => $v) {
536  if ($v == "") {
537  $v = $lng->txt("none");
538  }
539  if (substr($v, 0, 4) == "ilc_") {
540  $v = substr($v, 4);
541  }
542  $check = $lng->txt("cont_style") . ": " .
543  '<input type="checkbox" value="1"' .
544  ' name="target[' . $k . ']">' . '</input> ' . $v;
545 
546  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
547  }
548  return $a_output;
549  }
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ _addWidthInputs()

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

Add width inputs.

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

References $DIC, and ilPageContentGUI\$lng.

Referenced by _renderTable().

579  {
580  global $DIC;
581 
582  $lng = $DIC->language();
583 
584  $widths = $a_table->getAllCellWidths();
585 
586  foreach ($widths as $k => $v) {
587  $check = $lng->txt("cont_width") . ": " .
588  '<input class="small" type="text" size="5" maxlength="10"' .
589  ' name="width[' . $k . ']" value="' . $v . '">' . '</input>';
590 
591  $a_output = str_replace("{{{{{TableEdit;" . $k . "}}}}}", $check, $a_output);
592  }
593  return $a_output;
594  }
$DIC
Definition: xapitoken.php:46
+ 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,
  $page_object = null 
)
static

Static render table function.

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

References $DIC, $ilUser, _addAlignmentCheckboxes(), _addSpanInputs(), _addStyleCheckboxes(), _addWidthInputs(), ilUtil\getImagePath(), ilCOPagePCDef\getPCDefinitions(), ilUtil\getWebspaceDir(), ilCOPagePCDef\requirePCClassByName(), 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  // for all page components...
508  if (isset($page_object)) {
510  foreach ($defs as $def) {
512  $pc_class = $def["pc_class"];
513  $pc_obj = new $pc_class($page_object);
514 
515  // post xsl page content modification by pc elements
516  $output = $pc_obj->modifyPageContentPostXsl($output, "presentation", false);
517  }
518  }
519 
520 
521  return $output;
522  }
xslt_create()
static _addSpanInputs($a_output, $a_table)
Add span inputs.
xslt_free(&$proc)
static _addWidthInputs($a_output, $a_table)
Add width inputs.
static getPCDefinitions()
Get PC definitions.
static requirePCClassByName($a_name)
Get instance.
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.
$DIC
Definition: xapitoken.php:46
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 980 of file class.ilPCTableGUI.php.

Referenced by create().

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

◆ centerAlign()

ilPCTableGUI::centerAlign ( )

align table to left

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

References $_SESSION.

876  {
877  $this->content_obj->setHorizontalAlign("Center");
878  $_SESSION["il_pg_error"] = $this->pg_obj->update();
879  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
880  }
$_SESSION["AccountId"]

◆ create()

ilPCTableGUI::create ( )

create new table in dom and update page in db

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

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

931  {
932  global $lng;
933 
934  $this->content_obj = $this->getNewTableObject();
935  $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
936  $import_table = trim($_POST["import_table"]);
937 
938  // import xhtml or spreadsheet table
939  if (!empty($import_table)) {
940  switch ($_POST["import_type"]) {
941  // xhtml import
942  case "html":
943  if (!$this->content_obj->importHtml($_POST["language"], $import_table)) {
944  $this->insert();
945  return;
946  }
947  break;
948 
949  // spreadsheet
950  case "spreadsheet":
951  $this->content_obj->importSpreadsheet($_POST["language"], $import_table);
952  break;
953  }
954  } else {
955  $this->content_obj->addRows(
956  ilUtil::stripSlashes($_POST["nr_rows"]),
957  ilUtil::stripSlashes($_POST["nr_cols"])
958  );
959  }
960 
961  $this->setProperties();
962 
963  $frtype = ilUtil::stripSlashes($_POST["first_row_style"]);
964  if ($frtype != "") {
965  $this->content_obj->setFirstRowStyle($frtype);
966  }
967 
968  $this->updated = $this->pg_obj->update();
969 
970  if ($this->updated === true) {
971  $this->afterCreation();
972  } else {
973  $this->insert();
974  }
975  }
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\$tpl, ilPageContentGUI\displayValidationError(), getPropertiesFormValues(), initPropertiesForm(), renderTable(), and setTabs().

Referenced by saveProperties().

158  {
159  $tpl = $this->tpl;
160 
161  $this->displayValidationError();
162  $this->setTabs();
163 
164  $this->initPropertiesForm();
165  $this->getPropertiesFormValues();
166  $html = $this->form->getHTML();
167  $html .= "<br />" . $this->renderTable("");
168  $tpl->setContent($html);
169  }
initPropertiesForm($a_mode="edit")
Init properties form.
setTabs()
Set tabs.
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
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 993 of file class.ilPCTableGUI.php.

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

994  {
996  $tpl = $this->tpl;
997  $lng = $this->lng;
998  $ilTabs = $this->tabs;
999 
1000  $this->displayValidationError();
1001  $this->setTabs();
1002  $this->setCellPropertiesSubTabs();
1003  $ilTabs->setSubTabActive("cont_alignment");
1004  $ilTabs->setTabActive("cont_table_cell_properties");
1005 
1006  // edit form
1007  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
1008  $form = new ilPropertyFormGUI();
1009  $form->setFormAction($ilCtrl->getFormAction($this));
1010  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
1011 
1012  // alignment
1013  $options = array(
1014  "" => $lng->txt("default"),
1015  "Left" => $lng->txt("cont_left"),
1016  "Center" => $lng->txt("cont_center"),
1017  "Right" => $lng->txt("cont_right")
1018  );
1019  $si = new ilSelectInputGUI($lng->txt("cont_alignment"), "alignment");
1020  $si->setOptions($options);
1021  $si->setInfo($lng->txt(""));
1022  $form->addItem($si);
1023 
1024  $form->setKeepOpen(true);
1025 
1026  $form->addCommandButton("setAlignment", $lng->txt("cont_set_alignment"));
1027 
1028  $html = $form->getHTML();
1029  $html .= "<br />" . $this->renderTable("table_edit", "alignment") . "</form>";
1030  $tpl->setContent($html);
1031  }
This class represents a property form user interface.
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
+ Here is the call graph for this function:

◆ editCellSpan()

ilPCTableGUI::editCellSpan ( )

Edit cell spans.

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

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

714  {
716  $tpl = $this->tpl;
717  $lng = $this->lng;
718  $ilTabs = $this->tabs;
719 
720  $this->displayValidationError();
721  $this->setTabs();
722  $this->setCellPropertiesSubTabs();
723  $ilTabs->setSubTabActive("cont_span");
724  $ilTabs->setTabActive("cont_table_cell_properties");
725 
726  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "Services/COPage");
727  $ctpl->setVariable("BTN_NAME", "setSpans");
728  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_spans"));
729  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
730 
731  $html = $ctpl->get();
732  $html .= "<br />" . $this->renderTable("table_edit", "span") . "</form>";
733  $tpl->setContent($html);
734  }
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
+ Here is the call graph for this function:

◆ editCellStyle()

ilPCTableGUI::editCellStyle ( )

Edit cell styles.

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

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

639  {
641  $tpl = $this->tpl;
642  $lng = $this->lng;
643  $ilTabs = $this->tabs;
644 
645  $this->displayValidationError();
646  $this->setTabs();
647  $this->setCellPropertiesSubTabs();
648  $ilTabs->setSubTabActive("cont_style");
649 
650  // edit form
651  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
652  $form = new ilPropertyFormGUI();
653  $form->setFormAction($ilCtrl->getFormAction($this));
654  $form->setTitle($this->lng->txt("cont_table_cell_properties"));
655 
656  // first row style
657  require_once("./Services/Form/classes/class.ilAdvSelectInputGUI.php");
658  $style = new ilAdvSelectInputGUI(
659  $this->lng->txt("cont_style"),
660  "style"
661  );
662  $this->setBasicTableCellStyles();
663  $this->getCharacteristicsOfCurrentStyle("table_cell"); // scorm-2004
664  $chars = $this->getCharacteristics(); // scorm-2004
665  $options = array_merge(array("" => $this->lng->txt("none")), $chars); // scorm-2004
666  foreach ($options as $k => $option) {
667  $html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . '">' .
668  $option . '</td></tr></table>';
669  $style->addOption($k, $option, $html);
670  }
671 
672  $style->setValue("");
673  $style->setInfo($lng->txt("cont_set_tab_style_info"));
674  $form->addItem($style);
675  $form->setKeepOpen(true);
676 
677  $form->addCommandButton("setStyles", $lng->txt("cont_set_styles"));
678 
679  $html = $form->getHTML();
680  $html .= "<br />" . $this->renderTable("table_edit", "style") . "</form>";
681  $tpl->setContent($html);
682  }
getCharacteristicsOfCurrentStyle($a_type)
Get characteristics of current style.
This class represents a property form user interface.
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
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.
+ Here is the call graph for this function:

◆ editCellWidth()

ilPCTableGUI::editCellWidth ( )

Edit cell widths.

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

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

688  {
690  $tpl = $this->tpl;
691  $lng = $this->lng;
692  $ilTabs = $this->tabs;
693 
694  $this->displayValidationError();
695  $this->setTabs();
696  $this->setCellPropertiesSubTabs();
697  $ilTabs->setSubTabActive("cont_width");
698  $ilTabs->setTabActive("cont_table_cell_properties");
699 
700  $ctpl = new ilTemplate("tpl.table_cell_properties.html", true, true, "Services/COPage");
701  $ctpl->setVariable("BTN_NAME", "setWidths");
702  $ctpl->setVariable("BTN_TEXT", $lng->txt("cont_save_widths"));
703  $ctpl->setVariable("FORMACTION", $ilCtrl->getFormAction($this));
704 
705  $html = $ctpl->get();
706  $html .= "<br />" . $this->renderTable("table_edit", "width") . "</form>";
707  $tpl->setContent($html);
708  }
setCellPropertiesSubTabs()
Set tabs.
global $ilCtrl
Definition: ilias.php:18
setTabs()
Set tabs.
displayValidationError()
display validation errors
renderTable($a_mode="table_edit", $a_submode="")
Render the table.
+ 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 922 of file class.ilPCTableGUI.php.

References ilPageContentGUI\getPage().

Referenced by create().

923  {
924  return new ilPCTable($this->getPage());
925  }
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 388 of file class.ilPCTableGUI.php.

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

Referenced by edit().

389  {
390  $values = array();
391  $values["width"] = $this->content_obj->getWidth();
392  $values["border"] = $this->content_obj->getBorder();
393  $values["padding"] = $this->content_obj->getCellPadding();
394  $values["spacing"] = $this->content_obj->getCellSpacing();
395  $values["row_header"] = $this->content_obj->getHeaderRows();
396  $values["row_footer"] = $this->content_obj->getFooterRows();
397  $values["col_header"] = $this->content_obj->getHeaderCols();
398  $values["col_footer"] = $this->content_obj->getFooterCols();
399  if ($this->content_obj->getTemplate() != "") {
400  $values["characteristic"] = "t:" .
401  ilObjStyleSheet::_lookupTemplateIdByName($this->getStyleId(), $this->content_obj->getTemplate()) . ":" .
402  $this->content_obj->getTemplate();
403  } else {
404  $values["characteristic"] = $this->content_obj->getClass();
405  }
406  $values["align"] = $this->content_obj->getHorizontalAlign();
407  $values["caption"] = $this->content_obj->getCaption();
408  $values["cap_align"] = $this->content_obj->getCaptionAlign();
409  $values["language"] = $this->content_obj->getLanguage();
410 
411  $this->form->setValuesByArray($values);
412 
413  $ca = $this->form->getItemByPostVar("cap_align");
414  $ca->setValue($this->content_obj->getCaptionAlign());
415  }
static _lookupTemplateIdByName($a_style_id, $a_name)
Lookup table template preview.
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 174 of file class.ilPCTableGUI.php.

References $_GET, $_SESSION, $cols, ilPageContentGUI\$ctrl, $i, $ilCtrl, $ilUser, $lang, ilPageContentGUI\$lng, $rows, ilPageContentGUI\$tpl, $user, ilMDLanguageItem\_getLanguages(), ilRadioOption\addSubItem(), ilPageContentGUI\getCharacteristics(), ilPageContentGUI\getCharacteristicsOfCurrentStyle(), getTemplateOptions(), and setBasicTableCellStyles().

Referenced by edit(), and insert().

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

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

Referenced by create().

906  {
909  $tpl = $this->tpl;
910  $lng = $this->lng;
911 
912  $this->displayValidationError();
913 
914  $this->initPropertiesForm("create");
915  $html = $this->form->getHTML();
916  $tpl->setContent($html);
917  }
initPropertiesForm($a_mode="edit")
Init properties form.
global $ilCtrl
Definition: ilias.php:18
displayValidationError()
display validation errors
$ilUser
Definition: imgupload.php:18
+ 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 865 of file class.ilPCTableGUI.php.

References $_SESSION.

866  {
867  $this->content_obj->setHorizontalAlign("Left");
868  $_SESSION["il_pg_error"] = $this->pg_obj->update();
869  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
870  }
$_SESSION["AccountId"]

◆ leftFloatAlign()

ilPCTableGUI::leftFloatAlign ( )

align table to left float

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

References $_SESSION.

886  {
887  $this->content_obj->setHorizontalAlign("LeftFloat");
888  $_SESSION["il_pg_error"] = $this->pg_obj->update();
889  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
890  }
$_SESSION["AccountId"]

◆ renderTable()

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

Render the table.

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

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

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

421  {
422  $tab_node = $this->content_obj->getNode();
423  $tab_node->set_attribute("Enabled", "True");
424  $content = $this->dom->dump_node($tab_node);
425 
426  $trans = $this->pg_obj->getLanguageVariablesXML();
427  $mobs = $this->pg_obj->getMultimediaXML();
428  if ($this->getStyleId() > 0) {
429  if (ilObject::_lookupType($this->getStyleId()) == "sty") {
430  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
431  $style = new ilObjStyleSheet($this->getStyleId());
432  $template_xml = $style->getTemplateXML();
433  }
434  }
435 
436  $content = $content . $mobs . $trans . $template_xml;
437 
439  $content,
440  $a_mode,
441  $a_submode,
442  $this->content_obj,
443  !$this->pg_obj->getPageConfig()->getPreventHTMLUnmasking(),
444  $this->getPage()
445  );
446  }
static _renderTable( $content, $a_mode="table_edit", $a_submode="", $a_table_obj=null, $unmask=true, $page_object=null)
Static render table function.
$mobs
getStyleId()
Get Style Id.
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilObjStyleSheet.
+ 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 855 of file class.ilPCTableGUI.php.

References $_SESSION.

856  {
857  $this->content_obj->setHorizontalAlign("Right");
858  $_SESSION["il_pg_error"] = $this->pg_obj->update();
859  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
860  }
$_SESSION["AccountId"]

◆ rightFloatAlign()

ilPCTableGUI::rightFloatAlign ( )

align table to left

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

References $_SESSION.

896  {
897  $this->content_obj->setHorizontalAlign("RightFloat");
898  $_SESSION["il_pg_error"] = $this->pg_obj->update();
899  $this->ctrl->returnToParent($this, "jump" . $this->hier_id);
900  }
$_SESSION["AccountId"]

◆ saveProperties()

ilPCTableGUI::saveProperties ( )

save table properties in db and return to page edit screen

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

References edit(), and setProperties().

840  {
841  $this->setProperties();
842  $this->updated = $this->pg_obj->update();
843  if ($this->updated === true) {
844  $this->ctrl->redirect($this, "edit");
845  //$this->ctrl->returnToParent($this, "jump".$this->hier_id);
846  } else {
847  $this->pg_obj->addHierIDs();
848  $this->edit();
849  }
850  }
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 1036 of file class.ilPCTableGUI.php.

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

1037  {
1038  $lng = $this->lng;
1039 
1040  if (is_array($_POST["target"])) {
1041  foreach ($_POST["target"] as $k => $value) {
1042  if ($value > 0) {
1043  $cid = explode(":", $k);
1044  $this->content_obj->setTDAlignment(
1045  ilUtil::stripSlashes($cid[0]),
1046  ilUtil::stripSlashes($_POST["alignment"]),
1047  ilUtil::stripSlashes($cid[1])
1048  );
1049  }
1050  }
1051  }
1052  $this->updated = $this->pg_obj->update();
1053  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1054 
1055  $this->ctrl->redirect($this, "editCellAlignment");
1056  }
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 804 of file class.ilPCTableGUI.php.

References $_POST, and ilUtil\stripSlashes().

Referenced by create(), and saveProperties().

805  {
806  // mask html
807  $caption = ilUtil::stripSlashes($_POST["caption"]);
808  $caption = str_replace("&", "&amp;", $caption);
809  $caption = str_replace("<", "&lt;", $caption);
810  $caption = str_replace(">", "&gt;", $caption);
811 
812  $this->content_obj->setLanguage(ilUtil::stripSlashes($_POST["language"]));
813  $this->content_obj->setWidth(ilUtil::stripSlashes($_POST["width"]));
814  $this->content_obj->setBorder(ilUtil::stripSlashes($_POST["border"]));
815  $this->content_obj->setCellSpacing(ilUtil::stripSlashes($_POST["spacing"]));
816  $this->content_obj->setCellPadding(ilUtil::stripSlashes($_POST["padding"]));
817  $this->content_obj->setHorizontalAlign(ilUtil::stripSlashes($_POST["align"]));
818  $this->content_obj->setHeaderRows(ilUtil::stripSlashes($_POST["row_header"]));
819  $this->content_obj->setHeaderCols(ilUtil::stripSlashes($_POST["col_header"]));
820  $this->content_obj->setFooterRows(ilUtil::stripSlashes($_POST["row_footer"]));
821  $this->content_obj->setFooterCols(ilUtil::stripSlashes($_POST["col_footer"]));
822  if (strpos($_POST["characteristic"], ":") > 0) {
823  $t = explode(":", $_POST["characteristic"]);
824  $this->content_obj->setTemplate(ilUtil::stripSlashes($t[2]));
825  $this->content_obj->setClass("");
826  } else {
827  $this->content_obj->setClass(ilUtil::stripSlashes($_POST["characteristic"]));
828  $this->content_obj->setTemplate("");
829  }
830  $this->content_obj->setCaption(
831  $caption,
832  ilUtil::stripSlashes($_POST["cap_align"])
833  );
834  }
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 785 of file class.ilPCTableGUI.php.

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

786  {
787  $lng = $this->lng;
788 
789  if (is_array($_POST["colspan"])) {
790  foreach ($_POST["colspan"] as $k => $span) {
791  $_POST["colspan"][$k] = ilUtil::stripSlashes($span);
792  $_POST["rowspan"][$k] = ilUtil::stripSlashes($_POST["rowspan"][$k]);
793  }
794  $this->content_obj->setTDSpans($_POST["colspan"], $_POST["rowspan"]);
795  }
796  $this->updated = $this->pg_obj->update();
797  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
798  $this->ctrl->redirect($this, "editCellSpan");
799  }
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 739 of file class.ilPCTableGUI.php.

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

740  {
741  $lng = $this->lng;
742 
743  if (is_array($_POST["target"])) {
744  foreach ($_POST["target"] as $k => $value) {
745  if ($value > 0) {
746  $cid = explode(":", $k);
747  $this->content_obj->setTDClass(
748  ilUtil::stripSlashes($cid[0]),
749  ilUtil::stripSlashes($_POST["style"]),
750  ilUtil::stripSlashes($cid[1])
751  );
752  }
753  }
754  }
755  $this->updated = $this->pg_obj->update();
756  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
757  $this->ctrl->redirect($this, "editCellStyle");
758  }
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 763 of file class.ilPCTableGUI.php.

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

764  {
765  $lng = $this->lng;
766 
767  if (is_array($_POST["width"])) {
768  foreach ($_POST["width"] as $k => $width) {
769  $cid = explode(":", $k);
770  $this->content_obj->setTDWidth(
771  ilUtil::stripSlashes($cid[0]),
772  ilUtil::stripSlashes($width),
773  ilUtil::stripSlashes($cid[1])
774  );
775  }
776  }
777  $this->updated = $this->pg_obj->update();
778  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
779  $this->ctrl->redirect($this, "editCellWidth");
780  }
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: