43 $this->
ctrl = $DIC->ctrl();
44 $ilToolbar = $DIC->toolbar();
45 $ilTabs = $DIC->tabs();
48 $this->
tabs = $ilTabs;
55 $next_class = $this->
ctrl->getNextClass($this);
58 $cmd = $this->
ctrl->getCmd();
60 switch ($next_class) {
71 if ($this->
ctrl->getCmd() ==
"create") {
72 $form->setValuesByPost();
74 $this->tpl->setContent($form->getHTML());
98 $form->setFormAction($this->
ctrl->getFormAction($this));
99 $form->setTitle($this->
lng->txt(
"cont_ed_insert_grid"));
100 $form->setDescription($this->
lng->txt(
"cont_ed_insert_grid_info"));
104 $radg->
setValue(self::TEMPLATE_TWO_COLUMN);
105 $op1 =
new ilRadioOption(
$lng->
txt(
"cont_grid_t_two_column"), self::TEMPLATE_TWO_COLUMN,
$lng->
txt(
"cont_grid_t_two_column_info"));
106 $radg->addOption($op1);
107 $op2 =
new ilRadioOption(
$lng->
txt(
"cont_grid_t_three_column"), self::TEMPLATE_THREE_COLUMN,
$lng->
txt(
"cont_grid_t_three_column_info"));
108 $radg->addOption($op2);
110 $radg->addOption($op3);
111 $op4 =
new ilRadioOption(
$lng->
txt(
"cont_grid_t_two_by_two"), self::TEMPLATE_TWO_BY_TWO,
$lng->
txt(
"cont_grid_t_two_by_two_info"));
112 $radg->addOption($op4);
114 $radg->addOption($op5);
115 $form->addItem($radg);
122 $op5->addSubItem($ni);
134 $si->setInfo($this->
lng->txt(
"cont_grid_width_" . $s .
"_info"));
135 $si->setOptions($options);
136 $op5->addSubItem($si);
140 $form->addCommandButton(
"create_grid", $this->
lng->txt(
"save"));
141 $form->addCommandButton(
"cancelCreate", $this->
lng->txt(
"cancel"));
152 if ($form->checkInput()) {
153 $post_layout_template = (
int) $form->getInput(
"layout_template");
155 $this->content_obj->create($this->pg_obj, $this->hier_id, $this->pc_id);
156 $this->content_obj->applyTemplate(
157 $post_layout_template,
158 (
int) $form->getInput(
"number_of_cells"),
159 (
int) $form->getInput(
"s"),
160 (
int) $form->getInput(
"m"),
161 (
int) $form->getInput(
"l"),
162 (
int) $form->getInput(
"xl")
164 $this->updated = $this->pg_obj->update();
166 if ($this->updated ===
true) {
173 $form->setValuesByPost();
174 $this->tpl->setContent($form->getHTML());
180 $this->pg_obj->stripHierIDs();
181 $this->pg_obj->addHierIDs();
182 $this->
ctrl->setParameter($this,
"hier_id", $this->content_obj->readHierId());
183 $this->
ctrl->setParameter($this,
"pc_id", $this->content_obj->readPCId());
184 $this->content_obj->setHierId($this->content_obj->readHierId());
185 $this->
setHierId($this->content_obj->readHierId());
186 $this->content_obj->setPcId($this->content_obj->readPCId());
198 public function edit():
void 201 $this->
lng->txt(
"cont_add_cell"),
202 $this->
ctrl->getLinkTarget($this,
"addCell")
206 $this->
tabs->activateTab(
"settings");
210 $this->tpl->setContent($table_gui->getHTML());
218 $pos = $this->request->getStringArray(
"position");
219 if (count($pos) > 0) {
220 $this->content_obj->savePositions($pos);
222 $this->updated = $this->pg_obj->update();
223 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
224 $this->
ctrl->redirect($this,
"edit");
232 $this->content_obj->addCell();
233 $this->updated = $this->pg_obj->update();
235 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"cont_added_cell"),
true);
236 $this->
ctrl->redirect($this,
"edit");
246 $tid = $this->request->getStringArray(
"tid");
247 if (count($tid) == 0) {
248 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"no_checkbox"),
true);
249 $this->
ctrl->redirect($this,
"edit");
252 $cgui->setFormAction($this->
ctrl->getFormAction($this));
253 $cgui->setHeaderText($this->
lng->txt(
"cont_grid_cell_confirm_deletion"));
254 $cgui->setCancel($this->
lng->txt(
"cancel"),
"cancelCellDeletion");
255 $cgui->setConfirm($this->
lng->txt(
"delete"),
"deleteCells");
257 foreach ($tid as $k =>
$i) {
258 $id = explode(
":", $k);
259 $id = explode(
"_",
$id[0]);
260 $cgui->addItem(
"tid[]", $k, $this->
lng->txt(
"cont_grid_cell") .
" " .
$id[count(
$id) - 1]);
263 $this->tpl->setContent($cgui->getHTML());
272 $this->
ctrl->redirect($this,
"edit");
282 $tids = $this->request->getStringArray(
"tid");
283 foreach ($tids as $tid) {
284 $ids = explode(
":", $tid);
285 $this->content_obj->deleteGridCell($ids[0], $ids[1]);
287 $this->updated = $this->pg_obj->update();
289 $ilCtrl->redirect($this,
"edit");
294 $this->
tabs->setBackTarget(
295 $this->
lng->txt(
"pg"),
296 $this->
ctrl->getParentReturn($this)
301 $this->
lng->txt(
"settings"),
302 $this->
ctrl->getLinkTarget($this,
"edit")
311 $width_s = $this->request->getStringArray(
"width_s");
312 $width_m = $this->request->getStringArray(
"width_m");
313 $width_l = $this->request->getStringArray(
"width_l");
314 $width_xl = $this->request->getStringArray(
"width_xl");
315 $this->content_obj->saveWidths($width_s, $width_m, $width_l, $width_xl);
317 $pos = $this->request->getStringArray(
"position");
318 if (count($pos) > 0) {
319 $this->content_obj->savePositions($pos);
321 $this->updated = $this->pg_obj->update();
322 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
323 $this->
ctrl->redirect($this,
"edit");
static getWidths()
Get widths.
const TEMPLATE_TWO_BY_TWO
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilPageContent $content_obj
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create()
Create new grid element.
initCreationForm()
Init creation form.
const TEMPLATE_TWO_COLUMN
setHierId(string $a_hier_id)
set hierarchical id in dom object
saveCells()
Save cell properties.
confirmCellDeletion()
Confirm cell deletion.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
cancelCellDeletion()
Cancel cell deletion.
User Interface for Editing of Page Content Objects (Paragraphs, Tables, ...)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
saveCellData()
Save tabs properties in db and return to page edit screen.
const TEMPLATE_THREE_COLUMN
deleteCells()
Delete Cells.
__construct(Container $dic, ilPlugin $plugin)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(ilPageObject $a_pg_obj, ?ilPageContent $a_content_obj, string $a_hier_id, string $a_pc_id="")
static getSizes()
Get sizes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...