ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDidacticTemplateActionFactory.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateAction.php';
5 
13 {
19  public static function factoryByType($a_action_type)
20  {
21  switch ($a_action_type) {
23  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalPolicyAction.php';
25 
27  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalRoleAction.php';
29 
31  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateBlockRoleAction.php';
33  }
34  }
35 
36 
43  public static function factoryByTypeAndId($a_action_id, $a_action_type)
44  {
45  switch ($a_action_type) {
47  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalPolicyAction.php';
48  return new ilDidacticTemplateLocalPolicyAction($a_action_id);
49 
51  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateLocalRoleAction.php';
52  return new ilDidacticTemplateLocalRoleAction($a_action_id);
53 
55  include_once './Services/DidacticTemplate/classes/class.ilDidacticTemplateBlockRoleAction.php';
56  return new ilDidacticTemplateBlockRoleAction($a_action_id);
57  }
58  }
59 
60 
65  public static function getActionsByTemplateId($a_tpl_id)
66  {
67  global $ilDB;
68 
69  $query = 'SELECT id, type_id FROM didactic_tpl_a ' .
70  'WHERE tpl_id = ' . $ilDB->quote($a_tpl_id, 'integer');
71  $res = $ilDB->query($query);
72 
73  $actions = array();
74  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
75  $actions[] = self::factoryByTypeAndId($row->id, $row->type_id);
76  }
77  return (array) $actions;
78  }
79 }
static factoryByTypeAndId($a_action_id, $a_action_type)
Get instance by id and type.
Description of ilDidacticTemplateBlockRoleAction.
Factory for didactic template actions.
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
represents a creation of local roles action
global $ilDB
static getActionsByTemplateId($a_tpl_id)
Get actions of one template.
static factoryByType($a_action_type)
Get action class by type.