ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 $incl_desc;
34 protected string $base_cmd;
35 protected int $nr;
36
37 public function __construct(
38 ?object $parent_obj,
39 string $parent_cmd,
40 bool $incl_desc = true,
41 string $base_cmd = "HeaderTitle"
42 ) {
43 global $DIC;
44
45 $this->access = $DIC->access();
46 $this->lom_services = $DIC->learningObjectMetadata();
47
49 $this->incl_desc = $incl_desc;
50 $this->base_cmd = $base_cmd;
51
52 $this->setLimit(9999);
53
54 $this->addColumn("", "", "1");
55 $this->addColumn($this->lng->txt("language"));
56 $this->addColumn($this->lng->txt("default"));
57 $this->addColumn($this->lng->txt("title"));
58 if ($incl_desc) {
59 $this->addColumn($this->lng->txt("description"));
60 }
61
62 $this->setEnableHeader(true);
63 $this->setFormAction($this->ctrl->getFormAction($parent_obj));
64 $this->setRowTemplate("tpl.installation_heading_table_row.html", "components/ILIAS/SystemFolder");
65 $this->disable("footer");
66 $this->setEnableTitle(true);
67
68 $this->nr = 0;
69 }
70
71 protected function prepareOutput(): void
72 {
73 $this->addMultiCommand("delete" . $this->base_cmd . "s", $this->lng->txt("remove"));
74 if ($this->dataExists()) {
75 $this->addCommandButton("save" . $this->base_cmd . "s", $this->lng->txt("save"));
76 }
77 $this->addCommandButton("add" . $this->base_cmd, $this->lng->txt("add"));
78 }
79
80 protected function fillRow(array $set): void
81 {
82 $this->nr++;
83
84 if ($this->incl_desc) {
85 $this->tpl->setCurrentBlock("desc_row");
86 $this->tpl->setVariable("VAL_DESC", ilLegacyFormElementsUtil::prepareFormOutput($set["desc"]));
87 $this->tpl->setVariable("DNR", $this->nr);
88 $this->tpl->parseCurrentBlock();
89 }
90
91 $this->tpl->setVariable("NR", $this->nr);
92
93 // lang selection
94 $languages = [];
95 foreach ($this->lom_services->dataHelper()->getAllLanguages() as $language) {
96 $languages[$language->value()] = $language->presentableLabel();
97 }
98 $this->tpl->setVariable(
99 "LANG_SELECT",
101 $set["lang"],
102 "lang[" . $this->nr . "]",
103 $languages,
104 false,
105 true
106 )
107 );
108
109 if ($set["default"]) {
110 $this->tpl->setVariable("DEF_CHECKED", "checked=\"checked\"");
111 }
112
113 $this->tpl->setVariable("VAL_TITLE", ilLegacyFormElementsUtil::prepareFormOutput($set["title"]));
114 }
115}
TableGUI class for title/description translations.
prepareOutput()
Anything that must be done before HTML is generated.
__construct(?object $parent_obj, string $parent_cmd, bool $incl_desc=true, string $base_cmd="HeaderTitle")
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