43 $this->logger = $DIC->logger()->otpl();
73 $this->action_id = $a_action_id;
83 $this->type = $a_type_id;
92 $this->tpl_id = $a_id;
111 $this->ref_id = $a_ref_id;
132 $ilDB = $DIC[
'ilDB'];
139 $query =
'INSERT INTO didactic_tpl_a (id, tpl_id, type_id) ' .
145 $ilDB->manipulate($query);
155 public function delete()
159 $ilDB = $DIC[
'ilDB'];
161 $query =
'DELETE FROM didactic_tpl_a ' .
174 $ilDB = $DIC[
'ilDB'];
176 $query =
'SELECT * FROM didactic_tpl_a ' .
189 abstract public function getType();
196 abstract public function apply();
203 abstract public function revert();
228 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
241 $rbacreview = $DIC[
'rbacreview'];
243 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
246 self::PATTERN_PARENT_TYPE
250 foreach ($rbacreview->getParentRoleIds($source->
getRefId()) as $role_id => $role) {
251 switch ($this->getFilterType()) {
252 case self::FILTER_PARENT_ROLES:
256 ($role[
'parent'] == $source->
getRefId()) &&
257 ($role[
'assign'] ==
'y')
262 foreach ($patterns as $pattern) {
265 $filtered[$role_id] = $role;
270 case self::FILTER_LOCAL_ROLES:
273 $role[
'parent'] != $source->
getRefId() ||
274 $role[
'assign'] ==
'n' 276 $this->logger->debug(
'Excluding non local role' . $role[
'title']);
279 foreach ($patterns as $pattern) {
282 $filtered[$role_id] = $role;
288 case self::FILTER_SOURCE_TITLE:
289 foreach ($patterns as $pattern) {
292 $filtered[$role_id] = $role;
const FILTER_PARENT_ROLES
static lookupPatternsByParentId($a_parent_id, $a_parent_type)
Get patterns by template id.
save()
write action to db overwrite for filling additional db fields
static _lookupTitle($a_id)
lookup object title
setTemplateId($a_id)
Set template id.
__construct($action_id=0)
Constructor.
filterRoles(ilObject $source)
Filter roles.
getType()
Get type of template.
foreach($_POST as $key=> $value) $res
const PATTERN_PARENT_TYPE
const FILTER_SOURCE_OBJ_ID
getTemplateId()
Get template id.
getRefId()
Get ref id of target object.
setRefId($a_ref_id)
Set ref id of target object.
initSourceObject()
Init the source object.
setType($a_type_id)
Set type id.
Abstract class for template actions.
getRefId()
get reference id public
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static getLogger($a_component_id)
Get component logger.
setActionId($a_action_id)
Set action id.
const FILTER_SOURCE_TITLE
toXml(ilXmlWriter $writer)
Write xml for export.
revert()
Implement everthing that is necessary to revert a didactic template.
getActionId()
Get action id.