ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilInstallationHeadingTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
31 protected LOMServices $lom_services;
32
33 protected bool $write_enabled = false;
34 protected string $base_cmd;
35 protected int $nr;
36
37 public function __construct(
38 ?object $parent_obj,
39 string $parent_cmd,
41 ) {
42 global $DIC;
43
44 $this->access = $DIC->access();
45 $this->lom_services = $DIC->learningObjectMetadata();
46
48 $this->write_enabled = $write_enabled;
49
50 $this->setLimit(9999);
51
52 $this->addColumn("", "", "1");
53 $this->addColumn($this->lng->txt("language"));
54 $this->addColumn($this->lng->txt("default"));
55 $this->addColumn($this->lng->txt("title"));
56
57 $this->setEnableHeader(true);
58 $this->setFormAction($this->ctrl->getFormAction($parent_obj));
59 $this->setRowTemplate("tpl.installation_heading_table_row.html", "components/ILIAS/Administration");
60 $this->disable("footer");
61 $this->setEnableTitle(true);
62
63 $this->nr = 0;
64 }
65
66 protected function prepareOutput(): void
67 {
68 if ($this->write_enabled) {
69 $this->addMultiCommand("delete", $this->lng->txt("remove"));
70 if ($this->dataExists()) {
71 $this->addCommandButton("save", $this->lng->txt("save"));
72 }
73 $this->addCommandButton("add", $this->lng->txt("add"));
74 }
75 }
76
77 protected function fillRow(array $set): void
78 {
79 $this->nr++;
80 $this->tpl->setVariable("NR", $this->nr);
81
82 // lang selection
83 $languages = [];
84 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
85 $languages[$language->value()] = $language->presentableLabel();
86 }
87 $this->tpl->setVariable(
88 "LANG_SELECT",
90 $set["lang"],
91 "lang[" . $this->nr . "]",
92 $languages,
93 false,
94 true
95 )
96 );
97
98 if ($set["default"]) {
99 $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
100 }
101
102 $this->tpl->setVariable("VAL_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($set["title"]));
103 }
104}
TableGUI class for title/description translations.
prepareOutput()
Anything that must be done before HTML is generated.
__construct(?object $parent_obj, string $parent_cmd, bool $write_enabled)
fillRow(array $set)
Standard Version of Fill Row.
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...
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
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.
disable(string $a_module_name)
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26