4 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateAction.php';
51 $this->pattern = $patterns;
69 $this->filter_type = $a_type;
87 $this->role_template_type = $a_tpl_type;
104 $this->role_template_id = $a_id;
125 $query =
'INSERT INTO didactic_tpl_alp (action_id,filter_type,template_type,template_id) '.
132 $ilDB->manipulate(
$query);
138 $pattern->setParentType(self::PATTERN_PARENT_TYPE);
148 public function delete()
154 $query =
'DELETE FROM didactic_tpl_alp '.
155 'WHERE action_id = '.$ilDB->quote($this->
getActionId(),
'integer');
156 $ilDB->manipulate(
$query);
181 $rolf = $rbacreview->getRoleFolderIdOfObject($source->getRefId());
183 if(count($roles) and !$rolf)
185 $rolf = $source->createRoleFolder();
186 $rolf = $rolf->getRefId();
189 foreach($roles as $role_id => $role)
192 if($role[
'protected'] and $role[
'parent'] != $rolf)
208 global $rbacreview,$rbacadmin,$tree;
211 $rolf = $rbacreview->getRoleFolderIdOfObject($source->getRefId());
216 foreach($roles as $role_id => $role)
219 if(!$rbacreview->isGlobalRole($role[
'obj_id']) and
220 $rbacreview->isAssignable($role[
'obj_id'],$role[
'parent']) and
221 $rbacreview->isSystemGeneratedRole($role[
'obj_id']))
228 $rbacadmin->deleteLocalRole($role_id,$rolf);
230 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
232 $role_obj->changeExistingObjects(
265 case self::FILTER_SOURCE_TITLE:
266 $writer->
xmlStartTag(
'roleFilter',array(
'source' =>
'title'));
269 case self::FILTER_SOURCE_OBJ_ID:
270 $writer->
xmlStartTag(
'roleFilter',array(
'source' =>
'objId'));
277 $pattern->toXml($writer);
285 case self::TPL_ACTION_OVERWRITE:
287 'localPolicyTemplate',
289 'type' =>
'overwrite',
295 case self::TPL_ACTION_INTERSECT:
297 'localPolicyTemplate',
299 'type' =>
'intersect',
305 case self::TPL_ACTION_UNION:
307 'localPolicyTemplate',
316 include_once
'./Services/AccessControl/classes/class.ilRoleXmlExport.php';
321 $writer->
appendXML($exp->xmlDumpMem(FALSE));
322 $writer->
xmlEndTag(
'localPolicyTemplate');
352 $query =
'SELECT * FROM didactic_tpl_alp '.
353 'WHERE action_id = '.$ilDB->quote($this->
getActionId());
363 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
379 global $rbacreview, $rbacadmin;
381 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using role: '.print_r($role,
true));
383 $role_folder_id = $rbacreview->getRoleFolderIdOfObject($source->
getRefId());
385 $GLOBALS[
'ilLog']->write(__METHOD__.
': Role folder id: '.$role_folder_id);
389 if(!$rbacreview->isRoleAssignedToFolder($role[
'obj_id'],$role_folder_id))
391 $rbacadmin->assignRoleToFolder($role[
'obj_id'],$role_folder_id,
'n');
396 case self::TPL_ACTION_UNION:
398 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRolePermissionUnion()');
399 $rbacadmin->copyRolePermissionUnion(
409 case self::TPL_ACTION_OVERWRITE:
411 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRoleTemplatePermissions()');
412 $rbacadmin->copyRoleTemplatePermissions(
421 case self::TPL_ACTION_INTERSECT:
423 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRolePermissionIntersection()');
424 $rbacadmin->copyRolePermissionIntersection(
437 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
438 $role_obj =
new ilObjRole($role[
'obj_id']);
439 $role_obj->changeExistingObjects(
450 global $rbacadmin, $rbacreview, $ilDB;
452 $GLOBALS[
'ilLog']->write(__METHOD__.
': Reverting policy for role: '.print_r($role,
true));
456 if(substr($role[
'title'],0,3) !=
'il_')
458 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot revert local policy for role '. $role[
'title']);
463 $role_folder_id = $rbacreview->getRoleFolderIdOfObject($source->
getRefId());
470 $exploded_title = explode(
'_',$role[
'title']);
471 $rolt_title = $exploded_title[0].
'_'.$exploded_title[1].
'_'.$exploded_title[2];
474 $query =
'SELECT obj_id FROM object_data '.
475 'WHERE title = '.$ilDB->quote($rolt_title,
'text').
' '.
476 'AND type = '.$ilDB->quote(
'rolt',
'text');
480 $rolt_id =
$row->obj_id;
489 $rbacadmin->copyRoleTemplatePermissions(
498 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
499 $role_obj =
new ilObjRole($role[
'obj_id']);
500 $role_obj->changeExistingObjects(