ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LSItemOnlineStatus Class Reference
+ Collaboration diagram for LSItemOnlineStatus:

Public Member Functions

 setOnlineStatus (int $ref_id, bool $status)
 
 getOnlineStatus (int $ref_id)
 
 hasChangeableOnlineStatus (int $ref_id)
 

Data Fields

const S_LEARNMODULE_IL = "lm"
 
const S_LEARNMODULE_HTML = "htlm"
 
const S_SAHS = "sahs"
 
const S_TEST = "tst"
 
const S_SURVEY = "svy"
 
const S_CONTENTPAGE = "copa"
 
const S_EXERCISE = "exc"
 
const S_IND_ASSESSMENT = "iass"
 
const S_FILE = "file"
 

Protected Member Functions

 getObjectTypeFor (int $ref_id)
 
 getObject (int $ref_id)
 

Static Private Attributes

static array $objs_with_check_for_online_status
 

Detailed Description

Definition at line 21 of file LSItemOnlineStatus.php.

Member Function Documentation

◆ getObject()

LSItemOnlineStatus::getObject ( int  $ref_id)
protected

Definition at line 73 of file LSItemOnlineStatus.php.

73 : \ilObject
74 {
75 return \ilObjectFactory::getInstanceByRefId($ref_id);
76 }
Class ilObject Basic functions for all objects.
$ref_id
Definition: ltiauth.php:66

References $ref_id.

Referenced by hasChangeableOnlineStatus(), and setOnlineStatus().

+ Here is the caller graph for this function:

◆ getObjectTypeFor()

LSItemOnlineStatus::getObjectTypeFor ( int  $ref_id)
protected

Definition at line 68 of file LSItemOnlineStatus.php.

68 : string
69 {
70 return \ilObject::_lookupType($ref_id, true);
71 }

References $ref_id.

Referenced by hasChangeableOnlineStatus().

+ Here is the caller graph for this function:

◆ getOnlineStatus()

LSItemOnlineStatus::getOnlineStatus ( int  $ref_id)

Definition at line 46 of file LSItemOnlineStatus.php.

46 : bool
47 {
49 }
static _lookupObjId(int $ref_id)
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.

References $ref_id, ilObject\_lookupObjId(), and ilObject\lookupOfflineStatus().

+ Here is the call graph for this function:

◆ hasChangeableOnlineStatus()

LSItemOnlineStatus::hasChangeableOnlineStatus ( int  $ref_id)

Definition at line 51 of file LSItemOnlineStatus.php.

51 : bool
52 {
53 $obj_type = $this->getObjectTypeFor($ref_id);
54 if(! in_array($obj_type, self::$objs_with_check_for_online_status)) {
55 return true;
56 }
57
58 $obj = $this->getObject($ref_id);
59 if($obj_type === self::S_SURVEY) {
60 return $obj->hasQuestions();
61 }
62 if($obj_type === self::S_TEST) {
63 return count($obj->getQuestions()) > 0;
64 }
65 return false;
66 }
getObjectTypeFor(int $ref_id)

References getObject(), and getObjectTypeFor().

+ Here is the call graph for this function:

◆ setOnlineStatus()

LSItemOnlineStatus::setOnlineStatus ( int  $ref_id,
bool  $status 
)

Definition at line 38 of file LSItemOnlineStatus.php.

38 : void
39 {
40 $obj = $this->getObject($ref_id);
41 $props = $obj->getObjectProperties()->getPropertyIsOnline();
42 $props = $status ? $props->withOnline() : $props->withOffline();
43 $obj->getObjectProperties()->storePropertyIsOnline($props);
44 }

References getObject().

+ Here is the call graph for this function:

Field Documentation

◆ $objs_with_check_for_online_status

array LSItemOnlineStatus::$objs_with_check_for_online_status
staticprivate
Initial value:

Definition at line 33 of file LSItemOnlineStatus.php.

◆ S_CONTENTPAGE

const LSItemOnlineStatus::S_CONTENTPAGE = "copa"

Definition at line 28 of file LSItemOnlineStatus.php.

◆ S_EXERCISE

const LSItemOnlineStatus::S_EXERCISE = "exc"

Definition at line 29 of file LSItemOnlineStatus.php.

◆ S_FILE

const LSItemOnlineStatus::S_FILE = "file"

Definition at line 31 of file LSItemOnlineStatus.php.

◆ S_IND_ASSESSMENT

const LSItemOnlineStatus::S_IND_ASSESSMENT = "iass"

Definition at line 30 of file LSItemOnlineStatus.php.

◆ S_LEARNMODULE_HTML

const LSItemOnlineStatus::S_LEARNMODULE_HTML = "htlm"

Definition at line 24 of file LSItemOnlineStatus.php.

◆ S_LEARNMODULE_IL

const LSItemOnlineStatus::S_LEARNMODULE_IL = "lm"

Definition at line 23 of file LSItemOnlineStatus.php.

◆ S_SAHS

const LSItemOnlineStatus::S_SAHS = "sahs"

Definition at line 25 of file LSItemOnlineStatus.php.

◆ S_SURVEY

const LSItemOnlineStatus::S_SURVEY = "svy"

Definition at line 27 of file LSItemOnlineStatus.php.

◆ S_TEST

const LSItemOnlineStatus::S_TEST = "tst"

Definition at line 26 of file LSItemOnlineStatus.php.


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