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

Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeView (e.g. More...

+ Inheritance diagram for ilKioskModeView:
+ Collaboration diagram for ilKioskModeView:

Public Member Functions

 __construct (\ilObject $object, \ilCtrl $ctrl, \ilLanguage $lng, \ilAccessHandler $access)
 
- Public Member Functions inherited from ILIAS\KioskMode\View
 buildInitialState (State $empty_state)
 Build an initial state based on the Provided empty state. More...
 
 buildControls (State $state, ControlBuilder $builder)
 Construct the controls for the view based on the current state. More...
 
 updateGet (State $state, string $command, int $parameter=null)
 Update the state based on the provided command. More...
 
 updatePost (State $state, string $command, array $post)
 Update the state and the object based on the provided command and post-data. More...
 
 render (State $state, UI\Factory $factory, URLBuilder $url_builder, array $post=null)
 Render a state using the ui-factory and URLs from the builder. More...
 

Protected Member Functions

 getObjectClass ()
 Get the class of objects this view displays. More...
 
 setObject (\ilObject $object)
 Set the object for this view. More...
 
 hasPermissionToAccessKioskMode ()
 Check if the global user has permission to access the kiosk mode of the supplied object. More...
 

Protected Attributes

 $ctrl
 
 $lng
 
 $access
 

Detailed Description

Base class to be implemented and put in class-directory of module with the name il$MODULEKioskModeView (e.g.

ilTestKioskModeView).

Definition at line 8 of file class.ilKioskModeView.php.

Constructor & Destructor Documentation

◆ __construct()

ilKioskModeView::__construct ( \ilObject  $object,
\ilCtrl  $ctrl,
\ilLanguage  $lng,
\ilAccessHandler  $access 
)
final
Exceptions

Definition at line 31 of file class.ilKioskModeView.php.

References $access, $ctrl, $lng, getObjectClass(), hasPermissionToAccessKioskMode(), and setObject().

36  {
37  $this->ctrl = $ctrl;
38  $this->lng = $lng;
39  $this->access = $access;
40 
41  $objectClassName = $this->getObjectClass();
42  if (!($object instanceof $objectClassName)) {
43  throw new \LogicException(
44  "Provided object of class '" . get_class($object) . "' does not " .
45  "fit view for '" . $this->getObjectClass() . "'"
46  );
47  }
48  $this->setObject($object);
49  if (!$this->hasPermissionToAccessKioskMode()) {
50  throw new \RuntimeException(
51  "User is not allowed to access the kiosk mode for the supplied object."
52  );
53  }
54  }
setObject(\ilObject $object)
Set the object for this view.
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.
+ Here is the call graph for this function:

Member Function Documentation

◆ getObjectClass()

ilKioskModeView::getObjectClass ( )
abstractprotected

Get the class of objects this view displays.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ hasPermissionToAccessKioskMode()

ilKioskModeView::hasPermissionToAccessKioskMode ( )
abstractprotected

Check if the global user has permission to access the kiosk mode of the supplied object.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setObject()

ilKioskModeView::setObject ( \ilObject  $object)
abstractprotected

Set the object for this view.

This makes it possible to use an appropriately typehinted member variable to allow for static code analysis. Sadly PHP has no generics...

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilKioskModeView::$access
protected

Definition at line 23 of file class.ilKioskModeView.php.

Referenced by __construct().

◆ $ctrl

ilKioskModeView::$ctrl
protected

Definition at line 13 of file class.ilKioskModeView.php.

Referenced by __construct().

◆ $lng

ilKioskModeView::$lng
protected

Definition at line 18 of file class.ilKioskModeView.php.

Referenced by __construct().


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