ILIAS  release_8 Revision v8.24
class.ilSettingsTemplateTableGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
29{
31 protected \ILIAS\DI\Container $dic;
34
35 public function __construct(
36 object $a_parent_obj,
37 string $a_parent_cmd,
38 string $a_type
39 ) {
40 global $DIC;
41
42 $this->dic = $DIC;
43 $this->ctrl = $this->dic->ctrl();
44 $this->lng = $this->dic->language();
45 $this->access = $this->dic->access();
46 $this->rbacsystem = $this->dic->rbac()->system();
47 $ilCtrl = $this->dic->ctrl();
48 $lng = $this->dic->language();
49 $this->request = new SettingsTemplateGUIRequest(
50 $DIC->http(),
51 $DIC->refinery()
52 );
53
54 $this->setId("admsettemp" . $a_type);
55
56 parent::__construct($a_parent_obj, $a_parent_cmd);
57
59 $this->setTitle(
60 $lng->txt("adm_settings_templates") . " - " .
61 $lng->txt("obj_" . $a_type)
62 );
63
64 $this->addColumn("", "", "1", true);
65 $this->addColumn($this->lng->txt("title"), "title");
66 $this->addColumn($this->lng->txt("description"));
67 $this->addColumn($this->lng->txt("actions"));
68
69 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
70 $this->setRowTemplate(
71 "tpl.settings_template_row.html",
72 "Services/Administration"
73 );
74
75 if ($this->rbacsystem->checkAccess('write', $this->request->getRefId())) {
76 $this->addMultiCommand("confirmSettingsTemplateDeletion", $lng->txt("delete"));
77 //$this->addCommandButton("", $lng->txt(""));
78 }
79 }
80
81 protected function fillRow(array $a_set): void
82 {
84 $ilCtrl = $this->ctrl;
85
86 $ilCtrl->setParameter($this->parent_obj, "templ_id", $a_set["id"]);
87 $this->tpl->setVariable("VAL_ID", $a_set["id"]);
88 $this->tpl->setVariable("VAL_TITLE", ilSettingsTemplate::translate($a_set["title"] ?? ''));
89 $this->tpl->setVariable("VAL_DESCRIPTION", ilSettingsTemplate::translate($a_set["description"] ?? ''));
90 if ($this->rbacsystem->checkAccess('write', $this->request->getRefId())) {
91 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
92 $this->tpl->setVariable(
93 "HREF_EDIT",
94 $ilCtrl->getLinkTarget($this->parent_obj, "editSettingsTemplate")
95 );
96 }
97 $ilCtrl->setParameter($this->parent_obj, "templ_id", "");
98 }
99}
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
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...
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, string $a_parent_cmd, string $a_type)
static translate(string $a_title_desc)
static getAllSettingsTemplates(string $a_type, bool $a_include_auto_generated=false)
Get all settings templates of type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
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)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
ilLanguage $lng
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc