ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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.

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:26

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

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

147 : void
148 {
149 $this->allinone = $a_stat;
150 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableAttributeMapping()

ilECSNodeMappingSettings::enableAttributeMapping ( bool  $a_stat)

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

162 : void
163 {
164 $this->attributes = $a_stat;
165 }

Referenced by read().

+ Here is the caller graph for this function:

◆ enableCourseAllocation()

ilECSNodeMappingSettings::enableCourseAllocation ( bool  $a_stat)

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

122 : void
123 {
124 $this->course_active = $a_stat;
125 }

Referenced by read().

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

101 : void
102 {
103 $this->directory_active = $a_status;
104 }

Referenced by read().

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

109 : void
110 {
111 $this->create_empty_containers = $a_status;
112 }

Referenced by read().

+ Here is the caller graph for this function:

◆ getAllInOneCategory()

ilECSNodeMappingSettings::getAllInOneCategory ( )

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

157 : int
158 {
159 return $this->allinone_cat;
160 }

References $allinone_cat.

Referenced by update().

+ Here is the caller graph for this function:

◆ getAuthMode()

ilECSNodeMappingSettings::getAuthMode ( )

Get auth mode.

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

193 : ?string
194 {
195 return $this->auth_mode;
196 }

References $auth_mode.

Referenced by update().

+ Here is the caller graph for this function:

◆ getDefaultCourseCategory()

ilECSNodeMappingSettings::getDefaultCourseCategory ( )

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

137 : int
138 {
139 return $this->default_cat;
140 }

References $default_cat.

Referenced by update().

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

85 : int
86 {
87 return $this->mid;
88 }

References $mid.

Referenced by initStorage().

+ Here is the caller graph for this function:

◆ getRoleMappings()

ilECSNodeMappingSettings::getRoleMappings ( )

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

177 : array
178 {
180 }

References $role_mappings.

Referenced by update().

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

77 : int
78 {
79 return $this->server_id;
80 }

References $server_id.

Referenced by initStorage().

+ Here is the caller graph for this function:

◆ getStorage()

ilECSNodeMappingSettings::getStorage ( )
protected

Get storage.

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

218 : ilSetting
219 {
220 return $this->storage;
221 }
ILIAS Setting Class.

References $storage.

Referenced by read(), and update().

+ Here is the caller graph for this function:

◆ initStorage()

ilECSNodeMappingSettings::initStorage ( )
protected

Init storage.

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

226 : void
227 {
228 $this->storage = new ilSetting('ecs_node_mapping_' . $this->getServerId() . '_' . $this->getMid());
229 }
getServerId()
Get server id of setting.

References getMid(), and getServerId().

Referenced by __construct().

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

142 : bool
143 {
144 return $this->allinone;
145 }

References $allinone.

Referenced by update().

+ Here is the caller graph for this function:

◆ isAttributeMappingEnabled()

ilECSNodeMappingSettings::isAttributeMappingEnabled ( )

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

167 : bool
168 {
169 return $this->attributes;
170 }

References $attributes.

Referenced by update().

+ Here is the caller graph for this function:

◆ isCourseAllocationEnabled()

ilECSNodeMappingSettings::isCourseAllocationEnabled ( )

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

127 : bool
128 {
130 }

References $course_active.

Referenced by update().

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

93 : bool
94 {
96 }

References $directory_active.

Referenced by update().

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

117 : bool
118 {
120 }

References $create_empty_containers.

Referenced by update().

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

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 }
setAuthMode(string $a_auth_mode)
Set user auth mode.
setDefaultCourseCategory(int $a_default_category)
enableDirectoryMapping(bool $a_status)
Enable node mapping.
enableEmptyContainerCreation(bool $a_status)
enable creation of empty containers

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

Referenced by __construct().

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

152 : void
153 {
154 $this->allinone_cat = $a_cat;
155 }

Referenced by read().

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

185 : void
186 {
187 $this->auth_mode = $a_auth_mode;
188 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setDefaultCourseCategory()

ilECSNodeMappingSettings::setDefaultCourseCategory ( int  $a_default_category)

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

132 : void
133 {
134 $this->default_cat = $a_default_category;
135 }

Referenced by read().

+ Here is the caller graph for this function:

◆ setRoleMappings()

ilECSNodeMappingSettings::setRoleMappings ( array  $a_mappings)

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

172 : void
173 {
174 $this->role_mappings = $a_mappings;
175 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilECSNodeMappingSettings::update ( )

Save settings to db.

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

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 }
isEmptyContainerCreationEnabled()
Check if the creation of empty containers (pathes without courses) is enabled.
isDirectoryMappingEnabled()
Check if node mapping is enabled.

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

+ 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: