ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilKioskModeService.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 protected ilCtrl $ctrl;
28 protected ilAccess $access;
30
31 public function __construct(
36 ) {
37 $this->ctrl = $ctrl;
38 $this->language = $language;
39 $this->access = $access;
40 $this->obj_definition = $obj_definition;
41 }
42
46 public function getViewFor(ilObject $object): ?ilKioskModeView
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 }
62
68 public function hasKioskMode(string $object_type): bool
69 {
70 $class_name = $this->getClassNameForType($object_type);
71 return class_exists($class_name);
72 }
73
77 protected function getClassNameForType(string $object_type): string
78 {
79 $class = $this->obj_definition->getClassName($object_type);
80 return "il" . $class . "KioskModeView";
81 }
82}
Class ilAccessHandler Checks access for ILIAS objects.
Class ilCtrl provides processing control methods.
Central entry point for users of the service.
getViewFor(ilObject $object)
Try to get a kiosk mode view for the given object.
hasKioskMode(string $object_type)
Check if objects of a certain type provides kiosk mode in general.
getClassNameForType(string $object_type)
ilObjectDefinition $obj_definition
__construct(ilCtrl $ctrl, ilLanguage $language, ilAccess $access, ilObjectDefinition $obj_definition)
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
language handling
parses the objects.xml it handles the xml-description of all ilias objects
Class ilObject Basic functions for all objects.