ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjRoleTemplate.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
26{
27 public function __construct(int $a_id = 0, bool $a_call_by_reference = false)
28 {
29 $this->type = "rolt";
30 parent::__construct($a_id, $a_call_by_reference);
31 }
32
33 public function getPresentationTitle(): string
34 {
36
37 if ($r === $this->getUntranslatedTitle()) {
38 return $r;
39 }
40
41 return $r . ' (' . $this->getUntranslatedTitle() . ')';
42 }
43
50 public function delete(): bool
51 {
52 // put here role template specific stuff
53 // delete rbac permissions
54 $this->rbac_admin->deleteTemplate($this->getId());
55
56 // always call parent delete function at the end!!
57 return parent::delete();
58 }
59
60 public function isInternalTemplate(): bool
61 {
62 if (substr($this->getTitle(), 0, 3) == "il_") {
63 return true;
64 }
65
66 return false;
67 }
68
69 public function getFilterOfInternalTemplate(): array
70 {
71 $filter = [];
72 switch ($this->getTitle()) {
73 case "il_grp_admin":
74 case "il_grp_member":
75 case "il_grp_status_closed":
76 case "il_grp_status_open":
77 $obj_data = $this->obj_definition->getSubObjects('grp', false);
78 unset($obj_data["rolf"]);
79 $filter = array_keys($obj_data);
80 $filter[] = 'grp';
81 break;
82
83 case "il_crs_admin":
84 case "il_crs_tutor":
85 case "il_crs_member":
86 case "il_crs_non_member":
87 $obj_data = $this->obj_definition->getSubObjects('crs', false);
88 unset($obj_data["rolf"]);
89 $filter = array_keys($obj_data);
90 $filter[] = 'crs';
91 break;
92 case "il_frm_moderator":
93 $filter[] = 'frm';
94 break;
95 case "il_chat_moderator":
96 $filter[] = 'chtr';
97 break;
98 }
99
100 return $filter;
101 }
102}
Class ilObjRoleTemplate.
__construct(int $a_id=0, bool $a_call_by_reference=false)
getPresentationTitle()
get presentation title Normally same as title Overwritten for sessions
static _getTranslation(string $a_role_title)
Class ilObject Basic functions for all objects.
getUntranslatedTitle()
Get untranslated object title WebDAV needs to access the untranslated title of an object.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc