ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLSViewFactory.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
11{
12 public function __construct(
13 ilKioskModeService $kiosk_mode_service,
15 ilAccess $access
16 ) {
17 $this->kiosk_mode_service = $kiosk_mode_service;
18 $this->lng = $lng;
19 $this->access = $access;
20 }
21
22 public function getViewFor(LSLearnerItem $item) : ILIAS\KioskMode\View
23 {
24 $obj = $this->getInstanceByRefId($item->getRefId());
25 if ($this->kiosk_mode_service->hasKioskMode($item->getType())) {
26 return $this->kiosk_mode_service->getViewFor($obj);
27 } else {
28 return $this->getLegacyViewFor($obj);
29 }
30 }
31
32 protected function getInstanceByRefId(int $ref_id) : ilObject
33 {
34 return ilObjectFactory::getInstanceByRefId($ref_id, false);
35 }
36
37
39 {
40 $view = new ilLegacyKioskModeView(
41 $obj,
42 $this->lng,
43 $this->access
44 );
45 return $view;
46 }
47}
An exception for terminatinating execution or to throw for unit testing.
getRefId()
Definition: LSItem.php:129
getType()
Definition: LSItem.php:73
Add learning progress and availability information to the LSItem.
Class ilAccessHandler.
Central entry point for users of the service.
getInstanceByRefId(int $ref_id)
getLegacyViewFor(ilObject $obj)
__construct(ilKioskModeService $kiosk_mode_service, ilLanguage $lng, ilAccess $access)
getViewFor(LSLearnerItem $item)
language handling
Class ilLegacyKioskModeView.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
Class ChatMainBarProvider \MainMenu\Provider.
$lng