40 $this->logger =
$GLOBALS[
'DIC']->logger()->otpl();
70 $this->action_id = $a_action_id;
80 $this->type = $a_type_id;
89 $this->tpl_id = $a_id;
108 $this->ref_id = $a_ref_id;
134 $this->
setActionId($ilDB->nextId(
'didactic_tpl_a'));
135 $query =
'INSERT INTO didactic_tpl_a (id, tpl_id, type_id) '.
139 $ilDB->quote($this->
getType(),
'integer').
141 $ilDB->manipulate($query);
151 public function delete()
155 $query =
'DELETE FROM didactic_tpl_a '.
156 'WHERE id = '.$ilDB->quote($this->
getActionId(),
'integer');
157 $ilDB->manipulate(
$query);
168 $query =
'SELECT * FROM didactic_tpl_a '.
169 'WHERE id = '.$ilDB->quote($this->
getActionId(),
'integer');
182 abstract public function getType();
189 abstract public function apply();
196 abstract public function revert();
221 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
234 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateFilterPatternFactory.php';
237 self::PATTERN_PARENT_TYPE
241 foreach($rbacreview->getParentRoleIds($source->
getRefId()) as $role_id => $role)
243 switch($this->getFilterType())
245 case self::FILTER_PARENT_ROLES:
249 ($role[
'parent'] == $source->
getRefId()) &&
250 ($role[
'assign'] ==
'y')
256 foreach($patterns as $pattern)
261 $filtered[$role_id] = $role;
267 case self::FILTER_SOURCE_TITLE:
268 foreach($patterns as $pattern)
273 $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
Class ilObject Basic functions for all objects.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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.
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.
Create styles array
The data for the language used.
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.