ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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  }
+ 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.

References ILIAS\Help\Module\ModuleManager\isHelpActive(), and ILIAS\Repository\settings().

103  : bool
104  {
105  if ($this->settings->get("help_mode") === "1") {
106  return false;
107  }
108  return $this->isHelpActive();
109  }
+ 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.

References ilObject\_lookupType().

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

◆ getActiveModules()

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

Definition at line 81 of file ModuleManager.php.

References ILIAS\Help\Module\ModuleManager\getHelpModules(), and ILIAS\Repository\int().

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

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

◆ getAuthoringLMId()

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

Definition at line 115 of file ModuleManager.php.

References ilObject\_lookupObjId().

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

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

◆ getHelpModules()

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

Definition at line 73 of file ModuleManager.php.

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

73  : array
74  {
75  return $this->repo->getHelpModules();
76  }
+ Here is the caller graph for this function:

◆ isAuthoringMode()

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

Definition at line 111 of file ModuleManager.php.

References ILIAS\Help\Module\ModuleManager\getAuthoringLMId().

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

111  : bool
112  {
113  return ($this->getAuthoringLMId() > 0);
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isHelpActive()

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

Definition at line 92 of file ModuleManager.php.

References ILIAS\Help\Module\ModuleManager\getActiveModules(), ILIAS\Help\Module\ModuleManager\isAuthoringMode(), and ILIAS\Repository\user().

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

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  }
+ Here is the call graph for this function:
+ Here is the caller 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  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ 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  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ 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.

References Vendor\Package\$e, $id, and null.

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
manifest.xml file not found-exception for import
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

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: