ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDidacticTemplateLocalPolicyAction Class Reference

Description of class. More...

+ Inheritance diagram for ilDidacticTemplateLocalPolicyAction:
+ Collaboration diagram for ilDidacticTemplateLocalPolicyAction:

Public Member Functions

 __construct ($action_id=0)
 Constructor. More...
 
 addFilterPattern (ilDidacticTemplateFilterPattern $pattern)
 Add filter. More...
 
 setFilterPatterns (array $patterns)
 Set filter patterns. More...
 
 getFilterPattern ()
 Get filter pattern. More...
 
 setFilterType ($a_type)
 Set filter type. More...
 
 getFilterType ()
 Get filter type. More...
 
 setRoleTemplateType ($a_tpl_type)
 Set Role template type. More...
 
 getRoleTemplateType ()
 Get role template type. More...
 
 setRoleTemplateId ($a_id)
 Set role template id. More...
 
 getRoleTemplateId ()
 Get role template id. More...
 
 save ()
 Save action. More...
 
 delete ()
 delete action filter ilDB $ilDB More...
 
 apply ()
 Apply action. More...
 
 revert ()
 Revert action. More...
 
 getType ()
 Get action type. More...
 
 toXml (ilXmlWriter $writer)
 Export to xml. More...
 
 __clone ()
 clone method More...
 
 read ()
 
- Public Member Functions inherited from ilDidacticTemplateAction
 __construct ($action_id=0)
 Constructor. More...
 
 getLogger ()
 Get logger. More...
 
 getActionId ()
 Get action id. More...
 
 setActionId ($a_action_id)
 Set action id. More...
 
 setType ($a_type_id)
 Set type id. More...
 
 setTemplateId ($a_id)
 Set template id. More...
 
 getTemplateId ()
 Get template id. More...
 
 setRefId ($a_ref_id)
 Set ref id of target object. More...
 
 getRefId ()
 Get ref id of target object. More...
 
 save ()
 write action to db overwrite for filling additional db fields More...
 
 delete ()
 Delete didactic template action overwrite for filling additional db fields. More...
 
 read ()
 ilDB $ilDB More...
 
 getType ()
 Get type of template. More...
 
 apply ()
 Apply action. More...
 
 revert ()
 Implement everthing that is necessary to revert a didactic template. More...
 
 __clone ()
 Clone method. More...
 
 toXml (ilXmlWriter $writer)
 Write xml for export. More...
 

Data Fields

const TPL_ACTION_OVERWRITE = 1
 
const TPL_ACTION_INTERSECT = 2
 
const TPL_ACTION_ADD = 3
 
const TPL_ACTION_SUBTRACT = 4
 
const TPL_ACTION_UNION = 5
 
- Data Fields inherited from ilDidacticTemplateAction
const TYPE_LOCAL_POLICY = 1
 
const TYPE_LOCAL_ROLE = 2
 
const TYPE_BLOCK_ROLE = 3
 
const FILTER_SOURCE_TITLE = 1
 
const FILTER_SOURCE_OBJ_ID = 2
 
const FILTER_PARENT_ROLES = 3
 
const PATTERN_PARENT_TYPE = 'action'
 

Protected Member Functions

 createLocalPolicy (ilObject $source, $role)
 Create local policy. More...
 
 revertLocalPolicy (ilObject $source, $role)
 
- Protected Member Functions inherited from ilDidacticTemplateAction
 initSourceObject ()
 Init the source object. More...
 
 filterRoles (ilObject $source)
 Filter roles. More...
 

Private Attributes

 $pattern = array()
 
 $filter_type = self::FILTER_SOURCE_TITLE
 
 $role_template_type = self::TPL_ACTION_OVERWRITE
 
 $role_template_id = 0
 

Detailed Description

Description of class.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 12 of file class.ilDidacticTemplateLocalPolicyAction.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateLocalPolicyAction::__construct (   $action_id = 0)

Constructor.

Parameters
int$action_id

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

References ilDidacticTemplateAction\$action_id.

32  {
33  parent::__construct($action_id);
34  }

Member Function Documentation

◆ __clone()

ilDidacticTemplateLocalPolicyAction::__clone ( )

clone method

Definition at line 321 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $pattern, array, getFilterPattern(), and setFilterPatterns().

322  {
323  parent::__clone();
324 
325  // Clone patterns
326  $cloned = array();
327  foreach ($this->getFilterPattern() as $pattern) {
328  $clones[] = clone $pattern;
329  }
330  $this->setFilterPatterns($clones);
331  }
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ addFilterPattern()

ilDidacticTemplateLocalPolicyAction::addFilterPattern ( ilDidacticTemplateFilterPattern  $pattern)

Add filter.

Parameters
ilDidacticTemplateFilterPatter$pattern

Definition at line 40 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $pattern.

Referenced by read().

+ Here is the caller graph for this function:

◆ apply()

ilDidacticTemplateLocalPolicyAction::apply ( )

Apply action.

Definition at line 169 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $GLOBALS, $source, createLocalPolicy(), ilDidacticTemplateAction\filterRoles(), ilDidacticTemplateAction\getLogger(), and ilDidacticTemplateAction\initSourceObject().

170  {
171  $rbacreview = $GLOBALS['DIC']->rbac()->review();
172 
173  $source = $this->initSourceObject();
174  // Create a role folder for the new local policies
175 
176  $roles = $this->filterRoles($source);
177 
178  // Create local policy for filtered roles
179  foreach ($roles as $role_id => $role) {
180  $this->getLogger()->debug('Apply to role: ' . $role['title']);
181 
182  // No local policies for protected roles of higher context
183  if (
184  $rbacreview->isProtected($role['parent'], $role_id) &&
185  $role['parent'] != $source->getRefId()
186  ) {
187  $this->getLogger()->debug('Ignoring protected role.');
188  continue;
189  }
190  $this->createLocalPolicy($source, $role);
191  }
192  return true;
193  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
filterRoles(ilObject $source)
Filter roles.
createLocalPolicy(ilObject $source, $role)
Create local policy.
initSourceObject()
Init the source object.
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

◆ createLocalPolicy()

ilDidacticTemplateLocalPolicyAction::createLocalPolicy ( ilObject  $source,
  $role 
)
protected

Create local policy.

Parameters
ilObject$source
array$role
Returns
bool

Definition at line 364 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $GLOBALS, array, ilLoggerFactory\getLogger(), ilObject\getRefId(), getRoleTemplateId(), getRoleTemplateType(), ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, and ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES.

Referenced by apply().

365  {
366  global $rbacreview, $rbacadmin;
367 
368  // fetch role information
369  $role_data = array();
370  foreach ($rbacreview->getParentRoleIds($source->getRefId()) as $role_id => $tmp_role) {
371  if ($role_id == $role['obj_id']) {
372  $role_data = $tmp_role;
373  }
374  }
375 
376  // Add local policy
377  if (!$rbacreview->isRoleAssignedToObject($role['obj_id'], $source->getRefId())) {
378  $GLOBALS['DIC']->rbac()->admin()->assignRoleToFolder(
379  $role['obj_id'],
380  $source->getRefId(),
381  'n'
382  );
383  }
384 
385  // do nothing if role is protected in higher context
386  if (
387  $GLOBALS['DIC']->rbac()->review()->isProtected($source->getRefId(), $role['obj_id'])
388  ) {
389  $GLOBALS['DIC']->logger()->otpl()->info('Ignoring protected role: ' . $role['title']);
390  return true;
391  }
392 
393  switch ($this->getRoleTemplateType()) {
394  case self::TPL_ACTION_UNION:
395 
396  ilLoggerFactory::getLogger('otpl')->info('Using ilRbacAdmin::copyRolePermissionUnion()');
397  $rbacadmin->copyRolePermissionUnion(
398  $role_data['obj_id'],
399  $role_data['parent'],
400  $this->getRoleTemplateId(),
401  ROLE_FOLDER_ID,
402  $role_data['obj_id'],
403  $source->getRefId()
404  );
405  break;
406 
407  case self::TPL_ACTION_OVERWRITE:
408 
409  ilLoggerFactory::getLogger('otpl')->info('Using ilRbacAdmin::copyRoleTemplatePermission()');
410  $rbacadmin->copyRoleTemplatePermissions(
411  $this->getRoleTemplateId(),
412  ROLE_FOLDER_ID,
413  $source->getRefId(),
414  $role_data['obj_id'],
415  true
416  );
417  break;
418 
419  case self::TPL_ACTION_INTERSECT:
420 
421  ilLoggerFactory::getLogger('otpl')->info('Using ilRbacAdmin::copyRolePermissionIntersection()' . $this->getRoleTemplateId());
422  $rbacadmin->copyRolePermissionIntersection(
423  $role_data['obj_id'],
424  $role_data['parent'],
425  $this->getRoleTemplateId(),
426  ROLE_FOLDER_ID,
427  $source->getRefId(),
428  $role_data['obj_id']
429  );
430  break;
431 
432  }
433 
434  // Change existing object
435  include_once './Services/AccessControl/classes/class.ilObjRole.php';
436  $role_obj = new ilObjRole($role_data['obj_id']);
437  $role_obj->changeExistingObjects(
438  $source->getRefId(),
440  array('all')
441  );
442 
443  return true;
444  }
Class ilObjRole.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
getRefId()
get reference id public
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilDidacticTemplateLocalPolicyAction::delete ( )

delete action filter ilDB $ilDB

Returns
bool

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

References $ilDB, $pattern, $query, ilDidacticTemplateAction\getActionId(), and getFilterPattern().

148  {
149  global $ilDB;
150 
151  parent::delete();
152 
153  $query = 'DELETE FROM didactic_tpl_alp ' .
154  'WHERE action_id = ' . $ilDB->quote($this->getActionId(), 'integer');
155  $ilDB->manipulate($query);
156 
157  foreach ($this->getFilterPattern() as $pattern) {
158  $pattern->delete();
159  }
160  return true;
161  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ getFilterPattern()

ilDidacticTemplateLocalPolicyAction::getFilterPattern ( )

Get filter pattern.

Returns
array

Definition at line 58 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $pattern.

Referenced by __clone(), delete(), save(), and toXml().

+ Here is the caller graph for this function:

◆ getFilterType()

ilDidacticTemplateLocalPolicyAction::getFilterType ( )

Get filter type.

Returns
int

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

References $filter_type.

Referenced by save(), and toXml().

+ Here is the caller graph for this function:

◆ getRoleTemplateId()

ilDidacticTemplateLocalPolicyAction::getRoleTemplateId ( )

Get role template id.

Returns
int

Definition at line 111 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $role_template_id.

Referenced by createLocalPolicy(), save(), and toXml().

+ Here is the caller graph for this function:

◆ getRoleTemplateType()

ilDidacticTemplateLocalPolicyAction::getRoleTemplateType ( )

Get role template type.

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

References $role_template_type.

Referenced by createLocalPolicy(), save(), and toXml().

+ Here is the caller graph for this function:

◆ getType()

ilDidacticTemplateLocalPolicyAction::getType ( )

Get action type.

Returns
int

Definition at line 243 of file class.ilDidacticTemplateLocalPolicyAction.php.

244  {
245  return self::TYPE_LOCAL_POLICY;
246  }

◆ read()

ilDidacticTemplateLocalPolicyAction::read ( )

Definition at line 333 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $ilDB, $pattern, $query, $res, $row, addFilterPattern(), ilDBConstants\FETCHMODE_OBJECT, ilDidacticTemplateAction\getActionId(), ilDidacticTemplateFilterPatternFactory\lookupPatternsByParentId(), setFilterType(), setRoleTemplateId(), and setRoleTemplateType().

334  {
335  global $ilDB;
336 
337  if (!parent::read()) {
338  return false;
339  }
340 
341  $query = 'SELECT * FROM didactic_tpl_alp ' .
342  'WHERE action_id = ' . $ilDB->quote($this->getActionId());
343  $res = $ilDB->query($query);
344  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
345  $this->setFilterType($row->filter_type);
346  $this->setRoleTemplateType($row->template_type);
347  $this->setRoleTemplateId($row->template_id);
348  }
349 
350  // Read filter
351  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
352  foreach (ilDidacticTemplateFilterPatternFactory::lookupPatternsByParentId($this->getActionId(), self::PATTERN_PARENT_TYPE) as $pattern) {
353  $this->addFilterPattern($pattern);
354  }
355  }
static lookupPatternsByParentId($a_parent_id, $a_parent_type)
Get patterns by template id.
addFilterPattern(ilDidacticTemplateFilterPattern $pattern)
Add filter.
foreach($_POST as $key=> $value) $res
$query
global $ilDB
+ Here is the call graph for this function:

◆ revert()

ilDidacticTemplateLocalPolicyAction::revert ( )

Revert action.

ilRbacReview

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

References $GLOBALS, $source, array, ilDidacticTemplateAction\filterRoles(), ilDidacticTemplateAction\getLogger(), ilDidacticTemplateAction\initSourceObject(), ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES, and revertLocalPolicy().

201  {
202  global $rbacadmin,$tree;
203  $rbacreview = $GLOBALS['DIC']->rbac()->review();
204 
205  $source = $this->initSourceObject();
206  $roles = $this->filterRoles($source);
207 
208  // Delete local policy for filtered roles
209  foreach ($roles as $role_id => $role) {
210  // Do not delete local policies of auto genrated roles
211  if (!$rbacreview->isGlobalRole($role['obj_id']) and
212  $rbacreview->isAssignable($role['obj_id'], $source->getRefId()) and
213  $rbacreview->isSystemGeneratedRole($role['obj_id'])) {
214  $this->getLogger()->debug('Reverting local policy of auto generated role: ' . $role['title']);
215  $this->revertLocalPolicy($source, $role);
216  } else {
217  $this->getLogger()->debug('Reverting local policy and deleting local role: ' . $role['title']);
218 
219  // delete local role and change exiting objects
220  $rbacadmin->deleteLocalRole($role_id, $source->getRefId());
221  // Change existing object
222  include_once './Services/AccessControl/classes/class.ilObjRole.php';
223  $role_obj = new ilObjRole($role_id);
224 
225  $protected = $rbacreview->isProtected($role['parent'], $role['rol_id']);
226 
227  $role_obj->changeExistingObjects(
228  $source->getRefId(),
229  $protected ?
232  array('all')
233  );
234  }
235  }
236  return true;
237  }
Class ilObjRole.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
filterRoles(ilObject $source)
Filter roles.
Create styles array
The data for the language used.
initSourceObject()
Init the source object.
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
$source
Definition: linkback.php:22
+ Here is the call graph for this function:

◆ revertLocalPolicy()

ilDidacticTemplateLocalPolicyAction::revertLocalPolicy ( ilObject  $source,
  $role 
)
protected

Definition at line 446 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $ilDB, $query, $res, $row, array, ilDBConstants\FETCHMODE_OBJECT, ilLoggerFactory\getLogger(), ilObject\getRefId(), ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, and ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES.

Referenced by revert().

447  {
448  global $rbacadmin, $rbacreview, $ilDB;
449 
450  ilLoggerFactory::getLogger('otpl')->info('Reverting policy for role ' . $role['title']);
451  // Local policies can only be reverted for auto generated roles. Otherwise the
452  // original role settings are unknown
453  if (substr($role['title'], 0, 3) != 'il_') {
454  ilLoggerFactory::getLogger('otpl')->warning('Cannot revert local policy for role ' . $role['title']);
455  return false;
456  }
457 
458 
459  // No local policies
460  if (!$rbacreview->getLocalPolicies($source->getRefId())) {
461  return false;
462  }
463 
464  $exploded_title = explode('_', $role['title']);
465  $rolt_title = $exploded_title[0] . '_' . $exploded_title[1] . '_' . $exploded_title[2];
466 
467  // Lookup role template
468  $query = 'SELECT obj_id FROM object_data ' .
469  'WHERE title = ' . $ilDB->quote($rolt_title, 'text') . ' ' .
470  'AND type = ' . $ilDB->quote('rolt', 'text');
471  $res = $ilDB->query($query);
472  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
473  $rolt_id = $row->obj_id;
474  }
475 
476  // No template found
477  if (!$rolt_id) {
478  return false;
479  }
480 
481  $rbacadmin->copyRoleTemplatePermissions(
482  $rolt_id,
483  ROLE_FOLDER_ID,
484  $source->getRefId(),
485  $role['obj_id'],
486  true
487  );
488 
489  // Change existing object
490  include_once './Services/AccessControl/classes/class.ilObjRole.php';
491  $role_obj = new ilObjRole($role['obj_id']);
492  $role_obj->changeExistingObjects(
493  $source->getRefId(),
495  array('all')
496  );
497  }
Class ilObjRole.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
global $ilDB
getRefId()
get reference id public
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilDidacticTemplateLocalPolicyAction::save ( )

Save action.

Definition at line 119 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $ilDB, $pattern, $query, ilDidacticTemplateAction\getActionId(), getFilterPattern(), getFilterType(), getRoleTemplateId(), and getRoleTemplateType().

120  {
121  global $ilDB;
122 
123  parent::save();
124 
125  $query = 'INSERT INTO didactic_tpl_alp (action_id,filter_type,template_type,template_id) ' .
126  'VALUES( ' .
127  $ilDB->quote($this->getActionId(), 'integer') . ', ' .
128  $ilDB->quote($this->getFilterType(), 'integer') . ', ' .
129  $ilDB->quote($this->getRoleTemplateType(), 'integer') . ', ' .
130  $ilDB->quote($this->getRoleTemplateId(), 'integer') . ' ' .
131  ')';
132  $ilDB->manipulate($query);
133 
134  foreach ($this->getFilterPattern() as $pattern) {
135  /* @var ilDidacticTemplateFilterPattern $pattern */
136  $pattern->setParentId($this->getActionId());
137  $pattern->setParentType(self::PATTERN_PARENT_TYPE);
138  $pattern->save();
139  }
140  }
$query
global $ilDB
+ Here is the call graph for this function:

◆ setFilterPatterns()

ilDidacticTemplateLocalPolicyAction::setFilterPatterns ( array  $patterns)

Set filter patterns.

Parameters
array$patterns

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

Referenced by __clone().

50  {
51  $this->pattern = $patterns;
52  }
+ Here is the caller graph for this function:

◆ setFilterType()

ilDidacticTemplateLocalPolicyAction::setFilterType (   $a_type)

Set filter type.

Parameters
int$a_type

Definition at line 67 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $a_type.

Referenced by read().

68  {
69  $this->filter_type = $a_type;
70  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ setRoleTemplateId()

ilDidacticTemplateLocalPolicyAction::setRoleTemplateId (   $a_id)

Set role template id.

Parameters
int$a_id

Definition at line 102 of file class.ilDidacticTemplateLocalPolicyAction.php.

Referenced by read().

103  {
104  $this->role_template_id = $a_id;
105  }
+ Here is the caller graph for this function:

◆ setRoleTemplateType()

ilDidacticTemplateLocalPolicyAction::setRoleTemplateType (   $a_tpl_type)

Set Role template type.

Parameters
int$a_tpl_type

Definition at line 85 of file class.ilDidacticTemplateLocalPolicyAction.php.

Referenced by read().

86  {
87  $this->role_template_type = $a_tpl_type;
88  }
+ Here is the caller graph for this function:

◆ toXml()

ilDidacticTemplateLocalPolicyAction::toXml ( ilXmlWriter  $writer)

Export to xml.

Parameters
ilXmlWriter$writer
Returns
void

Definition at line 253 of file class.ilDidacticTemplateLocalPolicyAction.php.

References $pattern, ilObject\_lookupType(), ilXmlWriter\appendXML(), array, getFilterPattern(), getFilterType(), getRoleTemplateId(), getRoleTemplateType(), ilRoleXmlExport\MODE_DTPL, ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().

254  {
255  $writer->xmlStartTag('localPolicyAction');
256 
257  switch ($this->getFilterType()) {
258  case self::FILTER_SOURCE_TITLE:
259  $writer->xmlStartTag('roleFilter', array('source' => 'title'));
260  break;
261 
262  case self::FILTER_SOURCE_OBJ_ID:
263  $writer->xmlStartTag('roleFilter', array('source' => 'objId'));
264  break;
265 
266  }
267 
268  foreach ($this->getFilterPattern() as $pattern) {
269  $pattern->toXml($writer);
270  }
271  $writer->xmlEndTag('roleFilter');
272 
273  $il_role_id = 'il_' . IL_INST_ID . '_' . ilObject::_lookupType($this->getRoleTemplateId()) . '_' . $this->getRoleTemplateId();
274 
275  switch ($this->getRoleTemplateType()) {
276  case self::TPL_ACTION_OVERWRITE:
277  $writer->xmlStartTag(
278  'localPolicyTemplate',
279  array(
280  'type' => 'overwrite',
281  'id' => $il_role_id
282  )
283  );
284  break;
285 
286  case self::TPL_ACTION_INTERSECT:
287  $writer->xmlStartTag(
288  'localPolicyTemplate',
289  array(
290  'type' => 'intersect',
291  'id' => $il_role_id
292  )
293  );
294  break;
295 
296  case self::TPL_ACTION_UNION:
297  $writer->xmlStartTag(
298  'localPolicyTemplate',
299  array(
300  'type' => 'union',
301  'id' => $il_role_id
302  )
303  );
304  break;
305  }
306 
307  include_once './Services/AccessControl/classes/class.ilRoleXmlExport.php';
308  $exp = new ilRoleXmlExport();
309  $exp->setMode(ilRoleXmlExport::MODE_DTPL);
310  $exp->addRole($this->getRoleTemplateId(), ROLE_FOLDER_ID);
311  $exp->write();
312  $writer->appendXML($exp->xmlDumpMem(false));
313  $writer->xmlEndTag('localPolicyTemplate');
314  $writer->xmlEndTag('localPolicyAction');
315  return void;
316  }
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
xmlEndTag($tag)
Writes an endtag.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
Xml export of roles and role templates.
appendXML($a_str)
append xml string to document
+ Here is the call graph for this function:

Field Documentation

◆ $filter_type

ilDidacticTemplateLocalPolicyAction::$filter_type = self::FILTER_SOURCE_TITLE
private

Definition at line 22 of file class.ilDidacticTemplateLocalPolicyAction.php.

Referenced by getFilterType().

◆ $pattern

ilDidacticTemplateLocalPolicyAction::$pattern = array()
private

◆ $role_template_id

ilDidacticTemplateLocalPolicyAction::$role_template_id = 0
private

Definition at line 24 of file class.ilDidacticTemplateLocalPolicyAction.php.

Referenced by getRoleTemplateId().

◆ $role_template_type

ilDidacticTemplateLocalPolicyAction::$role_template_type = self::TPL_ACTION_OVERWRITE
private

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

Referenced by getRoleTemplateType().

◆ TPL_ACTION_ADD

const ilDidacticTemplateLocalPolicyAction::TPL_ACTION_ADD = 3

◆ TPL_ACTION_INTERSECT

const ilDidacticTemplateLocalPolicyAction::TPL_ACTION_INTERSECT = 2

◆ TPL_ACTION_OVERWRITE

const ilDidacticTemplateLocalPolicyAction::TPL_ACTION_OVERWRITE = 1

◆ TPL_ACTION_SUBTRACT

const ilDidacticTemplateLocalPolicyAction::TPL_ACTION_SUBTRACT = 4

◆ TPL_ACTION_UNION

const ilDidacticTemplateLocalPolicyAction::TPL_ACTION_UNION = 5

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