ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLMPage.php
Go to the documentation of this file.
1<?php
2
24{
25 protected \ILIAS\LearningModule\ReadingTime\ReadingTimeManager $lm_reading_time_manager;
26
27 public function getParentType(): string
28 {
29 return "lm";
30 }
31
32 public function afterConstructor(): void
33 {
34 $this->getPageConfig()->configureByObjectId($this->getParentId());
35 $this->lm_reading_time_manager = new \ILIAS\LearningModule\ReadingTime\ReadingTimeManager();
36 }
37
38 public function beforePageContentUpdate(ilPageContent $a_page_content): void
39 {
40 if ($a_page_content->getType() == "par") {
42 $a_page_content->autoLinkGlossaries($glos);
43 }
44 }
45
46 public function afterUpdate(DOMDocument $domdoc, string $xml): void
47 {
48 // send notifications
49 $references = ilObject::_getAllReferences($this->getParentId());
50 $notification = new ilLearningModuleNotification(
53 new ilObjLearningModule(reset($references)),
54 $this->getId()
55 );
56 $notification->send();
57
58 // update lm reading time
59 if ((int) $this->getParentId() > 0) {
60 $this->lm_reading_time_manager->updateReadingTime($this->getParentId());
61 }
62 }
63
64 protected function afterDelete(): void
65 {
66 if ((int) $this->getParentId() > 0) {
67 $this->lm_reading_time_manager->updateReadingTime($this->getParentId());
68 }
69 }
70
71 public function createWithLayoutId(int $a_layout_id): void
72 {
73 //get XML Data for Layout
74 $layout_obj = new ilPageLayout($a_layout_id);
75 parent::setXMLContent($layout_obj->getXMLContent());
76 parent::create(false);
77 }
78}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
afterUpdate(DOMDocument $domdoc, string $xml)
After update.
ILIAS LearningModule ReadingTime ReadingTimeManager $lm_reading_time_manager
createWithLayoutId(int $a_layout_id)
beforePageContentUpdate(ilPageContent $a_page_content)
Before page content update Note: This one is "work in progress", currently only text paragraphs call ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupAutoGlossaries(int $a_lm_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
Content object of ilPageObject (see ILIAS DTD).
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)