4 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateAction.php';
48 $this->pattern = $patterns;
89 $query =
'INSERT INTO didactic_tpl_abr (action_id,filter_type) ' .
99 $pattern->setParentType(self::PATTERN_PARENT_TYPE);
109 public function delete()
113 $ilDB = $DIC[
'ilDB'];
117 $query =
'DELETE FROM didactic_tpl_abr ' .
139 foreach ($roles as $role_id => $role) {
154 $rbacadmin = $DIC[
'rbacadmin'];
155 $rbacreview = $DIC[
'rbacreview'];
158 $assign = $rbacreview->isAssignable($a_role_id,
$source->getRefId()) ?
'y' :
'n';
161 $rbacadmin->revokeSubtreePermissions(
$source->getRefId(), $a_role_id);
164 $rbacadmin->deleteSubtreeTemplates(
$source->getRefId(), $a_role_id);
166 $rbacadmin->assignRoleToFolder(
183 foreach ($roles as $role_id => $role) {
199 $rbacreview = $DIC[
'rbacreview'];
200 $rbacadmin = $DIC[
'rbacadmin'];
205 if ($rbacreview->getRoleFolderOfRole($a_role_id) ==
$source->getRefId()) {
210 $rbacadmin->deleteLocalRole($a_role_id,
$source->getRefId());
213 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
215 $role->changeExistingObjects(
231 return self::TYPE_BLOCK_ROLE;
244 case self::FILTER_SOURCE_OBJ_ID:
245 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'objId']);
248 case self::FILTER_SOURCE_TITLE:
249 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'title']);
252 case self::FILTER_PARENT_ROLES:
253 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'parentRoles']);
257 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'title']);
263 $pattern->toXml($writer);
294 $ilDB = $DIC[
'ilDB'];
296 if (!parent::read()) {
300 $query =
'SELECT * FROM didactic_tpl_abr ' .
308 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
read()
read action data ilDB $ilDB
getFilterType()
Get filter type.
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
const PATTERN_PARENT_TYPE
Description of ilDidacticTemplateBlockRoleAction.
static lookupPatternsByParentId($a_parent_id, $a_parent_type)
Get patterns by template id.
addFilterPattern(ilDidacticTemplateFilterPattern $pattern)
Add filter.
setFilterPatterns(array $patterns)
Set filter patterns.
getFilterPattern()
Get filter pattern.
static _lookupTitle($a_id)
lookup object title
__construct($action_id=0)
Constructor.
xmlEndTag($tag)
Writes an endtag.
toXml(ilXmlWriter $writer)
Export to xml.
deleteLocalPolicy($a_role_id, $source)
Delete local policy.
filterRoles(ilObject $source)
Filter roles.
setFilterType($a_type)
Set filter type.
foreach($_POST as $key=> $value) $res
blockRole($a_role_id, $source)
Blo k role.
const FILTER_SOURCE_TITLE
const FILTER_PARENT_ROLES
initSourceObject()
Init the source object.
Abstract class for template actions.
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
const FILTER_SOURCE_OBJ_ID
static getLogger($a_component_id)
Get component logger.
Represents a filter pattern for didactic template actions.
getActionId()
Get action id.
getType()
Get action type.