ILIAS  Release_5_0_x_branch Revision 61816
 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 (array $a_mids)
 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 getAvailabeMids ($a_server_id)
 Get all available mids $ilDB.
static getExportableParticipants ($a_type)
 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.
static loookupCmsMid ($a_server_id)
 Lookup mid of current cms participant $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 158 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:

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, and DB_FETCHMODE_OBJECT.

Referenced by ilECSSettingsGUI\refreshParticipants().

{
global $ilDB;
$query = 'SELECT mid FROM ecs_part_settings '.
'WHERE sid = '.$ilDB->quote($a_server_id,'integer');
$res = $ilDB->query($query);
$mids = array();
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$mids[] = $row->mid;
}
return $mids;
}

+ Here is the caller graph for this function:

ilECSParticipantSettings::getEnabledParticipants ( )

get number of participants that are enabled

public

Deprecated:

Definition at line 244 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 (   $a_type)
static

Get participants which are enabled and export is allowed.

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

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

Referenced by ilECSObjectSettings\addSettingsToForm().

{
global $ilDB;
$query = 'SELECT sid,mid,export_types 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))
{
if(in_array($a_type, (array) unserialize($row->export_types)))
{
$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 136 of file class.ilECSParticipantSettings.php.

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

Referenced by ilECSObjectSettings\handleSettingsUpdate().

{
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 ilRemoteObjectBase\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 193 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 266 of file class.ilECSParticipantSettings.php.

{
return $this->export[$a_mid] ? true : false;
}
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.

{
foreach($a_mids as $mid)
{
if($this->import[$mid])
{
return true;
}
}
return false;
}
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, DB_FETCHMODE_OBJECT, and ilECSParticipantSetting\IMPORT_CMS.

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

{
global $ilDB;
include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
$query = 'SELECT mid FROM ecs_part_settings '.
'WHERE sid = '.$ilDB->quote($a_server_id,'integer').' '.
'AND import_type = '.$ilDB->quote(ilECSParticipantSetting::IMPORT_CMS);
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->mid;
}
return 0;
}

+ Here is the caller graph for this function:

ilECSParticipantSettings::read ( )

Read stored entry.

Returns
<type>

Definition at line 203 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;
$this->export_types[$row->mid] = (array) unserialize($row->export_types);
$this->import_types[$row->mid] = (array) unserialize($row->import_types);
}
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 278 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: