ILIAS  release_8 Revision v8.24
class.ilKioskModeService.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
5/* Copyright (c) 2018 - Richard Klees <richard.klees@concepts-and-training.de> - Extended GPL, see LICENSE */
6
11{
12 protected ilCtrl $ctrl;
14 protected ilAccess $access;
16
17 public function __construct(
22 ) {
23 $this->ctrl = $ctrl;
24 $this->language = $language;
25 $this->access = $access;
26 $this->obj_definition = $obj_definition;
27 }
28
32 public function getViewFor(ilObject $object): ?ilKioskModeView
33 {
34 $object_type = $object->getType();
35 if (!$this->hasKioskMode($object_type)) {
36 return null;
37 }
38
39 $class_name = $this->getClassNameForType($object_type);
40
41 return new $class_name(
42 $object,
43 $this->ctrl,
44 $this->language,
45 $this->access
46 );
47 }
48
54 public function hasKioskMode(string $object_type): bool
55 {
56 $class_name = $this->getClassNameForType($object_type);
57 return class_exists($class_name);
58 }
59
63 protected function getClassNameForType(string $object_type): string
64 {
65 $class = $this->obj_definition->getClassName($object_type);
66 return "il" . $class . "KioskModeView";
67 }
68}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...