ILIAS  Release_4_1_x_branch Revision 61804
 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  default:
87  die("No mode given");
88  }
89 
90  // E.G personal desktop mode needs $tpl->show();
91  $this->__buildFooter();
92 
93 
94  $ilBench->stop('LearningProgress','0000_Start');
95 
96  return true;
97  }
98 
99  function __setCmdClass($a_class)
100  {
101  // If cmd class == 'illearningprogressgui' the cmd class is set to the the new forwarded class
102  // otherwise e.g illplistofprogressgui tries to forward (back) to illearningprogressgui.
103 
104  if($this->ctrl->getCmdClass() == strtolower(get_class($this)))
105  {
106  $this->ctrl->setCmdClass(strtolower($a_class));
107  }
108  return true;
109  }
110 
111  function __getNextClass()
112  {
113  global $ilAccess;
114 
115  if(strlen($next_class = $this->ctrl->getNextClass()))
116  {
117  if($this->getMode() == LP_MODE_PERSONAL_DESKTOP)
118  {
119  $_SESSION['il_lp_history'] = $next_class;
120  }
121  return $next_class;
122  }
123  switch($this->getMode())
124  {
126  return 'illplistofobjectsgui';
127 
128  case LP_MODE_REPOSITORY:
129  if(!$this->anonymized and
130  !$this->isObjectAnonymized() and
131  $ilAccess->checkAccess('edit_learning_progress','',$this->getRefId()))
132  {
133  return 'illplistofobjectsgui';
134  }
135  return 'illplistofprogressgui';
136 
138  if(strlen($_SESSION['il_lp_history']))
139  {
140  return $_SESSION['il_lp_history'];
141  }
142  return 'illplistofprogressgui';
143 
144  case LP_MODE_USER_FOLDER:
145  return 'illplistofprogressgui';
146  }
147  }
148 }
149 ?>