ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLearningHistoryService.php
Go to the documentation of this file.
1 <?php
2 
24 {
26  protected ilLanguage $lng;
27  protected \ILIAS\DI\UIServices $ui;
29  protected ilTree $tree;
30 
31  public function __construct(
32  ilObjUser $user,
33  ilLanguage $lng,
34  \ILIAS\DI\UIServices $ui,
35  ilAccessHandler $access,
36  ilTree $tree
37  ) {
38  $this->current_user = $user;
39  $this->lng = $lng;
40  $this->ui = $ui;
41  $this->access = $access;
42  $this->tree = $tree;
43  }
44 
45  public function request(): \ILIAS\LearningHistory\StandardGUIRequest
46  {
47  global $DIC;
48 
49  return new \ILIAS\LearningHistory\StandardGUIRequest(
50  $DIC->http(),
51  $DIC->refinery()
52  );
53  }
54 
55  public function repositoryTree(): ilTree
56  {
57  return $this->tree;
58  }
59 
60  public function access(): ilAccessHandler
61  {
62  return $this->access;
63  }
64 
65  public function user(): ilObjUser
66  {
67  return $this->current_user;
68  }
69 
70  public function language(): ilLanguage
71  {
72  return $this->lng;
73  }
74 
75  public function ui(): \ILIAS\DI\UIServices
76  {
77  return $this->ui;
78  }
79 
83  public function factory(): ilLearningHistoryFactory
84  {
85  return new ilLearningHistoryFactory($this);
86  }
87 
89  {
90  return new ilLearningHistoryProviderFactory($this);
91  }
92 
96  public function isActive(int $user_id = 0): bool
97  {
98  global $DIC;
99 
100  $setting = $DIC->settings();
101  if ($setting->get("enable_learning_history") !== "1") {
102  return false;
103  }
104 
105  if ($user_id === 0) {
106  $user_id = $this->user()->getId();
107  }
108 
109  return count($this->provider()->getAllProviders(true, $user_id)) > 0;
110  }
111 }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
isActive(int $user_id=0)
Is the service active? The service will be active, if any of its providers are active.
Class HTTPServicesTest.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
factory()
Factory for learning history entries.
__construct(ilObjUser $user, ilLanguage $lng, \ILIAS\DI\UIServices $ui, ilAccessHandler $access, ilTree $tree)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...