ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLearningHistoryService.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
12 {
16  protected $current_user;
17 
21  protected $lng;
22 
26  protected $ui;
27 
31  protected $access;
32 
36  protected $tree;
37 
46  {
47  $this->current_user = $user;
48  $this->lng = $lng;
49  $this->ui = $ui;
50  $this->access = $access;
51  $this->tree = $tree;
52  }
53 
59  public function repositoryTree()
60  {
61  return $this->tree;
62  }
63 
69  public function access()
70  {
71  return $this->access;
72  }
73 
79  public function user()
80  {
81  return $this->current_user;
82  }
83 
89  public function language()
90  {
91  return $this->lng;
92  }
93 
99  public function ui()
100  {
101  return $this->ui;
102  }
103 
109  public function factory()
110  {
111  return new ilLearningHistoryFactory($this);
112  }
113 
119  public function provider()
120  {
121  return new ilLearningHistoryProviderFactory($this);
122  }
123 
130  public function isActive(int $user_id = 0)
131  {
132  global $DIC;
133 
134  $setting = $DIC->settings();
135  if ($setting->get("enable_learning_history") !== "1") {
136  return false;
137  }
138 
139  if ($user_id = 0) {
140  $user_id = $this->user()->getId();
141  }
142  foreach ($this->provider()->getAllProviders(true, $user_id) as $p) {
143  return true;
144  }
145  return false;
146  }
147 }
global $DIC
Definition: saml.php:7
Class BaseForm.
Interface ilAccessHandler.
isActive(int $user_id=0)
Is the service active? The service will be active, if any of its providers are active.
Class HTTPServicesTest.
$user
Definition: migrateto20.php:57
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
language handling
factory()
Factory for learning history entries.
__construct(ilObjUser $user, ilLanguage $lng, \ILIAS\DI\UIServices $ui, ilAccessHandler $access, ilTree $tree)
Constructor.