ILIAS  release_7 Revision v7.30-3-g800a261c036
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.

34 {
35 $this->ctrl = $ctrl;
36 $this->language = $language;
37 $this->access = $access;
38 $this->obj_definition = $obj_definition;
39 }
language()
Definition: language.php:2

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

+ Here is the call graph for this function:

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.

77 : string
78 {
79 $class = $this->obj_definition->getClassName($object_type);
80 $full_class = "il" . $class . "KioskModeView";
81 return $full_class;
82 }

Referenced by getViewFor(), and hasKioskMode().

+ 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.

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 }
hasKioskMode(string $object_type)
Check if objects of a certain type provides kiosk mode in general.
getClassNameForType(string $object_type)

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

+ 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.

68 : bool
69 {
70 $class_name = $this->getClassNameForType($object_type);
71 return class_exists($class_name);
72 }

References getClassNameForType().

Referenced by getViewFor().

+ 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: