ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLSViewFactory.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
25 {
27  protected ilLanguage $lng;
28  protected ilAccess $access;
29 
30  public function __construct(
31  ilKioskModeService $kiosk_mode_service,
32  ilLanguage $lng,
33  ilAccess $access
34  ) {
35  $this->kiosk_mode_service = $kiosk_mode_service;
36  $this->lng = $lng;
37  $this->access = $access;
38  }
39 
40  public function getViewFor(LSLearnerItem $item): ILIAS\KioskMode\View
41  {
42  $obj = $this->getInstanceByRefId($item->getRefId());
43  if ($this->kiosk_mode_service->hasKioskMode($item->getType())) {
44  return $this->kiosk_mode_service->getViewFor($obj);
45  } else {
46  return $this->getLegacyViewFor($obj);
47  }
48  }
49 
50  protected function getInstanceByRefId(int $ref_id): ?\ilObject
51  {
52  return ilObjectFactory::getInstanceByRefId($ref_id, false);
53  }
54 
55 
57  {
58  return new ilLegacyKioskModeView(
59  $obj,
60  $this->lng,
61  $this->access
62  );
63  }
64 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getViewFor(LSLearnerItem $item)
ilKioskModeService $kiosk_mode_service
Class ChatMainBarProvider .
getRefId()
Definition: LSItem.php:90
getInstanceByRefId(int $ref_id)
getLegacyViewFor(ilObject $obj)
$ref_id
Definition: ltiauth.php:67
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
Central entry point for users of the service.
__construct(ilKioskModeService $kiosk_mode_service, ilLanguage $lng, ilAccess $access)
getType()
Definition: LSItem.php:55
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...