3 declare(strict_types=1);
33 $this->pattern = $patterns;
47 $this->filter_type = $a_type;
58 $query =
'INSERT INTO didactic_tpl_abr (action_id,filter_type) ' .
63 $this->db->manipulate($query);
68 $pattern->setParentType(self::PATTERN_PARENT_TYPE);
75 public function delete():
void 78 $query =
'DELETE FROM didactic_tpl_abr ' .
79 'WHERE action_id = ' . $this->db->quote($this->
getActionId(),
'integer');
80 $this->db->manipulate($query);
93 foreach ($roles as $role_id => $role) {
103 $assign = $this->review->isAssignable($a_role_id, $source->
getRefId()) ?
'y' :
'n';
106 $this->admin->revokeSubtreePermissions($source->
getRefId(), $a_role_id);
109 $this->admin->deleteSubtreeTemplates($source->
getRefId(), $a_role_id);
111 $this->admin->assignRoleToFolder(
126 foreach ($roles as $role_id => $role) {
138 if ($this->review->getRoleFolderOfRole($a_role_id) === $source->
getRefId()) {
143 $this->admin->deleteLocalRole($a_role_id, $source->
getRefId());
147 $role->changeExistingObjects(
157 return self::TYPE_BLOCK_ROLE;
165 case self::FILTER_SOURCE_OBJ_ID:
166 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'objId']);
169 case self::FILTER_PARENT_ROLES:
170 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'parentRoles']);
173 case self::FILTER_SOURCE_TITLE:
175 $writer->
xmlStartTag(
'roleFilter', [
'source' =>
'title']);
180 $pattern->toXml($writer);
200 $query =
'SELECT * FROM didactic_tpl_abr ' .
202 $res = $this->db->query($query);
210 self::PATTERN_PARENT_TYPE
Description of ilDidacticTemplateBlockRoleAction.
addFilterPattern(ilDidacticTemplateFilterPattern $pattern)
setFilterPatterns(array $patterns)
Set filter patterns.
blockRole(int $a_role_id, ilObject $source)
getFilterPattern()
Get filter patterns.
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.