ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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)
 
 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.

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

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)
+ Here is the call graph for this function:

Member Function Documentation

◆ build()

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

Definition at line 107 of file SubObjectTableBuilder.php.

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

107  : TableAdapterGUI
108  {
109  $lng = $this->domain->lng();
110  $user = $this->domain->user();
111  $transl = $this->gui->editing()->request()->getTranslation();
112  $table = $table
113  ->iconColumn("type", $lng->txt("type"))
114  ->textColumn("title", $lng->txt("title"));
115  if (!in_array($transl, ["-", ""])) {
116  $table = $table->textColumn("trans_title", $lng->txt("title") .
117  " (" . $lng->txt("meta_l_" . $transl) . ")");
118  }
119  if ($this->type === "st") {
120  $acts = [
121  [
122  "editPages",
123  $lng->txt("edit"),
124  [\ilObjLearningModuleGUI::class, \ilStructureObjectGUI::class, EditSubObjectsGUI::class],
125  "editPages",
126  "obj_id"
127  ],
128  [
129  "insertChapterAfter",
130  $lng->txt("lm_insert_chapter_after"),
131  [EditSubObjectsGUI::class],
132  "insertChapterAfter",
133  "target_id"
134  ],
135  [
136  "insertChapterBefore",
137  $lng->txt("lm_insert_chapter_before"),
138  [EditSubObjectsGUI::class],
139  "insertChapterBefore",
140  "target_id"
141  ]
142  ];
143  if ($user->clipboardHasObjectsOfType("st")) {
144  $acts[] = [
145  "insertChapterClipAfter",
146  $lng->txt("lm_insert_chapter_clip_after"),
147  [EditSubObjectsGUI::class],
148  "insertChapterClipAfter",
149  "target_id"
150  ];
151  $acts[] = [
152  "insertChapterClipBefore",
153  $lng->txt("lm_insert_chapter_clip_before"),
154  [EditSubObjectsGUI::class],
155  "insertChapterClipBefore",
156  "target_id"
157  ];
158  }
159  } else {
160  $acts = [
161  [
162  "editPage",
163  $lng->txt("edit"),
164  [\ilObjLearningModuleGUI::class, \ilLMPageObjectGUI::class],
165  "edit",
166  "obj_id"
167  ],
168  [
169  "insertPageAfter",
170  $lng->txt("lm_insert_page_after"),
171  [EditSubObjectsGUI::class],
172  "insertPageAfter",
173  "target_id"
174  ],
175  [
176  "insertPageBefore",
177  $lng->txt("lm_insert_page_before"),
178  [EditSubObjectsGUI::class],
179  "insertPageBefore",
180  "target_id"
181  ]
182  ];
183  if ($user->clipboardHasObjectsOfType("pg")) {
184  $acts[] = [
185  "insertPageClipAfter",
186  $lng->txt("lm_insert_page_clip_after"),
187  [EditSubObjectsGUI::class],
188  "insertPageClipAfter",
189  "target_id"
190  ];
191  $acts[] = [
192  "insertPageClipBefore",
193  $lng->txt("lm_insert_page_clip_before"),
194  [EditSubObjectsGUI::class],
195  "insertPageClipBefore",
196  "target_id"
197  ];
198  }
199  if (count($this->page_layouts) > 0) {
200  $acts[] = [
201  "insertLayoutAfter",
202  $lng->txt("lm_insert_layout_after"),
203  [EditSubObjectsGUI::class],
204  "insertLayoutAfter",
205  "target_id"
206  ];
207  $acts[] = [
208  "insertLayoutBefore",
209  $lng->txt("lm_insert_layout_before"),
210  [EditSubObjectsGUI::class],
211  "insertLayoutBefore",
212  "target_id"
213  ];
214  }
215  }
216  foreach ($acts as $a) {
218  $a[0],
219  $a[1],
220  $a[2],
221  $a[3],
222  $a[4]
223  );
224  }
225  $table = $table
226  ->standardAction(
227  "delete",
228  $lng->txt("delete")
229  )
230  ->singleAction(
231  "editTitle",
232  $lng->txt("cont_edit_title"),
233  true
234  )
235  ->standardAction(
236  "cutItems",
237  $lng->txt("cut")
238  )
239  ->standardAction(
240  "copyItems",
241  $lng->txt("copy")
242  );
243  if ($this->type === "pg") {
245  "activatePages",
246  $lng->txt("cont_de_activate")
247  );
248  }
249  return $table;
250  }
singleRedirectAction(string $action, string $title, array $class_path, string $cmd="", string $id_param="")
textColumn(string $key, string $title, bool $sortable=false)
iconColumn(string $key, string $title, bool $sortable=false)
standardAction(string $action, string $title)
global $lng
Definition: privfeed.php:31
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
+ Here is the call graph for this function:

◆ getId()

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

Definition at line 48 of file SubObjectTableBuilder.php.

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

◆ getOrderingCommand()

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

Definition at line 69 of file SubObjectTableBuilder.php.

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

◆ getRetrieval()

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

Definition at line 58 of file SubObjectTableBuilder.php.

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

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

Definition at line 74 of file SubObjectTableBuilder.php.

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

74  : array
75  {
76  $lng = $this->domain->lng();
77  $f = $this->gui->ui()->factory();
78  if ($data_row["type"] === "pg") {
79  $img_sc = $data_row["scheduled"]
80  ? "_sc"
81  : "";
82 
83  if (!$data_row["active"]) {
84  $img = "standard/icon_pg_d" . $img_sc . ".svg";
85  $alt = $lng->txt("cont_page_deactivated");
86  } else {
87  if ($data_row["deactivated_elements"]) {
88  $img = "standard/icon_pg_del" . $img_sc . ".svg";
89  $alt = $lng->txt("cont_page_deactivated_elements");
90  } else {
91  $img = "standard/icon_pg" . $img_sc . ".svg";
92  $alt = $lng->txt("pg");
93  }
94  }
95  } else {
96  $img = "standard/icon_st.svg";
97  $alt = $lng->txt("st");
98  }
99  return [
100  "id" => $data_row["id"],
101  "type" => $f->symbol()->icon()->custom(\ilUtil::getImagePath($img), $alt),
102  "title" => $data_row["title"],
103  "trans_title" => $data_row["trans_title"],
104  ];
105  }
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
global $lng
Definition: privfeed.php:31
+ 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: