19 declare(strict_types=1);
43 bool $readOnly =
false 49 $this->
setId(
'mail_man_tpl');
56 if (!$this->readOnly) {
62 $this->
addColumn($this->
lng->txt(
'title'),
'title',
'30%');
63 $this->
addColumn($this->
lng->txt(
'mail_template_context'),
'context',
'20%');
66 $this->
setRowTemplate(
'tpl.mail_template_row.html',
'Services/Mail');
74 if (
'tpl_id' === $column) {
77 if (
'lang' === $column) {
78 return $this->
lng->txt(
'meta_l_' . $row[$column]);
80 if ($column ===
'context') {
81 if (isset($this->contexts[$row[$column]])) {
82 $isDefaultSuffix =
'';
83 if ($row[
'is_default']) {
84 $isDefaultSuffix = $this->
lng->txt(
'mail_template_default');
88 $this->contexts[$row[$column]]->getTitle(),
93 return $this->
lng->txt(
'mail_template_orphaned_context');
99 protected function fillRow(array $a_set): void
101 foreach ($a_set as
$column => $value) {
102 if (
$column ===
'tpl_id' && $this->readOnly) {
107 $this->tpl->setVariable(
'VAL_' . strtoupper(
$column), $value);
119 if (count($this->contexts) > 0) {
120 if (!$this->readOnly) {
124 $this->
lng->txt(
'edit'),
131 $this->
lng->txt(
'view'),
137 if (!$this->readOnly) {
138 $deleteModal = $this->uiFactory
141 $this->
lng->txt(
'delete'),
142 $this->
lng->txt(
'mail_tpl_sure_delete_entry'),
144 )->withActionButtonLabel(
148 $this->uiComponents[] = $deleteModal;
153 $this->
lng->txt(
'delete'),
155 )->withOnClick($deleteModal->getShowSignal());
157 if ($row[
'is_default']) {
161 $this->
lng->txt(
'mail_template_unset_as_default'),
168 $this->
lng->txt(
'mail_template_set_as_default'),
176 $dropDown = $this->uiFactory
179 ->withLabel($this->
lng->txt(
'actions'));
181 return $this->uiRenderer->render([$dropDown]);
186 return parent::getHTML() . $this->uiRenderer->render($this->uiComponents);
An entity that renders components to a string output.
__construct(ilMailTemplateGUI $a_parent_obj, string $a_parent_cmd, Factory $uiFactory, Renderer $uiRenderer, bool $readOnly=false)
setFormAction(string $a_form_action, bool $a_multipart=false)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
formatActionsDropDown(array $row)
Class ilMailTemplateTableGUI.
static getTemplateContexts(?array $a_id=null)
Returns an array of mail template contexts, the key of each entry matches its id. ...
setDefaultOrderField(string $a_defaultorderfield)
formatCellValue(string $column, array $row)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
__construct(Container $dic, ilPlugin $plugin)
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)
addMultiCommand(string $a_cmd, string $a_text)