ILIAS  Release_4_2_x_branch Revision 61807
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLearningProgressGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Tracking/classes/class.ilLearningProgressBaseGUI.php';
5 
18 {
19  function ilLearningProgressGUI($a_mode,$a_ref_id = 0,$a_user_id = 0)
20  {
21  parent::ilLearningProgressBaseGUI($a_mode,$a_ref_id,$a_user_id);
22  }
23 
27  function &executeCommand()
28  {
29  global $ilBench;
30 
31  $ilBench->start('LearningProgress','0000_Start');
32 
33 
34  $this->ctrl->setReturn($this, "");
35 
36  // E.g personal desktop mode needs locator header icon ...
37  $this->__buildHeader();
38  switch($this->__getNextClass())
39  {
40  case 'illplistofprogressgui':
41  include_once 'Services/Tracking/classes/class.ilLPListOfProgressGUI.php';
42 
44  $this->__setCmdClass('illplistofprogressgui');
45  $lop_gui = new ilLPListOfProgressGUI($this->getMode(),$this->getRefId(),$this->getUserId());
46  $this->ctrl->forwardCommand($lop_gui);
47  break;
48 
49  case 'illplistofobjectsgui':
50  include_once 'Services/Tracking/classes/class.ilLPListOfObjectsGUI.php';
51  if(stristr($this->ctrl->getCmd(), "matrix"))
52  {
53  $this->__setSubTabs(LP_ACTIVE_MATRIX);
54  }
55  else if(stristr($this->ctrl->getCmd(), "summary"))
56  {
58  }
59  else
60  {
62  }
63  $loo_gui = new ilLPListOfObjectsGUI($this->getMode(),$this->getRefId());
64  $this->__setCmdClass('illplistofobjectsgui');
65  $this->ctrl->forwardCommand($loo_gui);
66  break;
67 
68  case 'illplistofsettingsgui':
69  include_once 'Services/Tracking/classes/class.ilLPListOfSettingsGUI.php';
70 
72  $los_gui = new ilLPListOfSettingsGUI($this->getMode(),$this->getRefId());
73  $this->__setCmdClass('illplistofsettingsgui');
74  $this->ctrl->forwardCommand($los_gui);
75  break;
76 
77  case 'illmstatisticsgui':
78  include_once 'Services/Tracking/classes/class.ilLMStatisticsGUI.php';
79 
81  $los_gui = new ilLMStatisticsGUI($this->getMode(),$this->getRefId());
82  $this->__setCmdClass('illmstatisticsgui');
83  $this->ctrl->forwardCommand($los_gui);
84  break;
85 
86  case 'illpobjectstatisticsgui':
87  include_once 'Services/Tracking/classes/class.ilLPObjectStatisticsGUI.php';
88  if(stristr($this->ctrl->getCmd(), "access"))
89  {
91  }
92  else if(stristr($this->ctrl->getCmd(), "types"))
93  {
95  }
96  else if(stristr($this->ctrl->getCmd(), "daily"))
97  {
99  }
100  else
101  {
103  }
104  $this->__setCmdClass('illpobjectstatisticsgui');
105  $ost_gui = new ilLPObjectStatisticsGUI($this->getMode(),$this->getRefId());
106  $this->ctrl->forwardCommand($ost_gui);
107  break;
108 
109  default:
110  die("No mode given");
111  }
112 
113  // E.G personal desktop mode needs $tpl->show();
114  $this->__buildFooter();
115 
116 
117  $ilBench->stop('LearningProgress','0000_Start');
118 
119  return true;
120  }
121 
122  function __setCmdClass($a_class)
123  {
124  // If cmd class == 'illearningprogressgui' the cmd class is set to the the new forwarded class
125  // otherwise e.g illplistofprogressgui tries to forward (back) to illearningprogressgui.
126 
127  if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
128  {
129  $this->ctrl->setCmdClass(strtolower($a_class));
130  }
131  return true;
132  }
133 
134  function __getNextClass()
135  {
136  global $ilAccess, $ilUser;
137 
138  if(strlen($next_class = $this->ctrl->getNextClass()))
139  {
140  if($this->getMode() == LP_MODE_PERSONAL_DESKTOP)
141  {
142  $_SESSION['il_lp_history'] = $next_class;
143  }
144  return $next_class;
145  }
146  switch($this->getMode())
147  {
149  return 'illplistofobjectsgui';
150 
151  case LP_MODE_REPOSITORY:
152  if(!$this->anonymized and
153  !$this->isObjectAnonymized() and
154  $ilAccess->checkAccess('edit_learning_progress','',$this->getRefId()))
155  {
156  return 'illplistofobjectsgui';
157  }
158  return 'illplistofprogressgui';
159 
161  if(strlen($_SESSION['il_lp_history']))
162  {
163  if($_SESSION['il_lp_history'] == "illplistofobjectsgui")
164  {
165  // see __setSubTabs()
166  $types = array("crs", "grp", "exc", "tst", "lm", "sahs", "htlm", "dbk");
167  if(!ilUtil::_getObjectsByOperations($types, "edit_learning_progress", $ilUser->getId(), 1))
168  {
169  $_SESSION['il_lp_history'] = null;
170  return 'illplistofprogressgui';
171  }
172  }
173  return $_SESSION['il_lp_history'];
174  }
175  return 'illplistofprogressgui';
176 
177  case LP_MODE_USER_FOLDER:
178  return 'illplistofprogressgui';
179  }
180  }
181 }
182 ?>