ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDidacticTemplateSettings Class Reference
+ Collaboration diagram for ilDidacticTemplateSettings:

Public Member Functions

 getTemplates ()
 Get templates. More...
 
 getObjectType ()
 Get object type. More...
 
 readInactive ()
 Read disabled templates. More...
 

Static Public Member Functions

static getInstance ()
 Get singelton instance. More...
 
static getInstanceByObjectType ($a_obj_type)
 Get instance by obj type. More...
 

Protected Member Functions

 read ()
 Read active didactic templates ilDB $ilDB. More...
 

Private Member Functions

 __construct ($a_obj_type='')
 Constructor. More...
 

Private Attributes

 $templates = array()
 
 $obj_type = ''
 

Static Private Attributes

static $instance = null
 
static $instances = null
 

Detailed Description

Definition at line 12 of file class.ilDidacticTemplateSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilDidacticTemplateSettings::__construct (   $a_obj_type = '')
private

Constructor.

Parameters
int$a_id

Definition at line 25 of file class.ilDidacticTemplateSettings.php.

References read().

26  {
27  $this->obj_type = $a_obj_type;
28  $this->read();
29  }
read()
Read active didactic templates ilDB $ilDB.
+ Here is the call graph for this function:

Member Function Documentation

◆ getInstance()

static ilDidacticTemplateSettings::getInstance ( )
static

Get singelton instance.

Returns
ilDidacticTemplateSettings

Definition at line 35 of file class.ilDidacticTemplateSettings.php.

Referenced by ilDidacticTemplateSettingsTableGUI\parse().

36  {
37  if(self::$instance)
38  {
39  return self::$instance;
40  }
41  return self::$instance = new ilDidacticTemplateSettings();
42  }
+ Here is the caller graph for this function:

◆ getInstanceByObjectType()

static ilDidacticTemplateSettings::getInstanceByObjectType (   $a_obj_type)
static

Get instance by obj type.

Parameters
string$a_obj_type
Returns
ilDidacticTemplateSettings

Definition at line 49 of file class.ilDidacticTemplateSettings.php.

Referenced by ilDidacticTemplateGUI\appendToolbarSwitch(), and ilObjectGUI\initDidacticTemplate().

50  {
51  if(self::$instances[$a_obj_type])
52  {
53  return self::$instances[$a_obj_type];
54  }
55  return self::$instances[$a_obj_type] = new ilDidacticTemplateSettings($a_obj_type);
56  }
+ Here is the caller graph for this function:

◆ getObjectType()

ilDidacticTemplateSettings::getObjectType ( )

Get object type.

Returns
string

Definition at line 71 of file class.ilDidacticTemplateSettings.php.

References $obj_type.

Referenced by read(), and readInactive().

+ Here is the caller graph for this function:

◆ getTemplates()

ilDidacticTemplateSettings::getTemplates ( )

Get templates.

Returns
ilDidacticTemplateSetting[]

Definition at line 62 of file class.ilDidacticTemplateSettings.php.

References $templates, and array.

63  {
64  return (array) $this->templates;
65  }
Create styles array
The data for the language used.

◆ read()

ilDidacticTemplateSettings::read ( )
protected

Read active didactic templates ilDB $ilDB.

Returns
bool

Definition at line 110 of file class.ilDidacticTemplateSettings.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and getObjectType().

Referenced by __construct().

111  {
112  global $ilDB;
113 
114  $query = 'SELECT dtpl.id FROM didactic_tpl_settings dtpl ';
115 
116  if($this->getObjectType())
117  {
118  $query .= 'JOIN didactic_tpl_sa tplsa ON dtpl.id = tplsa.id ';
119  }
120  $query .= 'WHERE enabled = '.$ilDB->quote(1,'integer').' ';
121 
122  if($this->getObjectType())
123  {
124  $query .= 'AND obj_type = '.$ilDB->quote($this->getObjectType(),'text');
125  }
126 
127  $res = $ilDB->query($query);
128  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
129  {
130  $this->templates[$row->id] = new ilDidacticTemplateSetting($row->id);
131  }
132  return true;
133  }
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readInactive()

ilDidacticTemplateSettings::readInactive ( )

Read disabled templates.

Definition at line 79 of file class.ilDidacticTemplateSettings.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and getObjectType().

80  {
81 
82  global $ilDB;
83 
84  $query = 'SELECT dtpl.id FROM didactic_tpl_settings dtpl ';
85 
86  if($this->getObjectType())
87  {
88  $query .= 'JOIN didactic_tpl_sa tplsa ON dtpl.id = tplsa.id ';
89  }
90  $query .= 'WHERE enabled = '.$ilDB->quote(0,'integer').' ';
91 
92  if($this->getObjectType())
93  {
94  $query .= 'AND obj_type = '.$ilDB->quote($this->getObjectType(),'text');
95  }
96 
97  $res = $ilDB->query($query);
98  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
99  {
100  $this->templates[$row->id] = new ilDidacticTemplateSetting($row->id);
101  }
102  return true;
103  }
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $instance

ilDidacticTemplateSettings::$instance = null
staticprivate

Definition at line 14 of file class.ilDidacticTemplateSettings.php.

◆ $instances

ilDidacticTemplateSettings::$instances = null
staticprivate

Definition at line 15 of file class.ilDidacticTemplateSettings.php.

◆ $obj_type

ilDidacticTemplateSettings::$obj_type = ''
private

Definition at line 19 of file class.ilDidacticTemplateSettings.php.

Referenced by getObjectType().

◆ $templates

ilDidacticTemplateSettings::$templates = array()
private

Definition at line 18 of file class.ilDidacticTemplateSettings.php.

Referenced by getTemplates().


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