ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilTableTemplatesTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29{
30 protected string $temp_type;
35
36 public function __construct(
37 string $a_temp_type,
38 object $a_parent_obj,
39 string $a_parent_cmd,
40 ilObjStyleSheet $a_style_obj,
42 ) {
43 global $DIC;
44
45 $this->access_manager = $access_manager;
46 $this->ctrl = $DIC->ctrl();
47 $this->lng = $DIC->language();
48 $this->access = $DIC->access();
49 $this->rbacsystem = $DIC->rbac()->system();
50 $ilCtrl = $DIC->ctrl();
51 $lng = $DIC->language();
52
53 parent::__construct($a_parent_obj, $a_parent_cmd);
54
56
57 $this->setTitle($lng->txt("sty_templates"));
58 $this->style_obj = $a_style_obj;
59 $this->temp_type = $a_temp_type;
60
61 $this->addColumn("", "", "1"); // checkbox
62 $this->addColumn($this->lng->txt("sty_template_name"), "");
63 $this->addColumn($this->lng->txt("sty_preview"), "");
64 $this->addColumn($this->lng->txt("sty_commands"), "", "1");
65 $this->setEnableHeader(true);
66 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
67 $this->setRowTemplate("tpl.style_template_row.html", "components/ILIAS/Style/Content");
68 $this->getItems();
69
70 // action commands
71 if ($this->access_manager->checkWrite()) {
72 $this->addMultiCommand("deleteTemplateConfirmation", $lng->txt("delete"));
73 }
74
75 $this->setEnableTitle(true);
76 }
77
78 public function getItems(): void
79 {
80 $this->setData($this->style_obj->getTemplates($this->temp_type));
81 }
82
83 protected function fillRow(array $a_set): void
84 {
86 $ilCtrl = $this->ctrl;
87
88 $this->tpl->setVariable(
89 "T_PREVIEW",
90 $this->style_obj->lookupTemplatePreview((int) $a_set["id"])
91 );
92 $this->tpl->setVariable("TID", $a_set["id"]);
93 $this->tpl->setVariable("TEMPLATE_NAME", $a_set["name"]);
94 $ilCtrl->setParameter($this->parent_obj, "t_id", $a_set["id"]);
95
96 if ($this->access_manager->checkWrite()) {
97 $this->tpl->setVariable(
98 "LINK_EDIT_TEMPLATE",
99 $ilCtrl->getLinkTarget($this->parent_obj, "editTemplate")
100 );
101 $this->tpl->setVariable("TXT_EDIT", $lng->txt("edit"));
102 }
103 }
104}
Manages access to content style editing.
static addCss()
Add required css.
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 ilObjStyleSheet.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
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="")
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.
setData(array $a_data)
Set table data.
ilLanguage $lng
__construct(string $a_temp_type, object $a_parent_obj, string $a_parent_cmd, ilObjStyleSheet $a_style_obj, Content\Access\StyleAccessManager $access_manager)
Content Access StyleAccessManager $access_manager
fillRow(array $a_set)
Standard Version of Fill Row.
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