ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilECSParticipantSettings Class Reference
+ Collaboration diagram for ilECSParticipantSettings:

Public Member Functions

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

Static Public Member Functions

static _getInstance ()
 get instance
static getInstanceByServerId ($a_server_id)
 Get instance by server id.
static getExportableParticipants ()
 Get participants which are enabled and export is allowed.
static getExportServers ()
 Get server ids which allow an export <type> $ilDB.
static deleteByServer ($a_server_id)
 Delete by server $ilDB.

Private Member Functions

 __construct ($a_server_id)
 Constructor (Singleton)

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

ilECSParticipantSettings::__construct (   $a_server_id)
private

Constructor (Singleton)

private

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

References read().

{
$this->server_id = $a_server_id;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilECSParticipantSettings::_getInstance ( )
static

get instance

public

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

References $GLOBALS, and getInstanceByServerId().

{
$GLOBALS['ilLog']->write(__METHOD__.': Using deprecated call');
$GLOBALS['ilLog']->logStack();
}

+ Here is the call graph for this function:

static ilECSParticipantSettings::deleteByServer (   $a_server_id)
static

Delete by server $ilDB.

Parameters
int$a_server_id

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

References $ilDB, and $query.

Referenced by ilECSSettingsGUI\doDelete().

{
global $ilDB;
$query = 'DELETE from ecs_part_settings '.
'WHERE sid = '.$ilDB->quote($a_server_id,'integer');
$ilDB->manipulate($query);
}

+ Here is the caller graph for this function:

ilECSParticipantSettings::getEnabledParticipants ( )

get number of participants that are enabled

public

Deprecated:

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

References $ret.

{
$ret = array();
foreach($this->export as $mid => $enabled)
{
if($enabled)
{
$ret[] = $mid;
}
}
return $ret;
#return $this->enabled ? $this->enabled : array();
}
static ilECSParticipantSettings::getExportableParticipants ( )
static

Get participants which are enabled and export is allowed.

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjCourseGUI\fillECSExportSettings().

{
global $ilDB;
$query = 'SELECT sid,mid FROM ecs_part_settings ep '.
'JOIN ecs_server es ON ep.sid = es.server_id '.
'WHERE export = '.$ilDB->quote(1,'integer').' '.
'AND active = '.$ilDB->quote(1,'integer').' '.
'ORDER BY cname,es.title';
$res = $ilDB->query($query);
$mids = array();
$counter = 0;
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$mids[$counter]['sid'] = $row->sid;
$mids[$counter]['mid'] = $row->mid;
$counter++;
}
return $mids;
}

+ Here is the caller graph for this function:

static ilECSParticipantSettings::getExportServers ( )
static

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

Returns
<type>

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

References $ilDB, $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjCourseGUI\updateECSExportSettings().

{
global $ilDB;
$query = 'SELECT DISTINCT(sid) FROM ecs_part_settings ep '.
'JOIN ecs_server es ON ep.sid = es.server_id '.
'WHERE export = '.$ilDB->quote(1,'integer').' '.
'AND active = '.$ilDB->quote(1,'integer').' ';
$res = $ilDB->query($query);
$sids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$sids[] = $row->sid;
}
return $sids;
}

+ Here is the caller graph for this function:

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 _getInstance(), and ilECSTaskScheduler\handleUpdate().

{
if(isset(self::$instances[$a_server_id]))
{
return self::$instances[$a_server_id];
}
return self::$instances[$a_server_id] = new ilECSParticipantSettings($a_server_id);
}

+ Here is the caller graph for this function:

ilECSParticipantSettings::getServerId ( )

Get server id.

Returns
int

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

Referenced by read().

{
return $this->server_id;
}

+ Here is the caller graph for this function:

ilECSParticipantSettings::isEnabled (   $a_mid)

is partivcipant enabled

public

Parameters
intmid
Deprecated:

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

{
return $this->export[$a_mid] ? true : false;
}
ilECSParticipantSettings::isImportAllowed (   $a_mid)

Check if import is allowed for scecific mid.

Parameters
<type>$a_mid
Returns
<type>

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

{
return $this->import[$a_mid] ? true : false;
}
ilECSParticipantSettings::read ( )

Read stored entry.

Returns
<type>

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

References $ilDB, $query, $res, $row, DB_FETCHMODE_OBJECT, and getServerId().

Referenced by __construct().

{
global $ilDB;
$query = 'SELECT * FROM ecs_part_settings '.
'WHERE sid = '.$ilDB->quote($this->getServerId(),'integer').' ';
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->export[$row->mid] = $row->export;
$this->import[$row->mid] = $row->import;
$this->import_type[$row->mid] = $row->import_type;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilECSParticipantSettings::setEnabledParticipants (   $a_parts)

set enabled participants by community

public

Parameters
intcommunity id
arrayparticipant ids

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

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

Field Documentation

ilECSParticipantSettings::$export = array()
private

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

ilECSParticipantSettings::$export_type = array()
private

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

ilECSParticipantSettings::$import = array()
private

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

ilECSParticipantSettings::$instances = null
staticprivate

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


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