ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLSViewFactory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27{
29 protected ilLanguage $lng;
30 protected ilAccess $access;
31 protected LOMServices $lom_services;
32
33 public function __construct(
37 LOMServices $lom_services
38 ) {
39 $this->kiosk_mode_service = $kiosk_mode_service;
40 $this->lng = $lng;
41 $this->access = $access;
42 $this->lom_services = $lom_services;
43 }
44
45 public function getViewFor(LSLearnerItem $item): ILIAS\KioskMode\View
46 {
47 $obj = $this->getInstanceByRefId($item->getRefId());
48 if ($this->kiosk_mode_service->hasKioskMode($item->getType())) {
49 return $this->kiosk_mode_service->getViewFor($obj);
50 } else {
51 return $this->getLegacyViewFor($obj);
52 }
53 }
54
55 protected function getInstanceByRefId(int $ref_id): ?\ilObject
56 {
58 }
59
60
62 {
63 return new ilLegacyKioskModeView(
64 $obj,
65 $this->lng,
66 $this->access,
67 $this->lom_services
68 );
69 }
70}
getRefId()
Definition: LSItem.php:93
getType()
Definition: LSItem.php:58
Add learning progress and availability information to the LSItem.
Class ilAccessHandler Checks access for ILIAS objects.
Central entry point for users of the service.
getInstanceByRefId(int $ref_id)
ilKioskModeService $kiosk_mode_service
getLegacyViewFor(ilObject $obj)
getViewFor(LSLearnerItem $item)
__construct(ilKioskModeService $kiosk_mode_service, ilLanguage $lng, ilAccess $access, LOMServices $lom_services)
language handling
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
$ref_id
Definition: ltiauth.php:66
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.