ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
TemplateTableBuilder.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
30{
31 public function __construct(
32 protected InternalDomainService $domain,
33 protected \ilObjStyleSheet $style_obj,
34 protected string $temp_type,
35 protected StyleAccessManager $access_manager,
36 object $parent_gui,
37 string $parent_cmd
38 ) {
39 parent::__construct($parent_gui, $parent_cmd);
40 }
41
42 protected function getId(): string
43 {
44 return "style_templates";
45 }
46
47 protected function getTitle(): string
48 {
49 return $this->domain->lng()->txt("sty_templates");
50 }
51
52 protected function getRetrieval(): RetrievalInterface
53 {
54 return $this->domain->templateRetrieval($this->style_obj, $this->temp_type);
55 }
56
57 protected function transformRow(array $data_row): array
58 {
60 $this->style_obj,
61 $this->temp_type,
62 (int) $data_row["id"],
63 false
64 );
65
66 return [
67 "id" => (int) $data_row["id"],
68 "name" => (string) $data_row["name"],
69 "preview" => $preview
70 ];
71 }
72
74 {
75 $lng = $this->domain->lng();
76
78 ->textColumn("name", $lng->txt("sty_template_name"), true)
79 ->textColumn("preview", $lng->txt("sty_preview"));
80
81 if ($this->access_manager->checkWrite()) {
84 "editTemplate",
85 $lng->txt("edit"),
86 [get_class($this->parent_gui)],
87 "editTemplate",
88 "t_id"
89 )
90 ->multiAction(
91 "deleteTemplateConfirmation",
92 $lng->txt("delete"),
93 true
94 );
95 }
96
97 return $table;
98 }
99}
textColumn(string $key, string $title, bool $sortable=false)
singleRedirectAction(string $action, string $title, array $class_path, string $cmd="", string $id_param="", bool $async=false)
Manages access to content style editing.
transformRow(array $data_row)
transform raw data array to table row data array
__construct(protected InternalDomainService $domain, protected \ilObjStyleSheet $style_obj, protected string $temp_type, protected StyleAccessManager $access_manager, object $parent_gui, string $parent_cmd)
static _getTemplatePreview(ilObjStyleSheet $a_style, string $a_type, int $a_t_id, bool $a_small_mode=false)
Get table template preview.
Class ilObjStyleSheet.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $lng
Definition: privfeed.php:26