ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExportUserSettings Class Reference
+ Collaboration diagram for ilExportUserSettings:

Public Member Functions

 __construct ($a_user_id, $a_obj_id)
 Constructor.
 set ($a_data)
 Set Settings.
 enabled ($a_option)
 Check if a specific option is enabled.
 getOrderedExportableFields ()
 Get ordered enabled fields.
 store ()
 Store settings in DB.

Static Public Member Functions

static _delete ($a_usr_id)
 Delete user related data.

Private Member Functions

 read ()
 Read store settings.

Private Attributes

 $db
 $user_id
 $obj_id
 $settings = array()

Detailed Description

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
$Id$

/

Definition at line 31 of file class.ilExportUserSettings.php.

Constructor & Destructor Documentation

ilExportUserSettings::__construct (   $a_user_id,
  $a_obj_id 
)

Constructor.

public

Definition at line 44 of file class.ilExportUserSettings.php.

References $ilDB, and read().

{
global $ilDB;
$this->user_id = $a_user_id;
$this->obj_id = $a_obj_id;
$this->db = $ilDB;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilExportUserSettings::_delete (   $a_usr_id)
static

Delete user related data.

public

Definition at line 61 of file class.ilExportUserSettings.php.

References $ilDB, and $query.

{
global $ilDB;
$query = "DELETE FROM member_export_settings WHERE user_id = ".$ilDB->quote($a_usr_id);
$ilDB->query($query);
return true;
}
ilExportUserSettings::enabled (   $a_option)

Check if a specific option is enabled.

public

Parameters
strinoption

Definition at line 89 of file class.ilExportUserSettings.php.

Referenced by getOrderedExportableFields().

{
if(array_key_exists($a_option,(array) $this->settings) and $this->settings[$a_option])
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilExportUserSettings::getOrderedExportableFields ( )

Get ordered enabled fields.

public

Parameters

Definition at line 105 of file class.ilExportUserSettings.php.

References ilCourseDefinedFieldDefinition\_getFields(), ilUserDefinedFields\_getInstance(), ilExportFieldsInfo\_getInstance(), ilPrivacySettings\_getInstance(), ilCourseDefinedFieldDefinition\_hasFields(), and enabled().

{
include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
include_once('Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
include_once('Services/User/classes/class.ilUserDefinedFields.php');
$fields[] = 'role';
// Append agreement info
if($privacy->confirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->obj_id))
{
$fields[] = 'agreement';
}
foreach($field_info->getExportableFields() as $field)
{
if($this->enabled($field))
{
$fields[] = $field;
}
}
foreach($udf->getCourseExportableFields() as $field_id => $udf_data)
{
$fields[] = 'udf_'.$field_id;
}
// Add course specific fields
foreach(ilCourseDefinedFieldDefinition::_getFields($this->obj_id) as $field_obj)
{
if($this->enabled('cdf_'.$field_obj->getId()))
{
$fields[] = 'cdf_'.$field_obj->getId();
}
}
return $fields ? $fields : array();
}

+ Here is the call graph for this function:

ilExportUserSettings::read ( )
private

Read store settings.

private

Parameters

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

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

Referenced by __construct(), and store().

{
$query = "SELECT * FROM member_usr_settings WHERE user_id = ".$this->db->quote($this->user_id ,'integer');
$res = $this->db->query($query);
$this->settings = array();
if($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->settings = unserialize($row->settings);
}
return true;
}

+ Here is the caller graph for this function:

ilExportUserSettings::set (   $a_data)

Set Settings.

public

Parameters
arrayArray of Settings

Definition at line 77 of file class.ilExportUserSettings.php.

Referenced by ilMemberExportGUI\export().

{
$this->settings = $a_data;
}

+ Here is the caller graph for this function:

ilExportUserSettings::store ( )

Store settings in DB.

public

Definition at line 153 of file class.ilExportUserSettings.php.

References $ilDB, $query, $res, and read().

{
global $ilDB;
$query = "DELETE FROM member_usr_settings WHERE user_id = ".$this->db->quote($this->user_id ,'integer');
$res = $ilDB->manipulate($query);
$query = "INSERT INTO member_usr_settings (user_id,settings) ".
"VALUES( ".
$this->db->quote($this->user_id ,'integer').", ".
$ilDB->quote(serialize($this->settings) ,'text')." ".
")";
$res = $ilDB->manipulate($query);
$this->read();
}

+ Here is the call graph for this function:

Field Documentation

ilExportUserSettings::$db
private

Definition at line 33 of file class.ilExportUserSettings.php.

ilExportUserSettings::$obj_id
private

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

ilExportUserSettings::$settings = array()
private

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

ilExportUserSettings::$user_id
private

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


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