ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilPCGridCellTableGUI.php
Go to the documentation of this file.
1<?php
2
25{
26 protected int $pos = 0;
27 protected ilPCGrid $grid;
28
29 public function __construct(
30 object $a_parent_obj,
31 string $a_parent_cmd,
32 ilPCGrid $a_grid
33 ) {
34 global $DIC;
35
36 $this->ctrl = $DIC->ctrl();
37 $this->lng = $DIC->language();
38 $ilCtrl = $DIC->ctrl();
39 $lng = $DIC->language();
40
41 parent::__construct($a_parent_obj, $a_parent_cmd);
42
43 $this->addColumn("", "", "1");
44 $this->addColumn($lng->txt("cont_position"), "", "1");
45 $this->addColumn($lng->txt("cont_grid_width_s"));
46 $this->addColumn($lng->txt("cont_grid_width_m"));
47 $this->addColumn($lng->txt("cont_grid_width_l"));
48 $this->addColumn($lng->txt("cont_grid_width_xl"));
49 $this->setEnableHeader(true);
50 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
51 $this->setRowTemplate(
52 "tpl.grid_cell_row.html",
53 "components/ILIAS/COPage"
54 );
55
56 $this->grid = $a_grid;
57 //$caps = $this->tabs->getCaptions();
58 $this->setData($this->grid->getCellData());
59 $this->setLimit(0);
60
61 $this->addMultiCommand("confirmCellDeletion", $lng->txt("delete"));
62 $this->addCommandButton("saveCellData", $lng->txt("save"));
63
64 $this->setTitle($lng->txt("cont_ed_grid_col_widths"));
65 }
66
67 protected function fillRow(array $a_set): void
68 {
69 $this->pos += 10;
70 $this->tpl->setVariable("POS", ilLegacyFormElementsUtil::prepareFormOutput($this->pos));
71 $tid = $a_set["hier_id"] . ":" . $a_set["pc_id"];
72 $this->tpl->setVariable("TID", $tid);
73 foreach (ilPCGrid::getSizes() as $s) {
74 $this->tpl->setCurrentBlock("select_width");
75 $this->tpl->setVariable(
76 "SELECT_WIDTH",
78 $a_set[$s],
79 "width_" . $s . "[$tid]",
80 ["" => ""] + ilPCGrid::getWidths(),
81 false,
82 true
83 )
84 );
85 $this->tpl->parseCurrentBlock();
86 }
87 }
88}
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static prepareFormOutput($a_str, bool $a_strip=false)
static formSelect( $selected, string $varname, array $options, bool $multiple=false, bool $direct_text=false, int $size=0, string $style_class="", array $attribs=[], bool $disabled=false)
Builds a select form field with options and shows the selected option first.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd, ilPCGrid $a_grid)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getSizes()
Get sizes.
static getWidths()
Get widths.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
ilLanguage $lng
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26