ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 24 of file class.ilECSNodeMappingSettings.php.

Constructor & Destructor Documentation

◆ __construct()

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

Singeleton constructor.

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

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

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

Member Function Documentation

◆ enableAllInOne()

ilECSNodeMappingSettings::enableAllInOne ( bool  $a_stat)

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

Referenced by read().

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

◆ enableAttributeMapping()

ilECSNodeMappingSettings::enableAttributeMapping ( bool  $a_stat)

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

Referenced by read().

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

◆ enableCourseAllocation()

ilECSNodeMappingSettings::enableCourseAllocation ( bool  $a_stat)

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

Referenced by read().

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

◆ enableDirectoryMapping()

ilECSNodeMappingSettings::enableDirectoryMapping ( bool  $a_status)

Enable node mapping.

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

Referenced by read().

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

◆ enableEmptyContainerCreation()

ilECSNodeMappingSettings::enableEmptyContainerCreation ( bool  $a_status)

enable creation of empty containers

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

Referenced by read().

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

◆ getAllInOneCategory()

ilECSNodeMappingSettings::getAllInOneCategory ( )

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

References $allinone_cat.

Referenced by update().

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

◆ getAuthMode()

ilECSNodeMappingSettings::getAuthMode ( )

Get auth mode.

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

References $auth_mode.

Referenced by update().

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

◆ getDefaultCourseCategory()

ilECSNodeMappingSettings::getDefaultCourseCategory ( )

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

References $default_cat.

Referenced by update().

137  : int
138  {
139  return $this->default_cat;
140  }
+ 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 85 of file class.ilECSNodeMappingSettings.php.

References $mid.

Referenced by initStorage().

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

◆ getRoleMappings()

ilECSNodeMappingSettings::getRoleMappings ( )

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

References $role_mappings.

Referenced by update().

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

◆ getServerId()

ilECSNodeMappingSettings::getServerId ( )

Get server id of setting.

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

References $server_id.

Referenced by initStorage().

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

◆ getStorage()

ilECSNodeMappingSettings::getStorage ( )
protected

Get storage.

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

References $storage.

Referenced by read(), and update().

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

◆ initStorage()

ilECSNodeMappingSettings::initStorage ( )
protected

Init storage.

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

References getMid(), and getServerId().

Referenced by __construct().

226  : void
227  {
228  $this->storage = new ilSetting('ecs_node_mapping_' . $this->getServerId() . '_' . $this->getMid());
229  }
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 142 of file class.ilECSNodeMappingSettings.php.

References $allinone.

Referenced by update().

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

◆ isAttributeMappingEnabled()

ilECSNodeMappingSettings::isAttributeMappingEnabled ( )

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

References $attributes.

Referenced by update().

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

◆ isCourseAllocationEnabled()

ilECSNodeMappingSettings::isCourseAllocationEnabled ( )

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

References $course_active.

Referenced by update().

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

◆ isDirectoryMappingEnabled()

ilECSNodeMappingSettings::isDirectoryMappingEnabled ( )

Check if node mapping is enabled.

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

References $directory_active.

Referenced by update().

93  : bool
94  {
96  }
+ 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 117 of file class.ilECSNodeMappingSettings.php.

References $create_empty_containers.

Referenced by update().

117  : bool
118  {
120  }
+ 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 236 of file class.ilECSNodeMappingSettings.php.

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

Referenced by __construct().

236  : void
237  {
238  if ($this->getStorage()->get('directory_active')) {
239  $this->enableDirectoryMapping((bool) $this->getStorage()->get('directory_active'));
240  }
241  if ($this->getStorage()->get('create_empty')) {
242  $this->enableEmptyContainerCreation((bool) $this->getStorage()->get('create_empty'));
243  }
244  if ($this->getStorage()->get('course_active')) {
245  $this->enableCourseAllocation((bool) $this->getStorage()->get('course_active'));
246  }
247  if ($this->getStorage()->get('default_category')) {
248  $this->setDefaultCourseCategory((int) $this->getStorage()->get('default_category'));
249  }
250  if ($this->getStorage()->get('allinone')) {
251  $this->enableAllInOne((bool) $this->getStorage()->get('allinone'));
252  }
253  if ($this->getStorage()->get('allinone_cat')) {
254  $this->setAllInOneCategory((int) $this->getStorage()->get('allinone_cat'));
255  }
256  if ($this->getStorage()->get('attributes')) {
257  $this->enableAttributeMapping((bool) $this->getStorage()->get('attributes'));
258  }
259  if ($this->getStorage()->get('role_mappings')) {
260  $this->setRoleMappings(unserialize($this->getStorage()->get('role_mappings'), ['allowed_classes' => true]));
261  }
262  if ($this->getStorage()->get('auth_mode')) {
263  $this->setAuthMode($this->getStorage()->get('auth_mode'));
264  }
265  }
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 152 of file class.ilECSNodeMappingSettings.php.

Referenced by read().

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

◆ setAuthMode()

ilECSNodeMappingSettings::setAuthMode ( string  $a_auth_mode)

Set user auth mode.

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

Referenced by read().

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

◆ setDefaultCourseCategory()

ilECSNodeMappingSettings::setDefaultCourseCategory ( int  $a_default_category)

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

Referenced by read().

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

◆ setRoleMappings()

ilECSNodeMappingSettings::setRoleMappings ( array  $a_mappings)

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

Referenced by read().

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

◆ update()

ilECSNodeMappingSettings::update ( )

Save settings to db.

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

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

201  : bool
202  {
203  $this->getStorage()->set('directory_active', (string) $this->isDirectoryMappingEnabled());
204  $this->getStorage()->set('create_empty', (string) $this->isEmptyContainerCreationEnabled());
205  $this->getStorage()->set('course_active', (string) $this->isCourseAllocationEnabled());
206  $this->getStorage()->set('default_category', (string) $this->getDefaultCourseCategory());
207  $this->getStorage()->set('allinone', (string) $this->isAllInOneCategoryEnabled());
208  $this->getStorage()->set('allinone_cat', (string) $this->getAllInOneCategory());
209  $this->getStorage()->set('attributes', (string) $this->isAttributeMappingEnabled());
210  $this->getStorage()->set('role_mappings', serialize($this->getRoleMappings()));
211  $this->getStorage()->set('auth_mode', $this->getAuthMode());
212  return true;
213  }
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 45 of file class.ilECSNodeMappingSettings.php.

Referenced by isAllInOneCategoryEnabled().

◆ $allinone_cat

int ilECSNodeMappingSettings::$allinone_cat = 0
private

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

Referenced by getAllInOneCategory().

◆ $attributes

bool ilECSNodeMappingSettings::$attributes = false
private

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

Referenced by isAttributeMappingEnabled().

◆ $auth_mode

string ilECSNodeMappingSettings::$auth_mode = null
private

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

Referenced by getAuthMode().

◆ $course_active

bool ilECSNodeMappingSettings::$course_active = false
private

Course allocation.

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

Referenced by isCourseAllocationEnabled().

◆ $create_empty_containers

bool ilECSNodeMappingSettings::$create_empty_containers = false
private

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

Referenced by isEmptyContainerCreationEnabled().

◆ $default_cat

int ilECSNodeMappingSettings::$default_cat = 0
private

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

Referenced by getDefaultCourseCategory().

◆ $directory_active

bool ilECSNodeMappingSettings::$directory_active = false
private

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

Referenced by isDirectoryMappingEnabled().

◆ $instances

array ilECSNodeMappingSettings::$instances = []
staticprivate

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

◆ $mid

int ilECSNodeMappingSettings::$mid
private

MID of sender.

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

Referenced by getMid().

◆ $role_mappings

array ilECSNodeMappingSettings::$role_mappings = array()
private

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

Referenced by getRoleMappings().

◆ $server_id

int ilECSNodeMappingSettings::$server_id
private

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

Referenced by getServerId().

◆ $storage

ilSetting ilECSNodeMappingSettings::$storage
private

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

Referenced by getStorage().


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