46 $this->
setId(
'mail_man_tpl');
47 parent::__construct($a_parent_obj, $a_parent_cmd);
49 $this->
setTitle($this->lng->txt(
'mail_templates'));
53 if (!$this->readOnly) {
56 $this->
addMultiCommand(
'confirmDeleteTemplate', $this->lng->txt(
'delete'));
59 $this->
addColumn($this->lng->txt(
'title'),
'title',
'30%');
60 $this->
addColumn($this->lng->txt(
'mail_template_context'),
'context',
'20%');
61 $this->
addColumn($this->lng->txt(
'action'),
'',
'10%');
63 $this->
setRowTemplate(
'tpl.mail_template_row.html',
'Services/Mail');
64 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
76 if (
'tpl_id' === $column) {
77 return \ilUtil::formCheckbox(
false,
'tpl_id[]', $row[$column]);
79 if (
'lang' === $column) {
80 return $this->lng->txt(
'meta_l_' . $row[$column]);
82 if ($column ==
'context') {
83 if (isset($this->contexts[$row[$column]])) {
84 $isDefaultSuffix =
'';
85 if ($row[
'is_default']) {
86 $isDefaultSuffix = $this->lng->txt(
'mail_template_default');
90 $this->contexts[$row[$column]]->getTitle(),
94 return $this->lng->txt(
'mail_template_orphaned_context');
100 return $row[$column];
108 foreach (
$row as $column => $value) {
109 if ($column ===
'tpl_id' && $this->readOnly) {
114 $this->tpl->setVariable(
'VAL_' . strtoupper($column), $value);
126 $this->ctrl->setParameter($this->
getParentObject(),
'tpl_id', $row[
'tpl_id']);
130 if (count($this->contexts) > 0) {
131 if (!$this->readOnly) {
132 $buttons[] = $this->uiFactory
135 $this->lng->txt(
'edit'),
136 $this->ctrl->getLinkTarget($this->
getParentObject(),
'showEditTemplateForm')
139 $buttons[] = $this->uiFactory
142 $this->lng->txt(
'view'),
143 $this->ctrl->getLinkTarget($this->
getParentObject(),
'showEditTemplateForm')
148 if (!$this->readOnly) {
149 $deleteModal = $this->uiFactory
152 $this->lng->txt(
'delete'),
153 $this->lng->txt(
'mail_tpl_sure_delete_entry'),
157 $this->uiComponents[] = $deleteModal;
159 $buttons[] = $this->uiFactory
162 $this->lng->txt(
'delete'),
163 $this->ctrl->getLinkTarget($this->
getParentObject(),
'confirmDeleteTemplate')
164 )->withOnClick($deleteModal->getShowSignal());
166 if ($row[
'is_default']) {
167 $buttons[] = $this->uiFactory
170 $this->lng->txt(
'mail_template_unset_as_default'),
171 $this->ctrl->getLinkTarget($this->
getParentObject(),
'unsetAsContextDefault')
174 $buttons[] = $this->uiFactory
177 $this->lng->txt(
'mail_template_set_as_default'),
178 $this->ctrl->getLinkTarget($this->
getParentObject(),
'setAsContextDefault')
185 $dropDown = $this->uiFactory
188 ->withLabel($this->lng->txt(
'actions'));
190 return $this->uiRenderer->render([$dropDown]);
198 return parent::getHTML() . $this->uiRenderer->render($this->uiComponents);
An entity that renders components to a string output.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
formatCellValue($column, array $row)
formatActionsDropDown(array $row)
getParentObject()
Get parent object.
Class ilMailTemplateTableGUI.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
This is how the factory for UI elements looks.
static getTemplateContexts($a_id=null)
Returns an array of mail template contexts, the key of each entry matches its id. ...
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct( $a_parent_obj, $a_parent_cmd, Factory $uiFactory, Renderer $uiRenderer, $readOnly=false)
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.