26     protected \ILIAS\HTTP\Services 
$http;
    37         $this->main_tpl = $DIC->ui()->mainTemplate();
    38         $this->
lng = $DIC->language();
    39         $this->
ctrl = $DIC->ctrl();
    40         $this->
tabs = $DIC->tabs();
    43         $this->tool_context = $DIC->globalScreen()->tool()->context();
    44         $this->
http = $DIC->http();
    49         if ($a_mode === 
"create") {
    50             return $this->
lng->txt(
"cont_ed_insert_dtab");
    52         return $this->
lng->txt(
"cont_table_properties");
    64         $next_class = $this->
ctrl->getNextClass($this);
    67         $cmd = $this->
ctrl->getCmd();
    69         switch ($next_class) {
    86     public function update(
bool $a_redirect = 
true): void
    92         $cell = $this->request->getArrayArray(
"cell");
    93         if (is_array($cell)) {
    94             foreach ($cell as $i => $row) {
    96                     foreach ($row as $j => $cell) {
   100                                 $this->content_obj->getLanguage()
   107         $this->updated = $this->content_obj->setData(
$data);
   109         if ($this->updated !== 
true) {
   114         $this->updated = $this->pg_obj->update();
   117             $this->main_tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"msg_obj_modified"), 
true);
   118             $this->
ctrl->redirect($this, 
"editData");
   130         if ($this->request->getString(
"cancel_update") != 
"") {
   132             $this->
ctrl->returnToParent($this, 
"jump" . $this->hier_id);
   137         $post = $this->
http->request()->getParsedBody();
   138         foreach (
$post as $k => $content) {
   139             if (substr($k, 0, 5) != 
"cell_") {
   145             $p1 = strpos($div, 
'>');
   146             $div = substr($div, $p1 + 1);
   147             $div = 
"<div class='ilc_text_block_TableContent'>" . $div;
   149             if ($text === 
false) {
   150                 $ilCtrl->returnToParent($this, 
"jump" . $this->hier_id);
   152             $text = $text[
"text"];
   156                 $this->content_obj->getLanguage(),
   163             $id = explode(
"_", $k);
   168         $this->updated = $this->content_obj->setData(
$data);
   170         if ($this->updated !== 
true) {
   175         $this->updated = $this->pg_obj->update();
   177         $tab_cmd_id = $this->request->getInt(
"tab_cmd_id");
   178         $tab_cmd_type = $this->request->getString(
"tab_cmd_type");
   179         $tab_cmd = $this->request->getString(
"tab_cmd");
   183         $this->pg_obj->addHierIDs();
   185         if ($tab_cmd != 
"") {
   186             $cell_hier_id = ($tab_cmd_type == 
"col")
   187                 ? $this->hier_id . 
"_1_" . ($tab_cmd_id + 1)
   188                 : $this->hier_id . 
"_" . ($tab_cmd_id + 1) . 
"_1";
   189             $cell_obj = $this->pg_obj->getContentObject($cell_hier_id);
   190             if (is_object($cell_obj)) {
   191                 $cell_obj->$tab_cmd();
   192                 $ret = $this->pg_obj->update();
   194                     $this->main_tpl->setOnScreenMessage(
'failure', $ret[0][1], 
true);
   201             $this->main_tpl->setOnScreenMessage(
'success', 
$lng->
txt(
"msg_obj_modified"), 
true);
   203         if ($this->request->getString(
"save_return") != 
"") {
   204             $this->
ctrl->returnToParent($this, 
"jump" . $this->hier_id);
   206             $this->
ctrl->redirect($this, 
"editData");
   226         $this->pg_obj->stripHierIDs();
   227         $this->pg_obj->addHierIDs();
   228         $ilCtrl->
setParameter($this, 
"hier_id", $this->content_obj->readHierId());
   229         $ilCtrl->setParameter($this, 
"pc_id", $this->content_obj->readPCId());
   230         $ilCtrl->redirect($this, 
"editData");
   241         $this->pg_obj->addHierIDs();
   243         $type = $this->request->getString(
"type");
   244         $action = $this->request->getString(
"action");
   245         $id = $this->request->getInt(
"id");
   247         $cell_hier_id = ($type == 
"col")
   248             ? $this->hier_id . 
"_1_" . (
$id + 1)
   249             : $this->hier_id . 
"_" . (
$id + 1) . 
"_1";
   250         $cell_obj = $this->pg_obj->getContentObject($cell_hier_id);
   251         if (is_object($cell_obj)) {
   252             $cell_obj->$action();
   253             $this->edit_repo->setPageError($this->pg_obj->update());
   255         $ilCtrl->redirect($this, 
"editData");
   261     public function setTabs(
string $data_tab_txt_key = 
""): void
   263         parent::setTabs(
"cont_ed_edit_data");
   268         $cmd = $this->
ctrl->getCmd();
   269         if ($cmd == 
"update") {
   273                 $this->content_obj->getCellText($i, $j),
   280                 $this->content_obj->readPCId() . 
"_" . $i . 
"_" . $j
   285         $s_text = str_replace(
"{", 
"{", $s_text);
   286         $s_text = str_replace(
"}", 
"}", $s_text);
   293         $a_seleted_value = 
"";
   304         for ($i = 1; $i <= 20; $i++) {
   322             $this->
lng->txt(
"cont_table_style"),
   327         $chars = array_merge($templates, $chars);
   328         if (is_object($this->content_obj)) {
   329             if (($chars[$a_seleted_value] ?? 
"") == 
"" && ($this->content_obj->getClass() != 
"")) {
   330                 $chars = array_merge(
   331                     array($this->content_obj->getClass() => $this->content_obj->getClass()),
   336         foreach ($chars as $k => $char) {
   337             if (strpos($k, 
":") > 0) {
   338                 $t = explode(
":", $k);
   339                 $html = $this->style->lookupTemplatePreview($t[1]) . 
'<div style="clear:both;" class="small">' . $char . 
"</div>";
   341                 $html = 
'<table class="ilc_table_' . $k . 
'"><tr><td class="small">' .
   342                     $char . 
'</td></tr></table>';
   344             $char_prop->addOption($k, $char, $html);
   346         if (count($chars) > 1) {
   347             $char_prop->setValue(
"StandardTable");
   364         $a_seleted_value = 
"";
   376             $this->
lng->txt(
"cont_table_style"),
   381         $chars = array_merge($templates, $chars);
   382         if (is_object($this->content_obj)) {
   383             if (($chars[$a_seleted_value] ?? 
"") == 
"" && ($this->content_obj->getClass() != 
"")) {
   384                 $chars = array_merge(
   385                     array($this->content_obj->getClass() => $this->content_obj->getClass()),
   390         foreach ($chars as $k => $char) {
   391             if (strpos($k, 
":") > 0) {
   392                 $t = explode(
":", $k);
   393                 $html = $this->style->lookupTemplatePreview($t[1]) . 
'<div style="clear:both;" class="small">' . $char . 
"</div>";
   395                 $html = 
'<table class="ilc_table_' . $k . 
'"><tr><td class="small">' .
   396                     $char . 
'</td></tr></table>';
   398             $char_prop->addOption($k, $char, $html);
   400         if (count($chars) > 1) {
   401             if ($this->content_obj->getTemplate() !== 
"") {
   404                     $this->content_obj->getTemplate();
   406                 $val = $this->content_obj->getClass();
   408             $char_prop->setValue($val);
   414         if ($this->content_obj->getHeaderRows() > 0) {
   415             $cb->setChecked(
true);
   425         $a_seleted_value = 
"";
   440         $import_data->setInfo($this->
lng->txt(
"cont_table_import_info"));
   441         $import_data->setRows(8);
   442         $import_data->setCols(50);
   447             $this->
lng->txt(
"cont_table_style"),
   448             "import_characteristic"   452         $chars = array_merge($templates, $chars);
   453         if (is_object($this->content_obj)) {
   454             if (($chars[$a_seleted_value] ?? 
"") == 
"" && ($this->content_obj->getClass() != 
"")) {
   455                 $chars = array_merge(
   456                     array($this->content_obj->getClass() => $this->content_obj->getClass()),
   461         foreach ($chars as $k => $char) {
   462             if (strpos($k, 
":") > 0) {
   463                 $t = explode(
":", $k);
   464                 $html = $this->style->lookupTemplatePreview($t[1]) . 
'<div style="clear:both;" class="small">' . $char . 
"</div>";
   466                 $html = 
'<table class="ilc_table_' . $k . 
'"><tr><td class="small">' .
   467                     $char . 
'</td></tr></table>';
   469             $char_prop->addOption($k, $char, $html);
   471         if (count($chars) > 1) {
   472             $char_prop->setValue(
"StandardTable");
   502             $this->
lng->txt(
"cont_style"),
   505         $style->setPullRight(
false);
   509         $options = array_merge(array(
"" => $this->
lng->txt(
"none")), 
$chars);   
   510         foreach ($options as $k => $option) {
   511             $html = 
'<table border="0" cellspacing="0" cellpadding="0"><tr><td class="ilc_table_cell_' . $k . 
'">' .
   512                 $option . 
'</td></tr></table>';
   513             $style->addOption($k, $option, $html);
   516         if (count($options) > 1) {
   523         $ti->setMaxLength(20);
   532             "Left" => 
$lng->
txt(
"cont_left"),
   533             "Center" => 
$lng->
txt(
"cont_center"),
   534             "Right" => 
$lng->
txt(
"cont_right")
   538         $al_cb->addSubItem($si);
 tableAction()
Perform operation on table (adding, moving, deleting rows/cols) 
 
editData()
Edit data of table. 
 
static xml2outputJS(string $s_text)
Prepare content for js output. 
 
updateJS()
Update via JavaScript. 
 
static handleAjaxContent(string $a_content)
Handle ajax content. 
 
executeCommand()
execute command 
 
getCharacteristicsOfCurrentStyle(array $a_type)
Get characteristics of current style and call setCharacteristics, if style is given. 
 
static _lookupTemplateIdByName(int $a_style_id, string $a_name)
Lookup table template preview. 
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
getFormTitle(string $a_mode="edit")
 
ILIAS HTTP Services $http
 
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
 
ilGlobalTemplateInterface $main_tpl
 
static xml2output(string $a_text, bool $a_wysiwyg=false, bool $a_replace_lists=true, bool $unmask=true)
Converts xml from DB to output in edit textarea. 
 
setTabs(string $data_tab_txt_key="")
Set tabs. 
 
setCharacteristics(array $a_chars)
 
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
 
Content object of ilPageObject (see ILIAS DTD). 
 
static handleAjaxContentPost(string $text)
Post input2xml handling of ajax content. 
 
static http()
Fetches the global http state from ILIAS. 
 
afterCreation()
After creation processing. 
 
setBasicTableCellStyles()
 
static _input2xml(string $a_text, string $a_lang, bool $a_wysiwyg=false, bool $a_handle_lists=true)
Converts user input to xml User input comes as bb code information, e.g. 
 
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD) 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getNewTableObject()
Get new table object. 
 
getTemplateOptions(string $a_type="")
 
This class represents a text area property in a property form. 
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
 
getCellContent(int $i, int $j)
 
update(bool $a_redirect=true)
Update table data in dom and update page in db.