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

Public Member Functions

 getServerId ()
 Get server id. More...
 
 read ()
 Read stored entry. More...
 
 isImportAllowed (array $a_mids)
 Check if import is allowed for scecific mid. More...
 
 getEnabledParticipants ()
 get number of participants that are enabled More...
 
 isEnabled ($a_mid)
 is partivcipant enabled More...
 
 setEnabledParticipants ($a_parts)
 set enabled participants by community More...
 

Static Public Member Functions

static _getInstance ()
 get instance More...
 
static getInstanceByServerId ($a_server_id)
 Get instance by server id. More...
 
static getAvailabeMids ($a_server_id)
 Get all available mids $ilDB. More...
 
static getExportableParticipants ($a_type)
 Get participants which are enabled and export is allowed. More...
 
static getExportServers ()
 Get server ids which allow an export <type> $ilDB. More...
 
static deleteByServer ($a_server_id)
 Delete by server $ilDB. More...
 
static loookupCmsMid ($a_server_id)
 Lookup mid of current cms participant $ilDB. More...
 

Private Member Functions

 __construct ($a_server_id)
 Constructor (Singleton) More...
 

Private Attributes

 $export = array()
 
 $import = array()
 
 $export_type = array()
 

Static Private Attributes

static $instances = null
 

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 32 of file class.ilECSParticipantSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilECSParticipantSettings::__construct (   $a_server_id)
private

Constructor (Singleton)

private

Definition at line 46 of file class.ilECSParticipantSettings.php.

References read().

47  {
48  $this->server_id = $a_server_id;
49  $this->read();
50  }
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilECSParticipantSettings::_getInstance ( )
static

get instance

public

Definition at line 59 of file class.ilECSParticipantSettings.php.

References $GLOBALS.

60  {
61  $GLOBALS['ilLog']->write(__METHOD__.': Using deprecated call');
62  $GLOBALS['ilLog']->logStack();
63  return self::getInstanceByServerId(15);
64  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

◆ deleteByServer()

static ilECSParticipantSettings::deleteByServer (   $a_server_id)
static

Delete by server $ilDB.

Parameters
int$a_server_id

Definition at line 158 of file class.ilECSParticipantSettings.php.

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

159  {
160  global $ilDB;
161 
162  $query = 'DELETE from ecs_part_settings '.
163  'WHERE sid = '.$ilDB->quote($a_server_id,'integer');
164  $ilDB->manipulate($query);
165  }
global $ilDB
+ Here is the caller graph for this function:

◆ getAvailabeMids()

static ilECSParticipantSettings::getAvailabeMids (   $a_server_id)
static

Get all available mids $ilDB.

Parameters
type$a_server_id
Returns
type

Definition at line 86 of file class.ilECSParticipantSettings.php.

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSSettingsGUI\refreshParticipants().

87  {
88  global $ilDB;
89 
90  $query = 'SELECT mid FROM ecs_part_settings '.
91  'WHERE sid = '.$ilDB->quote($a_server_id,'integer');
92  $res = $ilDB->query($query);
93 
94  $mids = array();
95  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
96  {
97  $mids[] = $row->mid;
98  }
99  return $mids;
100  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getEnabledParticipants()

ilECSParticipantSettings::getEnabledParticipants ( )

get number of participants that are enabled

public

Deprecated:

Definition at line 244 of file class.ilECSParticipantSettings.php.

References $ret, array, and export.

245  {
246  $ret = array();
247  foreach($this->export as $mid => $enabled)
248  {
249  if($enabled)
250  {
251  $ret[] = $mid;
252  }
253  }
254  return $ret;
255  #return $this->enabled ? $this->enabled : array();
256  }
Removing first two heading rows for CSV export
Definition: 26utf8.php:79
Create styles array
The data for the language used.
$ret
Definition: parser.php:6

◆ getExportableParticipants()

static ilECSParticipantSettings::getExportableParticipants (   $a_type)
static

Get participants which are enabled and export is allowed.

Definition at line 106 of file class.ilECSParticipantSettings.php.

References $a_type, $counter, $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\addSettingsToForm().

107  {
108  global $ilDB;
109 
110  $query = 'SELECT sid,mid,export_types FROM ecs_part_settings ep '.
111  'JOIN ecs_server es ON ep.sid = es.server_id '.
112  'WHERE export = '.$ilDB->quote(1,'integer').' '.
113  'AND active = '.$ilDB->quote(1,'integer').' '.
114  'ORDER BY cname,es.title';
115 
116  $res = $ilDB->query($query);
117  $mids = array();
118  $counter = 0;
119  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
120  {
121  if(in_array($a_type, (array) unserialize($row->export_types)))
122  {
123  $mids[$counter]['sid'] = $row->sid;
124  $mids[$counter]['mid'] = $row->mid;
125  $counter++;
126  }
127  }
128  return $mids;
129  }
$counter
$a_type
Definition: workflow.php:93
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getExportServers()

static ilECSParticipantSettings::getExportServers ( )
static

Get server ids which allow an export <type> $ilDB.

Returns
<type>

Definition at line 136 of file class.ilECSParticipantSettings.php.

References $ilDB, $query, $res, $row, array, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\handleSettingsUpdate().

137  {
138  global $ilDB;
139 
140  $query = 'SELECT DISTINCT(sid) FROM ecs_part_settings ep '.
141  'JOIN ecs_server es ON ep.sid = es.server_id '.
142  'WHERE export = '.$ilDB->quote(1,'integer').' '.
143  'AND active = '.$ilDB->quote(1,'integer').' ';
144  $res = $ilDB->query($query);
145  $sids = array();
146  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
147  {
148  $sids[] = $row->sid;
149  }
150  return $sids;
151  }
Create styles array
The data for the language used.
global $ilDB
+ Here is the caller graph for this function:

◆ getInstanceByServerId()

static ilECSParticipantSettings::getInstanceByServerId (   $a_server_id)
static

Get instance by server id.

Parameters
int$a_server_id
Returns
ilECSParticipantSettings

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

Referenced by ilECSCommunityReader\getEnabledParticipants(), and ilRemoteObjectBase\handleUpdate().

72  {
73  if(isset(self::$instances[$a_server_id]))
74  {
75  return self::$instances[$a_server_id];
76  }
77  return self::$instances[$a_server_id] = new ilECSParticipantSettings($a_server_id);
78  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSParticipantSettings::getServerId ( )

Get server id.

Returns
int

Definition at line 193 of file class.ilECSParticipantSettings.php.

Referenced by read().

194  {
195  return $this->server_id;
196  }
+ Here is the caller graph for this function:

◆ isEnabled()

ilECSParticipantSettings::isEnabled (   $a_mid)

is partivcipant enabled

public

Parameters
intmid
Deprecated:

Definition at line 266 of file class.ilECSParticipantSettings.php.

References export.

267  {
268  return $this->export[$a_mid] ? true : false;
269  }
Removing first two heading rows for CSV export
Definition: 26utf8.php:79

◆ isImportAllowed()

ilECSParticipantSettings::isImportAllowed ( array  $a_mids)

Check if import is allowed for scecific mid.

Parameters
array$a_mids
Returns
<type>

Definition at line 226 of file class.ilECSParticipantSettings.php.

227  {
228  foreach($a_mids as $mid)
229  {
230  if($this->import[$mid])
231  {
232  return true;
233  }
234  }
235  return false;
236  }

◆ loookupCmsMid()

static ilECSParticipantSettings::loookupCmsMid (   $a_server_id)
static

Lookup mid of current cms participant $ilDB.

Parameters
int$a_server_id

Definition at line 172 of file class.ilECSParticipantSettings.php.

References $ilDB, $query, $res, $row, ilDBConstants\FETCHMODE_OBJECT, and ilECSParticipantSetting\IMPORT_CMS.

Referenced by ilECSCmsTreeCommandQueueHandler\init(), and ilECSMappingSettingsGUI\setTabs().

173  {
174  global $ilDB;
175 
176  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
177 
178  $query = 'SELECT mid FROM ecs_part_settings '.
179  'WHERE sid = '.$ilDB->quote($a_server_id,'integer').' '.
180  'AND import_type = '.$ilDB->quote(ilECSParticipantSetting::IMPORT_CMS);
181  $res = $ilDB->query($query);
182  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
183  {
184  return $row->mid;
185  }
186  return 0;
187  }
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilECSParticipantSettings::read ( )

Read stored entry.

Returns
<type>

Definition at line 203 of file class.ilECSParticipantSettings.php.

References $ilDB, $query, $res, $row, array, export, ilDBConstants\FETCHMODE_OBJECT, and getServerId().

Referenced by __construct().

204  {
205  global $ilDB;
206 
207  $query = 'SELECT * FROM ecs_part_settings '.
208  'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' ';
209  $res = $ilDB->query($query);
210  while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
211  {
212  $this->export[$row->mid] = $row->export;
213  $this->import[$row->mid] = $row->import;
214  $this->import_type[$row->mid] = $row->import_type;
215  $this->export_types[$row->mid] = (array) unserialize($row->export_types);
216  $this->import_types[$row->mid] = (array) unserialize($row->import_types);
217  }
218  return true;
219  }
Removing first two heading rows for CSV export
Definition: 26utf8.php:79
Create styles array
The data for the language used.
global $ilDB
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEnabledParticipants()

ilECSParticipantSettings::setEnabledParticipants (   $a_parts)

set enabled participants by community

public

Parameters
intcommunity id
arrayparticipant ids

Definition at line 278 of file class.ilECSParticipantSettings.php.

References array.

279  {
280  $this->enabled = (array) $a_parts;
281  }
Create styles array
The data for the language used.

Field Documentation

◆ $export

ilECSParticipantSettings::$export = array()
private

Definition at line 36 of file class.ilECSParticipantSettings.php.

◆ $export_type

ilECSParticipantSettings::$export_type = array()
private

Definition at line 38 of file class.ilECSParticipantSettings.php.

◆ $import

ilECSParticipantSettings::$import = array()
private

Definition at line 37 of file class.ilECSParticipantSettings.php.

◆ $instances

ilECSParticipantSettings::$instances = null
staticprivate

Definition at line 34 of file class.ilECSParticipantSettings.php.


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