ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
ILIAS\LearningModule\Editing\SubObjectTableBuilder Class Reference
+ Inheritance diagram for ILIAS\LearningModule\Editing\SubObjectTableBuilder:
+ Collaboration diagram for ILIAS\LearningModule\Editing\SubObjectTableBuilder:

Public Member Functions

 __construct (protected InternalDomainService $domain, protected InternalGUIService $gui, protected string $title, protected int $lm_id, protected string $type, object $parent_gui, string $parent_cmd)
 
- Public Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 __construct (protected object $parent_gui, protected string $parent_cmd, bool $numeric_ids=true)
 
 getTable ()
 

Protected Member Functions

 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 getOrderingCommand ()
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 
- Protected Member Functions inherited from ILIAS\Repository\Table\CommonTableBuilder
 getId ()
 
 getTitle ()
 
 getRetrieval ()
 
 getNamespace ()
 
 getOrderingCommand ()
 
 activeAction (string $action, array $data_row)
 
 transformRow (array $data_row)
 transform raw data array to table row data array More...
 
 build (TableAdapterGUI $table)
 

Protected Attributes

array $page_layouts
 
- Protected Attributes inherited from ILIAS\Repository\Table\CommonTableBuilder
TableAdapterGUI $table
 

Detailed Description

Definition at line 29 of file SubObjectTableBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::__construct ( protected InternalDomainService  $domain,
protected InternalGUIService  $gui,
protected string  $title,
protected int  $lm_id,
protected string  $type,
object  $parent_gui,
string  $parent_cmd 
)

Definition at line 33 of file SubObjectTableBuilder.php.

41 {
42 $this->page_layouts = \ilPageLayout::activeLayouts(
44 );
45 parent::__construct($parent_gui, $parent_cmd);
46 }
static activeLayouts(int $a_module=0)
Get active layouts.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), ilPageLayout\activeLayouts(), and ilPageLayout\MODULE_LM.

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::build ( TableAdapterGUI  $table)
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 126 of file SubObjectTableBuilder.php.

126 : TableAdapterGUI
127 {
128 $lng = $this->domain->lng();
129 $user = $this->domain->user();
130 $transl = $this->gui->editing()->request()->getTranslation();
131 $table = $table
132 ->iconColumn("type", $lng->txt("type"))
133 ->linkColumn("title", $lng->txt("title"));
134 if (!in_array($transl, ["-", ""])) {
135 $table = $table->textColumn("trans_title", $lng->txt("title") .
136 " (" . $lng->txt("meta_l_" . $transl) . ")");
137 }
138 if ($this->type === "st") {
140 "editPages",
141 $lng->txt("lm_list_pages"),
142 [\ilObjLearningModuleGUI::class, \ilStructureObjectGUI::class, EditSubObjectsGUI::class],
143 "editPages",
144 "obj_id"
145 );
147 "editTitle",
148 $lng->txt("cont_edit_title"),
149 true
150 );
152 "insertChapterAfter",
153 $lng->txt("lm_insert_chapter_after"),
154 true
155 );
157 "insertChapterBefore",
158 $lng->txt("lm_insert_chapter_before"),
159 true
160 );
161 if ($user->clipboardHasObjectsOfType("st")) {
163 "insertChapterClipAfter",
164 $lng->txt("lm_insert_chapter_clip_after"),
165 [EditSubObjectsGUI::class],
166 "insertChapterClipAfter",
167 "target_id"
168 );
170 "insertChapterClipBefore",
171 $lng->txt("lm_insert_chapter_clip_before"),
172 [EditSubObjectsGUI::class],
173 "insertChapterClipBefore",
174 "target_id"
175 );
176 }
177 } else {
179 "editPage",
180 $lng->txt("lm_edit_content"),
181 [\ilObjLearningModuleGUI::class, \ilLMPageObjectGUI::class],
182 "edit",
183 "obj_id"
184 );
186 "editTitle",
187 $lng->txt("cont_edit_title"),
188 true
189 );
191 "insertPageAfter",
192 $lng->txt("lm_insert_page_after"),
193 true
194 );
196 "insertPageBefore",
197 $lng->txt("lm_insert_page_before"),
198 true
199 );
200 if ($user->clipboardHasObjectsOfType("pg")) {
202 "insertPageClipAfter",
203 $lng->txt("lm_insert_page_clip_after"),
204 [EditSubObjectsGUI::class],
205 "insertPageClipAfter",
206 "target_id"
207 );
209 "insertPageClipBefore",
210 $lng->txt("lm_insert_page_clip_before"),
211 [EditSubObjectsGUI::class],
212 "insertPageClipBefore",
213 "target_id"
214 );
215 }
216 }
217 $table = $table
219 "delete",
220 $lng->txt("delete")
221 )
222 ->standardAction(
223 "cutItems",
224 $lng->txt("cut")
225 )
226 ->standardAction(
227 "copyItems",
228 $lng->txt("copy")
229 );
230 if ($this->type === "pg") {
232 "activatePages",
233 $lng->txt("cont_de_activate")
234 );
235 }
236 return $table;
237 }
textColumn(string $key, string $title, bool $sortable=false)
singleAction(string $action, string $title, bool $async=false)
standardAction(string $action, string $title)
singleRedirectAction(string $action, string $title, array $class_path, string $cmd="", string $id_param="", bool $async=false)
iconColumn(string $key, string $title, bool $sortable=false)
global $lng
Definition: privfeed.php:31

References $lng, ILIAS\Repository\Table\CommonTableBuilder\$table, ILIAS\Repository\Table\TableAdapterGUI\iconColumn(), ILIAS\Repository\Table\TableAdapterGUI\singleAction(), ILIAS\Repository\Table\TableAdapterGUI\singleRedirectAction(), ILIAS\Repository\Table\TableAdapterGUI\standardAction(), and ILIAS\Repository\Table\TableAdapterGUI\textColumn().

+ Here is the call graph for this function:

◆ getId()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::getId ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 48 of file SubObjectTableBuilder.php.

48 : string
49 {
50 return "subobj";
51 }

◆ getOrderingCommand()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::getOrderingCommand ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 69 of file SubObjectTableBuilder.php.

69 : string
70 {
71 return "saveOrder";
72 }

◆ getRetrieval()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::getRetrieval ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 58 of file SubObjectTableBuilder.php.

58 : RetrievalInterface
59 {
60 $request = $this->gui->editing()->request();
61 return $this->domain->subObjectRetrieval(
62 $this->lm_id,
63 $this->type,
64 $request->getObjId(),
65 $request->getTranslation()
66 );
67 }

◆ getTitle()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::getTitle ( )
protected

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 53 of file SubObjectTableBuilder.php.

53 : string
54 {
55 return $this->title;
56 }

◆ transformRow()

ILIAS\LearningModule\Editing\SubObjectTableBuilder::transformRow ( array  $data_row)
protected

transform raw data array to table row data array

Reimplemented from ILIAS\Repository\Table\CommonTableBuilder.

Definition at line 74 of file SubObjectTableBuilder.php.

74 : array
75 {
76 $lng = $this->domain->lng();
77 $f = $this->gui->ui()->factory();
78 $ctrl = $this->gui->ctrl();
79 if ($data_row["type"] === "pg") {
80 $img_sc = $data_row["scheduled"]
81 ? "_sc"
82 : "";
83
84 if (!$data_row["active"]) {
85 $img = "standard/icon_pg_d" . $img_sc . ".svg";
86 $alt = $lng->txt("cont_page_deactivated");
87 } else {
88 if ($data_row["deactivated_elements"]) {
89 $img = "standard/icon_pg_del" . $img_sc . ".svg";
90 $alt = $lng->txt("cont_page_deactivated_elements");
91 } else {
92 $img = "standard/icon_pg" . $img_sc . ".svg";
93 $alt = $lng->txt("pg");
94 }
95 }
96 } else {
97 $img = "standard/icon_st.svg";
98 $alt = $lng->txt("st");
99 }
100 $target = "#";
101 if ($data_row["type"] === "pg") {
102 $ctrl->setParameterByClass(\ilLMPageGUI::class, "obj_id", $data_row["id"]);
103 $target = $ctrl->getLinkTargetByClass([
104 \ilObjLearningModuleGUI::class,
105 \ilLMPageObjectGUI::class,
106 \ilLMPageGUI::class
107 ], "edit");
108 } elseif ($data_row["type"] === "st") {
109 $ctrl->setParameterByClass(\ilStructureObjectGUI::class, "obj_id", $data_row["id"]);
110 $target = $ctrl->getLinkTargetByClass([
111 \ilObjLearningModuleGUI::class,
112 \ilStructureObjectGUI::class,
113 EditSubObjectsGUI::class
114 ], "editPages");
115 }
116
117 $title = $f->link()->standard($data_row["title"], $target);
118 return [
119 "id" => $data_row["id"],
120 "type" => $f->symbol()->icon()->custom(\ilUtil::getImagePath($img), $alt),
121 "title" => $title,
122 "trans_title" => $data_row["trans_title"],
123 ];
124 }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References Vendor\Package\$f, $lng, and ilUtil\getImagePath().

+ Here is the call graph for this function:

Field Documentation

◆ $page_layouts

array ILIAS\LearningModule\Editing\SubObjectTableBuilder::$page_layouts
protected

Definition at line 31 of file SubObjectTableBuilder.php.


The documentation for this class was generated from the following file: