ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilDidacticTemplateUtils Class Reference

Utilities for didactic templates. More...

+ Collaboration diagram for ilDidacticTemplateUtils:

Static Public Member Functions

static switchTemplate ($a_ref_id, $a_new_tpl_id)
 

Detailed Description

Utilities for didactic templates.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 11 of file class.ilDidacticTemplateUtils.php.

Member Function Documentation

◆ switchTemplate()

static ilDidacticTemplateUtils::switchTemplate (   $a_ref_id,
  $a_new_tpl_id 
)
static

Definition at line 13 of file class.ilDidacticTemplateUtils.php.

14 {
15 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
17 $a_ref_id
18 );
19
20 ilLoggerFactory::getLogger('dtpl')->debug('Current template id: ' . $current_tpl_id);
21
22 // Revert current template
23 if ($current_tpl_id) {
24 ilLoggerFactory::getLogger('dtpl')->debug('Reverting template with id: ' . $current_tpl_id);
25
26 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateActionFactory.php';
28 $action->setRefId($a_ref_id);
29 $action->revert();
30 }
31 }
32
33 include_once './Services/Object/classes/class.ilObjectFactory.php';
35 $obj = $factory->getInstanceByRefId($a_ref_id, false);
36 if ($obj instanceof ilObject) {
37 $obj->applyDidacticTemplate($a_new_tpl_id);
38 }
39 return true;
40 }
$factory
Definition: metadata.php:47
static getActionsByTemplateId($a_tpl_id)
Get actions of one template.
static lookupTemplateId($a_ref_id)
Lookup template id @global ilDB $ilDB.
static getLogger($a_component_id)
Get component logger.
Class ilObjectFactory.
Class ilObject Basic functions for all objects.
$action

References $action, $factory, ilDidacticTemplateActionFactory\getActionsByTemplateId(), ilLoggerFactory\getLogger(), and ilDidacticTemplateObjSettings\lookupTemplateId().

Referenced by ilDidacticTemplateGUI\switchTemplate(), and ilObjGroupGUI\updateGroupTypeObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: