ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager Class Reference
+ Collaboration diagram for ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager:

Public Member Functions

 __construct (InternalRepoService $repo, InternalDomainService $domain)
 
 saveScreenIdsForChapter (int $chap, array $ids)
 
 saveMappingEntry (int $chap, string $comp, string $screen_id, string $screen_sub_id, string $perm, int $module_id=0, string $full_id="")
 
 removeScreenIdsOfChapter (int $chap, int $module_id=0)
 
 getScreenIdsOfChapter (int $chap, int $module_id=0)
 
 getHelpSectionsForId (string $a_screen_id, int $a_ref_id)
 
 hasScreenIdSections (string $a_screen_id)
 Has given screen Id any sections? Note: We removed the "ref_id" parameter here, since this method should be fast. More...
 
 deleteEntriesOfModule (int $id)
 

Protected Attributes

ilObjUser $user
 
ilRbacReview $rbacreview
 
ilSetting $settings
 
ilAccessHandler $access
 
InternalDomainService $domain
 
MapDBRepository $repo
 

Detailed Description

Definition at line 26 of file MapManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::__construct ( InternalRepoService  $repo,
InternalDomainService  $domain 
)

Definition at line 35 of file MapManager.php.

References ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager\$domain, ILIAS\Repository\access(), ILIAS\Repository\settings(), and ILIAS\Repository\user().

38  {
39  $this->repo = $repo->map();
40  $this->domain = $domain;
41 
42  $this->access = $domain->access();
43  $this->settings = $domain->settings();
44  $this->rbacreview = $domain->rbac()->review();
45  $this->user = $domain->user();
46  }
+ Here is the call graph for this function:

Member Function Documentation

◆ deleteEntriesOfModule()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::deleteEntriesOfModule ( int  $id)

Definition at line 169 of file MapManager.php.

171  : void {
172  $this->repo->deleteEntriesOfModule($id);
173  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

◆ getHelpSectionsForId()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::getHelpSectionsForId ( string  $a_screen_id,
int  $a_ref_id 
)

Definition at line 96 of file MapManager.php.

References ilObject\_lookupObjId(), ilObject\_lookupOwner(), ILIAS\Repository\access(), SYSTEM_ROLE_ID, and ILIAS\Repository\user().

99  : array {
100  if ($this->domain->module()->isAuthoringMode()) {
101  $module_ids = [0];
102  } else {
103  $module_ids = $this->domain->module()->getActiveModules();
104  }
105  $chaps = [];
106  foreach ($this->repo->getChaptersForScreenId($a_screen_id, $module_ids) as $rec) {
107  if ($rec["perm"] != "" && $rec["perm"] != "-") {
108  // check special "create*" permission
109  if ($rec["perm"] === "create*") {
110  $has_create_perm = false;
111 
112  // check owner
113  if ($this->user->getId() === \ilObject::_lookupOwner(\ilObject::_lookupObjId($a_ref_id))) {
114  $has_create_perm = true;
115  } elseif ($this->rbacreview->isAssigned($this->user->getId(), SYSTEM_ROLE_ID)) { // check admin
116  $has_create_perm = true;
117  } elseif ($this->access->checkAccess("read", "", $a_ref_id)) {
118  $perm = $this->rbacreview->getUserPermissionsOnObject($this->user->getId(), $a_ref_id);
119  foreach ($perm as $p) {
120  if (strpos($p, "create_") === 0) {
121  $has_create_perm = true;
122  }
123  }
124  }
125  if ($has_create_perm) {
126  $chaps[] = $rec["chap"];
127  }
128  } elseif ($this->access->checkAccess($rec["perm"], "", $a_ref_id)) {
129  $chaps[] = $rec["chap"];
130  }
131  } else {
132  $chaps[] = $rec["chap"];
133  }
134  }
135  return $chaps;
136  }
const SYSTEM_ROLE_ID
Definition: constants.php:29
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:

◆ getScreenIdsOfChapter()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::getScreenIdsOfChapter ( int  $chap,
int  $module_id = 0 
)

Definition at line 85 of file MapManager.php.

88  : array {
89  return $this->repo->getScreenIdsOfChapter(
90  $chap,
91  $module_id
92  );
93  }

◆ hasScreenIdSections()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::hasScreenIdSections ( string  $a_screen_id)

Has given screen Id any sections? Note: We removed the "ref_id" parameter here, since this method should be fast.

It is used to decide whether the help button should appear or not. We assume that there is at least one section for users with the "read" permission.

Definition at line 145 of file MapManager.php.

References ILIAS\Repository\settings(), and ILIAS\Repository\user().

147  : bool {
148 
149  if ($this->user->getLanguage() !== "de") {
150  return false;
151  }
152 
153  if ($this->settings->get("help_mode") === "2") {
154  return false;
155  }
156 
157  if ($this->domain->module()->isAuthoringMode()) {
158  $module_ids = [0];
159  } else {
160  $module_ids = $this->domain->module()->getActiveModules();
161  }
162 
163  foreach ($this->repo->getChaptersForScreenId($a_screen_id, $module_ids) as $rec) {
164  return true;
165  }
166  return false;
167  }
+ Here is the call graph for this function:

◆ removeScreenIdsOfChapter()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::removeScreenIdsOfChapter ( int  $chap,
int  $module_id = 0 
)

Definition at line 75 of file MapManager.php.

78  : void {
79  $this->repo->removeScreenIdsOfChapter(
80  $chap,
81  $module_id
82  );
83  }

◆ saveMappingEntry()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::saveMappingEntry ( int  $chap,
string  $comp,
string  $screen_id,
string  $screen_sub_id,
string  $perm,
int  $module_id = 0,
string  $full_id = "" 
)

Definition at line 55 of file MapManager.php.

63  : void {
64  $this->repo->saveMappingEntry(
65  $chap,
66  $comp,
67  $screen_id,
68  $screen_sub_id,
69  $perm,
70  $module_id,
71  $full_id
72  );
73  }

◆ saveScreenIdsForChapter()

ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::saveScreenIdsForChapter ( int  $chap,
array  $ids 
)

Definition at line 48 of file MapManager.php.

51  : void {
52  $this->repo->saveScreenIdsForChapter($chap, $ids);
53  }

Field Documentation

◆ $access

ilAccessHandler ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::$access
protected

Definition at line 31 of file MapManager.php.

◆ $domain

InternalDomainService ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::$domain
protected

◆ $rbacreview

ilRbacReview ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::$rbacreview
protected

Definition at line 29 of file MapManager.php.

◆ $repo

MapDBRepository ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::$repo
protected

Definition at line 33 of file MapManager.php.

◆ $settings

ilSetting ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::$settings
protected

Definition at line 30 of file MapManager.php.

◆ $user

ilObjUser ILIAS\GlobalScreen\Scope\MainMenu\Collector\Map\Map\MapManager::$user
protected

Definition at line 28 of file MapManager.php.


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