ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilKioskModeService Class Reference

Central entry point for users of the service. More...

+ Collaboration diagram for ilKioskModeService:

Public Member Functions

 __construct (ilCtrl $ctrl, ilLanguage $language, ilAccess $access, ilObjectDefinition $obj_definition)
 
 getViewFor (\ilObject $object)
 Try to get a kiosk mode view for the given object. More...
 
 hasKioskMode (string $object_type)
 Check if objects of a certain type provides kiosk mode in general. More...
 

Protected Member Functions

 getClassNameForType (string $object_type)
 

Protected Attributes

 $ctrl
 
 $language
 
 $access
 
 $obj_definition
 

Detailed Description

Central entry point for users of the service.

Definition at line 7 of file class.ilKioskModeService.php.

Constructor & Destructor Documentation

◆ __construct()

ilKioskModeService::__construct ( ilCtrl  $ctrl,
ilLanguage  $language,
ilAccess  $access,
ilObjectDefinition  $obj_definition 
)

Definition at line 29 of file class.ilKioskModeService.php.

References $access, $ctrl, $language, and $obj_definition.

34  {
35  $this->ctrl = $ctrl;
36  $this->language = $language;
37  $this->access = $access;
38  $this->obj_definition = $obj_definition;
39  }

Member Function Documentation

◆ getClassNameForType()

ilKioskModeService::getClassNameForType ( string  $object_type)
protected
Returns
classname of type-specific kiosk view.

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

Referenced by getViewFor(), and hasKioskMode().

77  : string
78  {
79  $class = $this->obj_definition->getClassName($object_type);
80  $full_class = "il" . $class . "KioskModeView";
81  return $full_class;
82  }
+ Here is the caller graph for this function:

◆ getViewFor()

ilKioskModeService::getViewFor ( \ilObject  $object)

Try to get a kiosk mode view for the given object.

Returns
ilKioskModeView|null

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

References getClassNameForType(), ilObject\getType(), and hasKioskMode().

47  {
48  $object_type = $object->getType();
49  if (!$this->hasKioskMode($object_type)) {
50  return null;
51  }
52 
53  $class_name = $this->getClassNameForType($object_type);
54 
55  return new $class_name(
56  $object,
57  $this->ctrl,
58  $this->language,
59  $this->access
60  );
61  }
getClassNameForType(string $object_type)
hasKioskMode(string $object_type)
Check if objects of a certain type provides kiosk mode in general.
+ Here is the call graph for this function:

◆ hasKioskMode()

ilKioskModeService::hasKioskMode ( string  $object_type)

Check if objects of a certain type provides kiosk mode in general.

Parameters
string$object_typeneeds to be a valid object type

Definition at line 68 of file class.ilKioskModeService.php.

References getClassNameForType().

Referenced by getViewFor().

68  : bool
69  {
70  $class_name = $this->getClassNameForType($object_type);
71  return class_exists($class_name);
72  }
getClassNameForType(string $object_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilKioskModeService::$access
protected

Definition at line 22 of file class.ilKioskModeService.php.

Referenced by __construct().

◆ $ctrl

ilKioskModeService::$ctrl
protected

Definition at line 12 of file class.ilKioskModeService.php.

Referenced by __construct().

◆ $language

ilKioskModeService::$language
protected

Definition at line 17 of file class.ilKioskModeService.php.

Referenced by __construct().

◆ $obj_definition

ilKioskModeService::$obj_definition
protected

Definition at line 27 of file class.ilKioskModeService.php.

Referenced by __construct().


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