ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.EditSubObjectsGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
26 use ilLMObject;
29 
31 {
32  protected string $lang;
33  protected array $page_layouts;
35  protected int $lm_id;
36  protected \ilLMTree $lm_tree;
37  protected int $sub_obj_id;
38 
39  public function __construct(
40  protected InternalDomainService $domain,
41  protected InternalGUIService $gui,
42  protected string $sub_type,
43  protected \ilObjLearningModule $lm,
44  protected string $table_title
45  ) {
46  $this->sub_obj_id = $this->gui->editing()->request()->getObjId();
47  $this->gui->ctrl()->saveParameterByClass(self::class, "sub_type");
48  $this->lm_id = $lm->getId();
49  $this->lm_tree = $this->domain->lmTree($this->lm_id);
50  $this->request = $this->gui->editing()->request();
51  $this->page_layouts = \ilPageLayout::activeLayouts(
53  );
54  $this->lang = $this->request->getTranslation();
55  $this->gui->initFetch();
56  }
57 
58  public function executeCommand(): void
59  {
60  $ctrl = $this->gui->ctrl();
61  $next_class = $ctrl->getNextClass($this);
62  $cmd = $ctrl->getCmd("list");
63 
64  switch ($next_class) {
65  default:
66  if (in_array($cmd, [
67  "list", "tableCommand", "editPages",
68  "insertChapterAfter", "insertChapterBefore", "insertFirstChapter",
69  "insertPageAfter", "insertPageBefore", "insertFirstPage",
70  "editTitle", "saveTitle", "saveOrder",
71  "confirmedDelete", "delete", "cancelDelete",
72  "insertPageClip", "insertPageClipBefore", "insertPageClipAfter",
73  "insertChapterClip", "insertChapterClipBefore", "insertChapterClipAfter",
74  "activatePages",
75  "insertLayoutBefore", "insertLayoutAfter", "insertPageFromLayout",
76  "switchToLanguage", "editMasterLanguage"
77  ])) {
78  $this->$cmd();
79  }
80  }
81  }
82 
83  protected function editPages(): void
84  {
85  $this->gui->ctrl()->setParameterByClass(self::class, "sub_type", "pg");
86  $this->gui->ctrl()->redirectByClass(static::class, "list");
87  }
88 
89  protected function getTable(): TableAdapterGUI
90  {
91  return $this->gui->editing()->subObjectTableGUI(
92  $this->table_title,
93  $this->lm_id,
94  $this->sub_type,
95  $this
96  );
97  }
98 
99  public function tableCommand(): void
100  {
101  $this->getTable()->handleCommand();
102  }
103 
104  public function switchToLanguage(): void
105  {
106  $ctrl = $this->gui->ctrl();
107  $ctrl->setParameter($this, "transl", $this->request->getToTranslation());
108  $ctrl->redirect($this, "list");
109  }
110 
111  public function editMasterLanguage(): void
112  {
113  $ctrl = $this->gui->ctrl();
114  $ctrl->setParameter($this, "transl", "-");
115  $ctrl->redirect($this, "list");
116  }
117 
118 
119  protected function list(): void
120  {
121  $lng = $this->domain->lng();
122  $ctrl = $this->gui->ctrl();
123  $main_tpl = $this->gui->mainTemplate();
124  $user = $this->domain->user();
125 
126  $retrieval = $this->domain->subObjectRetrieval(
127  $this->lm_id,
128  $this->sub_type,
129  $this->sub_obj_id,
130  $this->lang
131  );
132 
133  $ml_head = \ilObjLearningModuleGUI::getMultiLangHeader($this->lm_id, $this);
134 
135  if ($retrieval->count() === 0) {
136  if ($this->sub_type === "st") {
137  $this->gui->button(
138  $lng->txt("lm_insert_chapter"),
139  $ctrl->getLinkTargetByClass(self::class, "insertFirstChapter")
140  )->toToolbar();
141  if ($user->clipboardHasObjectsOfType("st")) {
142  $this->gui->button(
143  $lng->txt("lm_insert_chapter_clip"),
144  $ctrl->getLinkTargetByClass(self::class, "insertChapterClip")
145  )->toToolbar();
146  }
147  } else {
148  $this->gui->button(
149  $lng->txt("lm_insert_page"),
150  $ctrl->getLinkTargetByClass(self::class, "insertFirstPage")
151  )->toToolbar();
152  if ($user->clipboardHasObjectsOfType("pg")) {
153  $this->gui->button(
154  $lng->txt("lm_insert_page_clip"),
155  $ctrl->getLinkTargetByClass(self::class, "insertPageClip")
156  )->toToolbar();
157  }
158  }
159  }
160  $table = $this->getTable();
161 
162  $main_tpl->setContent($ml_head . $table->render());
163  $main_tpl->addOnloadCode("window.setTimeout(() => { il.repository.core.trigger('il-lm-editor-tree'); }, 500);");
164  }
165 
166  public function insertChapterClipBefore(): void
167  {
168  $parent = $this->sub_obj_id;
169  $target_id = $this->request->getTargetId();
170  $before_target = \ilTree::POS_FIRST_NODE;
171  foreach ($this->lm_tree->getChilds($parent) as $node) {
172  if ((int) $node["obj_id"] !== $target_id) {
173  $before_target = (int) $node["obj_id"];
174  } else {
175  break;
176  }
177  }
178  $this->insertChapterClip(
179  $before_target
180  );
181  }
182 
183  public function insertChapterClipAfter(): void
184  {
185  $this->insertChapterClip(
186  $this->request->getTargetId()
187  );
188  }
189 
190  public function insertChapterClip(
191  $target = \ilTree::POS_LAST_NODE
192  ): void {
193  $user = $this->domain->user();
194  $ctrl = $this->gui->ctrl();
195  $parent_id = $this->request->getObjId();
196 
197  // copy and paste
198  $chapters = $user->getClipboardObjects("st", true);
199  $copied_nodes = array();
200 
201  foreach ($chapters as $chap) {
202  $cid = ilLMObject::pasteTree(
203  $this->lm,
204  $chap["id"],
205  $parent_id,
206  (int) $target,
207  (string) ($chap["insert_time"] ?? ""),
208  $copied_nodes,
209  (\ilEditClipboard::getAction() == "copy")
210  );
211  $target = $cid;
212  }
213  ilLMObject::updateInternalLinks($copied_nodes);
214 
215  if (\ilEditClipboard::getAction() == "cut") {
216  $user->clipboardDeleteObjectsOfType("pg");
217  $user->clipboardDeleteObjectsOfType("st");
219  }
220 
221  $this->lm->checkTree();
222  $ctrl->redirect($this, "list");
223  }
224 
225  public function insertPageClipBefore(): void
226  {
227  $parent = $this->sub_obj_id;
228  $target_id = $this->request->getTargetId();
229  $before_target = \ilTree::POS_FIRST_NODE;
230  foreach ($this->lm_tree->getChildsByType($parent, "pg") as $node) {
231  if ((int) $node["obj_id"] !== $target_id) {
232  $before_target = (int) $node["obj_id"];
233  } else {
234  break;
235  }
236  }
237  $this->insertPageClip(
238  $before_target
239  );
240  }
241 
242  public function insertPageClipAfter(): void
243  {
244  $this->insertPageClip(
245  $this->request->getTargetId()
246  );
247  }
248 
249  public function insertPageClip(
250  int $target = 0
251  ): void {
252  $user = $this->domain->user();
253  $ctrl = $this->gui->ctrl();
254 
255  $parent_id = $this->request->getObjId();
256 
257  // cut and paste
258  $pages = $user->getClipboardObjects("pg");
259  $copied_nodes = array();
260  foreach ($pages as $pg) {
261  $cid = ilLMObject::pasteTree(
262  $this->lm,
263  $pg["id"],
264  $parent_id,
265  $target,
266  (string) ($pg["insert_time"] ?? ""),
267  $copied_nodes,
268  (\ilEditClipboard::getAction() == "copy")
269  );
270  $target = $cid;
271  }
272  \ilLMObject::updateInternalLinks($copied_nodes);
273 
274  if (\ilEditClipboard::getAction() == "cut") {
275  $user->clipboardDeleteObjectsOfType("pg");
276  $user->clipboardDeleteObjectsOfType("st");
278  }
279 
280  $ctrl->redirect($this, "list");
281  }
282 
283  public function insertFirstPage(): void
284  {
285  $this->insertPage(
286  $this->sub_obj_id
287  );
288  }
289  public function insertPageAfter(): void
290  {
291  $target_id = $this->request->getTargetId();
292  $this->insertPage(
293  $this->sub_obj_id,
294  $target_id
295  );
296  }
297 
298  public function insertPageBefore(): void
299  {
300  $parent = $this->sub_obj_id;
301  $target_id = $this->request->getTargetId();
302  $before_target = \ilTree::POS_FIRST_NODE;
303  foreach ($this->lm_tree->getChildsByType($parent, "pg") as $node) {
304  if ((int) $node["obj_id"] !== $target_id) {
305  $before_target = (int) $node["obj_id"];
306  } else {
307  break;
308  }
309  }
310  $this->insertPage(
311  $parent,
312  $before_target
313  );
314  }
315 
316  protected function insertPage(
317  int $parent_id = 0,
318  int $target = \ilTree::POS_LAST_NODE
319  ): void {
320  $lng = $this->domain->lng();
321  $ctrl = $this->gui->ctrl();
322 
323  $chap = new \ilLMPageObject($this->lm);
324  $chap->setType("pg");
325  $chap->setTitle($lng->txt("cont_new_page"));
326  $chap->setLMId($this->lm_id);
327  $chap->create();
328  \ilLMObject::putInTree($chap, $parent_id, $target);
329 
330  /*
331  if ($parent_id === $this->lm_tree->readRootId()) {
332  $ctrl->setParameterByClass(static::class, "obj_id", 0);
333  } else {
334  $ctrl->setParameterByClass(static::class, "obj_id", $parent_id);
335  }*/
336 
337  $ctrl->redirect($this, "list");
338  }
339 
340  public function insertFirstChapter(): void
341  {
342  $this->insertChapter(
343  $this->sub_obj_id
344  );
345  }
346  public function insertChapterAfter(): void
347  {
348  $target_id = $this->request->getTargetId();
349  $this->insertChapter(
350  $this->sub_obj_id,
351  $target_id
352  );
353  }
354 
355  public function insertChapterBefore(): void
356  {
357  $parent = $this->sub_obj_id;
358  if ($parent === 0) {
359  $parent = $this->lm_tree->getRootId();
360  }
361  $target_id = $this->request->getTargetId();
362  $before_target = \ilTree::POS_FIRST_NODE;
363  foreach ($this->lm_tree->getChilds($parent) as $node) {
364  if ((int) $node["obj_id"] !== $target_id) {
365  $before_target = (int) $node["obj_id"];
366  } else {
367  break;
368  }
369  }
370  $this->insertChapter(
371  $parent,
372  $before_target
373  );
374  }
375 
376  protected function insertChapter(
377  int $parent_id = 0,
378  int $target = \ilTree::POS_LAST_NODE
379  ): void {
380  $lng = $this->domain->lng();
381  $ctrl = $this->gui->ctrl();
382  $chap = new \ilStructureObject($this->lm);
383  $chap->setType("st");
384  $chap->setTitle($lng->txt("cont_new_chap"));
385  $chap->setLMId($this->lm_id);
386  $chap->create();
387  \ilLMObject::putInTree($chap, $parent_id, $target);
388 
389  /*
390  if ($parent_id === $this->lm_tree->readRootId()) {
391  $ctrl->setParameterByClass(static::class, "obj_id", 0);
392  } else {
393  $ctrl->setParameterByClass(static::class, "obj_id", $parent_id);
394  }*/
395 
396  $ctrl->redirect($this, "list");
397  }
398 
399  protected function getEditTitleForm(int $id): FormAdapterGUI
400  {
401  $lng = $this->domain->lng();
402  $this->gui->ctrl()->setParameterByClass(self::class, "edit_id", $id);
403  $ot = \ilObjectTranslation::getInstance($this->lm->getId());
404  $ml = "";
405  if ($ot->getContentActivated()) {
406  $ml = " (".$lng->txt("meta_l_" .$ot->getMasterLanguage()) . ")";
407  }
408 
409  $form = $this
410  ->gui
411  ->form(self::class, "saveTitle")
412  ->text("title", $lng->txt('title') . $ml, "", ilLMObject::_lookupTitle($id));
413  if ($ot->getContentActivated()) {
414  foreach ($ot->getLanguages() as $lang) {
415  $code = $lang->getLanguageCode();
416  if ($code === $ot->getMasterLanguage()) {
417  continue;
418  }
419  $lmobjtrans = new \ilLMObjTranslation($id, $code);
420  $title = $lmobjtrans->getTitle();
421  $form = $form->text("title_" . $code, $lng->txt('title') . " (" . $lng->txt("meta_l_" . $code) . ")",
422  "", $title);
423  }
424  }
425  return $form;
426  }
427 
428  public function editTitle(int $id): void
429  {
430  $this->gui->clearAsnyOnloadCode();
431  $modal = $this->gui->modal()->form($this->getEditTitleForm($id));
432  $modal->send();
433  }
434 
435  public function saveTitle(): void
436  {
437  $mt = $this->gui->mainTemplate();
438  $lng = $this->domain->lng();
439  $form = $this->getEditTitleForm($this->request->getEditId());
440  if ($form->isValid()) {
441  \ilLMObject::saveTitle($this->request->getEditId(), $form->getData("title"));
442 
443  $ot = \ilObjectTranslation::getInstance($this->lm->getId());
444  if ($ot->getContentActivated()) {
445  foreach ($ot->getLanguages() as $lang) {
446  $code = $lang->getLanguageCode();
447  if ($code === $ot->getMasterLanguage()) {
448  continue;
449  }
450  \ilLMObject::saveTitle($this->request->getEditId(), $form->getData("title_" . $code), $code);
451  }
452  }
453  }
454  $mt->setContent("success", $lng->txt("msg_obj_modified"), true);
455  $this->gui->ctrl()->redirect($this, "list");
456  }
457 
458  public function saveOrder(): void
459  {
460  $mt = $this->gui->mainTemplate();
461  $lng = $this->domain->lng();
462  $tree = $this->domain->lmTree($this->lm_id);
463  $table = $this->getTable();
464  $data = $table->getData();
465  $parent = ($this->sub_obj_id > 0)
466  ? $this->sub_obj_id
467  : $tree->readRootId();
468  if (!is_array($data)) {
469  return;
470  }
471 
472  // note: moveTree has a bug and does not use the last parameter
473  // target will always be "last node"
474  // since all chapters must follow all pages
475  // we can simple call moveTree in the correct order for the chapters
476  // but if we order the pages, we must append all chapters to the data first
477  if ($this->sub_type === "pg") {
478  foreach ($tree->getChilds($parent) as $child) {
479  if ($child["type"] == "st") {
480  $data[] = $child["child"];
481  }
482  }
483  }
484  foreach ($data as $id) {
485  $tree->moveTree((int) $id, $parent);
486  }
487  $mt->setContent("success", $lng->txt("msg_obj_modified"), true);
488  $this->gui->ctrl()->redirect($this, "list");
489  }
490 
497  public function delete(array $ids): void
498  {
499  $a_parent_subobj_id = $this->sub_obj_id;
500  $mt = $this->gui->mainTemplate();
501  $lng = $this->domain->lng();
502  $ctrl = $this->gui->ctrl();
503 
504  if (count($ids) == 0) {
505  $mt->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
506  $this->cancelDelete();
507  }
508 
509  if (count($ids) == 1 && $ids[0] == \ilTree::POS_FIRST_NODE) {
510  $mt->setOnScreenMessage('failure', $lng->txt("cont_select_item"), true);
511  $this->cancelDelete();
512  }
513 
514  $form_action = $ctrl->getFormActionByClass(self::class);
515 
516  // display confirmation message
517  $cgui = new \ilConfirmationGUI();
518  $cgui->setFormAction($form_action);
519  $cgui->setHeaderText($lng->txt("info_delete_sure"));
520  $cgui->setCancel($lng->txt("cancel"), "cancelDelete");
521  $cgui->setConfirm($lng->txt("confirm"), "confirmedDelete");
522 
523  foreach ($ids as $id) {
524  if ($id != \ilTree::POS_FIRST_NODE) {
525  $obj = new \ilLMObject($this->lm, $id);
526  $caption = $obj->getTitle();
527 
528  $cgui->addItem("id[]", (string) $id, $caption);
529  }
530  }
531 
532  $mt->setContent($cgui->getHTML());
533  }
534 
535  public function cancelDelete(): void
536  {
537  $this->gui->ctrl()->redirect($this, "list");
538  }
539 
547  public function confirmedDelete(int $a_parent_subobj_id = 0): void
548  {
549  $tree = $this->domain->lmTree($this->lm_id);
550  $ids = $this->request->getIds();
551  $mt = $this->gui->mainTemplate();
552  $ctrl = $this->gui->ctrl();
553  $lng = $this->domain->lng();
554 
555  // check number of objects
556  if (count($ids) == 0) {
557  $mt->setOnScreenMessage('failure', $lng->txt("no_checkbox"));
558  $ctrl->redirect($this, "list");
559  }
560 
561  // delete all selected objects
562  foreach ($ids as $id) {
563  if ($id != \ilTree::POS_FIRST_NODE) {
564  $obj = \ilLMObjectFactory::getInstance($this->lm, $id, false);
565  $node_data = $tree->getNodeData($id);
566  if (is_object($obj)) {
567  $obj->setLMId($this->lm->getId());
568  $obj->delete();
569  }
570  if ($tree->isInTree($id)) {
571  $tree->deleteTree($node_data);
572  }
573  }
574  }
575 
576  // check the tree
577  $this->lm->checkTree();
578 
579  // feedback
580  $mt->setOnScreenMessage('success', $lng->txt("info_deleted"), true);
581  $ctrl->redirect($this, "list");
582  }
583 
587  public function cutItems(array $ids): void
588  {
589  $ctrl = $this->gui->ctrl();
590  $mt = $this->gui->mainTemplate();
591  $lng = $this->domain->lng();
592 
593  $items = $ids;
594  if (count($items) == 0) {
595  $mt->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
596  $ctrl->redirect($this, "list");
597  }
598 
599  $todel = array(); // delete IDs < 0 (needed for non-js editing)
600  foreach ($items as $k => $item) {
601  if ($item < 0) {
602  $todel[] = $k;
603  }
604  }
605  foreach ($todel as $k) {
606  unset($items[$k]);
607  }
608 
609  \ilLMObject::clipboardCut($this->lm_id, $items);
611  $mt->setOnScreenMessage('info', $lng->txt("cont_selected_items_have_been_cut"), true);
612 
613  $ctrl->redirect($this, "list");
614  }
615 
619  public function copyItems($ids): void
620  {
621 
622  $ctrl = $this->gui->ctrl();
623  $lng = $this->domain->lng();
624  $mt = $this->gui->mainTemplate();
625 
626  $items = $ids;
627  if (count($items) == 0) {
628  $mt->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
629  $ctrl->redirect($this, "list");
630  }
631 
632  $todel = array(); // delete IDs < 0 (needed for non-js editing)
633  foreach ($items as $k => $item) {
634  if ($item < 0) {
635  $todel[] = $k;
636  }
637  }
638  foreach ($todel as $k) {
639  unset($items[$k]);
640  }
641 
642  \ilLMObject::clipboardCopy($this->lm_id, $items);
644 
645  $mt->setOnScreenMessage('info', $lng->txt("cont_selected_items_have_been_copied"), true);
646  $ctrl->redirect($this, "list");
647  }
648 
649  public function activatePages(array $ids): void
650  {
651  $ctrl = $this->gui->ctrl();
652  $mt = $this->gui->mainTemplate();
653  $lng = $this->domain->lng();
654  $lm_tree = $this->domain->lmTree($this->lm_id);
655 
656  $ids = $ids;
657  if (count($ids) > 0) {
658  $act_items = array();
659  // get all "top" ids, i.e. remove ids, that have a selected parent
660  foreach ($ids as $id) {
661  $path = $lm_tree->getPathId($id);
662  $take = true;
663  foreach ($path as $path_id) {
664  if ($path_id != $id && in_array($path_id, $ids)) {
665  $take = false;
666  }
667  }
668  if ($take) {
669  $act_items[] = $id;
670  }
671  }
672 
673 
674  foreach ($act_items as $id) {
675  $childs = $lm_tree->getChilds($id);
676  foreach ($childs as $child) {
677  if (ilLMObject::_lookupType($child["child"]) == "pg") {
679  $child["child"],
680  $this->lm->getType()
681  );
683  $child["child"],
684  $this->lm->getType(),
685  !$act
686  );
687  }
688  }
689  if (ilLMObject::_lookupType($id) == "pg") {
691  $id,
692  $this->lm->getType()
693  );
695  $id,
696  $this->lm->getType(),
697  !$act
698  );
699  }
700  }
701  } else {
702  $mt->setOnScreenMessage('failure', $lng->txt("no_checkbox"), true);
703  }
704 
705  $ctrl->redirect($this, "list");
706  }
707 
708  public function insertLayoutBefore(): void
709  {
710  $this->insertLayout(true);
711  }
712 
713  public function insertLayoutAfter(): void
714  {
715  $this->insertLayout();
716  }
717 
718  public function insertLayout(bool $before = false): void
719  {
720  $ctrl = $this->gui->ctrl();
721  $ui = $this->gui->ui();
722  $mt = $this->gui->mainTemplate();
723  if ($before) {
724  $ctrl->setParameterByClass(self::class, "before", "1");
725  }
726  $ctrl->saveParameterByClass(self::class, ["obj_id", "target_id"]);
727  $form = $this->initInsertTemplateForm();
728  $mt->setContent($ui->renderer()->render($form) . \ilLMPageObjectGUI::getLayoutCssFix());
729  }
730 
731  public function initInsertTemplateForm(): Standard
732  {
733  $ui = $this->gui->ui();
734  $f = $ui->factory();
735  $ctrl = $this->gui->ctrl();
736  $lng = $this->domain->lng();
737 
738  $fields["title"] = $f->input()->field()->text($lng->txt("title"), "");
739  $ts = \ilPageLayoutGUI::getTemplateSelection((string) \ilPageLayout::MODULE_LM);
740  if (!is_null($ts)) {
741  $fields["layout_id"] = $ts;
742  }
743 
744  // section
745  $section1 = $f->input()->field()->section($fields, $lng->txt("cont_insert_pagelayout"));
746 
747  $form_action = $ctrl->getLinkTarget($this, "insertPageFromLayout");
748  return $f->input()->container()->form()->standard($form_action, ["sec" => $section1]);
749  }
750 
751  public function insertPageFromLayout(): void
752  {
753  global $DIC;
754 
755  $ctrl = $this->gui->ctrl();
756  $mt = $this->gui->mainTemplate();
757  $lng = $this->domain->lng();
758 
759 
760  $parent = $this->sub_obj_id;
761  $target_id = $this->request->getTargetId();
762 
763  $first_child = false;
764  if ($this->request->getBefore()) {
765  $before_target = \ilTree::POS_FIRST_NODE;
766  $first_child = true;
767  foreach ($this->lm_tree->getChildsByType($parent, "pg") as $node) {
768  if ((int) $node["obj_id"] !== $target_id) {
769  $before_target = (int) $node["obj_id"];
770  $first_child = false;
771  } else {
772  break;
773  }
774  }
775  $target_id = $before_target;
776  }
777 
778  $form = $this->initInsertTemplateForm();
779  $form = $form->withRequest($DIC->http()->request());
780  $data = $form->getData();
781  $layout_id = $data["sec"]["layout_id"];
783  $this->lm->getId(),
784  1,
785  $target_id,
786  $first_child,
787  (int) $layout_id,
788  $data["sec"]["title"]
789  );
790 
791  $mt->setOnScreenMessage("success", $lng->txt("lm_page_added"), true);
792 
793  $ctrl->redirect($this, "list");
794  }
795 }
static updateInternalLinks(array $a_copied_nodes, string $a_parent_type="lm")
Update internal links, after multiple pages have been copied.
static _lookupActive(int $a_id, string $a_parent_type, bool $a_check_scheduled_activation=false, string $a_lang="-")
lookup activation status
static setAction(string $a_action)
__construct(protected InternalDomainService $domain, protected InternalGUIService $gui, protected string $sub_type, protected \ilObjLearningModule $lm, protected string $table_title)
cutItems(array $ids)
Copy items to clipboard, then cut them from the current tree.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertPage(int $parent_id=0, int $target=\ilTree::POS_LAST_NODE)
static getInstance(ilObjLearningModule $a_content_obj, int $a_id=0, bool $a_halt=true)
insertChapter(int $parent_id=0, int $target=\ilTree::POS_LAST_NODE)
static getLayoutCssFix()
Get layout css fix (workaround for broken radio options)
static clipboardCut(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static putInTree(ilLMObject $a_obj, int $a_parent_id=0, int $a_target_node_id=0)
put this object into content object tree
$path
Definition: ltiservices.php:30
static _lookupTitle(int $a_obj_id)
confirmedDelete(int $a_parent_subobj_id=0)
delete page object or structure objects
static activeLayouts(int $a_module=0)
Get active layouts.
const POS_FIRST_NODE
static getInstance(int $obj_id)
static insertPagesFromTemplate(int $lm_id, int $num, int $node_id, bool $first_child, int $layout_id, string $title="")
Insert (multiple) pages templates at node.
global $DIC
Definition: shib_login.php:25
static saveTitle(int $id, string $title, string $lang="-")
static _writeActive(int $a_id, string $a_parent_type, bool $a_active)
write activation status
static getMultiLangHeader(int $a_lm_id, object $a_gui_class, string $a_mode="")
const POS_LAST_NODE
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
global $lng
Definition: privfeed.php:32
static _lookupType(int $a_obj_id, int $a_lm_id=0)
static clipboardCopy(int $a_cont_obj_id, array $a_ids)
Copy a set of chapters/pages into the clipboard.