ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilKioskModeView.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25abstract class ilKioskModeView implements ILIAS\KioskMode\View
26{
27 protected ilCtrl $ctrl;
28 protected ilLanguage $lng;
30
37 final public function __construct(
38 ilObject $object,
42 ) {
43 $this->ctrl = $ctrl;
44 $this->lng = $lng;
45 $this->access = $access;
46
47 $objectClassName = $this->getObjectClass();
48 if (!($object instanceof $objectClassName)) {
49 throw new LogicException(
50 "Provided object of class '" . get_class($object) . "' does not " .
51 "fit view for '" . $this->getObjectClass() . "'"
52 );
53 }
54 $this->setObject($object);
55 if (!$this->hasPermissionToAccessKioskMode()) {
56 throw new RuntimeException(
57 "User is not allowed to access the kiosk mode for the supplied object."
58 );
59 }
60 }
61
65 abstract protected function getObjectClass(): string;
66
73 abstract protected function setObject(ilObject $object);
74
79 abstract protected function hasPermissionToAccessKioskMode(): bool;
80
81 // Note that methods of ILIAS\KioskMode\View need to be implemented as well.
82}
Class ilCtrl provides processing control methods.
Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeVie...
ilAccessHandler $access
setObject(ilObject $object)
Set the object for this view.
__construct(ilObject $object, ilCtrl $ctrl, ilLanguage $lng, ilAccessHandler $access)
getObjectClass()
Get the class of objects this view displays.
hasPermissionToAccessKioskMode()
Check if the global user has permission to access the kiosk mode of the supplied object.
language handling
Class ilObject Basic functions for all objects.
A kiosk mode view on a certain object.
Definition: View.php:31
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...