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->isLocalRole($role[
'obj_id'],$role[
'parent']) and
220 $rbacreview->isSystemGeneratedRole($role[
'obj_id']))
226 $rbacadmin->deleteLocalRole($role_id,$rolf);
253 case self::FILTER_SOURCE_TITLE:
254 $writer->
xmlStartTag(
'roleFilter',array(
'source' =>
'title'));
257 case self::FILTER_SOURCE_OBJ_ID:
258 $writer->
xmlStartTag(
'roleFilter',array(
'source' =>
'objId'));
265 $pattern->toXml($writer);
273 case self::TPL_ACTION_OVERWRITE:
275 'localPolicyTemplate',
277 'type' =>
'overwrite',
283 case self::TPL_ACTION_INTERSECT:
285 'localPolicyTemplate',
287 'type' =>
'intersect',
293 case self::TPL_ACTION_UNION:
295 'localPolicyTemplate',
304 include_once
'./Services/AccessControl/classes/class.ilRoleXmlExport.php';
309 $writer->
appendXML($exp->xmlDumpMem(FALSE));
310 $writer->
xmlEndTag(
'localPolicyTemplate');
340 $query =
'SELECT * FROM didactic_tpl_alp '.
341 'WHERE action_id = '.$ilDB->quote($this->
getActionId());
351 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
367 global $rbacreview, $rbacadmin;
369 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using role: '.print_r($role,
true));
371 $role_folder_id = $rbacreview->getRoleFolderIdOfObject($source->
getRefId());
373 $GLOBALS[
'ilLog']->write(__METHOD__.
': Role folder id: '.$role_folder_id);
377 if(!$rbacreview->isRoleAssignedToFolder($role[
'obj_id'],$role_folder_id))
379 $rbacadmin->assignRoleToFolder($role[
'obj_id'],$role_folder_id,
'n');
384 case self::TPL_ACTION_UNION:
386 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRolePermissionUnion()');
387 $rbacadmin->copyRolePermissionUnion(
397 case self::TPL_ACTION_OVERWRITE:
399 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRoleTemplatePermissions()');
400 $rbacadmin->copyRoleTemplatePermissions(
409 case self::TPL_ACTION_INTERSECT:
411 $GLOBALS[
'ilLog']->write(__METHOD__.
': Using ilRbacAdmin::copyRolePermissionIntersection()');
412 $rbacadmin->copyRolePermissionIntersection(
425 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
426 $role_obj =
new ilObjRole($role[
'obj_id']);
427 $role_obj->changeExistingObjects(
438 global $rbacadmin, $rbacreview,
$ilDB;
440 $GLOBALS[
'ilLog']->write(__METHOD__.
': Reverting policy for role: '.print_r($role,
true));
444 if(substr($role[
'title'],0,3) !=
'il_')
446 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot revert local policy for role '. $role[
'title']);
451 $role_folder_id = $rbacreview->getRoleFolderIdOfObject($source->
getRefId());
458 $exploded_title = explode(
'_',$role[
'title']);
459 $rolt_title = $exploded_title[0].
'_'.$exploded_title[1].
'_'.$exploded_title[2];
462 $query =
'SELECT obj_id FROM object_data '.
463 'WHERE title = '.$ilDB->quote($rolt_title,
'text').
' '.
464 'AND type = '.$ilDB->quote(
'rolt',
'text');
468 $rolt_id =
$row->obj_id;
477 $rbacadmin->copyRoleTemplatePermissions(
486 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
487 $role_obj =
new ilObjRole($role[
'obj_id']);
488 $role_obj->changeExistingObjects(