ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSNodeMappingSettings Class Reference

Genearal. More...

+ Collaboration diagram for ilECSNodeMappingSettings:

Public Member Functions

 getServerId ()
 Get server id of setting. More...
 
 getMid ()
 Get mid of sender. More...
 
 isDirectoryMappingEnabled ()
 Check if node mapping is enabled. More...
 
 enableDirectoryMapping (bool $a_status)
 Enable node mapping. More...
 
 enableEmptyContainerCreation (bool $a_status)
 enable creation of empty containers More...
 
 isEmptyContainerCreationEnabled ()
 Check if the creation of empty containers (pathes without courses) is enabled. More...
 
 enableCourseAllocation (bool $a_stat)
 
 isCourseAllocationEnabled ()
 
 setDefaultCourseCategory (int $a_default_category)
 
 getDefaultCourseCategory ()
 
 isAllInOneCategoryEnabled ()
 
 enableAllInOne (bool $a_stat)
 
 setAllInOneCategory (int $a_cat)
 
 getAllInOneCategory ()
 
 enableAttributeMapping (bool $a_stat)
 
 isAttributeMappingEnabled ()
 
 setRoleMappings (array $a_mappings)
 
 getRoleMappings ()
 
 setAuthMode (string $a_auth_mode)
 Set user auth mode. More...
 
 getAuthMode ()
 Get auth mode. More...
 
 update ()
 Save settings to db. More...
 

Static Public Member Functions

static getInstanceByServerMid (int $a_server_id, int $a_mid)
 Get instance. More...
 

Protected Member Functions

 __construct (int $a_server_id, int $a_mid)
 Singeleton constructor. More...
 
 getStorage ()
 Get storage. More...
 
 initStorage ()
 Init storage. More...
 
 read ()
 

Private Attributes

ilSetting $storage
 
int $server_id
 
int $mid
 MID of sender. More...
 
bool $directory_active = false
 
bool $create_empty_containers = false
 
bool $course_active = false
 Course allocation. More...
 
int $default_cat = 0
 
bool $allinone = false
 
int $allinone_cat = 0
 
bool $attributes = false
 
array $role_mappings = array()
 
string $auth_mode = null
 

Static Private Attributes

static array $instances = []
 

Detailed Description

Genearal.

Definition at line 23 of file class.ilECSNodeMappingSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSNodeMappingSettings::__construct ( int  $a_server_id,
int  $a_mid 
)
protected

Singeleton constructor.

Definition at line 53 of file class.ilECSNodeMappingSettings.php.

References $DIC, initStorage(), and read().

54  {
55  global $DIC;
56 
57  $this->server_id = $a_server_id;
58  $this->mid = $a_mid;
59 
60  $this->initStorage();
61  $this->read();
62  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ enableAllInOne()

ilECSNodeMappingSettings::enableAllInOne ( bool  $a_stat)

Definition at line 146 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

146  : void
147  {
148  $this->allinone = $a_stat;
149  }
+ Here is the caller graph for this function:

◆ enableAttributeMapping()

ilECSNodeMappingSettings::enableAttributeMapping ( bool  $a_stat)

Definition at line 161 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

161  : void
162  {
163  $this->attributes = $a_stat;
164  }
+ Here is the caller graph for this function:

◆ enableCourseAllocation()

ilECSNodeMappingSettings::enableCourseAllocation ( bool  $a_stat)

Definition at line 121 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

121  : void
122  {
123  $this->course_active = $a_stat;
124  }
+ Here is the caller graph for this function:

◆ enableDirectoryMapping()

ilECSNodeMappingSettings::enableDirectoryMapping ( bool  $a_status)

Enable node mapping.

Definition at line 100 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

100  : void
101  {
102  $this->directory_active = $a_status;
103  }
+ Here is the caller graph for this function:

◆ enableEmptyContainerCreation()

ilECSNodeMappingSettings::enableEmptyContainerCreation ( bool  $a_status)

enable creation of empty containers

Definition at line 108 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

108  : void
109  {
110  $this->create_empty_containers = $a_status;
111  }
+ Here is the caller graph for this function:

◆ getAllInOneCategory()

ilECSNodeMappingSettings::getAllInOneCategory ( )

Definition at line 156 of file class.ilECSNodeMappingSettings.php.

References $allinone_cat.

Referenced by update().

156  : int
157  {
158  return $this->allinone_cat;
159  }
+ Here is the caller graph for this function:

◆ getAuthMode()

ilECSNodeMappingSettings::getAuthMode ( )

Get auth mode.

Definition at line 192 of file class.ilECSNodeMappingSettings.php.

References $auth_mode.

Referenced by update().

192  : ?string
193  {
194  return $this->auth_mode;
195  }
+ Here is the caller graph for this function:

◆ getDefaultCourseCategory()

ilECSNodeMappingSettings::getDefaultCourseCategory ( )

Definition at line 136 of file class.ilECSNodeMappingSettings.php.

References $default_cat.

Referenced by update().

136  : int
137  {
138  return $this->default_cat;
139  }
+ Here is the caller graph for this function:

◆ getInstanceByServerMid()

static ilECSNodeMappingSettings::getInstanceByServerMid ( int  $a_server_id,
int  $a_mid 
)
static

◆ getMid()

ilECSNodeMappingSettings::getMid ( )

Get mid of sender.

Definition at line 84 of file class.ilECSNodeMappingSettings.php.

References $mid.

Referenced by initStorage().

84  : int
85  {
86  return $this->mid;
87  }
+ Here is the caller graph for this function:

◆ getRoleMappings()

ilECSNodeMappingSettings::getRoleMappings ( )

Definition at line 176 of file class.ilECSNodeMappingSettings.php.

References $role_mappings.

Referenced by update().

176  : array
177  {
178  return $this->role_mappings;
179  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSNodeMappingSettings::getServerId ( )

Get server id of setting.

Definition at line 76 of file class.ilECSNodeMappingSettings.php.

References $server_id.

Referenced by initStorage().

76  : int
77  {
78  return $this->server_id;
79  }
+ Here is the caller graph for this function:

◆ getStorage()

ilECSNodeMappingSettings::getStorage ( )
protected

Get storage.

Definition at line 217 of file class.ilECSNodeMappingSettings.php.

References $storage.

Referenced by read(), and update().

217  : ilSetting
218  {
219  return $this->storage;
220  }
+ Here is the caller graph for this function:

◆ initStorage()

ilECSNodeMappingSettings::initStorage ( )
protected

Init storage.

Definition at line 225 of file class.ilECSNodeMappingSettings.php.

References getMid(), and getServerId().

Referenced by __construct().

225  : void
226  {
227  $this->storage = new ilSetting('ecs_node_mapping_' . $this->getServerId() . '_' . $this->getMid());
228  }
getServerId()
Get server id of setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAllInOneCategoryEnabled()

ilECSNodeMappingSettings::isAllInOneCategoryEnabled ( )

Definition at line 141 of file class.ilECSNodeMappingSettings.php.

References $allinone.

Referenced by update().

141  : bool
142  {
143  return $this->allinone;
144  }
+ Here is the caller graph for this function:

◆ isAttributeMappingEnabled()

ilECSNodeMappingSettings::isAttributeMappingEnabled ( )

Definition at line 166 of file class.ilECSNodeMappingSettings.php.

References $attributes.

Referenced by update().

166  : bool
167  {
168  return $this->attributes;
169  }
+ Here is the caller graph for this function:

◆ isCourseAllocationEnabled()

ilECSNodeMappingSettings::isCourseAllocationEnabled ( )

Definition at line 126 of file class.ilECSNodeMappingSettings.php.

References $course_active.

Referenced by update().

126  : bool
127  {
128  return $this->course_active;
129  }
+ Here is the caller graph for this function:

◆ isDirectoryMappingEnabled()

ilECSNodeMappingSettings::isDirectoryMappingEnabled ( )

Check if node mapping is enabled.

Definition at line 92 of file class.ilECSNodeMappingSettings.php.

References $directory_active.

Referenced by update().

92  : bool
93  {
95  }
+ Here is the caller graph for this function:

◆ isEmptyContainerCreationEnabled()

ilECSNodeMappingSettings::isEmptyContainerCreationEnabled ( )

Check if the creation of empty containers (pathes without courses) is enabled.

Definition at line 116 of file class.ilECSNodeMappingSettings.php.

References $create_empty_containers.

Referenced by update().

116  : bool
117  {
119  }
+ Here is the caller graph for this function:

◆ read()

ilECSNodeMappingSettings::read ( )
protected
Todo:
convert to own database table Read settings from db

Definition at line 235 of file class.ilECSNodeMappingSettings.php.

References enableAllInOne(), enableAttributeMapping(), enableCourseAllocation(), enableDirectoryMapping(), enableEmptyContainerCreation(), getStorage(), setAllInOneCategory(), setAuthMode(), setDefaultCourseCategory(), and setRoleMappings().

Referenced by __construct().

235  : void
236  {
237  if ($this->getStorage()->get('directory_active')) {
238  $this->enableDirectoryMapping((bool) $this->getStorage()->get('directory_active'));
239  }
240  if ($this->getStorage()->get('create_empty')) {
241  $this->enableEmptyContainerCreation((bool) $this->getStorage()->get('create_empty'));
242  }
243  if ($this->getStorage()->get('course_active')) {
244  $this->enableCourseAllocation((bool) $this->getStorage()->get('course_active'));
245  }
246  if ($this->getStorage()->get('default_category')) {
247  $this->setDefaultCourseCategory((int) $this->getStorage()->get('default_category'));
248  }
249  if ($this->getStorage()->get('allinone')) {
250  $this->enableAllInOne((bool) $this->getStorage()->get('allinone'));
251  }
252  if ($this->getStorage()->get('allinone_cat')) {
253  $this->setAllInOneCategory((int) $this->getStorage()->get('allinone_cat'));
254  }
255  if ($this->getStorage()->get('attributes')) {
256  $this->enableAttributeMapping((bool) $this->getStorage()->get('attributes'));
257  }
258  if ($this->getStorage()->get('role_mappings')) {
259  $this->setRoleMappings(unserialize($this->getStorage()->get('role_mappings'), ['allowed_classes' => true]));
260  }
261  if ($this->getStorage()->get('auth_mode')) {
262  $this->setAuthMode($this->getStorage()->get('auth_mode'));
263  }
264  }
enableDirectoryMapping(bool $a_status)
Enable node mapping.
setAuthMode(string $a_auth_mode)
Set user auth mode.
enableEmptyContainerCreation(bool $a_status)
enable creation of empty containers
setDefaultCourseCategory(int $a_default_category)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setAllInOneCategory()

ilECSNodeMappingSettings::setAllInOneCategory ( int  $a_cat)

Definition at line 151 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

151  : void
152  {
153  $this->allinone_cat = $a_cat;
154  }
+ Here is the caller graph for this function:

◆ setAuthMode()

ilECSNodeMappingSettings::setAuthMode ( string  $a_auth_mode)

Set user auth mode.

Definition at line 184 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

184  : void
185  {
186  $this->auth_mode = $a_auth_mode;
187  }
+ Here is the caller graph for this function:

◆ setDefaultCourseCategory()

ilECSNodeMappingSettings::setDefaultCourseCategory ( int  $a_default_category)

Definition at line 131 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

131  : void
132  {
133  $this->default_cat = $a_default_category;
134  }
+ Here is the caller graph for this function:

◆ setRoleMappings()

ilECSNodeMappingSettings::setRoleMappings ( array  $a_mappings)

Definition at line 171 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

171  : void
172  {
173  $this->role_mappings = $a_mappings;
174  }
+ Here is the caller graph for this function:

◆ update()

ilECSNodeMappingSettings::update ( )

Save settings to db.

Definition at line 200 of file class.ilECSNodeMappingSettings.php.

References getAllInOneCategory(), getAuthMode(), getDefaultCourseCategory(), getRoleMappings(), getStorage(), isAllInOneCategoryEnabled(), isAttributeMappingEnabled(), isCourseAllocationEnabled(), isDirectoryMappingEnabled(), and isEmptyContainerCreationEnabled().

200  : bool
201  {
202  $this->getStorage()->set('directory_active', (string) $this->isDirectoryMappingEnabled());
203  $this->getStorage()->set('create_empty', (string) $this->isEmptyContainerCreationEnabled());
204  $this->getStorage()->set('course_active', (string) $this->isCourseAllocationEnabled());
205  $this->getStorage()->set('default_category', (string) $this->getDefaultCourseCategory());
206  $this->getStorage()->set('allinone', (string) $this->isAllInOneCategoryEnabled());
207  $this->getStorage()->set('allinone_cat', (string) $this->getAllInOneCategory());
208  $this->getStorage()->set('attributes', (string) $this->isAttributeMappingEnabled());
209  $this->getStorage()->set('role_mappings', serialize($this->getRoleMappings()));
210  $this->getStorage()->set('auth_mode', $this->getAuthMode());
211  return true;
212  }
isDirectoryMappingEnabled()
Check if node mapping is enabled.
isEmptyContainerCreationEnabled()
Check if the creation of empty containers (pathes without courses) is enabled.
+ Here is the call graph for this function:

Field Documentation

◆ $allinone

bool ilECSNodeMappingSettings::$allinone = false
private

Definition at line 44 of file class.ilECSNodeMappingSettings.php.

Referenced by isAllInOneCategoryEnabled().

◆ $allinone_cat

int ilECSNodeMappingSettings::$allinone_cat = 0
private

Definition at line 45 of file class.ilECSNodeMappingSettings.php.

Referenced by getAllInOneCategory().

◆ $attributes

bool ilECSNodeMappingSettings::$attributes = false
private

Definition at line 46 of file class.ilECSNodeMappingSettings.php.

Referenced by isAttributeMappingEnabled().

◆ $auth_mode

string ilECSNodeMappingSettings::$auth_mode = null
private

Definition at line 48 of file class.ilECSNodeMappingSettings.php.

Referenced by getAuthMode().

◆ $course_active

bool ilECSNodeMappingSettings::$course_active = false
private

Course allocation.

Definition at line 42 of file class.ilECSNodeMappingSettings.php.

Referenced by isCourseAllocationEnabled().

◆ $create_empty_containers

bool ilECSNodeMappingSettings::$create_empty_containers = false
private

Definition at line 37 of file class.ilECSNodeMappingSettings.php.

Referenced by isEmptyContainerCreationEnabled().

◆ $default_cat

int ilECSNodeMappingSettings::$default_cat = 0
private

Definition at line 43 of file class.ilECSNodeMappingSettings.php.

Referenced by getDefaultCourseCategory().

◆ $directory_active

bool ilECSNodeMappingSettings::$directory_active = false
private

Definition at line 36 of file class.ilECSNodeMappingSettings.php.

Referenced by isDirectoryMappingEnabled().

◆ $instances

array ilECSNodeMappingSettings::$instances = []
staticprivate

Definition at line 25 of file class.ilECSNodeMappingSettings.php.

◆ $mid

int ilECSNodeMappingSettings::$mid
private

MID of sender.

Definition at line 34 of file class.ilECSNodeMappingSettings.php.

Referenced by getMid().

◆ $role_mappings

array ilECSNodeMappingSettings::$role_mappings = array()
private

Definition at line 47 of file class.ilECSNodeMappingSettings.php.

Referenced by getRoleMappings().

◆ $server_id

int ilECSNodeMappingSettings::$server_id
private

Definition at line 30 of file class.ilECSNodeMappingSettings.php.

Referenced by getServerId().

◆ $storage

ilSetting ilECSNodeMappingSettings::$storage
private

Definition at line 27 of file class.ilECSNodeMappingSettings.php.

Referenced by getStorage().


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