ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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['DIC']['ilLog']->write(__METHOD__ . ': Using deprecated call');
62  $GLOBALS['DIC']['ilLog']->logStack();
63  return self::getInstanceByServerId(15);
64  }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

◆ deleteByServer()

static ilECSParticipantSettings::deleteByServer (   $a_server_id)
static

Delete by server $ilDB.

Parameters
int$a_server_id

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

References $DIC, $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

160  {
161  global $DIC;
162 
163  $ilDB = $DIC['ilDB'];
164 
165  $query = 'DELETE from ecs_part_settings ' .
166  'WHERE sid = ' . $ilDB->quote($a_server_id, 'integer');
167  $ilDB->manipulate($query);
168  }
global $DIC
Definition: saml.php:7
$query
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 85 of file class.ilECSParticipantSettings.php.

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

Referenced by ilECSSettingsGUI\refreshParticipants().

86  {
87  global $DIC;
88 
89  $ilDB = $DIC['ilDB'];
90 
91  $query = 'SELECT mid FROM ecs_part_settings ' .
92  'WHERE sid = ' . $ilDB->quote($a_server_id, 'integer');
93  $res = $ilDB->query($query);
94 
95  $mids = array();
96  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
97  $mids[] = $row->mid;
98  }
99  return $mids;
100  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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 247 of file class.ilECSParticipantSettings.php.

References $ret.

248  {
249  $ret = array();
250  foreach ($this->export as $mid => $enabled) {
251  if ($enabled) {
252  $ret[] = $mid;
253  }
254  }
255  return $ret;
256  #return $this->enabled ? $this->enabled : array();
257  }
$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, $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\addSettingsToForm().

107  {
108  global $DIC;
109 
110  $ilDB = $DIC['ilDB'];
111 
112  $query = 'SELECT sid,mid,export_types FROM ecs_part_settings ep ' .
113  'JOIN ecs_server es ON ep.sid = es.server_id ' .
114  'WHERE export = ' . $ilDB->quote(1, 'integer') . ' ' .
115  'AND active = ' . $ilDB->quote(1, 'integer') . ' ' .
116  'ORDER BY cname,es.title';
117 
118  $res = $ilDB->query($query);
119  $mids = array();
120  $counter = 0;
121  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
122  if (in_array($a_type, (array) unserialize($row->export_types))) {
123  $mids[$counter]['sid'] = $row->sid;
124  $mids[$counter]['mid'] = $row->mid;
125  $counter++;
126  }
127  }
128  return $mids;
129  }
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92
foreach($_POST as $key=> $value) $res
$query
$row
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 $DIC, $ilDB, $query, $res, $row, and ilDBConstants\FETCHMODE_OBJECT.

Referenced by ilECSObjectSettings\handleSettingsUpdate().

137  {
138  global $DIC;
139 
140  $ilDB = $DIC['ilDB'];
141 
142  $query = 'SELECT DISTINCT(sid) FROM ecs_part_settings ep ' .
143  'JOIN ecs_server es ON ep.sid = es.server_id ' .
144  'WHERE export = ' . $ilDB->quote(1, 'integer') . ' ' .
145  'AND active = ' . $ilDB->quote(1, 'integer') . ' ';
146  $res = $ilDB->query($query);
147  $sids = array();
148  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
149  $sids[] = $row->sid;
150  }
151  return $sids;
152  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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  return self::$instances[$a_server_id];
75  }
76  return self::$instances[$a_server_id] = new ilECSParticipantSettings($a_server_id);
77  }
+ Here is the caller graph for this function:

◆ getServerId()

ilECSParticipantSettings::getServerId ( )

Get server id.

Returns
int

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

Referenced by read().

198  {
199  return $this->server_id;
200  }
+ Here is the caller graph for this function:

◆ isEnabled()

ilECSParticipantSettings::isEnabled (   $a_mid)

is partivcipant enabled

public

Parameters
intmid
Deprecated:

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

268  {
269  return $this->export[$a_mid] ? true : false;
270  }

◆ isImportAllowed()

ilECSParticipantSettings::isImportAllowed ( array  $a_mids)

Check if import is allowed for scecific mid.

Parameters
array$a_mids
Returns
<type>

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

232  {
233  foreach ($a_mids as $mid) {
234  if ($this->import[$mid]) {
235  return true;
236  }
237  }
238  return false;
239  }

◆ loookupCmsMid()

static ilECSParticipantSettings::loookupCmsMid (   $a_server_id)
static

Lookup mid of current cms participant $ilDB.

Parameters
int$a_server_id

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

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

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

176  {
177  global $DIC;
178 
179  $ilDB = $DIC['ilDB'];
180 
181  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
182 
183  $query = 'SELECT mid FROM ecs_part_settings ' .
184  'WHERE sid = ' . $ilDB->quote($a_server_id, 'integer') . ' ' .
185  'AND import_type = ' . $ilDB->quote(ilECSParticipantSetting::IMPORT_CMS);
186  $res = $ilDB->query($query);
187  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
188  return $row->mid;
189  }
190  return 0;
191  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
global $ilDB
+ Here is the caller graph for this function:

◆ read()

ilECSParticipantSettings::read ( )

Read stored entry.

Returns
<type>

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

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

Referenced by __construct().

208  {
209  global $DIC;
210 
211  $ilDB = $DIC['ilDB'];
212 
213  $query = 'SELECT * FROM ecs_part_settings ' .
214  'WHERE sid = ' . $ilDB->quote($this->getServerId(), 'integer') . ' ';
215  $res = $ilDB->query($query);
216  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
217  $this->export[$row->mid] = $row->export;
218  $this->import[$row->mid] = $row->import;
219  $this->import_type[$row->mid] = $row->import_type;
220  $this->export_types[$row->mid] = (array) unserialize($row->export_types);
221  $this->import_types[$row->mid] = (array) unserialize($row->import_types);
222  }
223  return true;
224  }
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
$query
$row
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 279 of file class.ilECSParticipantSettings.php.

280  {
281  $this->enabled = (array) $a_parts;
282  }

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: