3 declare(strict_types=1);
48 $this->pattern = $patterns;
62 $this->filter_type = $a_type;
73 $query =
'INSERT INTO didactic_tpl_abr (action_id,filter_type) ' .
78 $this->db->manipulate(
$query);
83 $pattern->setParentType(self::PATTERN_PARENT_TYPE);
90 public function delete():
void 93 $query =
'DELETE FROM didactic_tpl_abr ' .
94 'WHERE action_id = ' . $this->db->quote($this->
getActionId(),
'integer');
95 $this->db->manipulate(
$query);
108 foreach ($roles as $role_id => $role) {
118 $assign = $this->review->isAssignable($a_role_id, $source->
getRefId()) ?
'y' :
'n';
121 $this->admin->revokeSubtreePermissions($source->
getRefId(), $a_role_id);
124 $this->admin->deleteSubtreeTemplates($source->
getRefId(), $a_role_id);
126 $this->admin->assignRoleToFolder(
141 foreach ($roles as $role_id => $role) {
153 if ($this->review->getRoleFolderOfRole($a_role_id) === $source->
getRefId()) {
158 $this->admin->deleteLocalRole($a_role_id, $source->
getRefId());
162 $role->changeExistingObjects(
172 return self::TYPE_BLOCK_ROLE;
180 case self::FILTER_SOURCE_OBJ_ID:
181 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'objId']);
184 case self::FILTER_PARENT_ROLES:
185 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'parentRoles']);
188 case self::FILTER_SOURCE_TITLE:
190 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'title']);
196 $pattern->toXml($writer);
216 $query =
'SELECT * FROM didactic_tpl_abr ' .
226 self::PATTERN_PARENT_TYPE
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilterPattern(ilDidacticTemplateFilterPattern $pattern)
setFilterPatterns(array $patterns)
Set filter patterns.
blockRole(int $a_role_id, ilObject $source)
getFilterPattern()
Get filter patterns.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFilterType(int $a_type)
__construct(int $action_id=0)
toXml(ilXmlWriter $writer)
xmlEndTag(string $tag)
Writes an endtag.
filterRoles(ilObject $source)
static _lookupTitle(int $obj_id)
Abstract class for template actions.
static lookupPatternsByParentId(int $a_parent_id, string $a_parent_type)
deleteLocalPolicy(int $a_role_id, ilObject $source)
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
__construct(Container $dic, ilPlugin $plugin)
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
Represents a filter pattern for didactic template actions.