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

Public Member Functions

 ilLPObjSettings ($a_obj_id)
 cloneSettings ($a_new_obj_id)
 Clone settings.
 getVisits ()
 setVisits ($a_visits)
 setMode ($a_mode)
 getMode ()
 getObjId ()
 getObjType ()
 __read ()
 update ($a_refresh_lp=true)
 insert ()
 _delete ($a_obj_id)
 _lookupVisits ($a_obj_id)

Static Public Member Functions

static _lookupDBModeForObjects (array $a_obj_ids)
static _lookupDBMode ($a_obj_id)
static _mode2Text ($a_mode)
static _mode2InfoText ($a_mode)

Data Fields

 $db = null
 $obj_id = null
 $obj_type = null
 $obj_mode = null
 $visits = null
 $is_stored = false
const LP_MODE_DEACTIVATED = 0
const LP_MODE_TLT = 1
const LP_MODE_VISITS = 2
const LP_MODE_MANUAL = 3
const LP_MODE_OBJECTIVES = 4
const LP_MODE_COLLECTION = 5
const LP_MODE_SCORM = 6
const LP_MODE_TEST_FINISHED = 7
const LP_MODE_TEST_PASSED = 8
const LP_MODE_EXERCISE_RETURNED = 9
const LP_MODE_EVENT = 10
const LP_MODE_MANUAL_BY_TUTOR = 11
const LP_MODE_SCORM_PACKAGE = 12
const LP_MODE_UNDEFINED = 13
const LP_MODE_PLUGIN = 14
const LP_MODE_COLLECTION_TLT = 15
const LP_MODE_COLLECTION_MANUAL = 16
const LP_DEFAULT_VISITS = 30

Protected Member Functions

 doLPRefresh ()

Detailed Description

Definition at line 14 of file class.ilLPObjSettings.php.

Member Function Documentation

ilLPObjSettings::__read ( )

Definition at line 114 of file class.ilLPObjSettings.php.

References $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilLPObjSettings(), insert(), and update().

{
$res = $this->db->query("SELECT * FROM ut_lp_settings WHERE obj_id = ".
$this->db->quote($this->obj_id ,'integer'));
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->is_stored = true;
$this->obj_type = $row->obj_type;
$this->obj_mode = $row->u_mode;
$this->visits = $row->visits;
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilLPObjSettings::_delete (   $a_obj_id)

Definition at line 181 of file class.ilLPObjSettings.php.

References $query, and $res.

{
global $ilDB;
$query = "DELETE FROM ut_lp_settings WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->manipulate($query);
return true;
}
static ilLPObjSettings::_lookupDBMode (   $a_obj_id)
static

Definition at line 228 of file class.ilLPObjSettings.php.

References $query, and $row.

Referenced by ilObjectLP\getCurrentMode().

{
global $ilDB;
// this does NOT handle default mode!
$query = "SELECT u_mode FROM ut_lp_settings".
" WHERE obj_id = ".$ilDB->quote($a_obj_id, "integer");
$set = $ilDB->query($query);
$row = $ilDB->fetchAssoc($set);
if(is_array($row))
{
return $row['u_mode'];
}
}

+ Here is the caller graph for this function:

static ilLPObjSettings::_lookupDBModeForObjects ( array  $a_obj_ids)
static

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

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

Referenced by ilLPStatus\preloadListGUIData().

{
global $ilDB;
// this does NOT handle default mode!
$res = array();
$query = "SELECT obj_id, u_mode FROM ut_lp_settings".
" WHERE ".$ilDB->in("obj_id", $a_obj_ids, "", "integer");
$set = $ilDB->query($query);
while($row = $set->fetchRow(DB_FETCHMODE_OBJECT))
{
$res[$row->obj_id] = $row->u_mode;
}
return $res;
}

+ Here is the caller graph for this function:

ilLPObjSettings::_lookupVisits (   $a_obj_id)

Definition at line 194 of file class.ilLPObjSettings.php.

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

Referenced by ilLearningProgressBaseGUI\__readItemStatusInfo(), ilLearningProgressBaseGUI\__showObjectDetails(), ilLPStatusVisits\_getStatusInfo(), and ilLPStatusVisits\determinePercentage().

{
global $ilDB;
$query = "SELECT visits FROM ut_lp_settings ".
"WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer');
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->visits;
}
}

+ Here is the caller graph for this function:

static ilLPObjSettings::_mode2InfoText (   $a_mode)
static

Definition at line 300 of file class.ilLPObjSettings.php.

References $lng, and ilObjUserTracking\_getValidTimeSpan().

Referenced by ilObjectLP\getModeInfoText().

{
global $lng;
switch($a_mode)
{
case self::LP_MODE_DEACTIVATED:
return $lng->txt('trac_mode_deactivated_info_new');
case self::LP_MODE_TLT:
include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
return sprintf($lng->txt('trac_mode_tlt_info'), ilObjUserTracking::_getValidTimeSpan());
case self::LP_MODE_VISITS:
return $lng->txt('trac_mode_visits_info');
case self::LP_MODE_MANUAL:
return $lng->txt('trac_mode_manual_info');
case self::LP_MODE_MANUAL_BY_TUTOR:
return $lng->txt('trac_mode_manual_by_tutor_info');
case self::LP_MODE_OBJECTIVES:
return $lng->txt('trac_mode_objectives_info');
case self::LP_MODE_COLLECTION:
return $lng->txt('trac_mode_collection_info');
case self::LP_MODE_SCORM:
return $lng->txt('trac_mode_scorm_info');
case self::LP_MODE_TEST_FINISHED:
return $lng->txt('trac_mode_test_finished_info');
case self::LP_MODE_TEST_PASSED:
return $lng->txt('trac_mode_test_passed_info');
case self::LP_MODE_EXERCISE_RETURNED:
return $lng->txt('trac_mode_exercise_returned_info');
case self::LP_MODE_SCORM_PACKAGE:
return $lng->txt('trac_mode_scorm_package_info');
case self::LP_MODE_EVENT:
return $lng->txt('trac_mode_event_info');
case self::LP_MODE_COLLECTION_MANUAL:
return $lng->txt('trac_mode_collection_manual_info');
case self::LP_MODE_COLLECTION_TLT:
return $lng->txt('trac_mode_collection_tlt_info');
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilLPObjSettings::_mode2Text (   $a_mode)
static

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

References $lng.

Referenced by ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), and ilObjectLP\getModeText().

{
global $lng;
switch($a_mode)
{
case self::LP_MODE_DEACTIVATED:
return $lng->txt('trac_mode_deactivated');
case self::LP_MODE_TLT:
return $lng->txt('trac_mode_tlt');
case self::LP_MODE_VISITS:
return $lng->txt('trac_mode_visits');
case self::LP_MODE_MANUAL:
return $lng->txt('trac_mode_manual');
case self::LP_MODE_MANUAL_BY_TUTOR:
return $lng->txt('trac_mode_manual_by_tutor');
case self::LP_MODE_OBJECTIVES:
return $lng->txt('trac_mode_objectives');
case self::LP_MODE_COLLECTION:
return $lng->txt('trac_mode_collection');
case self::LP_MODE_SCORM:
return $lng->txt('trac_mode_scorm');
case self::LP_MODE_TEST_FINISHED:
return $lng->txt('trac_mode_test_finished');
case self::LP_MODE_TEST_PASSED:
return $lng->txt('trac_mode_test_passed');
case self::LP_MODE_EXERCISE_RETURNED:
return $lng->txt('trac_mode_exercise_returned');
case self::LP_MODE_SCORM_PACKAGE:
return $lng->txt('trac_mode_scorm_package');
case self::LP_MODE_EVENT:
return $lng->txt('trac_mode_event');
case self::LP_MODE_PLUGIN:
return $lng->txt('trac_mode_plugin');
case self::LP_MODE_COLLECTION_MANUAL:
return $lng->txt('trac_mode_collection_manual');
case self::LP_MODE_COLLECTION_TLT:
return $lng->txt('trac_mode_collection_tlt');
}
}

+ Here is the caller graph for this function:

ilLPObjSettings::cloneSettings (   $a_new_obj_id)

Clone settings.

public

Parameters
intnew obj id

Definition at line 69 of file class.ilLPObjSettings.php.

References $query, $res, getMode(), getObjType(), and getVisits().

{
global $ilDB;
$query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
"VALUES( ".
$this->db->quote($a_new_obj_id ,'integer').", ".
$this->db->quote($this->getObjType() ,'text').", ".
$this->db->quote($this->getMode() ,'integer').", ".
$this->db->quote($this->getVisits() ,'integer').
")";
$res = $ilDB->manipulate($query);
return true;
}

+ Here is the call graph for this function:

ilLPObjSettings::doLPRefresh ( )
protected

Definition at line 174 of file class.ilLPObjSettings.php.

References ilLPStatusWrapper\_refreshStatus(), and getObjId().

Referenced by insert(), and update().

{
// refresh learning progress
include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::getMode ( )

Definition at line 99 of file class.ilLPObjSettings.php.

References $obj_mode.

Referenced by cloneSettings(), insert(), and update().

{
}

+ Here is the caller graph for this function:

ilLPObjSettings::getObjId ( )

Definition at line 104 of file class.ilLPObjSettings.php.

References $obj_id.

Referenced by doLPRefresh(), insert(), and update().

{
return (int) $this->obj_id;
}

+ Here is the caller graph for this function:

ilLPObjSettings::getObjType ( )

Definition at line 109 of file class.ilLPObjSettings.php.

References $obj_type.

Referenced by cloneSettings(), and insert().

{
}

+ Here is the caller graph for this function:

ilLPObjSettings::getVisits ( )

Definition at line 84 of file class.ilLPObjSettings.php.

References LP_DEFAULT_VISITS.

Referenced by cloneSettings(), insert(), and update().

{
return (int) $this->visits ? $this->visits : self::LP_DEFAULT_VISITS;
}

+ Here is the caller graph for this function:

ilLPObjSettings::ilLPObjSettings (   $a_obj_id)

Definition at line 45 of file class.ilLPObjSettings.php.

References __read(), and ilObjectLP\getInstance().

{
global $ilObjDataCache, $ilDB;
$this->db = $ilDB;
$this->obj_id = $a_obj_id;
if(!$this->__read())
{
$this->obj_type = $ilObjDataCache->lookupType($this->obj_id);
include_once "Services/Object/classes/class.ilObjectLP.php";
$olp = ilObjectLP::getInstance($this->obj_id);
$this->obj_mode = $olp->getDefaultMode();
}
}

+ Here is the call graph for this function:

ilLPObjSettings::insert ( )

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

References $ilLog, $query, $res, __read(), doLPRefresh(), getMode(), getObjId(), getObjType(), and getVisits().

Referenced by update().

{
global $ilDB,$ilLog;
$ilLog->logStack();
$query = "INSERT INTO ut_lp_settings (obj_id,obj_type,u_mode,visits) ".
"VALUES(".
$ilDB->quote($this->getObjId() ,'integer').", ".
$ilDB->quote($this->getObjType(),'text').", ".
$ilDB->quote($this->getMode(),'integer').", ".
$ilDB->quote($this->getVisits(), 'integer'). // #12482
")";
$res = $ilDB->manipulate($query);
$this->__read();
$this->doLPRefresh();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilLPObjSettings::setMode (   $a_mode)

Definition at line 94 of file class.ilLPObjSettings.php.

{
$this->obj_mode = $a_mode;
}
ilLPObjSettings::setVisits (   $a_visits)

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

{
$this->visits = $a_visits;
}
ilLPObjSettings::update (   $a_refresh_lp = true)

Definition at line 131 of file class.ilLPObjSettings.php.

References $query, $res, __read(), doLPRefresh(), getMode(), getObjId(), getVisits(), and insert().

{
global $ilDB;
if(!$this->is_stored)
{
return $this->insert();
}
$query = "UPDATE ut_lp_settings SET u_mode = ".$ilDB->quote($this->getMode() ,'integer').", ".
"visits = ".$ilDB->quote($this->getVisits() ,'integer')." ".
"WHERE obj_id = ".$ilDB->quote($this->getObjId() ,'integer');
$res = $ilDB->manipulate($query);
$this->__read();
if($a_refresh_lp)
{
$this->doLPRefresh();
}
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilLPObjSettings::$db = null

Definition at line 16 of file class.ilLPObjSettings.php.

ilLPObjSettings::$is_stored = false

Definition at line 23 of file class.ilLPObjSettings.php.

ilLPObjSettings::$obj_id = null

Definition at line 18 of file class.ilLPObjSettings.php.

Referenced by getObjId().

ilLPObjSettings::$obj_mode = null

Definition at line 20 of file class.ilLPObjSettings.php.

Referenced by getMode().

ilLPObjSettings::$obj_type = null

Definition at line 19 of file class.ilLPObjSettings.php.

Referenced by getObjType().

ilLPObjSettings::$visits = null

Definition at line 21 of file class.ilLPObjSettings.php.

const ilLPObjSettings::LP_DEFAULT_VISITS = 30

Definition at line 43 of file class.ilLPObjSettings.php.

Referenced by _lookupVisits(), and getVisits().

const ilLPObjSettings::LP_MODE_EVENT = 10
const ilLPObjSettings::LP_MODE_EXERCISE_RETURNED = 9
const ilLPObjSettings::LP_MODE_PLUGIN = 14
const ilLPObjSettings::LP_MODE_SCORM_PACKAGE = 12
const ilLPObjSettings::LP_MODE_TEST_FINISHED = 7

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