ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Help\Module\ModuleManager Class Reference
+ Collaboration diagram for ILIAS\Help\Module\ModuleManager:

Public Member Functions

 __construct (ModuleDBRepository $repo, InternalDomainService $domain)
 
 upload (array $file)
 
 getHelpModules ()
 
 getActiveModules ()
 
 isHelpActive ()
 
 areTooltipsActive ()
 
 isAuthoringMode ()
 
 getAuthoringLMId ()
 
 lookupModuleTitle (int $id)
 
 lookupModuleLmId (int $id)
 
 activate (int $module_id)
 
 deactivate (int $module_id)
 
 deleteModule (int $id)
 
 isHelpLM (int $lm_id)
 
 saveOrder (array $order)
 

Protected Attributes

ilObjUser $user
 
ILIAS Help Tooltips TooltipsManager $tooltips
 
ILIAS Help Map MapManager $help_map
 
ilAppEventHandler $event
 
ModuleDBRepository $repo
 
ilSetting $settings
 

Detailed Description

Definition at line 26 of file ModuleManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Help\Module\ModuleManager::__construct ( ModuleDBRepository  $repo,
InternalDomainService  $domain 
)

Definition at line 35 of file ModuleManager.php.

38 {
39 $this->repo = $repo;
40 $this->settings = $domain->settings();
41 $this->help_map = $domain->map();
42 $this->tooltips = $domain->tooltips();
43 $this->event = $domain->event();
44 $this->user = $domain->user();
45 }

References ILIAS\Help\Module\ModuleManager\$repo, ILIAS\Help\InternalDomainService\map(), ILIAS\Repository\settings(), ILIAS\Help\InternalDomainService\tooltips(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ activate()

ILIAS\Help\Module\ModuleManager::activate ( int  $module_id)

Definition at line 136 of file ModuleManager.php.

136 : void
137 {
138 $this->repo->writeActive($module_id, true);
139 }

◆ areTooltipsActive()

ILIAS\Help\Module\ModuleManager::areTooltipsActive ( )

Definition at line 103 of file ModuleManager.php.

103 : bool
104 {
105 if ($this->settings->get("help_mode") === "1") {
106 return false;
107 }
108 return $this->isHelpActive();
109 }

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ deactivate()

ILIAS\Help\Module\ModuleManager::deactivate ( int  $module_id)

Definition at line 141 of file ModuleManager.php.

141 : void
142 {
143 $this->repo->writeActive($module_id, false);
144 }

◆ deleteModule()

ILIAS\Help\Module\ModuleManager::deleteModule ( int  $id)

Definition at line 146 of file ModuleManager.php.

148 : void {
149 $lm_id = $this->repo->lookupModuleLmId($id);
150
151 // delete learning module
152 if (\ilObject::_lookupType($lm_id) === "lm") {
153 $lm = new \ilObjLearningModule($lm_id, false);
154 $lm->delete();
155 }
156
157 // delete mappings
158 $this->help_map->deleteEntriesOfModule($id);
159
160 // delete tooltips
161 $this->tooltips->deleteTooltipsOfModule($id);
162
163 $this->repo->deleteModule($id);
164 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupType(int $id, bool $reference=false)

◆ getActiveModules()

ILIAS\Help\Module\ModuleManager::getActiveModules ( )
Returns
int[]

Definition at line 81 of file ModuleManager.php.

81 : array
82 {
83 $ids = [];
84 foreach ($this->getHelpModules() as $m) {
85 if ($m["active"]) {
86 $ids[] = (int) $m["id"];
87 }
88 }
89 return $ids;
90 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getAuthoringLMId()

ILIAS\Help\Module\ModuleManager::getAuthoringLMId ( )

Definition at line 115 of file ModuleManager.php.

115 : int
116 {
117 $lm_id = 0;
118 if (defined('OH_REF_ID') && (int) OH_REF_ID > 0) {
119 $lm_id = \ilObject::_lookupObjId((int) OH_REF_ID);
120 }
121 return $lm_id;
122 }
static _lookupObjId(int $ref_id)

References ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ getHelpModules()

ILIAS\Help\Module\ModuleManager::getHelpModules ( )

Definition at line 73 of file ModuleManager.php.

73 : array
74 {
75 return $this->repo->getHelpModules();
76 }

◆ isAuthoringMode()

ILIAS\Help\Module\ModuleManager::isAuthoringMode ( )

Definition at line 111 of file ModuleManager.php.

111 : bool
112 {
113 return ($this->getAuthoringLMId() > 0);
114 }

◆ isHelpActive()

ILIAS\Help\Module\ModuleManager::isHelpActive ( )

Definition at line 92 of file ModuleManager.php.

92 : bool
93 {
94 if ($this->user->getLanguage() !== "de") {
95 return false;
96 }
97 if ($this->isAuthoringMode()) {
98 return true;
99 }
100 return (count($this->getActiveModules()) > 0);
101 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ isHelpLM()

ILIAS\Help\Module\ModuleManager::isHelpLM ( int  $lm_id)

Definition at line 166 of file ModuleManager.php.

168 : bool {
169 return $this->repo->isHelpLM($lm_id);
170 }

◆ lookupModuleLmId()

ILIAS\Help\Module\ModuleManager::lookupModuleLmId ( int  $id)

Definition at line 130 of file ModuleManager.php.

132 : int {
133 return $this->repo->lookupModuleLmId($id);
134 }

◆ lookupModuleTitle()

ILIAS\Help\Module\ModuleManager::lookupModuleTitle ( int  $id)

Definition at line 124 of file ModuleManager.php.

126 : string {
127 return $this->repo->lookupModuleTitle($id);
128 }

◆ saveOrder()

ILIAS\Help\Module\ModuleManager::saveOrder ( array  $order)

Definition at line 172 of file ModuleManager.php.

172 : void
173 {
174 $this->repo->saveOrder($order);
175 }

◆ upload()

ILIAS\Help\Module\ModuleManager::upload ( array  $file)

Definition at line 47 of file ModuleManager.php.

49 : void {
50 $id = $this->repo->create();
51
52 try {
53 $imp = new \ilImport();
54 $conf = $imp->getConfig("components/ILIAS/Help");
55 $conf->setModuleId($id);
56 $new_id = $imp->importObject(null, $file["tmp_name"], $file["name"], "lm", "components/ILIAS/LearningModule"); //
57 $newObj = new \ilObjLearningModule($new_id, false);
58
59 $this->repo->writeHelpModuleLmId($id, $newObj->getId());
61 throw new \ilLMOldExportFileException("This file seems to be from ILIAS version 5.0.x or lower. Import is not supported anymore.");
62 }
63
64 $this->event->raise(
65 'components/ILIAS/Help',
66 'create',
67 array(
68 'obj_id' => $id,
69 'obj_type' => 'lm'
70 )
71 );
72 }
manifest.xml file not found-exception for import

References $id.

Field Documentation

◆ $event

ilAppEventHandler ILIAS\Help\Module\ModuleManager::$event
protected

Definition at line 31 of file ModuleManager.php.

◆ $help_map

ILIAS Help Map MapManager ILIAS\Help\Module\ModuleManager::$help_map
protected

Definition at line 30 of file ModuleManager.php.

◆ $repo

ModuleDBRepository ILIAS\Help\Module\ModuleManager::$repo
protected

Definition at line 32 of file ModuleManager.php.

Referenced by ILIAS\Help\Module\ModuleManager\__construct().

◆ $settings

ilSetting ILIAS\Help\Module\ModuleManager::$settings
protected

Definition at line 33 of file ModuleManager.php.

◆ $tooltips

ILIAS Help Tooltips TooltipsManager ILIAS\Help\Module\ModuleManager::$tooltips
protected

Definition at line 29 of file ModuleManager.php.

◆ $user

ilObjUser ILIAS\Help\Module\ModuleManager::$user
protected

Definition at line 28 of file ModuleManager.php.


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